@@ -86,7 +86,7 @@ async function build() { |
86 | 86 | console.log(" Running final build smoke check...") |
87 | 87 |
|
88 | 88 | try { |
89 | | - await $`./script/build.ts --single`.cwd("packages/opencode") |
| 89 | + await $`./script/build.ts --single`.cwd("packages/cli") |
90 | 90 | return true |
91 | 91 | } catch (err) { |
92 | 92 | console.log(`Build failed: ${err}`) |
@@ -200,7 +200,7 @@ async function smoke(prs: PR[], applied: number[]) { |
200 | 200 | "The beta merge batch is complete, but the deterministic final smoke check failed.", |
201 | 201 | `Merged PRs on HEAD:\n${done}`, |
202 | 202 | "Run `bun typecheck` at the repo root.", |
203 | | - "Run `./script/build.ts --single` in `packages/opencode`.", |
| 203 | + "Run `./script/build.ts --single` in `packages/cli`.", |
204 | 204 | "Fix any merge-caused issues until both commands pass.", |
205 | 205 | "Do not create a commit.", |
206 | 206 | ].join("\n") |
@@ -216,25 +216,27 @@ async function smoke(prs: PR[], applied: number[]) { |
216 | 216 | return commitSmokeChanges() |
217 | 217 | } |
218 | 218 |
|
| 219 | +async function checkout() { |
| 220 | + console.log("Fetching latest v2 branch...") |
| 221 | + await $`git fetch origin v2` |
| 222 | + |
| 223 | + console.log("Checking out beta branch...") |
| 224 | + await $`git checkout -B beta origin/v2` |
| 225 | + |
| 226 | + console.log("Installing v2 dependencies...") |
| 227 | + await $`bun install --frozen-lockfile` |
| 228 | +} |
| 229 | + |
219 | 230 | async function main() { |
220 | 231 | console.log("Fetching open PRs with beta label...") |
221 | 232 |
|
222 | 233 | const stdout = |
223 | | - await $`gh pr list --state open --draft=false --label beta --json number,title,author,labels --limit 100`.text() |
| 234 | + await $`gh pr list --state open --draft=false --base v2 --label beta --json number,title,author,labels --limit 100`.text() |
224 | 235 | const prs: PR[] = JSON.parse(stdout).sort((a: PR, b: PR) => a.number - b.number) |
225 | 236 |
|
226 | 237 | console.log(`Found ${prs.length} open PRs with beta label`) |
227 | 238 |
|
228 | | - if (prs.length === 0) { |
229 | | - console.log("No team PRs to merge") |
230 | | - return |
231 | | - } |
232 | | - |
233 | | - console.log("Fetching latest dev branch...") |
234 | | - await $`git fetch origin dev` |
235 | | - |
236 | | - console.log("Checking out beta branch...") |
237 | | - await $`git checkout -B beta origin/dev` |
| 239 | + await checkout() |
238 | 240 |
|
239 | 241 | const applied: number[] = [] |
240 | 242 | const failed: FailedPR[] = [] |
@@ -262,7 +264,7 @@ async function main() { |
262 | 264 | if (!(await fix(pr, files, prs, applied, idx))) { |
263 | 265 | await cleanup() |
264 | 266 | failed.push({ number: pr.number, title: pr.title, reason: "Merge conflicts" }) |
265 | | - await commentOnPR(pr.number, "Merge conflicts with dev branch") |
| 267 | + await commentOnPR(pr.number, "Merge conflicts with v2 branch") |
266 | 268 | continue |
267 | 269 | } |
268 | 270 | } else { |
@@ -318,7 +320,7 @@ async function main() { |
318 | 320 | await $`git fetch origin beta` |
319 | 321 |
|
320 | 322 | const localTree = (await $`git rev-parse beta^{tree}`.text()).trim() |
321 | | - const remoteTrees = (await $`git log origin/dev..origin/beta --format=%T`.text()).split("\n") |
| 323 | + const remoteTrees = (await $`git log origin/v2..origin/beta --format=%T`.text()).split("\n") |
322 | 324 |
|
323 | 325 | const matchIdx = remoteTrees.indexOf(localTree) |
324 | 326 | if (matchIdx !== -1) { |
@@ -335,7 +337,7 @@ async function main() { |
335 | 337 | await $`git fetch origin beta` |
336 | 338 |
|
337 | 339 | const validatedTree = (await $`git rev-parse beta^{tree}`.text()).trim() |
338 | | - const remoteTreesAfterSmoke = (await $`git log origin/dev..origin/beta --format=%T`.text()).split("\n") |
| 340 | + const remoteTreesAfterSmoke = (await $`git log origin/v2..origin/beta --format=%T`.text()).split("\n") |
339 | 341 | const matchIdxAfterSmoke = remoteTreesAfterSmoke.indexOf(validatedTree) |
340 | 342 | if (matchIdxAfterSmoke !== -1) { |
341 | 343 | if (matchIdxAfterSmoke !== 0) { |
|