Early Bird Registration for DrupalCon Atlanta is now open! By registering during our Early Bird Registration window, you’ll save $100. This window ends on 19 January 2025 and will go by quickly, so don’t wait!
Problem/Motivation
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#22 | 3342227-21.patch | 4.55 KB | wim leers |
#5 | Screenshot 2023-02-16 at 8.07.00 PM.png | 160.93 KB | omkar.podey |
Issue fork automatic_updates-3342227
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3342227-update-scaffoldfilepermissionsvalidator-to changes, plain diff MR !711
Comments
Comment #2
yash.rode CreditAttribution: yash.rode at Acquia commentedI think this one will need input from #3334994: Add new InstalledPackagesList which does not rely on Composer API to get package info, as we need list of installed packages.
Comment #4
omkar.podey CreditAttribution: omkar.podey at Acquia commentedComment #5
omkar.podey CreditAttribution: omkar.podey at Acquia commented@travis.carden the proposed change in question
Comment #6
omkar.podey CreditAttribution: omkar.podey at Acquia commentedSo @ted.bow if it was okay to call
composerInspector->getConfig()
while passing a working directory for the core's composer json to fetch theextra
config ? (could also be called with--no-plugins
to make it safer but would that be enough ?)Comment #7
wim leersThis now blocks #3338346: Do not allow drupal/core-composer-scaffold to be used by packages other than core.
Comment #8
omkar.podey CreditAttribution: omkar.podey at Acquia commented@ted.bow could you leave a comment here about the discussion you had with @travis.carden.
Comment #9
wim leers#3334994: Add new InstalledPackagesList which does not rely on Composer API to get package info landed, this should now be able to move forward.
Comment #10
wim leersWhile we should still get that input from @tedbow, meanwhile this MR can be rebased on top of #3334994: Add new InstalledPackagesList which does not rely on Composer API to get package info! 👍
Comment #11
tedbowComment #12
tedbow@omkar.podey add an issue summary here? thanks
Comment #13
phenaproximaRegarding #6, I discussed this with @tedbow.
I did a little experimentation to see if a Composer plugin could alter the file mapping defined by drupal/core, that gets written to installed.json and composer.lock.
The answer is yes, it could be done, if the plugin did something similar to what cweagans/composer-patches used to do. I don't, however, think that's especially likely to happen.
The real problem is that we do not properly account for the overridability of scaffold file mappings supported by the scaffold plugin, and we never have. I've opened a post-MVP issue to deal with that.
For that reason, @tedbow and I agreed that it's okay for us to change the validator to call
$composerInspector->getConfig('extra.drupal-scaffold.file-mapping', $installed_packages['drupal/core']->path)
. Doing that will get the file mapping defined by core, which is not guaranteed to be complete or accurate for the actual project using Package Manager -- but it also doesn't make the current situation any worse. And it helps get us off of ComposerUtility.Comment #14
phenaproximaYeah, that sucks...composer.lock isn't there in core's directory (and rightfully so), and therefore ComposerInspector::validate() throws an exception when it tries to validate that. The only real way out of this pickle is for us to stop requiring the presence of composer.lock, but that means we can't get the types of installed packages until Composer merges and tags https://github.com/composer/composer/pull/11340. Maddening.
Here's what I would suggest: we should change
validate()
so that it doesn't require composer.lock to exist, butgetInstalledPackagesList()
does. I think this is a reasonable course of action because a) it doesn't change or complicate our API, and b) getInstalledPackagesList() is the only thing that needs to deal with composer.lock.Comment #15
phenaproximaTraced into some of the failures and the reason why it's going to keep failing is because the changed scaffold file mapping has to be defined in path/to/stage/dir/vendor/drupal/core/composer.json. Not installed.json, which is where ComposerUtility would read it from.
Hopefully the fixture manipulator is smart enough to do that...
Comment #16
omkar.podey CreditAttribution: omkar.podey at Acquia commentedOkay so it isn't possible to manipulate composer.json's of packages right now, But i got to discuss it with @Wim.leers and we decided to update
\Drupal\fixture_manipulator\FixtureManipulator::modifyPackage
to actually manipulate the composer.json of the package.I'll make a new method for it, for now , referencing
\Drupal\fixture_manipulator\FixtureManipulator::addConfig
as it also manipulates composer.jsonComment #17
wim leersDiscussed in detail during meeting just now. Conclusion: this is hard-blocked on direction from @tedbow in #3343827: Update FixtureManipulator to work with InstalledPackagesList, real composer show command to avoid wasted work.
Comment #18
wim leersComment #19
wim leers#3343827: Update FixtureManipulator to work with InstalledPackagesList, real composer show command landed, this is unblocked!
Comment #20
wim leersThis should wait for #3345633: Remove FixtureManipulator::modifyPackage() last usage to land, because otherwise duplicate changes would need to be made here.
Comment #22
wim leersThis patch will pass once #3345633: Remove FixtureManipulator::modifyPackage() last usage lands.
Comment #24
phenaproxima😅
I have no objections to this code. Committing when tests pass.
Comment #26
phenaproximaNo it didn't. We're just positively plagued by these pestilential random failures.
Comment #28
phenaproximaAnd, committed!
Only one (or two) things left to do, and ComposerUtility is gone.
Comment #29
wim leersThat means #3338346: Do not allow drupal/core-composer-scaffold to be used by packages other than core is now unblocked! 👍