From 43f2cf074bd3ca41a1f9b866021accc6cb3c9ab8 Mon Sep 17 00:00:00 2001 From: autonomic-bot <64+autonomic-bot@noreply.git.autonomic.zone> Date: Mon, 14 Sep 2026 19:19:45 +0000 Subject: [PATCH] cctest-recipe-upstream: derive upstream base branch (mirror main vs upstream master) --- .opencode/skills/cctest-recipe-upstream/SKILL.md | 9 ++++++++- scripts/gen-cctest-skills.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.opencode/skills/cctest-recipe-upstream/SKILL.md b/.opencode/skills/cctest-recipe-upstream/SKILL.md index 52bac6f..1db8420 100644 --- a/.opencode/skills/cctest-recipe-upstream/SKILL.md +++ b/.opencode/skills/cctest-recipe-upstream/SKILL.md @@ -80,4 +80,11 @@ one upgrade commit. Guard: while preparing, run `git merge-base `; if the result is older than a few commits below upstream `origin/main`, cherry-pick the upgrade commit(s) onto fresh upstream `origin/main` (branch `-rebased`), push THAT to the autonomic mirror, and emit the fetch/push/compare commands -using the rebased branch instead of the raw one. +using the rebased branch instead of the raw one. Also fix the stale `origin/main` wording above: +the upstream base branch may be `master`, not `main` — derive it from the remotes. + +**Branch-name mismatch mirror vs upstream.** The mirror and upstream can use different base-branch +names (gitea: mirror `main`, upstream `master`). When emitting step 3 (the post-merge release), +NEVER hardcode `main` — derive the upstream default branch from the existing remotes (`git +remote show origin` or `git ls-remote --symref origin HEAD`) and emit `git checkout ; +git fetch origin; git merge --ff-only origin/;` before `abra recipe release`. diff --git a/scripts/gen-cctest-skills.py b/scripts/gen-cctest-skills.py index 8ea4d21..7d1d9e0 100644 --- a/scripts/gen-cctest-skills.py +++ b/scripts/gen-cctest-skills.py @@ -108,7 +108,14 @@ one upgrade commit. Guard: while preparing, run `git merge-base `; if the result is older than a few commits below upstream `origin/main`, cherry-pick the upgrade commit(s) onto fresh upstream `origin/main` (branch `-rebased`), push THAT to the autonomic mirror, and emit the fetch/push/compare commands -using the rebased branch instead of the raw one. +using the rebased branch instead of the raw one. Also fix the stale `origin/main` wording above: +the upstream base branch may be `master`, not `main` — derive it from the remotes. + +**Branch-name mismatch mirror vs upstream.** The mirror and upstream can use different base-branch +names (gitea: mirror `main`, upstream `master`). When emitting step 3 (the post-merge release), +NEVER hardcode `main` — derive the upstream default branch from the existing remotes (`git +remote show origin` or `git ls-remote --symref origin HEAD`) and emit `git checkout ; +git fetch origin; git merge --ff-only origin/;` before `abra recipe release`. """, }