Problem/Motivation
Follow up to #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning.
In that issue we allowed Composer semantic versioning constraints to be use in a new core_version_requirment:
key of info.yml files for module and themes. We want to stop using single major branch core compatibility for modules generally, and to deprecate \Drupal::CORE_COMPATIBILITY
constant. (See #3081252: Don't allow core_version_requirement key to be used for versions less 8.7.6 and #3085662: Remove Drupal::CORE_COMPATIBILITY because it is not accurate when modules can be compatible with multiple core branches.)
The fact that this issue is unaddressed in 9.0.x currently prevents that version from being installed, at all, so this is critical.
Proposed resolution
There are a few possibilities:
-
We could do
core_version_requirment: ^8
but that would require use to leave thecore: 8.x
also so it is kind of meaningless. Really for drupal 8 modulescore_version_requirment
is useful to specify a particular requirement or to specify it is compatible with 9 also. - We could specify e.g.
^8.8
per minor version, and^8.9|^9.0
for 9.0.x. This has a big disadvantage as it'd mean a hugely disruptive patch every minor. - We could use
core_version_requirement: VERSION
(see #9 and #12). - We could exempt Drupal core-provided extensions from having to specify
core_version_requirement
. Because every core-provided extension is guaranteed to be compatible anyway, it is definitely pointless boilerplate that generates more confusion than it brings clarity. (see #55 + #57 + #58 + #59)
We've chosen the fourth approach because this solves the problem by simplifying and avoids hugely disruptive patches to info files every minor or major until #3005229: Provide optional support for using composer.json for dependency metadata is fixed, and we can't and shouldn't be making decisions to bump the compatibility on a per-module basis each time other modules add new APIs.
Remaining tasks
This issue should be fixed in 9.0.x as soon as possible since it is 100% blocking any further work there, but as a disruptive patch it should probably be scheduled during 8.8.x's beta phase for the 8.9 and 8.8 versions of the patch.
User interface changes
None
API changes
TBD
Data model changes
None
Release notes snippet
None
Comment | File | Size | Author |
---|---|---|---|
#126 | 3072702-8.8.x-126.patch | 21.85 KB | alexpott |
#126 | 122-126-interdiff.txt | 5.14 KB | alexpott |
#123 | 3072702-8.8.x-122.patch | 27.35 KB | alexpott |
#123 | 109-122-interdiff.txt | 730 bytes | alexpott |
#109 | interdiff.txt | 4.89 KB | Wim Leers |
Comments
Comment #1
tedbowtedbow created an issue. See original summary.
Comment #2
tedbowPostponing until #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning is fixed
Comment #3
xjmThis issue may need to be rescoped/retitled since the currently proposed resolution on #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning is to provide a new key instead, but we'll have the same end goal of making core modules follow the D9-ready best practice.
Comment #4
dww#3++
Comment #5
xjmComment #6
tedbow#2313917: Core version key in module's .info.yml doesn't respect core semantic versioning was committed
Update summary and title match the solution there.
Changed proposed solution. I am not actually sure we should make a change.
Comment #7
MixologicI think the time to leverage the new feature in existing core is when we have removed all known deprecations from a module and are confident that it will work on 9, then we can change it to ^8 || ^9 for the 8.9 cycle, perhaps. Not sure it really does anything beyond act as an example for people to follow, because core modules will always work on the version of core they ship with, nonwithstanding undetected bugs.
Comment #8
BerdirYeah, I don't think that makes much sense?
Core modules will always be compatible with whatever state the 9.x branch happens to be in because we always test core as a whole, but they will also quickly (at least with 9.1+) become 9.x only.
IMHO the only reason to use ^8 || ^9 would be as a transition during 8.9/9.0 development, so make it easier to port changes, but once/before 9.0 is released, I'd update that to ^9 only, not sure if updating on minor releases (^9.1, ^9.2, ..) is something we want to do. It would match the reality, because core code is always immediately updated to use new API's and you can never expect to use any core module in an older core version. But it's also a lot of overhead and would result in backport conflicts?
Comment #9
BerdirSo considering that, maybe it should actually be
core_version_requirement: VERSION
, matching "version: VERSION", that we'd replace to indicate that a core module is always only compatible with the exact version it is shipped as?We then also wouldn't have to keep it up to date manually, and there wouldn't be any actual change in info.yml files between minor and even major versions, making it easier to keep patches relevant and backportable (e.g. new test modules)
Comment #10
Wim LeersGreat and super interesting observations, @Berdir!
Comment #11
catchI like #9 a lot.
Comment #12
BerdirAbout the problem that contrib will copy this, which currently happens a lot in library definitions maybe we could enforce that only core modules are allowed to use this definition and throw an error if we find anything else using it? Based on the extension being in /core or not or a nicer similar check.
Comment #13
Wim LeersI like #12 a lot.
Can't wait to see what @Berdir says next :D
Comment #14
tedbowJust want to relate this to #3005229: Provide optional support for using composer.json for dependency metadata
Not sure when that issue will get in. If it does get in then by 10.0.0 would won't have
core_version_requirment
in info.yml files.If we expect that issue to get by 8.8.0 we could just switch to using composer.json for core and module dependencies. Of course we couldn't use
VERSION
fordrupal/core
in the composer.json because this would not work with composer outside of core.Comment #19
xjmSo, this issue is actually the very critical-est of critical issues as 9.0.x is uninstallable until we have a solution for this. See #3087408: Update D9 core's *.info.yml files. I've closed that as a duplicate and am bumping this one to critical in its place. Also adding issue credits from the other issue.
Comment #20
xjmListed the possible solutions so far in the IS.
Comment #21
webchickVERSION is parity with what we already have, and negates the requirement for us to ever have to revisit this problem again, so +1 here.
Putting anything with "8" in it anywhere in the Drupal *9* branch IMO risks end users who less clued into all the inner workings here filing bogus bug reports. And creates more things to clean up later, when 8 and 9 start to diverge.
I say this ALL THE TIME! :D
Comment #22
xjmForgot to mention in my IS update why it's critical. :P
Comment #23
Berdir> Can't wait to see what @Berdir says next :D
What was mentioned in the slack thread today is that VERSION doesn't actually prevent anyone from copying a module of any version and overwriting it and it would be "compatible". But the same is true with "version: VERSION" that we have as well in the .info.yml files. They magically become whatever version you put them in.
And for releases, we could possibly even overwrite it with the actual version during the package process?
Comment #24
mikelutzVERSION might make sense for right now, just to get the 9.0.x branch running.
Comment #25
mikelutzI guess we shouldn't replace
core: 8.x
in views yml files.........Comment #26
plachAre these intended?
Comment #27
mikelutz@plach, I'm honestly not sure yet, I started from the patch in #3087408: Update D9 core's *.info.yml files but I'm still failing Functional Tests. Once I get things green here, we'll need to manage those tests, and probably have a test for VERSION etc.
Comment #28
mikelutzOkay, so the functional tests are failing because the profiles are set to core:9.x but I'm running tests on 8.9.x
Comment #29
mikelutzOkay, lets try this against 8.9 for now, I just want to get the 'VERSION' functionality working and green. There will have to be a few adjustments for 9.0.x though. We will need to change the profile core keys, there's at least one test in InfoParserUnitTest that will fail on 9.0.x (testing that core: 8.x is a valid module)
Comment #30
mikelutzAlright, so we just need an explicit test of the VERSION keyword, update to that one test in InfoParser, and then figuring out what we are doing with profiles.
Comment #31
xjm+1 for this approach.
Comment #32
xjmCan we think of any potentially disruptive impacts from core modules no longer implementing the
core
key? Like does it change metadata in those arrays of extension information that get passed by reference everywhere (such that contrib or custom code might inspect them directly)?I think we may have added logic around how to resolve a conflict between
core
andcore_version_requirement
if they did not match, but I'm unsure whether that logic involved favoring one over the other, or whether it involved just forbidding them both from being added in the same module. Edit: the change record for the original issue explains why it has to be possible to have both at the same time.Comment #33
xjmTo clarify #32, we would presumably drop the
core
key in 9.0.x, but not sure if we should in 8.9.x or if that has the potential to break something. Edit: And for now we should make the patch that we would backport to 8.8.x.Comment #34
mikelutzI'm not sure we need to commit any of this to 8.9, particularly if you are going to diverge the info files anyway by keeping the core key. I suppose as it sits support for 'VERSION' is an API addition that should be in 8.9 if it's in 9.0, but we can't use VERSION and keep the core key anyway, because VERSION translates to 8.9-dev, and you can't have the core key if your core_version_requirement key doesn't include at least one version prior to 8.7.7 (it's buried in the cr)
Comment #35
xjmAhhh that's the code path I was thinking about. So yeah, maybe this is 9.0.x-only then. Moving accordingly. (We can still add the tests and queue the patch against 8.9.x-dev instead of 9.0.x-dev on upload to validate that it would be a viable solution in 8.9.x and therefore presumably won't further break 9.0.x.)
Comment #36
alexpottHere's a test.
I think @plach is correct - these shouldn't be ^9 - the core_version_requirement is irrelevant to these tests.
Comment #37
mikelutzI'm wondering if we shouldn't split out the functionality to allow the VERSION keyword into a seperate issue and commit it to 8.9 and 9.0, as well as resolve the profile situation in 8.9 and 9.0, and then commit the info file changes only to 9.0.
Comment #38
benjifisherSearching for the error message leads to #3087408: Update D9 core's *.info.yml files instead of here. Google, please index this:
Comment #39
benjifisherI tried installing Umami with Drupal 9.0.x, and got this error message: (removed and added to the child issue)
Should that be fixed as part of this issue?
Update: same problem with Minimal and Standard profiles. Replacing
core: 8.x
withdid not work. (Sorry, I did not save the error message.) Instead, I change it to
core: 9.x
.Update: Oh, I see this is already reported in #3087416: Core version key in profile's .info.yml doesn't respect core semantic versioning.
Comment #40
alexpottSo core_version_requirement is not supported in profile .info.yml so either we need to change it so that it is - or we need to update core's profiles to support it.
Comment #41
shaalIt would be great to have profiles support core_version_requirement like modules and themes do.
I didn't know how big of a change that is going to be so I opened a separate issue #3087416: Core version key in profile's .info.yml doesn't respect core semantic versioning for that.
Comment #42
rfaySince #36 doesn't update the profile core versions, this is needs work, right? With #36 installed, an install is still impossible
We won't talk about the fact that it says "module" for a profile, but it seems to me that the ability to do an install should be a basic goal of this issue.
Maybe that's the same as https://www.drupal.org/project/drupal/issues/3087416 ? But if so, it seems it needs to be brought in here IMO.
Comment #43
mikelutzYes, but that can't happen until we are able to run the testbot on the 9.0.x branch. We are simply prepping as far as we can to get ready. 9.0.x is not supposed to be installable yet, and won't be for a few days at least.
Comment #44
xjmIt sounds like #3070401: Install profiles do not support multiple core branch compatibility actually needs to be critical as well. I've promoted it.
We can possibly hack it for this issue to get a green test run (once CI is working for 9.0.x) by using
9.x
temporarily until we support profiles properly.Comment #45
xjmComment #46
xjmComment #47
xjm#37 is also actually something we should do I think so that 8.9.x has the same API. But I think we can wait to split out a separate issue until CI is working and we can verify whether or not this and #3070401: Install profiles do not support multiple core branch compatibility will be enough to fix HEAD.
Comment #48
alexpottHere's a version of the patch which doesn't change any profile info.yml files. Profiles are being handled in #3070401: Install profiles do not support multiple core branch compatibility. The two patches together make the 9.0.x installable and I've successfully run a functional test using run-tests.sh.
I'll leave it up to others as to whether we should do them separate but in order to install and test 9.0.x we do need them both.
Comment #49
alexpottAnother "fun" issue is the view configuration has a core key!!! So either we need to update that or remove it. I created #3087692: Remove the core key from views configuration.
Comment #51
alexpottHere's the combined patches with a few fixes.
Comment #53
alexpottOkay this patch should pass on 8.9.x and only have a few fails on 9.0.x which will be installable and testable - with unrelated fails. We still need another issue to actually fix the outstanding 9.0.x fails but I think they will require 9.0.x only fixes.
Comment #54
Wim LeersComment #55
Wim LeersDevil's advocate: why even again use the pattern
core_version_requirement: VERSION
like we did for asset library definitions if we can easily do something simpler here: for any extension that lives incore/…
we exempt that from having to specify that key?It's confusing, arguably even useless and nonsensical information in all of core's
*.info.yml
files anyway. All of the extensions in core are by definition compatible with this version of core!Comment #56
Wim Leers@alexpott told me he thinks #55 is a good point and likes where it's going. So I'll turn #55 into a proper patch. Stay tuned.
Comment #57
alexpottoh I like #55 a lot. That's a great idea.
Comment #58
dwwI truly like #55, but the devil's devil's advocate in me says:
But, based on the first sentence above, lots of folks do this in custom and contrib:
version: VERSION
The only other reason I can see to keep explicitly defining this is for if we ever try to split up core into smaller chunks so you can get different core modules separately from "core-core" (whatever that means). I know we're trying to do this for components. Maybe there's an issue somewhere about doing the same so you can explicitly
composer require drupal/book ^11
or whatever. Not sure why we'd ever want that, but I'm sure someone from the composer-fixes-everything crew thinks that'd be Slick(tm). ;) If/when we ever support something like that, we can revisit if/how this would need to be handled.So, for now, +1 to #55. That seems way better (simpler, easier to maintain, less magic) than the alternatives.
Cheers,
-Derek
p.s. And while I was writing the comment, #56 and #57 happened, so yay. ;)
Comment #59
catchOne issue with this - do we not have incompatible modules in core/tests? Easy fix if we do...
Otherwise +1 from me too.
Comment #61
alexpott#59 is right. I think we should prioritise on making features like this easy to test too so I've go for
Comment #62
Wim Leers#59: yep :) And #61 looks good to me. I incorporated it verbatim.
\Drupal\Tests\system\Functional\Module\DependencyTest::testCoreCompatibility()
uses thesystem_incompatible_core_version_test
module in core which is an example of this.The interdiff compares #53 to the
9.0.x
patch. Theinterdiff-d9-d8.txt
interdiff shows what we need to change for that to be committable to8.8.x
and8.9.x
.Comment #63
mikelutzFor BC reasons, I don't think we should remove the core key from the .info files in 8.8 or 8.9 (see #32)
I think we should have one patch with all the needed functionality that we commit to 8.9 and 9.0 based on passing 8.9 tests, and then one patch that goes into 9.0 only on top of it that makes 9.0 pass tests. (just my opinion though).
Then we can get to work :-)
Comment #64
Wim LeersI missed these 😭
Comment #65
Wim LeersWhat's the BC break here? #62 and #64 are not disallowing the
core
key. They're just dropping it for extensions that ship with Drupal core. https://www.drupal.org/node/3070687 indeed explains why we want both to be allowed/supported simultaneously, but that is specifically for contrib and custom modules, because they need to be able to declare compatibility with Drupal 8.7 and 8.8 simultaneously (and 8.9, and 9.0).#32 was only asking if we can do this, it was not saying we cannot do this.
This I do agree with: I'm not sure it's worth committing this to Drupal 8.8, I think committing only to 8.9 + 9.0 is preferable. Simply because it is unnecessary for 8.8. It's also unnecessary for 8.9, but the goals for 8.9 and 9.0 is to be identical except for dropping BC layers. Therefore this should be committed to both 8.9 and 9.0.
Comment #66
mikelutzThe 'BC break' is minor, only that
\Drupal::service('info_parser')->parse('core/modules/action/action.info.yml')['core']
has always returned '8.x' and is now unset and NULL. If we gained anything from making the change, I wouldn't care. I just don't think we gain anything in the 8.9 LTS from changing the info file arrays that justifies the change.Happy to be overruled by the RMs or anybody really, just my 1/50th of a currency unit.
Comment #71
Wim LeersComment #72
mikelutzComment #73
Wim LeersUpdater::getUpdaterFromDirectory()
results in a call to\Drupal\Core\Extension\InfoParserDynamic::parse()
with an absolute file path instead of a Drupal root-relative file path. That is an inconsistency that should be fixed IMHO, but that's certainly out of scope here. Made the "is core extension" detection also work for absolute paths. 👍StableBaseThemeUpdateTest
+BaseThemeDefaultDeprecationTest
+ConfigInstallProfileUnmetDependenciesTest
interestingly copy acore/…
extension into a test-specificsites/…
directory. Solution: inject thecore_version_requirement
key.Note that on point 1: I am using
DRUPAL_ROOT
here instead of$container->getParameter('app_root')
becauseInfoParserDynamic
is not a service. I think the proper solution is to add a constructor with an optional$app_root
argument. Otherwise unit tests such asDrupal\Tests\Core\Extension\ThemeExtensionListTest::testRebuildThemeDataWithThemeParents()
will triggerUse of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT' (this will throw an Error in a future version of PHP)
. I'll leave that for somebody else to fix while I sleep.Comment #74
xjmSo the requirements for commit here are:
Comment #76
mikelutzComment #77
Wim LeersUgh, #73's D8 patch was wrong 😭 The interdiff was correct, but it was applied relative to #62, not #63.
I don't know who queued a 9.0 test for the 8.8+8.9 patch in #73, but that's definitely going to fail.
Comment #78
Wim LeersUpdating the issue summary per #57 & #59.
Comment #79
MixologicRe #77 if you click on the test it tells you who queued it.
Comment #80
mikelutzI queued it because #74 asks for a patch that passes on 8.9 and surfaces real failures on 9.0, so somehow this needs to be distilled into one commit that goes on both, and then additional commits that go to 9.0 to bring all the tests green. I'm just trying to figure out what those patches look like.
Comment #81
alexpottOne thing is - we can do this in 9.0.x and take our time to work out what we want to do in 8.x.x because even if we allow core to not have core or core_version_requirement in 9.0.x we don’t have to implement that in 8.x.x because it is not like contrib can leverage it…
So I think we should only worry about 9.0.x here and then file follow-ups to consider 8.x.x.
I would use the service here. It's better than using the constant.
Let's use a * here because this is a test. We'll not have to update this.
Comment #82
alexpottHere's a patch the fixes most of 9.0.x. It also adds a test for core info.yml file not needing a core or core_version_requirement key - we can do that now we inject the app.root string. We use a string typehint to coerce this into a string so we don't have to change anything when this becomes a proper service.
It also sets
core_version_requirement
to*
in .info.yml generated by tests. This means we should never have to do this again and also makes the patch 8.x.x compat ftw.Comment #84
alexpottEnsure we have valid yaml in some tests... this yaml is never actually parsed though.
Comment #85
alexpottFixing a few things.
One thing I'm pondering is if we should do something like:
for maximum BC - just in case the container's not around.
Comment #86
Wim Leers#82.2: Oh! Yes! That will allow you to converge on a single patch instead of the
9.0.x
vs8.8.x_and_8.9.x
patches I've been rolling. Much better 👏#82.1 + #82 + #85 look great! #85 shows why I said we couldn't "just inject the app root": there are a few cases where the info parser is instantiated as a non-service.
I don't see the harm in that. Aiming for maximum BC is warranted in cases like this I think.
Comment #89
xjmCan we document what the method does a little more clearly? I.e., it adds a requirement of
*
which means "any version" (right?). At least in an inline comment that justifies why this is the right choice for the test.Also, what is the value of marking the method private instead of protected when it's called from a protected method? All private does in this case (vs. protected) is make it so that if someone subclasses the thing, they'll get a fatal error until they implement their own version of this method or override all the methods that called it to not call it anymore.
We should actually adopt a policy about the use of
private
in core before adding it here and there in some issues to some but not all APIs of a certain type. Maybe there's a case for all non-base-class tests should befinal
or something, to help indicate that the tests themselves are internal and don't support subclassing, but if so, we should make that change consistently across the test suite in a scheduled coding standards change patch following a core policy change, not randomly here and there. (Policy issue: #3019332: Use final to define classes that are NOT extension points. Edit: Removed out-of-scope rambling.)Comment #90
xjmIs this also fixing the lack of support for the key from profiles? (The
@todo
is being removed.) If so we'd need added tests for that which I don't see in the patch. (It's possible I missed them scanning through the patch as I've not done a close review. Maybe we should add a-do-not-test.patch
of the bits that aren't just removing the core key?) If not we'd want to leave in the@todo
.Comment #92
xjmIs the plan to add that to the patch, or should we do a
@trigger_eror()
in the code path and require the service in the next major? (And if so, would be good to have that backported to 8.8 before beta; if it's too disruptive or doesn't get backported in time, we'll need to handle this however we decide to do 10.0.x deprecations instead.)(Sorry for the piecemeal review comments; still going over what's in the more recent patches.)
Do we do a check like this elsewhere to determine if something's a core module? The info parser itself doesn't seem to yet before this patch. It seems like "is a core module" is something that should have its own API extracted.
Weird potential edgecase time: what if someone's site is installed in a subdirectory called
core/
or a contrib module has acore/
directory within its namespace? (Asking because InfoParserFilename::parse() says the filename can be use either relative or absolute path, without defining in so many words how many varieties of "relative" work.)I don't actually know that Drupal doesn't already blow up if a module or site uses its own
core
directory, but if Drupal works under those scenarios, then we could add test coverage proving that the info parser still works for those scenarios after this change. Edit: or rather, that it doesn't identify those things as core extensions.Comment #93
xjmDown to eight 9.0.x fails with a green 8.9.x patch, not bad. https://dispatcher.drupalci.org/job/drupal_patches/13442/ A couple look related to the l.d.o issue but not sure about the several others related to the update path.
🤔Looks like a
hook_update_last_removed()
expectation inconsistency or something? Could be related to the above discussion of the updater, and if so it'd probably still be in scope for this issue. (OTOH if it's a separate bug for something elsewhere let's split an issue out.)Comment #94
xjmOh, same comment about a comment about the
*
version here. I wonder if we should put it in a trait or something?VersionAgnosticTestInfoFileTrait
or something.Ditto.
Comment #95
mikelutzComment #96
mikelutz89 - addressed with new trait
90 - Yes, this allows the new key for profiles.
Test is here
92.1 - Would like to kick an actual deprecation and @trigger_error to a follow up. The app.root service itself is likely to be deprecated early in Drupal 9 in #3074585: [Symfony 5] Replace app.root and site.path string services with container parameters, and I'd like to get that one settled before we worry about trying to set up a deprecation around it.
92.2 - I think this is okay. relative vs absolute is a matter of file_get_contents(), so it should be either absolute or relative from the Drupal root, which precludes either scenario you described from triggering this, I believe.
93 - I believe this is a deeper problem that should be kicked into it's own issue.
94.1 - I made a trait with better documentation.
94.2 - I documented why we are using '*' in the tests in the places you mentioned.
Comment #97
xjmI think we can omit the inline comment here now since we're using the trait method, which is self-documenting.Edit: Ignore me; I should actually read the code snippets I'm commenting on. :P
Comment #98
mikelutzHere's an untested attempt to bulk pull out the info file changes. I'm not sure what this will do, but it might pass on 8.9 :-)
interdiff included, though I don't know how useful it is.
Comment #100
larowlanick, but yeah understand
any reason this doesn't use the trait?
Comment #101
mikelutzAssuming #98 passes on 8.9, I think it (along with any cleanup anybody wants to do) should be committed to 8.9 and #96 should be committed to 9.0.x, or we could commit #98 to 9.0 and 8.9 and then commit a diff of #96 and #98 to 9.0. Then we should be able to spin off a couple issues to fix the remaining test failures.
Comment #102
alexpottAdded an issue for the @todo and removed the new trait by doing things in a simpler way (less test API ftw) - see interdiff.
Comment #103
catch#102 looks good to avoid the trait. If this comes back green I think we should commit (to 9.0.x, then leave this open to discuss the 8.9.x backport a bit more) and open issues for the remaining test failures.
Comment #104
catchOpened #3087991: Drupal\Tests\system\Functional\Update\UpdatePathTestBaseFilledTest::testUpdateHookN Failed asserting that 8000 matches expected 8001..
Comment #105
alexpottRealised we can now have slightly less repeated logic in InfoParserDynamic.
I agree with #103
Comment #107
alexpottMeh... comment formatting.
Comment #109
Wim Leersprotected
works too.\Drupal\Tests\Core\Extension\InfoParserUnitTest::testProfile
).http://example.com/core
does not work. It has not worked since before Drupal 8 shipped. I reported that in 2015, perhaps even 2014 or 2013. It was never fixed because … nobody does that, so it's not prioritized.) EDIT: I see @mikelutz made the same argument in #96 🙂9.0.x
branch get to 0 fails. It's about getting it to run at all. Like @alexpott wrote in #53:InfoParser(Dynamic)
. I don't think it makes sense to defer to that issue.vfs://core/…
🤓And matches the way the virtual file system is intended to be used! 👏 I'm less of a fan of removingConfigInstallProfileUnmetDependenciesTest
's logic in favor of hardcodingcore_version_requirement: '*'
in a*.info.yml
file but … the harm is minimal and the simplicity is undeniable. So: 👍Patch review
🤓 A consequence is that this will result in
vfs://core/sites/simpletest/LOCK_ID/themes/test_stable/test_stable.info.yml
. So: asites
directory in acore
directory. This A) is weird, B) does not match the reality of a non-VFS Drupal core. We should ensure that the virtual file system matches the actual Drupal core file layout.Easily remedied though!
Ideally these would use a similar approach: ideally both would use
vfs://core
. And … we can! This means the lastprivate static function addCoreVersionRequirement
also disappears 🥳🤓 Note that in principle we don't need this
VfsThemeExtensionList
test class anymore norVfsInfoParser
. Because theInfoParser
now finally accepts an app root, so there is no more need to override either to force a different app root!We had no choice but to add these in #3065545: Deprecate base theme fallback to Stable, in principle we should now be able to remove them. Although that would sort of be out of scope.
Except we can't, because we're dealing with the Drupal test runner kernel's container and the "normal" container, and if we're not careful
vfs
won't exist yet (which would triggerfile_exists(): Unable to find the wrapper "vfs" - did you forget to enable it when you configured PHP?
).So … long story short, while I think this paves the path for further clean-up and simplification, I think that's out of scope here. But we definitely should take another hard look at extension discovery, extension info file parsing, and extension lists. (If you want even more detail, see #3065545-26: Deprecate base theme fallback to Stable.)
Remaining failures → other issues
The remaining failures in #105 are out-of-scope for this issue. Most of the failures are the responsibility of #3016471: Make localization file download major version agnostic. For the only other failure, @catch already opened #3087991: Drupal\Tests\system\Functional\Update\UpdatePathTestBaseFilledTest::testUpdateHookN Failed asserting that 8000 matches expected 8001..
The goal of this issue is to get Drupal
9.0.x
test runs running again. We've reached that point. We've reviewed approaches in detail. So … let's ship this! 🚢Comment #111
alexpottOpened #3088012: InstallerExistingConfigTest shouldn't download translations from l.d.o for one of the other failures.
Comment #112
mikelutz+1 on committing this to 9.0.x and moving on to the other test failures.
Comment #114
jibranComment #115
alexpottI worry that a change record here is going to be confusing. There's nothing for a contrib or custom extension to do as a result of this change. They still need a
core
orcore_requirement_version
key. I guess we could make one for the InfoParserDynamic change but I think that that belongs to #3087975: Add deprecation to InfoParserDynamic::__construct() to require root pathComment #117
catchYes I think we should avoid a change record here since it's likely to be more confusing than not, so untagging for that.
This is in good shape to unblock the other issues.
Committed e37031e and pushed to 9.0.x. Thanks!
Moving to 8.9.x for the backport discussion - my view is that we should backport the changes to minimise the likelihood of patch conflicts even though we don't need to for any other reason. No-one should be trying to parse out version compatibility from the .info.yml files in contrib/custom code and that's the only change that anyone will notice.
Comment #118
tim.plunkettWhat is the point of this line without any assignment?
Comment #119
mikelutzugh, #118 that may have been a bad copy paste on my part. That definitely should be an assignment.
I still think we need a CR for 'Profiles now support the core_version_requirement key'?
Comment #120
alexpottRe #118 nice catch and whoops. Well at least we're in a good place for the eventual requirement of the argument as we're not exercising this code.
Hotfixed.
Comment #122
catchI've updated the existing change record at https://www.drupal.org/node/3070687
Comment #123
alexpottHere's a patch for 8.x.x with the hotfix applied.
Comment #124
xjmThe inline comments got lost for a few of the places in the patch, but 'tis a trivial docs followup.
Comment #125
xjmAre the
composer.lock
changes intentional?Comment #126
alexpottNo the composer.lock files are cause I forgot to rebase my dev branch. Here's a fixed up patch.
Comment #127
Wim LeersWhat's left here?
Comment #128
alexpott@Wim Leers we just need to decide that we want to put #126 in Drupal 8 and whether or not that means 8.8.x too.
Comment #129
mikelutzAs I sit here, writing a bugfix test that requires a new test module, I realize that yes, we should backport this, and yes, we should backport it to 8.8, because I can't currently create a new test module that is compatible with 8.8 and 9.0, and I see that happening more than once with bug fixes on 8.8 over the next 6 months.
Symbolically RTBCing, since it comes down to a RM decision anyway.
Edit: actually, I might be able to use core_version_requirement: * to get one patch to work with both, but it would still warrant a 9.0.x follow-up to remove it, and I'd rather avoid the follow-up or the unnecessary key being there forever.
Comment #130
alexpottAS a corollary to #129 this resulted in me breaking HEAD with https://git.drupalcode.org/project/drupal/commit/7ad2889 - the same commit on 9.0.x fixed that branch :D
Comment #131
catchI'm in favour of backporting this back to 8.8 given the test module issue, that's a good reason to do so.
Comment #134
catchCommitted/pushed to 8.9.x and cherry-picked back to 8.8.x, thanks!