You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6b17322
Browse filesBrowse the repository at this point in the historyBrowse files
problems.push(`job '${id}' is an aggregate gate but its job-level if: is ${JSON.stringify(job.if)}, not always() — a gate that skips publishes no required context (#3622).`);
problems.push(`gate '${id}' reads needs.${QUEUE_VERDICT_JOB} in its if: without listing '${QUEUE_VERDICT_JOB}' in needs:, so the output is always empty (#31519).`);
1123
+
}
1087
1124
if(!needs.includes('filter')){
1088
1125
problems.push(`gate '${id}' does not list 'filter' in needs:, so it cannot apply the #4928 skipped-only-when-filter-succeeded guard.`);
1089
1126
}
@@ -1233,8 +1270,15 @@ export async function scanWorkflow(root) {
1233
1270
);
1234
1271
continue;
1235
1272
}
1236
-
if(emit.if!==undefined||upload.if!==undefined){
1237
-
problems.push(`job '${leg.job}' guards its attestation steps with an if: — the credential must mean "every earlier step succeeded", which only an unguarded step says (#6082).`);
`job '${leg.job}' guards its attestation steps with an if: — the credential must mean "every earlier step succeeded", which only an unguarded step says (#6082). `+
1278
+
`The one guard admitted is ${JSON.stringify(SEED_ONLY_CREDENTIAL_IF)} on BOTH steps (#31519).`,
problems.push(`job '${leg.job}' guards its attestation pair on needs.${QUEUE_VERDICT_JOB} without listing '${QUEUE_VERDICT_JOB}' in needs: (#31519).`);
'#6589: a shard job is not a gate because a step says `--verify`': 23,
1696
1740
'#26084 a planned roster: only the shards the plan started are counted': 16,
1697
1741
'#26084 the static guard holds the planned matrix and the gate to one expression': 10,
1742
+
'#31519 a borrowed push: the gate skip and the seed-only credential guard': 8,
1698
1743
});
1699
1744
1700
1745
// DELETING an entry silences that battery's floor exactly as effectively as
1701
1746
// zeroing it, so the roster's own size is pinned too.
1702
-
constSELF_TEST_BATTERY_FLOOR=24;
1747
+
constSELF_TEST_BATTERY_FLOOR=25;
1703
1748
1704
1749
// The key an assertion is filed under when no battery is open. It is not a
1705
1750
// declared battery, so it reds by the same set difference rather than silently
@@ -2710,11 +2755,47 @@ async function selfTest() {
2710
2755
(awaitfixture('unmatchable download pattern',(s)=>s.replace(' pattern: shard-attest-test-*',' pattern: shard-attest-nothing-*'))).problems.some((p)=>p.includes('none of which matches')),
2711
2756
'a gate whose download pattern cannot match its legs ⇒ red',
2712
2757
);
2758
+
constEMIT_GUARD=` - name: Attest this shard ran and passed\n if: ${SEED_ONLY_CREDENTIAL_IF}\n run: |\n node scripts/check-shard-attestation.mjs --emit \\\n --job test`;
(awaitfixture('if: on the credential step',(s)=>s.replace(' - name: Attest this shard ran and passed\n run: |\n node scripts/check-shard-attestation.mjs --emit \\\n --job test',' - name: Attest this shard ran and passed\n if: always()\n run: |\n node scripts/check-shard-attestation.mjs --emit \\\n --job test'))).problems.some((p)=>p.includes('guards its attestation steps with an if:')),
2761
+
(awaitfixture('if: on the credential step',(s)=>s.replace(EMIT_GUARD,EMIT_GUARD.replace(SEED_ONLY_CREDENTIAL_IF,'always()')))).problems.some((p)=>p.includes('guards its attestation steps with an if:')),
2715
2762
'an `if:` on the credential step ⇒ red (the credential would stop meaning "every earlier step passed")',
2716
2763
);
2717
2764
2765
+
// ── #31519: the borrowed push's two admitted spellings, and only those ──
2766
+
battery('#31519 a borrowed push: the gate skip and the seed-only credential guard');
2767
+
assert(good.includes(EMIT_GUARD)&&good.includes(UPLOAD_GUARD),"#31519: ci.yml's test pair carries the seed-only guard on both steps (the anchors below)");
2768
+
assert(
2769
+
(awaitfixture('a seed-only guard on one step only',(s)=>s.replace(UPLOAD_GUARD,UPLOAD_GUARD.replace(` if: ${SEED_ONLY_CREDENTIAL_IF}\n`,'')))).problems.some((p)=>p.includes('on BOTH steps')),
2770
+
'#31519: the seed-only guard on the credential step but not its upload ⇒ red',
2771
+
);
2772
+
assert(
2773
+
(awaitfixture('a widened credential guard',(s)=>s.replace(EMIT_GUARD,EMIT_GUARD.replace(SEED_ONLY_CREDENTIAL_IF,`${SEED_ONLY_CREDENTIAL_IF} || failure()`)))).problems.some((p)=>p.includes('guards its attestation steps with an if:')),
2774
+
'#31519: a guard that adds a status function to the credential ⇒ red',
2775
+
);
2776
+
assert(
2777
+
(awaitfixture('a credential guard on the wrong spelling',(s)=>s.replace(EMIT_GUARD,EMIT_GUARD.replace("!= 'true'","== 'false'")).replace(UPLOAD_GUARD,UPLOAD_GUARD.replace("!= 'true'","== 'false'")))).problems.some((p)=>p.includes('guards its attestation steps with an if:')),
2778
+
"#31519: `== 'false'` (an empty output would withhold the credential) ⇒ red",
2779
+
);
2780
+
assert(
2781
+
(awaitfixture('a seed-only guard without the probe in needs',(s)=>s.replace(' needs: [filter, test-plan, queue-verdict]\n',' needs: [filter, test-plan]\n'))).problems.some((p)=>p.includes("guards its attestation pair on needs.queue-verdict without listing")),
2782
+
'#31519: a credential guard on an output the job cannot read ⇒ red',
2783
+
);
2784
+
constGATE_IF=` if: ${BORROWED_PUSH_GATE_IF}\n`;
2785
+
assert(good.split(GATE_IF).length-1>=2,"#31519: ci.yml's test-gate and dogfood-gate carry the borrowed-push if: (the anchors below)");
2786
+
assert(
2787
+
(awaitfixture('a gate skipped on any push',(s)=>s.replace(GATE_IF," if: always() && github.event_name != 'push'\n"))).problems.some((p)=>p.includes('is an aggregate gate but its job-level if:')),
2788
+
'#31519: a gate skipped on every push, not only a covered one ⇒ red',
2789
+
);
2790
+
assert(
2791
+
(awaitfixture('a gate under !cancelled() and the probe',(s)=>s.replace(GATE_IF,` if: \${{ !cancelled() && ${SEED_ONLY_CREDENTIAL_IF} }}\n`))).problems.some((p)=>p.includes('is an aggregate gate but its job-level if:')),
2792
+
'#31519: the borrowed conjunct does not license dropping always() ⇒ red',
2793
+
);
2794
+
assert(
2795
+
(awaitfixture('a borrowed gate without the probe in needs',(s)=>s.replace(' needs: [test, filter, test-plan, queue-verdict]\n',' needs: [test, filter, test-plan]\n'))).problems.some((p)=>p.includes("reads needs.queue-verdict in its if: without listing")),
2796
+
'#31519: a gate reading an output it cannot see ⇒ red',
2797
+
);
2798
+
2718
2799
// ── #26084: the planned matrix and the gate read one expression ─────────
2719
2800
battery('#26084 the static guard holds the planned matrix and the gate to one expression');
@@ -2733,11 +2814,11 @@ async function selfTest() {
2733
2814
'#26084: a gate that is not handed the plan result ⇒ red',
2734
2815
);
2735
2816
assert(
2736
-
awaitplanProblem('the gate loses the plan job from needs',(s)=>s.replace(' needs: [test, filter, test-plan]\n',' needs: [test, filter]\n'),"plan job 'test-plan'",'#26084'),
2817
+
awaitplanProblem('the gate loses the plan job from needs',(s)=>s.replace(' needs: [test, filter, test-plan, queue-verdict]\n',' needs: [test, filter, queue-verdict]\n'),"plan job 'test-plan'",'#26084'),
2737
2818
'#26084: a gate that cannot read the plan job ⇒ red',
2738
2819
);
2739
2820
assert(
2740
-
awaitplanProblem('the test job loses the plan job from needs',(s)=>s.replace(' needs: [filter, test-plan]\n',' needs: filter\n'),"does not list 'test-plan'",'#26084'),
2821
+
awaitplanProblem('the test job loses the plan job from needs',(s)=>s.replace(' needs: [filter, test-plan, queue-verdict]\n',' needs: [filter, queue-verdict]\n'),"does not list 'test-plan'",'#26084'),
2741
2822
'#26084: a matrix built from a job it does not need ⇒ red',
0 commit comments