rebrand-literal-gutter: uhttpd section-vocabulary check trips on a COMMENT (uhttpd.luci in 92-tollgate-admin-setup:178)

Chiusa Adatta ai principianti
#723 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Amperstrand ci sta già lavorando.

Dal 11/10/2026.

  • #734 di @Amperstrand — chiusa senza merge
  • #863 di @Amperstrand — aperta
  • #1064 di @Amperstrand — aperta

Valutazione

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

Direzione di ricerca

Inizia dall’estrattore e dall’allowlist in tests/packaging/rebrand-literal-gutter_test.sh:124-130, poi esamina il commento in packaging/files/etc/uci-defaults/92-tollgate-admin-setup:178. Mantieni il controllo del vocabolario delle sezioni evitando al contempo che il testo dei commenti produca falsi positivi; esegui bash tests/packaging/rebrand-literal-gutter_test.sh e conferma che l’errore di sezione sconosciuta non si verifica più.

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

Descrizione

Summary

The same suite as the rebrand-gutter issue has a second, independent RED cause: the uhttpd section-vocabulary check extracts uhttpd.<name> tokens with a bare grep that does not strip comments, and a COMMENT in packaging/files/etc/uci-defaults/92-tollgate-admin-setup:178 mentions uhttpd.luci — tripping "unknown uhttpd section".

Verified on

  • Commit: 68ad5144ab09cb4723d8f3f655cbba1ac7ea9de5 (main, 2026-10-07); deterministic on any host

Evidence (verbatim)

The offending line — a comment, not code:

packaging/files/etc/uci-defaults/92-tollgate-admin-setup:178:# section (a stale `uhttpd.luci`-style section must not own the admin port).

The extractor and its allowlist (tests/packaging/rebrand-literal-gutter_test.sh:124-130):

KNOWN='main|portal|trusted|admin|crt|key|cert'
foreign="$(grep -rhoE 'uhttpd\.[a-zA-Z][a-zA-Z0-9_]*' packaging/files/etc/uci-defaults/ 2>/dev/null |
           sed 's/^uhttpd\.//' | sort -u | grep -v -E "^($KNOWN)$" || true)"

Actual extraction over the real tree yields only known sections (admin, crt, key, main, portal, trusted) — the luci hit comes solely from the comment.

Reproduce

git checkout 68ad5144ab09cb4723d8f3f655cbba1ac7ea9de5
bash tests/packaging/rebrand-literal-gutter_test.sh 2>&1 | grep -A2 'known uhttpd'
# FAIL unknown uhttpd section name(s) in the uci-defaults: luci

Troubleshooting guide + fix hints

Two equivalent fixes; the first is more robust:

  1. Strip comments before extraction — the uci-defaults scripts are POSIX shell; extract only from active code:
    grep -rhvE '^\s*#' packaging/files/etc/uci-defaults/ | grep -oE 'uhttpd\.[a-zA-Z][a-zA-Z0-9_]*' | ...
    
    (also handles trailing after-code comments if you strip #.*$ first — decide how thorough to be; leading-#-line stripping alone fixes this case).
  2. Or reword the comment in 92-tollgate-admin-setup:178 to avoid the token (a stale section named after LuCI).

Keep the check itself — it exists to stop a second admin writer from sneaking in a foreign uhttpd section (#684-era hygiene); only its tokenizer is wrong.

References

  • Same suite as the Net4sats gutter issue (fix both to restore the packaging gate to green).
Lingua principale
Go
Stelle
12
Fork
14
Merge medio
3g 20h
PR unite (30g)
261

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 OpenTollGate/tollgate-module-basic-go

Tutte le issue di OpenTollGate/tollgate-module-basic-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.