-
-
Notifications
You must be signed in to change notification settings - Fork 28
[#2096] Updated to use cweagans/composer-patches v2.
#2099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpgrades composer-patches to v2, adds patches.lock.json files, removes the composer-exit-on-patch-failure flag, centralizes fixture updates under Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Developer
participant Ahoy as "ahoy CLI"
participant Repo as "Repository"
participant Fixtures as "tests/ & installer/fixtures"
Note over Ahoy,Fixtures: Unified fixture update flow
Developer->>Ahoy: run `ahoy update-fixtures`
Ahoy->>Repo: ensure baseline fixtures committed
Ahoy->>Fixtures: update baseline and scenario fixtures
Fixtures-->>Ahoy: produce diffs
Ahoy->>Fixtures: run validation tests
alt diffs found
Ahoy->>Developer: present diffs for review
else no diffs
Ahoy->>Developer: report no changes
end
sequenceDiagram
autonumber
actor Maintainer
participant Composer as "composer"
participant Patches as "composer-patches v2"
participant Repo as "Repository"
Note over Patches,Repo: composer-patches v2 lifecycle
Maintainer->>Composer: add patch to `extra.patches` & run `composer patches-relock`
Composer->>Patches: generate `patches.lock.json` (hash + metadata)
Patches->>Repo: write `patches/` and `patches.lock.json`
Maintainer->>Composer: `composer install` / `composer patches-repatch`
Composer->>Repo: apply patches and update `composer.lock`
Maintainer->>Repo: commit `patches.lock.json`, `patches/`, and `composer.lock`
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related issues
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (19)
📒 Files selected for processing (10)
🧰 Additional context used🧠 Learnings (6)📚 Learning: 2025-05-29T12:15:32.188ZApplied to files:
📚 Learning: 2025-06-02T00:41:36.321ZApplied to files:
📚 Learning: 2025-08-08T12:02:24.652ZApplied to files:
📚 Learning: 2025-06-01T08:08:59.071ZApplied to files:
📚 Learning: 2025-09-13T04:14:41.765ZApplied to files:
📚 Learning: 2025-06-01T08:09:18.993ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
🔇 Additional comments (14)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2099 +/- ##
========================================
Coverage 68.16% 68.16%
========================================
Files 96 96
Lines 4749 4749
Branches 44 44
========================================
Hits 3237 3237
Misses 1512 1512 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
72e4ea8 to
6292f13
Compare
6292f13 to
6c0dd32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (19)
.vortex/installer/composer.lockis excluded by!**/*.lock.vortex/installer/tests/Fixtures/install/_baseline/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/ai_instructions_claude/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/ciprovider_circleci/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/ciprovider_gha/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/db_download_source_container_registry/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/hosting_acquia/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/hosting_acquia/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/hosting_lagoon/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/hosting_project_name___acquia/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/provision_database_lagoon/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/provision_profile/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/services_no_clamav/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/services_no_redis/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/services_no_solr/CLAUDE.mdis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/install/starter_drupal_cms_profile/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/version_replacement/baseline/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/version_replacement/expected/composer.jsonis excluded by!.vortex/installer/tests/Fixtures/**.vortex/tests/composer.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
.vortex/CLAUDE.md(6 hunks).vortex/docs/content/drupal/composer.mdx(2 hunks).vortex/docs/content/workflows/development.mdx(1 hunks).vortex/docs/cspell.json(1 hunks).vortex/installer/composer.json(1 hunks).vortex/installer/patches.lock.json(1 hunks).vortex/tests/composer.json(3 hunks).vortex/tests/patches.lock.json(1 hunks)CLAUDE.md(2 hunks)composer.json(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-05-29T12:15:32.188Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 0
File: :0-0
Timestamp: 2025-05-29T12:15:32.188Z
Learning: Do not review files in `.vortex/installer/tests/Fixtures/install` directory as they are test fixtures.
Applied to files:
.vortex/CLAUDE.md
📚 Learning: 2025-06-02T00:41:36.321Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 1697
File: .vortex/installer/tests/Fixtures/install/provision_database_lagoon/docs/onboarding.md:16-17
Timestamp: 2025-06-02T00:41:36.321Z
Learning: DO NOT EVER REVIEW FILES IN .vortex/installer/tests/Fixtures/ directory - these are test fixtures and should not be reviewed under any circumstances.
Applied to files:
.vortex/CLAUDE.md
📚 Learning: 2025-08-08T12:02:24.652Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 1896
File: .vortex/tests/bats/unit/download-db-lagoon.bats:24-25
Timestamp: 2025-08-08T12:02:24.652Z
Learning: In .vortex/tests/bats/unit Bats tests using ../_helper.bash (run_steps), prefixing a STEPS entry with "- " denotes a negative assertion (the substring must NOT appear in output). Unprefixed entries are positive assertions. Example: "- Database dump refresh requested. Will create a new dump." asserts absence; "Database dump refresh requested. Will create a new dump." asserts presence.
Applied to files:
.vortex/CLAUDE.md
📚 Learning: 2025-06-01T08:08:59.071Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 1693
File: .vortex/installer/tests/Fixtures/install/deploy_type_none_gha/.github/workflows/build-test-deploy.yml:1-4
Timestamp: 2025-06-01T08:08:59.071Z
Learning: Test fixture files (typically located in directories containing "fixture" or "test") should not be reviewed for code quality issues as they may intentionally contain incomplete, invalid, or malformed data for testing purposes.
Applied to files:
.vortex/CLAUDE.md
📚 Learning: 2025-09-13T04:14:41.765Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 2011
File: .vortex/tests/phpunit/Traits/Steps/StepAhoyTrait.php:20-23
Timestamp: 2025-09-13T04:14:41.765Z
Learning: In .vortex/tests/phpunit PHPUnit tests using cmd/cmdFail helpers, patterns in the expected output arrays support '*' markers for positive assertions (text must be present) and '!' markers for negative assertions (text must NOT be present). The '*' markers are NOT literal text matches but rather indicate expected presence.
Applied to files:
.vortex/CLAUDE.md
📚 Learning: 2025-06-01T08:09:18.993Z
Learnt from: AlexSkrypnyk
Repo: drevops/vortex PR: 1693
File: .vortex/installer/tests/Fixtures/install/hosting_acquia/docs/deployment.md:6-8
Timestamp: 2025-06-01T08:09:18.993Z
Learning: Do not review files in test fixture directories (e.g., files under paths containing `/tests/Fixtures/` or similar test fixture patterns). These files are used for testing purposes and should remain as-is.
Applied to files:
.vortex/CLAUDE.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build (1)
- GitHub Check: build (0)
- GitHub Check: vortex-test-workflow (0)
- GitHub Check: vortex-test-workflow (4)
- GitHub Check: vortex-test-workflow (2)
- GitHub Check: vortex-test-workflow (1)
- GitHub Check: vortex-test-workflow (3)
- GitHub Check: vortex-test-common
- GitHub Check: vortex-test-installer (8.4)
- GitHub Check: vortex-test-installer (8.3)
- GitHub Check: vortex-test-docs
🔇 Additional comments (14)
.vortex/docs/cspell.json (1)
31-31: Minor spelling dictionary addition—approved.Adding "drupalcode" to the spellcheck dictionary is appropriate for documentation of a Drupal project template. Word placement maintains alphabetical order.
composer.json (1)
9-9: Composer-patches version bump to v2.0—verified.The new commands
composer patches-relockandcomposer patches-repatchare confirmed as valid v2 commands. The patches.lock.json will be automatically created on first run and should be committed to version control alongside composer.json and composer.lock.The removal of
extra.composer-exit-on-patch-failureis appropriate since v2 automatically enforces patch application failures.CLAUDE.md (1)
382-551: Comprehensive v2 patching documentation—verified accurate.The documentation correctly states that patches.lock.json should be committed to version control alongside composer.json and composer.lock. The workflow in Step 7 (lines 531-551) aligns with official v2 recommended workflows: define patch → run
composer patches-relock→ runcomposer patches-repatch→ update composer.lock → commit changes.The emphasis on git-based patching, reproducible builds, and checksums reflects v2's core improvements over v1.
.vortex/tests/composer.json (1)
4-4: Test harness correctly updated for composer-patches v2.The test harness now:
- Adds
cweagans/composer-patches: ^2to production requirements (line 14)- Enables the plugin in
allow-plugins(line 40)- Updates supporting dev dependencies to compatible versions
- Adds GPL-2.0-or-later license metadata
These changes align with the root and installer composer.json updates and ensure the test environment supports v2 patching.
Also applies to: 14-14, 19-28, 40-40
.vortex/CLAUDE.md (1)
333-352: Fixture update workflow properly centralized.The documentation correctly establishes
ahoy update-fixturesas the standard, unified approach for updating all fixtures (template and installer), with appropriate guidance on what the command does and why manualUPDATE_FIXTURES=1commands should be avoided. The alternative manual approach (lines 355–364) provides an escape hatch for advanced debugging scenarios..vortex/installer/composer.json (1)
20-31: Installer dependencies properly updated for v2.Core update: cweagans/composer-patches bumped from ^1.7 to ^2, enabling the new
patches-relockandpatches-repatchcommands. The removal ofextra.composer-exit-on-patch-failureis appropriate since v2 enforces patch failures automatically.Other dependency updates (Symfony components, git-php, etc.) appear to be routine maintenance, with most being patch or minor version increments. The addition of
cweagans/composer-patchestoallow-plugins(line 74) ensures the plugin can operate properly.Also applies to: 35-45, 74-74
.vortex/installer/patches.lock.json (1)
1-4: New patches.lock.json follows v2 specification.The patches.lock.json file is automatically created by composer-patches v2 and should be committed to version control alongside composer.json and composer.lock. The file structure correctly follows the v2 format with a _hash and patches array.
.vortex/tests/patches.lock.json (1)
1-4: Test harness patches.lock.json—approved.Consistent with the installer's patches.lock.json, this file follows v2 specifications and should be committed to version control.
.vortex/docs/content/drupal/composer.mdx (3)
98-104: Accurate v2 composer-patches description.The updated documentation correctly describes v2 features:
git applyfor consistency, SHA-256 checksums, and thepatches.lock.jsonauto-generation. The cross-link to "Patching" in development.mdx aligns with the new workflow section.
263-267: Clear documentation of patches.lock.json auto-generation.The new section properly explains the purpose of
patches.lock.json, its auto-generation by v2.x, and its importance for reproducible builds and integrity verification. Placement in theextraconfiguration section is appropriate and reflects composer.json structure.
288-289: Cross-link reference updated appropriately.The reference from "Working with packages" to "Patching" aligns with the new Patching section in the development workflow documentation and provides better contextual guidance for users.
.vortex/docs/content/workflows/development.mdx (3)
220-227: Strong intro to v2 patching workflow with official documentation link.The section provides clear context (v2 uses
git apply) and directs users to authoritative resources for detailed guidance. This approach balances local documentation with upstream expertise.
228-243: Excellent explanation of patches.lock.json purpose and benefits.The subsection clearly articulates why
patches.lock.jsonmatters (reproducibility, checksums, explicit state tracking) and makes the value proposition compelling for teams. Formatting with bullet points enhances readability.
244-306: Commands verified as available and functioning as documented.The composer-patches v2.x plugin provides
composer patches-relockfor regenerating the patches lock file andcomposer patches-repatchfor re-applying patches and reinstalling patched packages. The documentation accurately reflects the available commands and their intended behaviors. No corrections needed.
| :::warning | ||
| `composer patches-repatch` removes patched dependencies from `vendor/` and reinstalls them. Ensure you have no unsaved changes in those directories. | ||
| ::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Clarify the scope of "unsaved changes" in the patches-repatch warning.
The warning appropriately flags that composer patches-repatch removes and reinstalls dependencies, but "unsaved changes in those directories" could be misinterpreted. Consider adding a clarification that this refers to uncommitted modifications to vendored dependencies (a rare but important distinction).
Suggested clarification:
:::warning
-`composer patches-repatch` removes patched dependencies from `vendor/` and reinstalls them. Ensure you have no unsaved changes in those directories.
+`composer patches-repatch` removes patched dependencies from `vendor/` and reinstalls them. Ensure you have no uncommitted local modifications to these vendored packages.
:::📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| :::warning | |
| `composer patches-repatch` removes patched dependencies from `vendor/` and reinstalls them. Ensure you have no unsaved changes in those directories. | |
| ::: | |
| :::warning | |
| `composer patches-repatch` removes patched dependencies from `vendor/` and reinstalls them. Ensure you have no uncommitted local modifications to these vendored packages. | |
| ::: |
🤖 Prompt for AI Agents
.vortex/docs/content/workflows/development.mdx around lines 270 to 272: the
warning "Ensure you have no unsaved changes in those directories" is ambiguous;
update the text to clarify it means uncommitted or locally modified files in
vendor/ (vendored dependencies), not unrelated unsaved editor buffers—replace or
append a brief clarification stating it refers specifically to uncommitted/local
modifications to files under vendor/ (or patches managed by composer) so users
understand to commit or stash those changes before running composer
patches-repatch.
6c0dd32 to
c0a16a3
Compare
c0a16a3 to
29adafa
Compare
Closes #2096
Summary by CodeRabbit
Documentation
Chores
Misc