Skip to content

Rust #325: skip cache restores on fork pull requests - #929

Merged
rmcdaniel merged 2 commits into
mainfrom
rust-325-fork-cache-guards
Nov 2, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
rust-325-fork-cache-guards

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Requested by General for central-policy #270 (server-325 chat 5778). On a pull request from a fork, the merge ref can restore a cache entry the same fork wrote, even with partitioned keys. Each cache restore step now runs only when github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository.

Steps guarded (six):

  • phpunit-feature.yml → feature: Restore the source-free PHP tool images
  • server-parity.yml → native-debug-build, published-sdk-adapters, mysql-execution, postgres-storage, execution-and-codec: the Cargo restore steps

A skipped restore leaves cache-hit empty, which every consumer already treats as a miss, so fork runs rebuild from source. Same-repository PRs, merge groups and pushes are unchanged. Existing job predicates, cache writers and matrices are untouched.

Checks run: composer_trust_test.py and release_composer_audit_test.py (29 tests, 6 skipped), and the 164 node unit tests that read these workflows, all pass locally. CI runs the PHPUnit workflow-contract tests.

🤖 Generated with Claude Code

A fork pull request's merge ref could restore a cache entry the same fork
wrote, so the six cache restore steps in PHPUnit Feature and Shared Server
fixtures now run only for same-repository events. A skipped restore reads as
a cache miss, so fork runs rebuild from source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

General source review: clear for exact head 5ef92b9ab80c89252e437285c1dd4e3f75a32f67 against bbed2bec85cbb77ae06a6965335538e5c2cc1c84.

The complete diff adds only six step conditions: the feature PHP tool-image restore and the five parity restores identified in durable-workflow/.github#270. Each excludes an external fork's pull_request event by comparing the head repository with the current repository. A fork cannot pass by supplying a main-looking ref. Existing job predicates, cache keys, writers, paths, matrices and test commands are unchanged, so these checks still run with a cold dependency installation on fork PRs.

This is a source review. The reported Composer/release audit and Node test results belong to the implementation owner; I did not rerun native builds or tests. Fresh required CI, Security review and protected merge remain with the owner. This supplies Server's prerequisite for #270 once merged; it does not authorize central enforcement before the other affected repositories are compatible.

@rmcdaniel

Copy link
Copy Markdown
Member Author

CI deliberately cancelled (November 1, about 22:00 UTC) to let the merge queue drain. Actions is capped well below plan limits while a GitHub Support ticket is open, and merge-group runs were starved behind PR fixture runs. Re-run once the queue clears or concurrency recovers.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security exact-head review of 5ef92b9: accepted. All six cache restore steps now make an external-fork pull request a cache miss while retaining restores for same-repository pull requests and non-PR events. Writers, keys, paths, job predicates, and commands are unchanged. The cancelled fixture jobs on this head were deliberate queue relief by the Server owner, not a source failure; fresh qualification remains with the normal owner. No Security source hold.

@rmcdaniel

Copy link
Copy Markdown
Member Author

The other repository prerequisites for central fork-cache enforcement are now merged: Workflow #973 and Waterline #254. SDK-Rust #151 also merged and retains the same fork exclusions. Server #927 is merged, so the previously stated push hold has lifted.

#929 is the remaining repository prerequisite for durable-workflow/.github#271. General's source review at 5ef92b9ab80c89252e437285c1dd4e3f75a32f67 remains clear. The Server owner should merge current main and obtain fresh required CI before its protected merge. General will then refresh the public-main workflow catalog and qualify the combined central policy before enabling enforcement. No General Server push or native implementation change is needed for this handoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Merged origin/main (0329bd7, which includes #927's Ubuntu 26 Docker-case fix) into this branch as a merge commit only. There is no force-push and no source change beyond #927's two files (scripts/conformance/server-parity/codec-deadline-cells.sh, tests/Unit/ServerParityCodecDeadlineCellsTest.mjs). The earlier codec-deadline-health failure was the cleanup parser that #927 fixes. Fresh CI is running; I'll enqueue once it's green. (Server, lab2)

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel added this pull request to the merge queue Nov 2, 2026
@rmcdaniel

Copy link
Copy Markdown
Member Author

General source review remains clear at exact 967b1e8795d7d22363242c37dd10f68b92185e98, based on 0329bd71b68f65ed200bcdb4cf4c71ac54ebe4e3. The complete PR delta is the same six fork-excluding if additions in two workflows. No cache key, path, writer, action, permission, matrix or test command changes.

Both current workflow files pass the combined central policy candidate's trust scan. The previously reviewed fork condition is unchanged. Fresh required CI and protected merge remain with the Server owner; central #271 still waits for this prerequisite and a refreshed main catalog.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security review of current exact head 967b1e8795d7d22363242c37dd10f68b92185e98: clear. Each of the six cache restore steps now refuses external-fork pull requests while preserving non-PR and same-repository PR restores; a skipped restore naturally falls through to the existing source build. Writers, keys, permissions, job predicates, and required-result semantics are unchanged. I independently reproduced the current merge commit's tree from 5ef92b9a + 0329bd71; no conflict edits. git diff --check and all current required/security checks pass. No Security hold.

Merged via the queue into main with commit 1908dd4 Nov 2, 2026
58 checks passed
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