Skip to content

test(metrics): fake the default home in the off-offer tests again - #37545

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/off-offer-test-default-home
Nov 15, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/off-offer-test-default-home

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: main's Backend Tests go green again: the off-offer tests run on the default data home they assume.

Three TestOffOffer tests in test/metrics/test_kiro_export_destination.py fail on main at 87b11b5 (assert False is True): test_it_is_due_and_changes_nothing, test_the_collection_status_reports_it and test_a_headless_terminal_start_prints_the_line_once. Two PRs merged minutes apart: #37463 added these tests, which rely on the shared home fixture faking beacon.is_default_home() as True, and #37460 removed that fake from the fixture because destinations() no longer reads it. off_offer_due() still asks only on the default home, so on the private test home it answers False.

Why it matters

Every PR based on current main gets a red Backend Tests shard and a red Coverage Gate for tests it did not touch.

Not a goal

What changed (motivation -> approach -> change)

The offer tests lost a fake they depended on -> give that one class its own fake -> TestOffOffer gains an autouse fixture that sets beacon.is_default_home to True through _floor_monkeypatch, so a test's own monkeypatch.undo() cannot lift it. The home case of test_it_is_not_due still sets it to False through the shared monkeypatch, which wins, so the not-on-a-dev-home check keeps its meaning.

Backwards compatibility

Compatible: test-only change.

Removes nothing: test-only change; no code path changes.

Tests

  • test/metrics/test_kiro_export_destination.py: 78 passed, three runs, random order (it failed 3 on main before the change).
  • test/test_flake_pattern_ratchet.py passes; the repository semgrep rules (semgrep scan --config semgrep/, diff-scoped) and scripts/check_comment_history.py against main report nothing.

Proof: not provable -- test-only change

Manual verification

N/A -- test-only change.

Related Issues

Fixes #37546

Refs #37463, #37460

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 89e67b3a8a264e608a4423c7c0ddfd660a2f19e8 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 89e67b3a8a264e608a4423c7c0ddfd660a2f19e8 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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing to check: this is a test-only change. It puts back the default-home fake in the one class whose tests depend on it, and leaves the shared fixture and production code alone.

[DESIGN-REVIEWED] 89e67b3

Description read

[DESCRIPTION-READ] 99aa7d1f97b4c0e8f61bf51ce7475157c1ee94c61f02e2abdf64cf87d5dc542b

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 Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 89e67b3a8a264e608a4423c7c0ddfd660a2f19e8 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 89e67b3

Verdict parsed from the review's SHA-scoped output markers for commit 89e67b3a8a264e608a4423c7c0ddfd660a2f19e8.

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

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 89e67b3a8a264e608a4423c7c0ddfd660a2f19e8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 89e67b3

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

@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.

Read the diff at 89e67b3: test-only, one autouse fixture on TestOffOffer that fakes beacon.is_default_home through the floor monkeypatch, so the class runs on the default home again after #37460 and #37463 crossed (#37546). The in-class test that sets it to False still overrides it. No product code changes.

@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 Nov 15, 2026
@chenmingwei23
chenmingwei23 merged commit 09b0ddc into main Nov 15, 2026
101 of 106 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/off-offer-test-default-home branch November 15, 2026 08:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 15, 2026
chenmingwei23 added a commit that referenced this pull request Nov 16, 2026
…f-form offer (#37460, #37463, #37545)

Backport to release/0.13.0 of three main commits, picked with
git cherry-pick -x in main's merge order and squashed into one commit.
They follow up #37183, which #37471 already put on 0.13:

- #37460 (2a679d6): the built-in
  kiro-telemetry destination is also returned under a non-default
  KIROCREW_HOME. kiro_export.destinations() drops only the
  is_default_home() check; the LTS, CI and test-suite gates and every
  consent gate stay. The heartbeat keeps its own default-home rule.
- #37463 (8de422d): installs that are off
  only because an older build wrote telemetry.enabled: false into their
  config are shown the Privacy chapter once, in an off form that names
  Kiro telemetry, with Turn on performance metrics / Keep off.
  kiro_export.off_offer_due decides that case; Keep off records only the
  notice version so it is not asked again.
- #37545 (09b0ddc): test only. The
  TestOffOffer tests fake the default data home, since the offer is asked
  only there and the test home is a private KIROCREW_HOME.

All three picks applied without conflicts; each backported patch is
identical to its main commit (git range-diff shows no change).

(cherry picked from commit 2a679d6)
(cherry picked from commit 8de422d)
(cherry picked from commit 09b0ddc)

Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com>
chenmingwei23 added a commit that referenced this pull request Nov 16, 2026
…f-form offer (#37460, #37463, #37545)

Backport to release/0.13.0 of three main commits, picked with
git cherry-pick -x in main's merge order and squashed into one commit.
They follow up #37183, which #37471 already put on 0.13:

- #37460 (2a679d6): the built-in
  kiro-telemetry destination is also returned under a non-default
  KIROCREW_HOME. kiro_export.destinations() drops only the
  is_default_home() check; the LTS, CI and test-suite gates and every
  consent gate stay. The heartbeat keeps its own default-home rule.
- #37463 (8de422d): installs that are off
  only because an older build wrote telemetry.enabled: false into their
  config are shown the Privacy chapter once, in an off form that names
  Kiro telemetry, with Turn on performance metrics / Keep off.
  kiro_export.off_offer_due decides that case; Keep off records only the
  notice version so it is not asked again.
- #37545 (09b0ddc): test only. The
  TestOffOffer tests fake the default data home, since the offer is asked
  only there and the test home is a private KIROCREW_HOME.

All three picks applied without conflicts; each backported patch is
identical to its main commit (git range-diff shows no change).

(cherry picked from commit 2a679d6)
(cherry picked from commit 8de422d)
(cherry picked from commit 09b0ddc)

Co-authored-by: Raymond Chen <chenmingwei23@users.noreply.github.com>
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.

main red: TestOffOffer runs on a non-default home after #37460 and #37463 crossed

2 participants