Repository navigation
refactor(approve, meow): drop the three dead arms left open on #466 - #497
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…0,415; meow.ts:88) effectiveKind's 'ignore' arms for review-approved / review-changes cannot run: with ignore_review_state on, the caller already passes [] as the review list, so no review event ever reaches them. upsertNotifier's existing.body ?? '' is dead by construction: the comment is only selected when its body contains the marker. Narrow the find predicate with a type guard instead of a fallback. fetchCatImage's opaqueredirect guard and the 'a redirect' fallback are browser-only: Node's fetch has no filtered responses, so a manual redirect resolves with the real 3xx status. Unit cases that only reached the removed arms are deleted; the bundle redirect assertion is tightened to 302; dist/ repacked. Refs #466 (the three production-cleanup items from the reopen comment; the owners.ts item already landed in #486) Signed-off-by: quality <quality@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
|
Please add a kind label with |
a35e1ef
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
Change
Files/functions claimed:
src/plugins/approve.ts(effectiveKind,upsertNotifier),src/issueComment/meow.ts(fetchCatImage),__tests__/plugins/approve.test.ts,__tests__/issueCommentTest/meow.test.ts,__tests__/bundle/meow.test.ts,dist/index.js(repack). This is the remaining production-cleanup cluster from the reopen comment on #466; same shape as #462 and #492.approve.ts:228,230—effectiveKind's'ignore'arms forreview-approved/review-changesare unreachable: withignore_review_stateon,approve.ts:381already passes[]as the review list toapprovalEvents, so no review event ever carries those kinds. Both now return'add'/'remove'unconditionally. The unit caseignore_review_state: reviews neither add nor remove(which fed review events directly intocomputeApprovalwith the flag on, a state production never produces) is removed; the setting's real behaviour stays covered by the handler-level unit tests and theapproveIgnoreReviewStatebundle scenarios from test(bundle): drive approve.ignore_review_state through dist/index.js (approve.ts:380-381) #468.approve.ts:415—existing.body ?? ''is dead by construction:existingis only selected whencomment.bodycontains the notifier marker. Thefindpredicate is now a type guard (comment is IssueComment & { body: string }), soIssueComment['body']stays typed optional (the point raised on refactor: drop defensive arms unreachable from dist/index.js #462) and no fallback or cast is needed.meow.ts:80,88—response.type !== 'opaqueredirect'and|| 'a redirect'are browser-only: Node'sfetchhas no filtered responses, soredirect: 'manual'resolves with the real 3xx status. The unit casenames a status-less response as a redirect(which stubbedfetchto resolveResponse.error(), which the runtime never does) is removed; the bundle redirect assertion in__tests__/bundle/meow.test.tsis tightened from(302|a redirect)to302.The fourth item in the reopen comment (
owners.ts:127-147expandGroupsteam arms) already landed in #486 (__tests__/bundle/ownersGroups.test.ts), so after this merges nothing is left for #466 to track.Verification (local, this branch)
npx tsc --noEmitclean;npx eslint src __tests__0 errors (one pre-existingcc.tsjsdoc warning, untouched)npm run test:coverage: 157 files / 2114 tests pass;src/plugins/approve.tsandsrc/issueComment/meow.tsboth 100% branch;coverage/lcov.infohas noBRDA:…,0entrynpm run build && npm run pack:dist/index.jsrepacked (6 lines changed)npm run test:coverage:e2e: 78 files / 487 tests pass;coverage-e2e/lcov.infohas noBRDA:228,BRDA:230orBRDA:415underSF:src/plugins/approve.ts, andmeow.tsreads 100 / 100 / 100 / 100Related Issue
Closes #466
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88