fix(ci): make shard manifest refresh reliable (BLO-24241) - #1487
Conversation
|
🔗 Paperclip issue: BLO-24241 |
1 similar comment
|
🔗 Paperclip issue: BLO-24241 |
|
Please review the exact current head Focus on:
Please report consolidated Critical and Important findings against this exact SHA. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 76130de
Critical Issues (0)
Important Issues (1)
- [gstack/review]
.github/workflows/refresh-shard-manifest.yml:201-218— the no-CI alarm uses the generated installation token forgh api repos/.../actions/runs, but the workflow'spermissions: actions: readonly applies to the defaultGITHUB_TOKEN; an installation token is authorized only by the App installation's own permissions. Ifcommitperclipis installed without Actions read (a common least-privilege setup, and not asserted by this workflow), this step exits on the API call before posting either theaction_requiredor zero-run alert, so the new failure signal is lost.- Use a credential that is guaranteed to have Actions read for the alarm (for example the workflow token, if repository policy permits it), or explicitly validate/document the App installation's Actions permission and handle a 403 as a distinct loud failure. Add a workflow-contract test covering the credential and permission contract.
Suggestions (0)
Strengths
- The refresh workflow fails closed when
COMMITPERCLIP_KEYis absent and does not include agithub.tokenfallback. - The 75% hard floor is separated from the visible, non-blocking 100% freshness check.
- Partial shard artifacts preserve prior durations, empty total measurements fail loudly, and durable
$notesguidance is preserved. - Dry-run JSON is written synchronously, and suite enumeration is shared between the runner and freshness diagnostics.
Recommended Action
- Fix Important issues before merge.
- Address Suggestions opportunistically.
|
Please re-review the exact current head The refresh PR still uses the commitperclip App token exclusively for the branch push and PR create/update. The no-CI alarm now uses |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: d4c7c9e
Prior Findings Dispositioned (1)
- prior:76130de critical 1 — fixed —
.github/workflows/refresh-shard-manifest.yml:246-252— the no-CI alarm now authenticates with${{ github.token }}, whose Actions and pull-request permissions are declared on the refresh job; the contract test also asserts the alarm does not use the App installation token.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The no-CI alarm now uses the workflow token for the API read and diagnostic comment while keeping the commitperclip App token isolated to push and PR creation.
- The workflow-contract test explicitly protects the split credential and permission contract.
- Refresh remains fail-closed without
COMMITPERCLIP_KEY, and the manifest merge preserves partial shard results and durable notes.
Recommended Action
- Merge when the remaining repository checks are green.
d4c7c9e to
328c129
Compare
|
Please re-review the exact current head Correction: the prior comment contained a mistyped SHA string. Ally formal review is recorded against the exact SHA above. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 328c129
Prior Findings Dispositioned (1)
- prior:76130de important 1 — fixed —
.github/workflows/refresh-shard-manifest.yml:246-252— the no-CI alarm now uses${{ github.token }}for the Actions read and diagnostic comment, while the App installation token remains isolated to push and PR creation; the workflow contract test asserts this split.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The refresh workflow fails closed when
COMMITPERCLIP_KEYis absent, preventing an unattended PR authored with the workflow token. - Partial shard artifacts preserve prior durations, while an entirely empty measurement fails loudly.
- Manifest merging preserves durable
$notesguidance and safely prunes only suites absent from the current checkout. - Vitest measurement and dry-run output avoid the prior output-buffer and truncated-pipe failure modes.
Recommended Action
- Merge when the remaining repository checks are green.
Stale review re-anchored by the force-push; superseded by exact-head review 5005650995 on 328c129.
328c129 to
cb52180
Compare
|
Please re-review the exact current head The rebase resolved the generated shard manifest as the union of current on-disk suites: 443/443 entries, preserving master’s |
|
Please perform the formal consolidated review for the exact current PR head: This is a fresh request after the prior reviewer wake failed during Paperclip setup. Review the current PR, report Critical and Important findings, and submit the formal GitHub review against that exact full SHA. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: cb52180
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The refresh workflow separates the commitperclip App token used for push and PR creation from the workflow token used for Actions-run inspection and diagnostic comments.
- Partial measurement shards preserve existing durations, while a completely empty measurement fails closed instead of rewriting the manifest with unusable data.
- Suite enumeration is shared between the runner, freshness diagnostic, and merge pruning, reducing drift between what CI runs and what the manifest describes.
- The manifest merge preserves durable
$notesguidance, and the measurement path avoids the prior unconsumed stdout buffer failure.
Recommended Action
- Merge when the remaining repository checks are green.
Thinking Path
Linked Issues or Issue Description
Paperclip issue: BLO-24241
GitHub Issues are disabled in this repository, so the issue is described here: the general-server duration manifest was allowed to drift as suites landed; the old required 90% coverage assertion converted ordinary drift into a
policyfailure that skipped unrelated CI lanes; and the unattended refresh path could fail silently through output buffering, metadata loss, or aGITHUB_TOKEN-authored PR whose checks never start.Related prior work: #1173 is the earlier merged manifest refresh. #1278 is the stale predecessor for this BLO-24241 repair and is behind current
master; #1487 is the fresh replacement rebased onto the current base. The predecessor is intentionally left unchanged while this replacement goes through review.What Changed
$notes, prunes deleted suites safely, and retains durations from partial shard results.spawnSyncbuffer/ENOBUFSfailure mode.COMMITPERCLIP_KEYfor unattended refresh PR creation, use the generated App token for both push and GitHub CLI operations, and use a non-App commit author.Verification
node --test scripts/__tests__/run-vitest-stable-shard.test.mjs scripts/check-shard-manifest-freshness.test.mjs scripts/__tests__/measure-general-server-shard-durations.test.mjs scripts/__tests__/merge-shard-duration-manifest.test.mjs scripts/__tests__/refresh-shard-manifest-workflow.test.mjs(39 passed)pnpm typecheck(full workspace, 37 projects passed)ACTIONLINT_BIN=/private/tmp/paperclip-tools/bin/actionlint node scripts/check-workflows-parse.mjs(29 workflows passed)node scripts/check-github-runner-labels.mjs(passed)node scripts/check-commit-author-attribution.mjs --base origin/master --head HEAD(passed)git diff --check(passed)Risks
The weekly refresh intentionally opens a PR rather than mutating
master; a failed measurement shard keeps its prior durations, while a total empty measurement fails loudly. The 75% floor still blocks a genuinely abandoned or malformed manifest, but ordinary small drift remains visible without skipping unrelated required jobs. The refresh job fails closed when the App credential is unavailable, so repository secret/configuration repair is required before unattended refresh can create a PR.Model Used
OpenAI Codex, GPT-5. Exact runtime model identifier is the Codex GPT-5 coding-agent model available in this session; extended tool use and code execution enabled.
Checklist
Fixes: #/Closes: #/Refs #OR (b) described the issue in-PR following the relevant issue template