Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

The ECG-72 patch was using a relative path (.vendor-patches/ECG-72.patch), which fails when openmage/magento-lts is installed as a dependency. Per composer-patches documentation, relative paths in dependencies resolve from the consumer's root, not the package root.

Changes

  • composer.json: Changed ECG-72 patch to use absolute GitHub URL matching the pattern of other patches
  • patches.lock.json: Updated URL and recalculated hash to reflect the change

All patches now use absolute URLs like:

"https://raw.githubusercontent.com/OpenMage/magento-lts/de83e28a673e3c1a249b51433abf6dc93e59063c/.vendor-patches/ECG-72.patch"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/cweagans/composer-configurable-plugin/zipball/15433906511a108a1806710e988629fd24b89974
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/2T31Pm /usr/bin/composer update --lock (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] Relative paths for patch files in composer.json is incorrect</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

One of the changes included in 20.16.0 is that composer.json uses relative paths for the patch files. That's only okay for final/leaf projects, not projects intended to be used as dependencies of other projects.

See: https://docs.cweagans.net/composer-patches/usage/defining-patches/#dependencies

As a result, installation of a new project fails because composer-patches is looking for the patch files at the root of the downstream project instead of the root of the Magento project.

Expected Behavior

composer install should work and not fail

Steps To Reproduce

  1. Start new PHP project
  2. Add openmage/magento-lts:20.16.0 as dependency
  3. composer install

Environment

- OpenMage: 20.16.0
- php: N/A

Anything else?

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Copilot AI changed the title [WIP] Fix relative paths for patch files in composer.json Fix relative patch path for magento-ecg/coding-standard Jan 5, 2026
Copilot AI requested a review from addison74 January 5, 2026 17:33
@github-actions github-actions bot added the composer Relates to composer.json label Jan 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

Test Results

966 tests  ±0   958 ✅ ±0   18s ⏱️ +2s
213 suites ±0     8 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit f9e41f4. ± Comparison against base commit 533b2a7.

♻️ This comment has been updated with latest results.

@addison74 addison74 marked this pull request as ready for review January 5, 2026 19:27
Copilot AI review requested due to automatic review settings January 5, 2026 19:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the ECG-72 patch used a relative path that fails when openmage/magento-lts is installed as a dependency in other projects. Per composer-patches documentation, relative paths in dependencies resolve from the consumer's root, not the package root.

  • Changed ECG-72 patch path from relative (.vendor-patches/ECG-72.patch) to absolute GitHub URL
  • Updated patches.lock.json to reflect the new URL and recalculated configuration hash
  • Ensured consistency with all other patches which already use absolute GitHub URLs

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
composer.json Updated ECG-72 patch URL from relative path to absolute GitHub URL matching the pattern of other patches
patches.lock.json Updated patch URL and recalculated _hash to reflect composer.json changes
composer.lock Updated content-hash as expected when composer.json changes

@Hanmac Hanmac requested review from kiatng and sreichel January 8, 2026 14:13
@sreichel
Copy link
Contributor

sreichel commented Jan 9, 2026

You can merge too.

@sreichel sreichel merged commit b7979dc into main Jan 9, 2026
49 checks passed
@sreichel sreichel deleted the copilot/fix-relative-paths-patch-files branch January 9, 2026 09:02
@sreichel sreichel added this to the 20.17.0 milestone Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

composer Relates to composer.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Relative paths for patch files in composer.json is incorrect

4 participants