run-offload.sh: a commit that is not on main cannot be given by SHA ("not found on GitHub" for a pushed branch)

Aperta
#1,314 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, github, shell
Ambito
cli, devops

Direzione di ricerca

Start with the ref resolution and fetch case in tools/offload/remote-run.sh, especially lines 48–53. Reproduce the failure with a pushed commit on a non-main branch and a bare SHA, then check how branch refs and missing refs are reported. Done means the SHA resolves when reachable from a pushed branch, with a useful error when it cannot be fetched.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

tools/offload/remote-run.sh resolves the ref by fetching, then git rev-parse origin/$ref || git rev-parse $ref. The fetch case list (line 49-53) sends a bare hex SHA down the *) arm, which runs git fetch --depth 50 origin <sha>. GitHub refuses a fetch by object id (uploadpack.allowReachableSHA1InWant is off), so nothing is fetched and the rev-parse fails with

FAIL: ref e0e25622b not found on GitHub (push it first)

even though the commit is pushed and git ls-remote shows it as a branch tip.

It only works today for a SHA that happens to be reachable from main, because line 48 always fetches main; that is why a SHA on main looks fine and a SHA on a wip/* branch does not.

The message is the worst part: it tells you to do the one thing you have already done, so the natural response is to push again and re-queue, which fails the same way. Two queued jobs were lost to this today before the cause was found.

Suggested fix: when the ref is a bare SHA that rev-parse cannot resolve after the fetch, fetch the branches that contain it (or simply git fetch --depth 50 origin '+refs/heads/*:refs/remotes/origin/*' as a fallback) before failing; and make the failure say whether the ref was not found at all or found but not fetchable by id.

Workaround: pass the branch name (wip/rundir-default) instead of the SHA.

Lingua principale
C
Stelle
10
Fork
8
Merge medio
6h 32m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FriendsofECCE/ECCE

Tutte le issue di FriendsofECCE/ECCE

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.