Make the offline lint failure message actionable and forbid hand-formatting

Aperta
#553 5 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Start with scripts/lint.py around lines 171–173 and inspect the bootstrap behavior from #524, which this issue says must land first. Check the existing lint tests and add assertions for the offline failure text, exit code, and the distinct bootstrap failure message; confirm the --online path still prints its build command. Done means all listed validation criteria pass without recommending a network command for an offline run.

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

Descrizione

bug infra triaged

What happened

When the hook cache is cold, scripts/lint.py exits 1 and prints a remedy that cannot work in the sandbox. The message at scripts/lint.py:171-173 says:

No network access is assumed for this run, so the missing revision(s) cannot be fetched. With network access, run:

The command it recommends is PRE_COMMIT_HOME="..." pre-commit install-hooks. That needs github.com. The sandbox has no github.com access.

Agents read the message as "formatting is optional". PR #496 then guessed ruff line wrapping by hand and failed CI. That failure started the fix loop that ended the PR.

Proposed change

Keep the fail-closed exit code 1. Change the message to state the consequence and the required behaviour:

  • State that validation did not run.
  • State that the agent must not commit.
  • State that the agent must not hand-format code.
  • State that the agent must list the skipped gates in the pull request body.
  • Remove the pre-commit install-hooks remedy when the run is offline.

Add a distinct message when the bootstrap from #524 ran but failed, so the agent can tell "no bootstrap" from "broken bootstrap".

Validation criteria

  1. With an empty PRE_COMMIT_HOME, python3 scripts/lint.py --files AGENTS.md exits 1 and prints the new text.
  2. The output contains no command that needs network access.
  3. An automated test asserts the exit code and the required phrases.
  4. The --online path still prints the build command.

Related issues

  • Blocked by #524. PR #532 rewrites this code, so this change must land after it. See also #550 for the hook conversion.
  • The companion AGENTS.md rule is tracked separately.

(AI generated)

Lingua principale
Go
Stelle
7
Fork
9
Merge medio
22h 37m
PR unite (30g)
118

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 redhat-et/ProtoBot

Tutte le issue di redhat-et/ProtoBot

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.