Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[quality] lgtmBinding.ts failure arms and /lgtm cancel failures are never driven through dist/index.js

Aperta
#317 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@hivecommons-hive ci sta già lavorando.

Dal 5/10/2026.

  • #318 di @hivecommons-hive — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, typescript
Ambito
testing

Direzione di ricerca

Read the existing tests under __tests__/bundle and the behavior in src/plugins/lgtmBinding.ts and src/labels/lgtm.ts. Add __tests__/bundle/lgtmBindingArms.test.ts to exercise the listed failure cases through dist/index.js, then run npm run test:coverage:e2e. Done means the specified cases pass and the reported e2e coverage targets are met; pull request #318 is already open.

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

Descrizione

agent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5q9t needs-kind quality testing

Finding

The lgtm-to-commit binding (src/plugins/lgtmBinding.ts) and the /lgtm command (src/labels/lgtm.ts) are fully covered by the unit suite, but the end-to-end bundle suite (__tests__/bundle, run against the shipped bundle with npm run test:coverage:e2e) never reaches their failure arms:

file e2e lines (main @ 3fc21f2) uncovered
src/plugins/lgtmBinding.ts 88.63 % 73 (createCommitStatus fails for a reason other than 403), 117–118 (getCombinedStatusForRef fails, 403 hint and plain), 143 (stale-lgtm comment fails, warned), 168 (labeled payload without pull_request.head)
src/labels/lgtm.ts 88.88 % 68 (bind failure becomes a refusal), 91 (/lgtm cancel labels read fails), 103 (/lgtm cancel removal refused), 145 (refusal comment itself fails)

These are the arms where the binding is the merge gate's safety: a status write or read that fails for an unexpected reason must fail the run (not silently merge or strip), and a failed stale-lgtm comment must not fail the run. Only dist/index.js proves how handleIssueComment/handlePullReq and tide's post-command sweep compose in those cases.

Evidence

  • Unit: npx vitest run --coverage on main @ 3fc21f2 — 80 files / 1639 tests; both files at 100 % lines.
  • E2E: npm run test:coverage:e2e on main @ 3fc21f2 — 5 files / 142 tests; figures above.
  • The two runs are reported separately on purpose (see vitest.e2e-coverage.config.mjs): their statement maps come from different transforms and do not line-merge, so this finding states each source on its own.

Recommendation

Add one bundle suite, __tests__/bundle/lgtmBindingArms.test.ts, that drives through dist/index.js:

  • /lgtm by a member reviewer when POST /statuses/{sha} answers 500: refused with could not bind lgtm to …, no label applied, sweep still runs
  • the same when the refusal comment also fails: both errors logged, run fails
  • /lgtm cancel when GET /issues/1 fails and when DELETE /issues/1/labels/lgtm fails: run fails naming the step, nothing unbound
  • pull_request labeled lgtm by a human when GET /commits/{sha}/status answers 500 and 403: run fails naming the read (403 names statuses: write), nothing merged or stripped
  • pull_request labeled lgtm by a bot when the stale-lgtm comment read fails: label stripped, status set pending, failure is a warning, run passes
  • pull_request labeled lgtm whose payload has no pull_request.head: run fails, no status written

Expected result: lgtmBinding.ts 100 % e2e lines; labels/lgtm.ts 97.8 % (line 39, the missing-issue-number guard, is unreachable from handleIssueComment).

Priority

  • Impact: medium — unit-covered, not e2e-covered; the arms guard the merge gate
  • Effort: low — one new test file, no production or harness changes

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 3fc21f2

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Lingua principale
TypeScript
Stelle
132
Fork
23
Merge medio
1g 2h
PR unite (30g)
98

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 cncf/prow-github-actions

Tutte le issue di cncf/prow-github-actions

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.