mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-03 11:47:42 +01:00
fix(ci): retry inconsistent release admission listings (#23572)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Core release workflows admit a source revision before running full verification. > - Admission discovers an active image or npm release for that exact revision. > - One inconsistent GitHub run listing currently fails admission before tests start. > - This pull request rereads count mismatches within a fixed retry budget. > - Complete listings and fresh canonical run identity remain required. ## Linked Issues or Issue Description **What happened?** [Cloud readiness run 47005873736](https://github.com/paperclipai/paperclip/actions/runs/47005873736) failed candidate admission with `Incomplete release workflow listing.` This happened before source tests ran. The [image workflow](https://github.com/paperclipai/paperclip/actions/runs/47005873889) then canceled itself because source verification failed. Image consumers could not advance to that revision. **Expected behavior** Admission should allow a short, bounded recovery window for an inconsistent workflow count. It must reject persistently incomplete or untrusted evidence. **Steps to reproduce** Return a workflow listing whose `total_count` differs from the number of returned runs. Then return a complete listing for the same query. The original script fails on the first response. The new regression test requires admission to wait for complete evidence and revalidate the selected run. **Paperclip version or commit** The reported run used `b066a3ddd39123972d0e7f5f9935c83d41303297`. This fix starts from `6e340a3f962c60e2723c780389db878ce7ff74c7`. **Deployment mode** Canonical GitHub Actions master-push release workflows. Related changes: #18869 introduced release admission; #22677 added conditional Actions reads; #22690 added quota-aware read retries. I searched open and closed PRs and issues for admission and workflow-listing failures. I found no duplicate fix. ## What Changed - Allow up to three admission listing reads when valid, bounded counts disagree with the returned run count. Wait one second, then two seconds. - Include safe workflow and count details if the mismatch persists. - Preserve strict listing validation and the fresh canonical run check. Publication and deferred-producer readers retain their existing single-read behavior. - Cover recovery for both release consumers, exhausted retries, overcounts, undercounts, and a run attempt changing before admission. ## Verification - The new admission regressions fail against the original implementation. - `node --test scripts/cloud-source-verification.test.mjs scripts/github-actions-rate-limit.test.mjs scripts/docker-image-metadata.test.mjs .github/scripts/tests/cloud-readiness.test.mjs` — 81 tests pass on the changed revision. - `node --check scripts/cloud-release-admission.mjs` and `git diff --check` pass. - `pnpm verify --explain` exits 2 as designed: the changed script is a global CI input. Broad typecheck, test, build, Runner, and browser checks must run in CI. This is not a full local-suite pass. - Reviewed the diff and scanned added lines for credentials, personal paths, and private URLs before pushing. No findings. - Greptile reviewed `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5` at 5/5. No review threads or actionable comments remain. All underlying typecheck, build, unit, Runner, serialized-server, and 16 browser shard checks passed in [CI run 47008128119](https://github.com/paperclipai/paperclip/actions/runs/47008128119) on `525694ddc75e7f4c4d1e6c2e00fbc9fd15deadd5`. The final [`ci / verify` aggregate](https://github.com/paperclipai/paperclip/actions/runs/47008128119/job/143921126471) also passed. All checks are settled with no failures. GitHub reports the branch clean and mergeable against current master. ## Risks Low risk. Admission can spend up to six extra seconds across its two consumer queries. Malformed metadata, oversized listings, and exhausted mismatches still fail closed. No source proof or publication gate is relaxed. No database or deployment configuration changes are required. The original GitHub response was not retained, so its exact invalid field remains unknown. The regression tests inject count mismatches; a later healthy master run establishes recovery, but does not prove the cause of the earlier response. ## Model Used OpenAI `gpt-6.1-sol` through Codex in T3 Code, with xhigh reasoning and shell/tool access. The runtime does not report the context window size. No subagents were used. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
0e9d4abcb3
commit
2a8a0b8e18
2 files changed
+56
-9
No files matched your search
@@ -485,7 +485,8 @@ describe("release candidate admission", () => {
|
||||
const producer = run(file, { status: "completed", conclusion: "success", ...change });
|
||||
const admission = file === "cloud-migrator-artifacts.yml" ? migratorAdmissionJob : sourceAdmissionJob;
|
||||
const f = { runs: { [file]: [producer] }, jobs: { [producer.id]: [job(producer, admission, "success"), job(producer, sourceVerificationJob)] },
|
||||
current: {}, writes: [], calls: [], requested: new Set(), file, sha, admissionJob: admission };
|
||||
current: {}, writes: [], calls: [], waits: [], requested: new Set(), file, sha, admissionJob: admission };
|
||||
f.sleep = async ms => f.waits.push(ms);
|
||||
f.api = async path => {
|
||||
f.calls.push(path);
|
||||
const url = new URL(`https://api.github.com${path}`);
|
||||
@@ -557,11 +558,49 @@ describe("release candidate admission", () => {
|
||||
f.total = total;
|
||||
await assert.rejects(releaseAdmitted(sha, f), /Incomplete/);
|
||||
assert.deepEqual(f.writes, []);
|
||||
assert.deepEqual(f.waits, total === 1 ? [1_000, 2_000] : []);
|
||||
assert.equal(f.calls.filter(path => path.includes("/runs?")).length, total === 1 ? 3 : 1);
|
||||
}
|
||||
await assert.rejects(releaseAdmitted(sha, { api: async () => { throw new Error("API unavailable"); } }), /unavailable/);
|
||||
await assert.rejects(releaseAdmitted("master", { api: () => assert.fail() }), /full source SHA/);
|
||||
});
|
||||
|
||||
test("admission rereads inconsistent listings before selecting a current consumer", async () => {
|
||||
for (const file of ["docker.yml", "release.yml"]) {
|
||||
for (const total of [0, 2]) {
|
||||
for (const changedAttempt of [false, true]) {
|
||||
const f = fixture();
|
||||
const active = run(file);
|
||||
f.runs[file] = [active];
|
||||
if (changedAttempt) f.current[active.id] = { ...active, run_attempt: 2 };
|
||||
const api = f.api;
|
||||
let reads = 0;
|
||||
f.api = async path => {
|
||||
const result = await api(path);
|
||||
if (path.includes(`/workflows/${ids[file]}/runs?`) && ++reads < 3) return { ...result, total_count: total };
|
||||
return result;
|
||||
};
|
||||
assert.equal(await releaseAdmitted(sha, f), !changedAttempt);
|
||||
assert.equal(reads, 3);
|
||||
assert.deepEqual(f.waits, [1_000, 2_000]);
|
||||
assert.equal(f.calls.filter(path => path.endsWith(`/runs/${active.id}`)).length, 1);
|
||||
assert.deepEqual(f.writes, []);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("an inconsistent listing never admits its returned consumer", async () => {
|
||||
const f = fixture();
|
||||
const active = run("docker.yml");
|
||||
f.runs["docker.yml"] = [active];
|
||||
f.total = 2;
|
||||
await assert.rejects(releaseAdmitted(sha, f), /Incomplete release workflow listing for docker\.yml \(1 returned, 2 expected\)/);
|
||||
assert.deepEqual(f.waits, [1_000, 2_000]);
|
||||
assert.equal(f.calls.filter(path => path.endsWith(`/runs/${active.id}`)).length, 0);
|
||||
assert.deepEqual(f.writes, []);
|
||||
});
|
||||
|
||||
test("a selected consumer restarts only a strictly deferred producer, once", async () => {
|
||||
for (const file of ["cloud-readiness.yml", "cloud-migrator-artifacts.yml"]) {
|
||||
const f = fixture(file);
|
||||
|
||||
Reference in new issue
Block a user