Skip to content

Patch the vendored NativePHP plugin from a stored stock copy - #188

Merged
fgilio merged 2 commits into
mainfrom
fix/patch-from-stock
Sep 6, 2026
Merged

fgilio merged 2 commits into
mainfrom
fix/patch-from-stock

Conversation

@fgilio

@fgilio fgilio commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Why

Every patch in scripts/patch-nativephp.php anchored on the text the previous revision of the script left behind. Changing a patch meant adding an upgrade path from its old output, and the review of #184, #185, and #186 found three such paths missing:

What

The runner keeps a copy of each stock target under vendor/nativephp/desktop/.rfa-stock on the first run over a fresh vendor tree. Every later run patches that copy and writes the result over the live file, so a patch only ever anchors on stock or on the output of an earlier patch in the same run.

  • A target without rfa edits is stock. It becomes the stored copy when the stored one is missing or differs, which covers a reinstalled or upgraded plugin.
  • A patched target with no stored copy comes from a script revision that kept none. The run is refused with the reinstall command instead of guessing.
  • The copies live inside the package so Composer drops them with it, and outside resources/electron, which the build copies whole.

Existing checkouts patched by an earlier revision need one reinstall: rm -rf vendor/nativephp/desktop && composer install.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RqwYa86be82YSKkJYb9VLz

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 80f499e4-64d0-47f1-b674-26565c027b12

📥 Commits

Reviewing files that changed from the base of the PR and between 50bb973 and cc80948.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • scripts/patch-nativephp.php
  • tests/Unit/Scripts/NativePhpPatchSetTest.php

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@fgilio
fgilio force-pushed the fix/patch-from-stock branch from c88c22c to 77df948 Compare September 6, 2026 13:05
The patch set applied each edit to whatever the vendored file held, so a
tree patched by an earlier revision of the script either blocked the run
or, when the old anchors still matched, ended up with both revisions'
edits. Every patch change needed its own upgrade path.

The runner now keeps a copy of each stock target under
vendor/nativephp/desktop/.rfa-stock on the first run and patches that
copy on every later run, writing the result over the live file. A patched
target without a stock copy is refused with a reinstall hint.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqwYa86be82YSKkJYb9VLz
@fgilio
fgilio force-pushed the fix/patch-from-stock branch from 77df948 to 4b10db7 Compare September 6, 2026 13:06
@fgilio
fgilio merged commit 6ebc25e into main Sep 6, 2026
15 checks passed
@fgilio
fgilio deleted the fix/patch-from-stock branch September 6, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant