Skip to content

Commit 8a84aa9

Browse files
committed
fix(e2e): fail closed during run lookup
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
1 parent 7039f5c commit 8a84aa9

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

.agents/skills/nemoclaw-maintainer-e2e/references/main-runs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ gh workflow run .github/workflows/e2e.yaml \
9090
Do not dispatch again because the run is slow to appear. Find it with bounded reads:
9191

9292
```bash
93+
set -euo pipefail
9394
RUN_TITLE="E2E main (${CORRELATION_ID})"
9495
if [[ "$RUN_MODE" == full ]]; then
9596
RUN_TITLE="E2E full main (${CORRELATION_ID})"

.agents/skills/nemoclaw-maintainer-e2e/references/manual-pr.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The trusted pre-checkout step requires current repository `maintain` or `admin`
8080
## Find and Verify the Run
8181

8282
```bash
83+
set -euo pipefail
8384
RUN_TITLE="E2E PR #${PR_NUMBER} (${CORRELATION_ID})"
8485
MATCHES='[]'
8586
for POLL_INDEX in $(seq 1 30); do

test/maintainer-e2e-skill.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe("nemoclaw-maintainer-e2e workflow routing", () => {
4545
expect(mainRuns).toContain("every release-required job must succeed");
4646
expect(mainRuns).toContain('-f "include_staging_brev_launchable=${INCLUDE_LAUNCHABLE}"');
4747
expect(mainRuns).toContain('RUN_TITLE="E2E full main (${CORRELATION_ID})"');
48+
expect(mainRuns).toMatch(/Find it with bounded reads:\n\n```bash\nset -euo pipefail/u);
4849
expect(mainRuns).toContain('test "$RUN_SHA" = "$CANDIDATE_SHA"');
4950
expect(mainRuns).toContain("It is not a tag-authorization rule");
5051
expect(mainRuns).toContain("launchable-e2e.json");
@@ -76,6 +77,7 @@ describe("nemoclaw-maintainer-e2e workflow routing", () => {
7677
expect(manualPr).toContain('-f "base_sha=${BASE_SHA}"');
7778
expect(manualPr).toContain('-f "workflow_sha=${WORKFLOW_SHA}"');
7879
expect(manualPr).toContain("nemoclaw-e2e-dispatch-v2");
80+
expect(manualPr).toMatch(/## Find and Verify the Run\n\n```bash\nset -euo pipefail/u);
7981
expect(manualPr).toContain("The Exact staging Brev Launchable path is not available");
8082
});
8183
});

test/release-candidate-evidence.test.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,22 @@ const evidencePath = path.join(
1414
".agents/skills/nemoclaw-maintainer-cut-release-tag/references/candidate-evidence.md",
1515
);
1616
const evidence = fs.readFileSync(evidencePath, "utf8");
17-
const bashBlocks = [...evidence.matchAll(/```bash\n([\s\S]*?)```/gu)].map((match) => match[1]);
18-
const releaseEntryBlock = bashBlocks[1] ?? "";
17+
18+
function bashBlockUnder(heading: string): string {
19+
const headingStart = evidence.indexOf(heading);
20+
if (headingStart === -1) {
21+
throw new Error(`candidate-evidence.md is missing ${heading}`);
22+
}
23+
const nextHeading = evidence.indexOf("\n## ", headingStart + heading.length);
24+
const section = evidence.slice(headingStart, nextHeading === -1 ? undefined : nextHeading);
25+
const block = /```bash\n([\s\S]*?)```/u.exec(section)?.[1];
26+
if (!block) {
27+
throw new Error(`candidate-evidence.md is missing a bash block under ${heading}`);
28+
}
29+
return block;
30+
}
31+
32+
const releaseEntryBlock = bashBlockUnder("## Release Entry and Pi Result");
1933
const temporaryDirectories: string[] = [];
2034

2135
const shellHelpers = String.raw`

0 commit comments

Comments
 (0)