Problem/Motivation
We're on Symfony 6.2 beta, and therefore ComposerProjectTemplatesTest::MINIMUM_STABILITY
is set to 'beta'. ComposerProjectTemplatesTest::testMinimumStabilityStrictness()
tests to ensure that that constant isn't less than core's current stability. Core's current stability is beta, so we're okay, but once we release Drupal 10.0.0-rc1, that test will start failing if we haven't upgraded to Symfony 6.2 RC by then.
Steps to reproduce
Proposed resolution
Perhaps wait a bit longer to see if Symfony releases 6.2 RC before we need to release Drupal 10.0 RC. If that doesn't happen soon enough, then comment out the first assertion in ComposerProjectTemplatesTest::testMinimumStabilityStrictness()
prior to tagging Drupal 10's RC, so that HEAD doesn't start failing following that release.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#24 | interdiff.txt | 4.02 KB | effulgentsia |
#24 | 3319794-24.patch | 3.29 KB | effulgentsia |
| |||
#19 | 3319794-19.patch | 3.11 KB | effulgentsia |
| |||
#16 | 3319794-16.patch | 2.82 KB | effulgentsia |
| |||
#11 | 3319794-11.patch | 4.27 KB | effulgentsia |
|
Comments
Comment #2
effulgentsia CreditAttribution: effulgentsia at Acquia commentedHere's a patch to demonstrate the failure that will start happening after we tag an RC.
Comment #3
effulgentsia CreditAttribution: effulgentsia at Acquia commentedAnd here's #2 plus commenting out the first assertion in
testMinimumStabilityStrictness()
. Changing the issue title and summary because we don't want to skip the whole test, only the first assertion.Comment #4
effulgentsia CreditAttribution: effulgentsia at Acquia commentedI keep forgetting we need a space after
//
. This adds that.Comment #5
effulgentsia CreditAttribution: effulgentsia at Acquia commentedBesides this test's assertion, we might need to also make sure that our recommended project template generator sets its minimum-stability to 'beta' rather than matching core's stability level.
Comment #6
effulgentsia CreditAttribution: effulgentsia at Acquia commentedComment #7
effulgentsia CreditAttribution: effulgentsia at Acquia commentedComment #8
Anchal_gupta CreditAttribution: Anchal_gupta at Srijan | A Material+ Company for Drupal India Association commentedFixed CS error. Please review it
Comment #9
longwaveIf we have to comment this out here, is this test really doing anything worth testing? Should we just remove it entirely, and rely on people to ensure dependencies have the intended stability when we do releases?
Comment #10
phenaproximaI would not recommend this. That would be asking for the stability check to slip through the cracks, IMHO.
Comment #11
effulgentsia CreditAttribution: effulgentsia at Acquia commentedOne reason we test for this is that when we generate the project templates for drupal/recommended-project, we set the minimum-stability to core's stability level. So a situation like this occurring where the assertion in testMinimumStabilityStrictness() is a problem lets us know that we need to figure out what to do about that as well.
Here's a patch that rather than commenting out the assertion, changes the expectation of it for the case of 10.0.0-rc1. This patch also makes the adjustment to the project template creation. I don't know what the best way is to test the change to project template creation.
In searching for where else within the
composer
directory we have minimum-stability, I foundDrupal\Composer\Generator\ComponentGenerator::getPackage()
, towards the bottom of that function. I don't know if we need to make any changes to that. This patch doesn't.I'm still hoping that Symfony 6.2 releases an RC in the next few days, so that we don't need to commit this patch to Drupal. But I have no idea if they will or not.
Comment #12
effulgentsia CreditAttribution: effulgentsia at Acquia commentedComment #13
andypostI think it needs todo and issue to get rid of it once stable
Comment #14
longwaveWhat if we need to do an rc2 before Symfony releases an rc? Hardcoding this feels prone to error, if we don't remember that this is here don't we risk a release that fails?
Comment #15
longwaveThis will presumably happen again in Drupal 11, assuming neither us nor Symfony change our release cadence.
What if we relax the rules on minimum-stability permanently, so a Drupal release candidate always allows beta dependencies?
Comment #16
effulgentsia CreditAttribution: effulgentsia at Acquia commentedSimplified the patch based on the above feedback and conversation with @xjm. I think anything beyond this we can do in follow-ups.
Comment #17
effulgentsia CreditAttribution: effulgentsia at Acquia commentedPer #11, the patch in #16 does not change this line. I'm not really clear on what that line does, so for anyone who does understand how that code fits into our packaging process, please review whether it's okay for that to remain as-is, or if this patch needs to change that as well. Thanks!
Comment #18
catchInstead of commenting this out entirely, could we also make it conditional on core stability being stable?
Comment #19
effulgentsia CreditAttribution: effulgentsia at Acquia commentedThis addresses #18 by using the same conditional in
testMinimumStabilityStrictness()
as insetTemplateProjectStability()
.Comment #20
xjmOut of scope change here.
Also out of scope (although I checked and there is indeed no return).
As far as I can tell, renaming this local variable is out of scope.
This is definitely less fragile than the previous version. We do get
$version
from the method, so we could parse that and add an&& version_compare(blah blah blah)
so that it's more targeted and won't malfunction with future versions.lol @ variable name
That's hard to read. I think the inline comment on lines 90-92 should be moved down, directly above the assertion (or in other words, the new code should go above the comment, not between comment and assertion).
I would probably still commit this despite the out-of-scope changes, but that's after I took 5 minutes or so to review the implications for the affected method in full context. It would be better to file a followup for them so that further reviewers can just review/commit the fix without having to review the implications of out-of-scope changes.
Next I'll try manually testing this with the release tagging script.
Comment #21
xjmManually tested this locally.
Manual testing against HEAD
Result:
Result: Failed installation.
Manual testing with patch
Apply and commit #19.
Tag 10.0.0-rc1 against HEAD with the script.
Result:
Result: Successful installation.
However, the above isn't a thorough test, because it installs the Drupal packages from d.o, and
drupal/core-recommended
10.0.0-rc1 doesn't exist on d.o yet, so in the steps above, it will installdrupal/core
10.0.0-beta2 and Symfony 6.1.x versions. For a full test, we need to apply this diff:composer/Template/RecommendedProject
, we run:composer.json
files and local path repos):So that all looks good.
Bug: Core component packages are still having their minimum stability set to "RC", and some are therefore uninstallable
I did notice a potential problem with the Drupal component packages. In either of the above testing steps, they still have "RC" as their minimum stability:
This could cause problems for the core components that have dependencies on both Symfony and other Drupal components. The following components have Symfony dependencies:
And, indeed, when searching for what depended on those packages, I found that
FrontMatter
had this problem. Applying the following diff to use RC1 as a local path repo again:This happens:
So, we'll need to fix that unless we're content with those component packages being broken until Symfony is stable. That's an actual regression, so we might need to fix it.
Edit: Channeling Wim and adding some
<hr>
for readability.Comment #22
xjmThis whole issue reminds me again that the way we are calculating and setting minimum stability is still silly nonsense in addition to adding technical debt and bad UX for Drupal installations. Adding related issues from a couple years ago, when we implemented the current mess as the least contentious way to fix an even worse mess.
Also fixing issue priority.
Comment #23
xjmAlso adding a link to the issue that added the component update magic. The thing to fix is probably:
Drupal\Composer\Generator\ComponentGenerator::getPackage()
(based on a completely lazy scan of the original patch without checking HEAD or actually reading the code).
Comment #24
effulgentsia CreditAttribution: effulgentsia at Acquia commentedI think this addresses all of #20 and #21, but I did not perform the manual test in #21 to confirm, so that still needs to happen, if someone is able to.
And yay, that answers the question from #17, so assuming this passes manual testing, I think it's good to go.
Comment #25
longwaveI repeated the steps in #21 and confirm I get the same result. I then repeated the steps again with the patch from #24. I also get the same result except for the final step with the FrontMatter component, where it now successfully installs the RC component with a beta version of Symfony, as expected:
The review changes from #20 are all good as well; the patch is now much easier to read as it is now only the same hunk repeated three times. Therefore to me this is RTBC.
Comment #28
catchLatest version of the code is a lot easier to follow and the least workaround-y we can get here I think without completely refactoring the test.
Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!