- Issue created by @tedbow
- Assigned to omkar.podey
- 🇮🇳India omkar.podey
My take on the issue,
- The first thing that pops up is the check
empty($extra['composer-exit-on-patch-failure'])
and this is checking the extra which is inside package and not config (added a screenshot) so we need a new function something like getRootPackageInfo inpackage_manager/src/ComposerInspector.php
- So I tried this
$this->runner->run(['--self', "--working-dir=$working_dir", '--json'], $this->jsonCallback); return $this->jsonCallback->getOutputData();
but it failed with an error
In PluginManager.php line 169: Plugin cweagans/composer-patches is missing a require statement for a version of the composer-plugin-api package.
-
So next thing was to add
"composer-plugin-api" => "^1.0 || ^2.0"
to the fixture being created but it still failed, @wim.leers had a hunch that it might be caused because we are not updating the composer and just touching the installed.json and installed .php in our manipulator.
Thoughts @ted.bowman ?
- The first thing that pops up is the check
- 🇺🇸United States tedbow Ithaca, NY, USA
@omkar.podey thanks for investigating this.
My guess is we might need 🐛 The 'fake_site' fixture cannot be using with `composer show` because the packages are not installed Fixed so our
fake_site
fixture is not so fake.I think in that issue we would make a Composer path repo for
cweagans/composer-patches
and then do an actualcomposer require cweagans/composer-patches
to bring in a mocked version of the package. The we won't have to worry about which fails we need to update - 🇮🇳India omkar.podey
The closest thing i could find, so now i think we might need to create a class which parses the composer for us and return specific values that we request for.
Or
I might have missed something and we might be able to do it with cli somehow.
- Assigned to wim leers
- Assigned to omkar.podey
- Status changed to Needs review
almost 2 years ago 8:50am 1 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I did a lot digging and trial and error. One thing is certain:
composer
's docs on this front suck.👆
composer config
works not just for the top-levelconfig
key incomposer.json
, but also forextra
… discovered this thanks to:$ composer help config | grep extra -j, --json JSON decode the setting value, to be used with extra.* keys -m, --merge Merge the setting value with the current value, to be used with extra.* keys in combination with --json To add or edit extra properties you can use: /opt/homebrew/bin/composer config extra.property value /opt/homebrew/bin/composer config extra.property --json '{"foo":true, "bar": []}'
- Status changed to Postponed
almost 2 years ago 9:07am 1 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Just discussed with @omkar.podey, he's +1 — and he did try
composer config
but the docs suggested that it was for writing only — like I said: the docs suck 🙈So now postponed on 🐛 The 'fake_site' fixture cannot be using with `composer show` because the packages are not installed Fixed .
- Issue was unassigned.
- Status changed to Needs work
almost 2 years ago 8:54pm 6 February 2023 - 🇺🇸United States tedbow Ithaca, NY, USA
- Assigned to omkar.podey
- Issue was unassigned.
- Status changed to Postponed
almost 2 years ago 12:37pm 8 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Discussed with @omkar.podey — this should wait for 📌 Reliably support cweagans/composer-patches in Package Manager & Automatic Updates: validate stage Fixed : that issue is 90% done and will heavily conflict with this.
- Status changed to Active
almost 2 years ago 7:51pm 14 February 2023 - Assigned to yash.rode
- Status changed to Needs work
almost 2 years ago 12:32pm 15 February 2023 - @yashrode opened merge request.
- Issue was unassigned.
- Status changed to Postponed
almost 2 years ago 11:14am 16 February 2023 - 🇮🇳India yash.rode pune
in
\Drupal\package_manager\Validator\ComposerPatchesValidator::computePatcherStatus
to calculate$is_installed
we need list of installed packages, so this should wait for 📌 Add new InstalledPackagesList which does not rely on Composer API to get package info Fixed - Status changed to Needs work
almost 2 years ago 8:36pm 21 February 2023 - 🇺🇸United States phenaproxima Massachusetts
The changes I made here:
- The patches validator needs to know whether the plugin is a root requirement. As it happens,
composer show
returns adirect-dependency
field which tells us exactly that. So I added that toInstalledPackage
. - I added the ability for
ComposerInspector::getConfig()
to return a default value. It's not clear that https://github.com/composer/composer/issues/11302 will ever be merged, and I don't think we should be adding more special-casing into ComposerInspector when we need a default value. This also allows the logic in computePatcherStatus() to be a little more straightforward.
- The patches validator needs to know whether the plugin is a root requirement. As it happens,
- Assigned to phenaproxima
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Yay, since 📌 Stop reusing core's commit-code-check.sh in favor of 4 simple commands Fixed this is no longer resulting in aborted CI runs, but instead it's reporting/failing on the actual quality problems 👍
- Assigned to yash.rode
- Issue was unassigned.
- Status changed to Postponed
over 1 year ago 3:06pm 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:46am 3 March 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
📌 Update FixtureManipulator to work with InstalledPackagesList, real composer show command Fixed landed, this is unblocked!
- Assigned to wim leers
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 6:49pm 7 March 2023 - Assigned to tedbow
- Status changed to Needs review
over 1 year ago 7:01pm 7 March 2023 - 🇺🇸United States phenaproxima Massachusetts
I think this looks great.
However, the one thing I really don't like is the special-casing of
extra.composer-exit-on-patch-failure
in ComposerInspector::getConfig(). That feels boundary-violating to me and I don't think we should be establishing that as a precedent.That said, I won't block commit on it, but I want to know what @tedbow thinks.
- Status changed to RTBC
over 1 year ago 7:09pm 7 March 2023 - 🇺🇸United States phenaproxima Massachusetts
Restoring RTBC on green. I don't think my changes are too controversial.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Excellent catch, and 100% agreed with the solution 😊👍
- 🇺🇸United States tedbow Ithaca, NY, USA
Great! Looks good. will merge on green
-
phenaproxima →
committed b7fadb4d on 3.0.x authored by
omkar.podey →
Issue #3337760 by phenaproxima, Wim Leers, yash.rode, omkar.podey:...
-
phenaproxima →
committed b7fadb4d on 3.0.x authored by
omkar.podey →
- Status changed to Fixed
over 1 year ago 8:12pm 7 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.