From 662b7d66b137fc09d134ac91579a25854e6f9489 Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Tue, 11 Aug 2026 10:49:09 +1000 Subject: [PATCH 1/3] chore: run beta sync from v2 --- .github/workflows/beta.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index e93d5fbdb260..a2bee99b178e 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -5,6 +5,8 @@ on: schedule: - cron: "0 * * * *" +concurrency: beta-sync + jobs: sync: runs-on: blacksmith-4vcpu-ubuntu-2404 @@ -16,22 +18,33 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 + ref: v2 - name: Setup Bun uses: ./.github/actions/setup-bun - - name: Setup Git Committer - id: setup-git-committer - uses: ./.github/actions/setup-git-committer - with: - opencode-app-id: ${{ vars.OPENCODE_APP_ID }} - opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} + - name: Configure git user + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - name: Install OpenCode run: bun i -g opencode-ai - name: Sync beta branch + id: sync env: - GH_TOKEN: ${{ steps.setup-git-committer.outputs.token }} + GH_TOKEN: ${{ github.token }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} - run: bun script/beta.ts + run: bun script/beta.ts --prepare + + - name: Setup Git Committer + if: steps.sync.outputs.changed == 'true' + uses: ./.github/actions/setup-git-committer + with: + opencode-app-id: ${{ vars.OPENCODE_APP_ID }} + opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} + + - name: Push beta branch + if: steps.sync.outputs.changed == 'true' + run: git push origin beta --force --no-verify From 4f416fdf153adafd8cfb9bce89c630730ab68267 Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Tue, 11 Aug 2026 11:37:19 +1000 Subject: [PATCH 2/3] refactor: keep beta push in script --- .github/workflows/beta.yml | 29 ++++++++--------------------- script/beta.ts | 23 +++++++++-------------- 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a2bee99b178e..e93d5fbdb260 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -5,8 +5,6 @@ on: schedule: - cron: "0 * * * *" -concurrency: beta-sync - jobs: sync: runs-on: blacksmith-4vcpu-ubuntu-2404 @@ -18,33 +16,22 @@ jobs: uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 with: fetch-depth: 0 - ref: v2 - name: Setup Bun uses: ./.github/actions/setup-bun - - name: Configure git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Setup Git Committer + id: setup-git-committer + uses: ./.github/actions/setup-git-committer + with: + opencode-app-id: ${{ vars.OPENCODE_APP_ID }} + opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} - name: Install OpenCode run: bun i -g opencode-ai - name: Sync beta branch - id: sync env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ steps.setup-git-committer.outputs.token }} OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} - run: bun script/beta.ts --prepare - - - name: Setup Git Committer - if: steps.sync.outputs.changed == 'true' - uses: ./.github/actions/setup-git-committer - with: - opencode-app-id: ${{ vars.OPENCODE_APP_ID }} - opencode-app-secret: ${{ secrets.OPENCODE_APP_SECRET }} - - - name: Push beta branch - if: steps.sync.outputs.changed == 'true' - run: git push origin beta --force --no-verify + run: bun script/beta.ts diff --git a/script/beta.ts b/script/beta.ts index d738c36ff017..d6cd3af51d79 100755 --- a/script/beta.ts +++ b/script/beta.ts @@ -86,7 +86,7 @@ async function build() { console.log(" Running final build smoke check...") try { - await $`./script/build.ts --single`.cwd("packages/opencode") + await $`./script/build.ts --single`.cwd("packages/cli") return true } catch (err) { console.log(`Build failed: ${err}`) @@ -200,7 +200,7 @@ async function smoke(prs: PR[], applied: number[]) { "The beta merge batch is complete, but the deterministic final smoke check failed.", `Merged PRs on HEAD:\n${done}`, "Run `bun typecheck` at the repo root.", - "Run `./script/build.ts --single` in `packages/opencode`.", + "Run `./script/build.ts --single` in `packages/cli`.", "Fix any merge-caused issues until both commands pass.", "Do not create a commit.", ].join("\n") @@ -220,21 +220,16 @@ async function main() { console.log("Fetching open PRs with beta label...") const stdout = - await $`gh pr list --state open --draft=false --label beta --json number,title,author,labels --limit 100`.text() + await $`gh pr list --state open --draft=false --base v2 --label beta --json number,title,author,labels --limit 100`.text() const prs: PR[] = JSON.parse(stdout).sort((a: PR, b: PR) => a.number - b.number) console.log(`Found ${prs.length} open PRs with beta label`) - if (prs.length === 0) { - console.log("No team PRs to merge") - return - } - - console.log("Fetching latest dev branch...") - await $`git fetch origin dev` + console.log("Fetching latest v2 branch...") + await $`git fetch origin v2` console.log("Checking out beta branch...") - await $`git checkout -B beta origin/dev` + await $`git checkout -B beta origin/v2` const applied: number[] = [] const failed: FailedPR[] = [] @@ -262,7 +257,7 @@ async function main() { if (!(await fix(pr, files, prs, applied, idx))) { await cleanup() failed.push({ number: pr.number, title: pr.title, reason: "Merge conflicts" }) - await commentOnPR(pr.number, "Merge conflicts with dev branch") + await commentOnPR(pr.number, "Merge conflicts with v2 branch") continue } } else { @@ -318,7 +313,7 @@ async function main() { await $`git fetch origin beta` const localTree = (await $`git rev-parse beta^{tree}`.text()).trim() - const remoteTrees = (await $`git log origin/dev..origin/beta --format=%T`.text()).split("\n") + const remoteTrees = (await $`git log origin/v2..origin/beta --format=%T`.text()).split("\n") const matchIdx = remoteTrees.indexOf(localTree) if (matchIdx !== -1) { @@ -335,7 +330,7 @@ async function main() { await $`git fetch origin beta` const validatedTree = (await $`git rev-parse beta^{tree}`.text()).trim() - const remoteTreesAfterSmoke = (await $`git log origin/dev..origin/beta --format=%T`.text()).split("\n") + const remoteTreesAfterSmoke = (await $`git log origin/v2..origin/beta --format=%T`.text()).split("\n") const matchIdxAfterSmoke = remoteTreesAfterSmoke.indexOf(validatedTree) if (matchIdxAfterSmoke !== -1) { if (matchIdxAfterSmoke !== 0) { From 6bbec6b83e8db7e75ee2fcd6a4525f1abcf50b59 Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Tue, 11 Aug 2026 11:43:19 +1000 Subject: [PATCH 3/3] fix: install v2 beta dependencies --- script/beta.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/script/beta.ts b/script/beta.ts index d6cd3af51d79..21ab038486fe 100755 --- a/script/beta.ts +++ b/script/beta.ts @@ -216,6 +216,17 @@ async function smoke(prs: PR[], applied: number[]) { return commitSmokeChanges() } +async function checkout() { + console.log("Fetching latest v2 branch...") + await $`git fetch origin v2` + + console.log("Checking out beta branch...") + await $`git checkout -B beta origin/v2` + + console.log("Installing v2 dependencies...") + await $`bun install --frozen-lockfile` +} + async function main() { console.log("Fetching open PRs with beta label...") @@ -225,11 +236,7 @@ async function main() { console.log(`Found ${prs.length} open PRs with beta label`) - console.log("Fetching latest v2 branch...") - await $`git fetch origin v2` - - console.log("Checking out beta branch...") - await $`git checkout -B beta origin/v2` + await checkout() const applied: number[] = [] const failed: FailedPR[] = []