MCPcopy Create free account
hub / github.com/anomalyco/opencode / smoke

Function smoke

script/beta.ts:191–217  ·  view source on GitHub ↗
(prs: PR[], applied: number[])

Source from the content-addressed store, hash-verified

189}
190
191async function smoke(prs: PR[], applied: number[]) {
192 console.log("\nRunning final smoke check...")
193
194 if (await validate()) return commitSmokeChanges()
195
196 console.log("\nTrying to fix final smoke check with opencode...")
197
198 const done = lines(prs.filter((x) => applied.includes(x.number)))
199 const prompt = [
200 "The beta merge batch is complete, but the deterministic final smoke check failed.",
201 `Merged PRs on HEAD:\n${done}`,
202 "Run `bun typecheck` at the repo root.",
203 "Run `./script/build.ts --single` in `packages/opencode`.",
204 "Fix any merge-caused issues until both commands pass.",
205 "Do not create a commit.",
206 ].join("\n")
207
208 try {
209 await $`opencode run -m ${model} ${prompt}`
210 } catch (err) {
211 console.log(`Smoke fix failed: ${err}`)
212 return false
213 }
214
215 if (!(await validate())) return false
216 return commitSmokeChanges()
217}
218
219async function main() {
220 console.log("Fetching open PRs with beta label...")

Callers 1

mainFunction · 0.85

Calls 4

commitSmokeChangesFunction · 0.85
validateFunction · 0.70
linesFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected