Skip to content

Commit d0ece8e

Browse files
Mossakaclaude
andcommitted
fix: postprocess smoke workflows to build container images locally
The smoke tests used pre-built GHCR images (--image-tag 0.13.4) which don't include recent fixes to entrypoint.sh and setup-iptables.sh (host.docker.internal iptables bypass, NO_PROXY, etc.). Update the postprocessor to also replace --image-tag/--skip-pull with --build-local so containers are built from source, matching the AWF binary which is already built from source. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6fce21a commit d0ece8e

1 file changed

Lines changed: 34 additions & 17 deletions

File tree

scripts/ci/postprocess-smoke-workflows.ts

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,44 @@ function buildLocalInstallSteps(indent: string): string {
6060
].join('\n') + '\n';
6161
}
6262

63-
for (const workflowPath of workflowPaths) {
64-
const content = fs.readFileSync(workflowPath, 'utf-8');
65-
const matches = content.match(installStepRegexGlobal);
63+
// Replace --image-tag <version> --skip-pull with --build-local so smoke tests
64+
// use locally-built container images (with the latest entrypoint.sh, setup-iptables.sh, etc.)
65+
// instead of pre-built GHCR images that may be stale.
66+
const imageTagRegex = /--image-tag\s+[0-9.]+\s+--skip-pull/g;
6667

67-
if (!matches || matches.length === 0) {
68-
console.log(`Skipping ${workflowPath}: no awf install step found.`);
69-
continue;
70-
}
68+
for (const workflowPath of workflowPaths) {
69+
let content = fs.readFileSync(workflowPath, 'utf-8');
70+
let modified = false;
7171

72-
if (matches.length !== 1) {
73-
throw new Error(
74-
`Expected exactly one awf install step in ${workflowPath}, found ${matches.length}. ` +
75-
'Ensure the workflow has a single "Install awf binary" step in the agent job.'
72+
// Replace "Install awf binary" step with local build steps
73+
const matches = content.match(installStepRegexGlobal);
74+
if (matches) {
75+
if (matches.length !== 1) {
76+
throw new Error(
77+
`Expected exactly one awf install step in ${workflowPath}, found ${matches.length}. ` +
78+
'Ensure the workflow has a single "Install awf binary" step in the agent job.'
79+
);
80+
}
81+
content = content.replace(
82+
installStepRegexGlobal,
83+
(_match, indent: string) => buildLocalInstallSteps(indent)
7684
);
85+
modified = true;
86+
console.log(` Replaced awf install step with local build`);
7787
}
7888

79-
const updated = content.replace(
80-
installStepRegexGlobal,
81-
(_match, indent: string) => buildLocalInstallSteps(indent)
82-
);
89+
// Replace GHCR image tags with local builds
90+
const imageTagMatches = content.match(imageTagRegex);
91+
if (imageTagMatches) {
92+
content = content.replace(imageTagRegex, '--build-local');
93+
modified = true;
94+
console.log(` Replaced ${imageTagMatches.length} --image-tag/--skip-pull with --build-local`);
95+
}
8396

84-
fs.writeFileSync(workflowPath, updated);
85-
console.log(`Updated ${workflowPath}`);
97+
if (modified) {
98+
fs.writeFileSync(workflowPath, content);
99+
console.log(`Updated ${workflowPath}`);
100+
} else {
101+
console.log(`Skipping ${workflowPath}: no changes needed.`);
102+
}
86103
}

0 commit comments

Comments
 (0)