Skip to content

fix(release): make one-click fallback PRs mergeable — explicit CI dispatch on fallback branch - #1746

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-30_fallback-release-ci-dispatch
Sep 30, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-30_fallback-release-ci-dispatch

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #1744

Problem

Under the current master protection (4 required test checks + PR-only), one-click release fallback PRs were not immediately mergeable:

  • the fallback branch push is made with GITHUB_TOKEN, and GitHub delivers no push events for ref updates made with GITHUB_TOKEN from within Actions → the ci.yml push trigger never fired on any -HHMMSS-suffixed fallback branch (verified across full history: three such branches, zero push runs);
  • the auto-PR opened by github-actions[bot] sits in action_required for its pull_request runs;
  • so no check runs ever land on the head sha → required checks unsatisfied → manual approval / bypass needed every time.

The #772 mechanism ("push CI on release branches satisfies required checks") only ever worked for release branches pushed with a real account token (agent-driven standard flow) — never for the one-click path. AGENTS.md §5 overstated this.

Changes

  • .github/workflows/ci.yml: add a workflow_dispatch trigger (without it the dispatch API call is rejected — see verification below) + rewrite the trigger comments to state the true mechanics.
  • .github/workflows/release-manual.yml: grant actions: write; after the fallback branch push succeeds, explicitly POST …/actions/workflows/ci.yml/dispatches with ref=<fallback branch> (best-effort step; on failure warns that manual approval of the gated runs is required). The dispatched run's check runs attach to the same head sha → once green, required checks pass and the auto-PR is mergeable without approving its action_required pull_request runs.
  • AGENTS.md §5: replace the incorrect "immediately mergeable via push CI" claim with the true mechanics (GITHUB_TOKEN pushes deliver no events; explicit dispatch compensates; manual approval is the documented escape hatch when dispatch fails).

Behavior changes (disclosure)

  1. One-click fallback runs now make an additional API call that triggers a NEW ci.yml run on the fallback branch (old: no automatic CI at all on that branch) — this is the intended fix.
  2. ci.yml gains a workflow_dispatch surface: anyone with Actions access can manually dispatch CI on any ref (no inputs). Standard practice; required seam for the fix.
  3. Docs-only: AGENTS.md §5 claim corrected (old: "auto-PR is immediately mergeable" via push CI on release branches; new: immediacy comes from the explicit dispatch, manual approval documented as fallback).

Verification

  • YAML validated locally (both workflows parse; ci.yml trigger keys = push/pull_request/workflow_dispatch).
  • End-to-end proof of the dispatch mechanic on this very branch:
    • negative control: dispatch against stale branch 2026-09-30_release-v0.1.175 (no new trigger) → HTTP 422 rejected — confirms the trigger addition is load-bearing;
    • positive: dispatch against this branch → HTTP 204, run 36677794487 created (event=workflow_dispatch, head_sha=90c556ae = this head). Its check runs are exactly what the fallback path will now produce on the release head sha.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-30_fallback-release-ci-dispatch (90c556a)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.1694-pr.1746.f25883e

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr1746.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #1746 审查结论(自查):修复了 one-click fallback PR 因 GITHUB_TOKEN push 不产生事件而永远等不到 required checks 的问题(fallback 步骤改为显式 dispatch ci.yml),核对代码与 CI 后可以合并——待主 CI run 变绿后我会再确认一次。

Review walkthrough (per repo review discipline):

① Original issue #1744 — direction check. Root cause was established with evidence before this PR (exhaustive 21-day history scan: all three -HHMMSS fallback branches ever produced zero push runs; every branch that did trigger push CI was pushed with an account token). This PR implements exactly the issue's suggested direction, plus the missing prerequisite it didn't mention (the workflow_dispatch trigger — without it the dispatch API call 422s, proven by the negative control against the stale branch). Direction is correct: it fixes the producer (no event delivered for GITHUB_TOKEN ref updates → compensate with an explicit API call at the decision point), not a symptom.

② Regression review — existing behaviors touched:

  • ci.yml push/pull_request triggers: byte-for-byte unchanged (branches: [master, "*_release-v*"] / [master]). Only addition is the workflow_dispatch: {} surface — new capability, disclosed, no existing behavior altered.
  • release-manual.yml direct-push-to-master success path: untouched — the new step is gated if: steps.push.outputs.needs_pr == 'true' (same gate as the existing "Open fallback PR" step), so it fires exclusively on the fallback path.
  • Fallback path behavior: old = zero automatic CI on the fallback branch (the bug); new = one dispatched ci.yml run whose check runs attach to the head sha. Intended fix, disclosed.
  • Job permissions: gains actions: write (scoped to this job, required for the dispatch endpoint). No other permission changes.
  • Step ordering: dispatch runs after the branch push and before the PR is opened — check runs bind to the sha regardless of PR existence, so ordering is safe either way; dispatch-first avoids any race where the PR is judged before checks land.
  • Best-effort semantics preserved: continue-on-error: true + non-204 → ::warning:: telling the human to approve the gated runs manually. A failed dispatch degrades to today's documented state, never fails the release run.
  • AGENTS.md §5: docs-only correction of an overstated claim (old: "auto-PR is immediately mergeable" via push CI; new: immediacy comes from the explicit dispatch, manual approval documented as the escape hatch). Disclosed as behavior-change item 3 — it is a doc fix, which is itself the point of one-click release fallback PRs are not immediately mergeable under current branch protection (#772 push-CI mechanism never fires) #1744.

③ Code review. Dispatch URL uses ${{ github.repository }} correctly; ref comes from steps.push.outputs.pr_branch (the actual pushed ref, not re-derived); HTTP code captured via -w '%{http_code}' with body to mktemp file; warning interpolates the response body for diagnosability. Nothing else in the file changed.

④ Test validity. Workflow-file changes have no unit-test surface; the right test is the live mechanic, and it was done end-to-end on this very branch: negative control (dispatch without trigger → 422) + positive control (dispatch with trigger → 204, run 36677794487 created, head_sha matches). That run is executing right now and its check runs are precisely what the fallback path will produce.

⑤ Diff cleanliness. One commit, three files, every line related to the stated purpose. No churn.

CI status at time of writing (head 90c556ae38): 7/8 pull_request runs already green (CI Windows codex overlay, e2e-fake-codex, e2e-native-{pi,opencode,dsh}, e2e-local-registry, PR Build Artifact); main CI run and the dispatch-proof CI run (36677794487) still in progress — will confirm here when they land.

Also confirmed the follow-up promised in #1744 floor 3: stale branch 2026-09-30_release-v0.1.175 is deleted (only -053442 remains) and PR #1735 is closed.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 CI 全绿确认:head 90c556ae38 上全部 9 个 runs completed / success——8 个 pull_request(含主 CI + Windows codex overlay + 5 个 e2e + Build Artifact)+ 1 个 workflow_dispatch(36677794487,即 fallback 路径将产生的那个 run)。PR #1746 可以合并。

The dispatched run going green is the load-bearing proof: it is exactly the check-run set the one-click fallback path will now produce on a release head sha, so once this PR lands, future fallback PRs get their required checks without manual approval of gated runs (dispatch failure remains the documented manual-approval escape hatch).

@ranxianglei
ranxianglei merged commit 1e1bcfe into master Sep 30, 2026
17 checks passed
@ranxianglei
ranxianglei deleted the 2026-09-30_fallback-release-ci-dispatch branch October 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

one-click release fallback PRs are not immediately mergeable under current branch protection (#772 push-CI mechanism never fires)

1 participant