fix(upgrade skills): real abra-auth fix — embed git.autonomic.zone creds in origin (go-git)
The actual 'abra auth error' that skipped 8 recipes was go-git failing to
fetch tags from the PRIVATE git.autonomic.zone mirror ('authentication
required: Unauthorized'), NOT the TTY issue. abra/go-git reads
remote.origin.url literally and IGNORES git url.insteadOf + credential
helpers (confirmed: insteadOf left immich Unauthorized; literal embedded URL
fixed it). Skill now bakes $GITEA_USERNAME:$GITEA_PASSWORD into origin for
git.autonomic.zone recipes before the version check, and stashes the
untracked cc-ci overlay so it isn't mis-counted as dirty-worktree.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
c0852d2302
commit
5c691cdb66
@@ -40,16 +40,32 @@ test** to make a PR green.
|
||||
> (`git`/other commands do NOT need the wrapper — only `abra`.) Do this for every abra command below.
|
||||
|
||||
### 1. Plan the upgrade (research — follow recipe-upgrade-plan methodology)
|
||||
On cc-ci, refresh the recipe and see what's available (each abra call wrapped per the box above):
|
||||
|
||||
> ### ⚠️ Two gotchas that silently skip recipes — handle BOTH before the version check
|
||||
> 1. **go-git auth to the private mirror.** Recipes hosted on `git.autonomic.zone` (custom-html(-tiny),
|
||||
> discourse, ghost, immich, lasuite-docs, plausible, uptime-kuma) fail with
|
||||
> **`FATA unable to fetch tags … authentication required: Unauthorized`** because abra's embedded
|
||||
> go-git reads `remote.origin.url` from `.git/config` **literally** and **ignores `git url.insteadOf`
|
||||
> / credential helpers**. Fix: bake the bot creds into the origin URL first (idempotent):
|
||||
> `git -C ~/.abra/recipes/<r> remote set-url origin "https://$GITEA_USERNAME:$GITEA_PASSWORD@git.autonomic.zone/recipe-maintainers/<r>.git"` (only when origin is on git.autonomic.zone).
|
||||
> 2. **Dirty worktree** is usually just the untracked cc-ci overlay (`compose.ccci.yml`) — don't skip on
|
||||
> that. `git stash -u` before the checks and `stash pop` after.
|
||||
|
||||
On cc-ci, refresh the recipe and see what's available (creds + stash first; each abra call pty-wrapped):
|
||||
```
|
||||
ssh cc-ci 'export PATH=/run/current-system/sw/bin:$PATH; \
|
||||
git -C ~/.abra/recipes/<recipe> status --short; \
|
||||
script -qec "abra recipe fetch <recipe> --force -n" /dev/null; \
|
||||
git -C ~/.abra/recipes/<recipe> fetch origin main; \
|
||||
script -qec "abra recipe versions <recipe> -m -n" /dev/null; \
|
||||
script -qec "abra recipe upgrade <recipe> -m -n" /dev/null'
|
||||
ssh cc-ci 'export PATH=/run/current-system/sw/bin:$PATH; R=<recipe>; \
|
||||
url=$(git -C ~/.abra/recipes/$R config --get remote.origin.url); \
|
||||
case "$url" in https://git.autonomic.zone/*) \
|
||||
git -C ~/.abra/recipes/$R remote set-url origin "https://'"$GITEA_USERNAME"':'"$GITEA_PASSWORD"'@${url#https://}";; esac; \
|
||||
git -C ~/.abra/recipes/$R stash -u >/dev/null 2>&1 || true; \
|
||||
script -qec "abra recipe fetch $R --force -n" /dev/null; \
|
||||
git -C ~/.abra/recipes/$R fetch origin main; \
|
||||
script -qec "abra recipe versions $R -m -n" /dev/null; \
|
||||
script -qec "abra recipe upgrade $R -m -n" /dev/null; \
|
||||
git -C ~/.abra/recipes/$R stash pop >/dev/null 2>&1 || true'
|
||||
```
|
||||
- **Dirty worktree on cc-ci → abort this recipe** (status `SKIPPED — dirty-worktree`); don't prompt.
|
||||
- Skip a recipe as `SKIPPED — dirty-worktree` **only if it is still dirty with TRACKED changes after the
|
||||
stash** (real local edits), not for the untracked overlay.
|
||||
- **Reconcile the mirror first (always, even if up to date).** Run:
|
||||
```
|
||||
set -a; . /srv/cc-ci/.testenv; set +a
|
||||
|
||||
Reference in New Issue
Block a user