- Issue created by @omkar.podey
- š®š³India yash.rode pune
I think this one will need input from š Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed , as we need list of installed packages.
- @omkarpodey opened merge request.
- Assigned to omkar.podey
- š®š³India omkar.podey
@travis.carden the proposed change in question
- š®š³India omkar.podey
So @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 ? - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
This now blocks š Do not allow drupal/core-composer-scaffold to be used by packages other than core Fixed .
- Assigned to tedbow
- Status changed to Needs work
almost 2 years ago 10:09am 21 February 2023 - š®š³India omkar.podey
@ted.bow could you leave a comment here about the discussion you had with @travis.carden.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
š Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed landed, this should now be able to move forward.
- Issue was unassigned.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
While we should still get that input from @tedbow, meanwhile this MR can be rebased on top of š Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed ! š
- Assigned to omkar.podey
- šŗšøUnited States tedbow Ithaca, NY, USA
@omkar.podey add an issue summary here? thanks
- šŗšøUnited States phenaproxima Massachusetts
Regarding #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 āØ When determining scaffold file mappings, determine them consistently and completely, accounting for overrides Active .
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 -- but it also doesn't make the current situation any worse. And it helps get us off of ComposerUtility. - šŗšøUnited States phenaproxima Massachusetts
Yeah, 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: in another issue, remove the requirement for composer.lock to exist, and use
library
as the default package type when creatingInstalledPackage
objects. getInstalledPackagesList() should try to load package types from composer.lock, but if composer.lock doesn't exist, we should just let the package type default tolibrary
. (We can get away with this since InstalledPackage's constructor is private.)Then, when we require a Composer version that provides the
type
key, we can change InstalledPackage to require atype
key. - šŗšøUnited States phenaproxima Massachusetts
Traced 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...
- š®š³India omkar.podey
Okay 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.json - Status changed to Postponed
over 1 year ago 3:05pm 28 February 2023 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
Discussed in detail during meeting just now. Conclusion: this is hard-blocked on direction from @tedbow in š Update FixtureManipulator to work with InstalledPackagesList, real composer show command Fixed to avoid wasted work.
- Status changed to Needs work
over 1 year ago 10:47am 3 March 2023 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
š Update FixtureManipulator to work with InstalledPackagesList, real composer show command Fixed landed, this is unblocked!
- Issue was unassigned.
- Status changed to Postponed
over 1 year ago 8:10pm 9 March 2023 - Status changed to Needs review
over 1 year ago 8:12pm 9 March 2023 - š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
This patch will pass once š Remove FixtureManipulator::modifyPackage() last usage Fixed lands.
The last submitted patch, 22: 3342227-21.patch, failed testing. View results ā
- Status changed to RTBC
over 1 year ago 9:22pm 9 March 2023 - šŗšøUnited States phenaproxima Massachusetts
+++ b/src/Validator/ScaffoldFilePermissionsValidator.php @@ -27,13 +27,17 @@ final class ScaffoldFilePermissionsValidator implements EventSubscriberInterface - * Constructs a SiteDirectoryPermissionsValidator object. + * Constructs a ScaffoldFilePermissionsValidator object.
š
I have no objections to this code. Committing when tests pass.
The last submitted patch, 22: 3342227-21.patch, failed testing. View results ā
- šŗšøUnited States phenaproxima Massachusetts
No it didn't. We're just positively plagued by these pestilential random failures.
-
phenaproxima ā
committed b302be99 on 3.0.x
Issue #3342227 by omkar.podey, phenaproxima, Wim Leers:...
-
phenaproxima ā
committed b302be99 on 3.0.x
- Status changed to Fixed
over 1 year ago 10:57pm 9 March 2023 - šŗšøUnited States phenaproxima Massachusetts
And, committed!
Only one (or two) things left to do, and ComposerUtility is gone.
- š§šŖBelgium wim leers Ghent š§šŖšŖšŗ
That means š Do not allow drupal/core-composer-scaffold to be used by packages other than core Fixed is now unblocked! š
Automatically closed - issue fixed for 2 weeks with no activity.