setup-sdk.sh cannot recover when killed after applying its patch

Aperta Adatta ai principianti
#246 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, shell, typescript
Ambito
tooling

Direzione di ricerca

Leggi reference-implementations/dacs-directory/scripts/setup-sdk.sh intorno alle righe 69–92 e i test esistenti in reference-implementations/dacs-directory/test/setup-sdk.test.mjs. Controlla come il test simula il checkout ed esegui prima quel test. Aggiungi un caso in cui i file tracciati sono stati modificati da un’esecuzione precedente; il lavoro è completato quando lo script ripristina la revisione fissata preservando il comportamento dei file non tracciati e il test passa.

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

Descrizione

contributors-section

Where: reference-implementations/dacs-directory/scripts/setup-sdk.sh:69 (on phase0-completion at the linked commit)

What goes wrong: reference-implementations/dacs-directory/scripts/setup-sdk.sh applies the compatibility patch inside a subshell (lines 85-92) and only reverts it through an EXIT trap (line 89). If the process is killed hard before the trap runs, tracked files in vendor/dacs-sdk stay modified. The next run fetches and checks out the pinned revision (line 69), which keeps those local changes, and the cleanliness check at lines 70-73 then stops with "vendor/dacs-sdk is not a clean checkout". The only way out is to delete vendor/dacs-sdk by hand.

Suggested fix: Before the cleanliness check (after the checkout at line 69), reset tracked files in vendor/dacs-sdk to the pinned revision (for example git -C vendor/dacs-sdk checkout --force --detach "$SDK_REV" or git reset --hard), or detect a half-applied patch with git apply --reverse --check and reverse it. Keep untracked-file behaviour unchanged. Add a test in reference-implementations/dacs-directory/test/setup-sdk.test.mjs that leaves the stubbed checkout reporting a modified tracked file from a previous run and expects the script to recover.

Size: Small

This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.

Lingua principale
TypeScript
Stelle
0
Fork
3
Merge medio
20h 26m
PR unite (30g)
119

Preparare l'ambiente

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 DACS-Agent-commerce/Community

Tutte le issue di DACS-Agent-commerce/Community

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.