Skip to content

fix(test): expect 'none' for API-key auth in the Kiro usage parser test - #25944

Merged
bolichen97 merged 1 commit into
mainfrom
fix/kiro-usage-api-key-test
Oct 29, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/kiro-usage-api-key-test

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Frontend Tests (1) passes on main again.

website/src/test/kiroUsageRefetchInterval.test.ts fails on main:

FAIL src/test/kiroUsageRefetchInterval.test.ts > parseKiroUsagePayload warming vs settled > maps an explicit unavailable answer to a terminal sentinel
AssertionError: expected 'none' to be 'api-key'

Why it matters

Every PR's Frontend Tests (1) shard is red, so no PR can reach PR Readiness green until this lands.

Not a goal

What changed (motivation → approach → change)

Two PRs crossed. #25434 removed the 'api-key' sentinel: API-key auth now resolves to a reading, and an unavailable answer with reason: 'api_key_auth' parses to 'none'. #22387 merged afterwards with a test that still expected 'api-key'. The test now asserts the current contract, and the terminal-cadence loop no longer lists the removed state.

Backwards compatibility

Compatible: test-only change; no production code moves.

Removes nothing: the 'api-key' state was already gone from src/api/kiroUsage.ts on main; this drops its last mention from a test.

Tests

  • src/test/kiroUsageRefetchInterval.test.ts: maps an explicit unavailable answer to a terminal sentinel expects 'none' for api_key_auth; 10 of 10 pass.

Proof: not provable -- test-only change

Manual verification

N/A — the failing test is the whole defect; it fails on main (d32862446c) and passes here.

Screenshots / video

Why no screenshot: test-only change; no rendered output moves.

Related Issues

Closes #25941

Sibling sweep

Sibling: website/src/test/kiroUsageRefetchInterval.test.ts:51 -- changed here
Sibling: website/src/api/kiroUsage.ts -- not affected -- #25434 already removed the state there

Pattern harvest

Not generalizable: two PRs that each passed CI alone crossed on merge; a test pinned a value the other PR removed.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9cd83bc2d1aad5868feba4f00986f59fdc59278a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Test-only change that brings a stale assertion in line with the contract #25434 already set in kiroUsage.ts.

Notes

  • The doc comment at website/src/api/kiroUsage.ts:144 still lists api-key as a terminal state, so the removed state is still mentioned outside this test. The description says this PR drops its "last mention", which isn't true yet.
  • The new test comment says "API-key auth is not terminal", but the assertion just below it expects 'none', which is a terminal sentinel. Reword the comment so it doesn't contradict what it explains.

[DESIGN-REVIEWED] 9cd83bc

Description read

[DESCRIPTION-READ] bc224e9ed0ece9db52d481df303631c712aa313fa376d0d7403464b348a0bd9e

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 9cd83bc2d1aad5868feba4f00986f59fdc59278a ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 9cd83bc2d1aad5868feba4f00986f59fdc59278a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. This PR only changes one test file (website/src/test/kiroUsageRefetchInterval.test.ts). It adds or changes no user-visible control, so missing screenshots leave no evidence gap.

[UX-REVIEWED] 9cd83bc

Description read

[DESCRIPTION-READ] cb3155e4faf944e34d81218c003fa43d72489d16c80d802887eee9db5df2f71c

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9cd83bc2d1aad5868feba4f00986f59fdc59278a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9cd83bc

Verdict parsed from the review's SHA-scoped output markers for commit 9cd83bc2d1aad5868feba4f00986f59fdc59278a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9cd83bc2d1aad5868feba4f00986f59fdc59278a false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9cd83bc2d1aad5868feba4f00986f59fdc59278a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9cd83bc

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9cd83bc2d1aad5868feba4f00986f59fdc59278a false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 29, 2026
@iamwhatever
iamwhatever force-pushed the fix/kiro-usage-api-key-test branch from 36bfa0e to 9cd83bc Compare October 29, 2026 21:51
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 29, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 29, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 9cd83bc.

The parser on main no longer has an api-key state. KiroUsageState lists only a reading, an account-only reading, none, signin-required and null, and parseKiroUsagePayload returns none for reason: api_key_auth. Both test edits match that: the parser case now expects none, and the terminal loop drops a value the type no longer has.

Gates checked at this head: readiness passed, every check green, AI lanes pass with no block, no other change request, mergeable, one test file only.

Optional follow up, not for this PR: the doc comment above kiroUsageRefetchInterval still names a terminal api-key state.

@bolichen97
bolichen97 merged commit 1fc4b3a into main Oct 29, 2026
93 checks passed
@bolichen97
bolichen97 deleted the fix/kiro-usage-api-key-test branch October 29, 2026 23:27
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(test): kiroUsageRefetchInterval expects the removed api-key sentinel on main

2 participants