Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2018 at 09:46 UTC
Updated:
18 Sep 2019 at 20:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jonathan1055 commentedTo verify this, here is a patch which alters composer.json but only changes the text and does nothing else.
Comment #4
jonathan1055 commentedIn the console output https://dispatcher.drupalci.org/job/drupal8_contrib_patches/33118/console we get:
Then after the patch has been applied we get (with ... for omitted lines) :
Then the Scheduler module is re-added, but with no dependencies
So the question is: Do we have to repeat the dependency and test-dependency information in both .info.yml and composer.json? Or should the DrupalCI procedure have re-added the dependencies using what is specified in .info.yml?
Comment #5
jonathan1055 commentedPatch to add drupal/devel as a test dependency in composer.json. The rules dependencies have not been changed, so rules tests will still fail.
Comment #7
jonathan1055 commentedThat's good the devel module is re-added:
and SchedulerDevelGenerateTest now passes.
Comment #8
jonathan1055 commentedThis patch adds new composer.json to the scheduler_rules_integration sub-module. Not sure it this is the correct way to go, as adding 'rules' into the require-dev list in the main composer.json would probably fix the problem. However, having a separate composer.json for the sub-module feels the right thing to do. Lots of guessing here, so this probably won't pass first time.
Comment #10
jonathan1055 commentedMaybe it should be "drupal/rules" not "rules/rules" as per .info.yml
Comment #12
idebr commentedAccording to the documentation page Add a composer.json file the dependency should be in the project's composer.json file:
In addition the dependency should be in the info file:
Also, the composer.json file syntax should use 4 spaces as indentation: #2654894: Use an indent of 4 spaces for composer.json
Comment #13
jonathan1055 commentedThanks for the patch. Yes the tests do pass with your patch, but I knew that was going to happen if you add the test dependency to the main composer,json file. The critical thing, however, is that we already have the rules test dependency defined, in the sub-module
/scheduler_rules_integration/scheduler_rules_integration.info.ymlfile. It is only required as a test dependency for that sub-module, so should not be in the main project scheduler.info.yml file or composer.json file. Otherwise you cannot test Scheduler locally if you dont have rules, or rules is not working (there is no full release yet). That is why we split out the rules integration code into a sub-module which can be enabled and/or tested separately.I have an idea that the tests in #10 failed because there is not currently any
/scheduler_rules_integration/composer.jsonfile so the patch to this file did not trigger a re-evaluation of the dependencies in the patched file.Thanks for the hint about using 4 spaces.
Comment #16
jonathan1055 commentedNow that the file
/scheduler_rules_integration/composer.jsonexists we can test the dependencies properly.Comment #18
jonathan1055 commentedTry again now that the committed composer.json syntax is correct.
Comment #20
jonathan1055 commentedNow adding require-dev to the rules file
Comment #22
jonathan1055 commentedOK, so it looks like idebr was right, and this is also confirmed by #2692407-34: Test_dependencies are downloaded before applying patches, rather than after.
When
require-dev drupal/rulesis added to the main composer.json I can still run local PHPunit non-rules tests if the Rules module is not available. This is good because it does not hinder non-rules development, which is what I was concerned about.This patch does not add
rules:rulesto the test dependencies in .info.yml file.Comment #23
jonathan1055 commentedI must get a json syntax checker!
Comment #24
jonathan1055 commentedOK, that works. Now to see if changing
"drupal/devel"to"drupal/devel_generate"works, as this is what we have in .info.ymlComment #26
jonathan1055 commentedHaving committed the minimum
require-devto the main module composer.json and minimumrequireto the sub-module, it will be useful to see if this is sufficient to re-load the dependencies after a dummy patch to the main composer.json. I expect it will not, and this test will fail, but useful to know for certain.Comment #28
jonathan1055 commentedSo the sub-modules actual dependencies are removed and not re-added, if the main module's composer.json is patched.
Comment #29
jonathan1055 commentedAs we do not want to addrequire-dev drupal/rulesto the main module's composer file I think we may have to leave it here, and just accept that patches to the main module composer.json will cause the sub-module tests to fail. But that does seem very limiting.edit: It is too much of a pain to have Rules tests fail on d.o. every time we patch composer.json - so I am going to add
require-dev drupal/rulesto the main module composer.jsonComment #30
jonathan1055 commentedHere's the patch. Added the equivalent test dependency to .info.yml to keep them in sync.
Comment #32
jonathan1055 commentedFixed. Thanks @idebr for your help.