From 13fcad6dc4711c05813132b505c215a986f1b1df Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 17 Jul 2026 10:27:58 +0000 Subject: [PATCH] fix(crow): make the trial-build gate no-op when the auto-patch branch is absent (#132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The trial pipeline errored: ``` git clone -q --branch auto/registry-patch-proposals ... fatal: Remote branch auto/registry-patch-proposals not found in upstream origin ``` I deleted the stale `auto/registry-patch-proposals` branch during cleanup, and — now that cascade detection (#128) makes the proposer correctly find **no candidates** — the proposer exits before ever recreating it. So the branch is legitimately absent, and the gate's hard `git clone --branch` fails. ## Fix "Branch absent" = "no pending auto-patch proposals" = **nothing to verify**, which should be a clean no-op, not a failure. Clone `main`, then fetch + checkout the patch branch only if it exists; otherwise log and `exit 0`. A present branch is verified exactly as before (checkout its tip, diff registry vs `main`). This also means the gate now runs `main`'s `trial-build-registry.R` (with the #130 fix) rather than a possibly-stale copy on the branch. Reviewed-on: https://git.devxy.io/devxy/build-cran-binaries/pulls/132 --- .crow/trial-build-registry.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.crow/trial-build-registry.yaml b/.crow/trial-build-registry.yaml index 602837f..3ec0417 100644 --- a/.crow/trial-build-registry.yaml +++ b/.crow/trial-build-registry.yaml @@ -121,8 +121,13 @@ steps: # with BINCRAFT_VERBOSE_PATCH_BUILD support; harmless on older versions). BINCRAFT_VERBOSE_PATCH_BUILD: 'TRUE' commands: - - git clone -q --branch ${patch_branch} https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . + # Clone main, then check out the auto-patch branch if it exists. When the + # proposer had no candidates it never (re)creates that branch, so a missing + # branch means "nothing to verify" -- no-op cleanly instead of failing the + # clone. + - git clone -q https://pat-s:$$REPO_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - git fetch -q origin main + - 'if git fetch -q origin ${patch_branch}; then git checkout -q FETCH_HEAD; else echo "No ${patch_branch} branch; no pending auto-patch proposals to verify."; exit 0; fi' - mkdir -p /mnt/cache/R-pkgs - rm -rf /mnt/cache/R-pkgs/00LOCK-* - /opt/R/$R_VERSION/bin/Rscript local/install-bincraft.R