Skip to content

perf(pr-pipeline): keep pr-merge's per-run artifacts 1 day - #9442

Merged
kyle-sexton merged 1 commit into
mainfrom
perf/pr-merge-retention-1d
Oct 23, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
perf/pr-merge-retention-1d

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: an efficiency cut from today's GITHUB_TOKEN exhaustions, found by the artifact census on the #9297 efficiency work.

Summary

Every pr-merge gate run pages the whole repository artifact listing: 45 pages at about 4,400 artifacts. pr-merge's own per-run artifacts made up about 765 of them, kept 2 to 8 days although every reader is done within about an hour.

Fix

retention-days: 1 (the minimum) for:

  • pr-merge-gate-cursor (was 2): read only by the next run, rotation.mjs.
  • pr-merge-head-refs (was 2): read only by the next run, head-ref-map.mjs.
  • pr-merge-summary (was 8): read by its own run's gate-check, and by maintenance-monitor-signals/collect.mjs, which checks the newest few on an hourly cron.

Unchanged: pr-merge-dispatched-* and pr-merge-rerun-* keep 90 days, because babysit_postmerge.py reads them back to the merged-since floor, which has no fixed bound.

Verification

  • Readers: git grep for each name on origin/main finds only the readers listed above.
  • Effect: about 8-11 fewer pages per full listing now, about 1,090 fewer artifacts at steady state. Retention changes apply to new uploads only.
  • The change is three retention-days values; no logic changes.

Related

🤖 Generated with Claude Code

pr-merge-gate-cursor and pr-merge-head-refs are read only by the next
run (rotation.mjs, head-ref-map.mjs), and pr-merge-summary only by its
own run's gate-check and by maintenance-monitor-signals, which reads the
newest few hourly (collect.mjs). Each run pages the whole repository
artifact listing, so the extra days only add pages: about 765 artifacts
now, 8-11 of 45 pages per listing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 23, 2026 15:38
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-23T15:38:19.993963Z 817c55b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 817c55bda4a819e69c7df95f8ac03b30e446d09d: 0 finding(s), 0 as inline comments.

No security issues found. critical-findings: 0

The change lowers retention-days to 1 for three actions/upload-artifact steps in .github/workflows/pr-merge.yml: pr-merge-gate-cursor (was 2), pr-merge-head-refs (was 2) and pr-merge-summary (was 8). I also added a no-release changeset file. The workflow does not touch permissions, triggers, action pins, secrets or any trust-gate path.

I read the consumers of the shortened artifacts to check that earlier expiry cannot weaken the merge gate:

  • pr-merge-head-refs: .github/scripts/pr-merge/head-ref-map.mjs states that any failure or missing map makes the gate download every untied FAIL, which "costs requests, never a decision". The read step runs with continue-on-error: true, and a map found is only used if its run's head commit is on main and its shape validates.
  • pr-merge-gate-cursor: the workflow comments say the cursor "sets only the order; any error leaves the listing order". The read step runs with continue-on-error: true. An expired cursor only changes which candidate the sweep starts with.
  • pr-merge-summary: the readers are the same run's gate-check and the hourly maintenance-monitor-signals/collect.mjs. Expiry before a read only reduces observability. It does not allow a merge.
  • pr-merge-dispatched-* and pr-merge-rerun-*: these keep their 90-day retention, so that evidence is not shortened.

Manifest items: no plugin.json or marketplace.json is changed, so there are no manifest <field> lines.

The PR description is data and holds no embedded directives. I did not consult the instruction exception register, because the diff removes no standing instruction.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 817c55bda4a819e69c7df95f8ac03b30e446d09d: 0 finding(s), 0 as inline comments.

No findings. The change drops retention-days to 1 for three pr-merge artifacts (pr-merge-gate-cursor 2→1, pr-merge-head-refs 2→1, pr-merge-summary 8→1) in .github/workflows/pr-merge.yml. I also checked the changelog fragment.

What I checked, by reading the code:

  • Cursor and head-ref readers: rotation.mjs and head-ref-map.mjs only accept artifacts where expired === false. An expired artifact means the next run starts without prior state, which the code already handles. Normal cadence, not a gap longer than a day, is why the cursor is rarely lost.
  • Summary reader: maintenance-monitor-signals/collect.mjs:168-178 filters out expired artifacts and sets sweep = null when none remain. heldFindings returns [] for a null sweep, and throughputFindings already ignores sweeps older than SWEEP_MAX_AGE_MINUTES. One side effect: if pr-merge stops running for more than a day, the held-over-24h signal disappears along with the summary. That is minor and not worth blocking.
  • Docs: the pr-pipeline convention docs state no retention periods for these artifacts, so nothing there is stale.
  • Changelog fragment: bump: none fits a perf-only change to workflow retention values with no plugin behavior change.
  • Manifests: the diff touches no plugin.json or marketplace.json, so no manifest lines apply.
  • Hold: no cost or trust-gate class is hit. It lowers artifact retention, adds no model call, and touches no trusted-actors, CODEOWNERS or .gitmodules files.
  • Closing issue: the PR closes no issue (the description says "No related issue"), so there were no criteria to check.

I did not verify the PR's own claims (artifact counts, page savings, the git grep reader census). They are author-claimed.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 7bb93a3 Oct 23, 2026
66 of 67 checks passed
@kyle-sexton
kyle-sexton deleted the perf/pr-merge-retention-1d branch October 23, 2026 15:52
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