Skip to content

test(crew-recency): patch the renamed cron creator admission fence - #18045

Closed
bolichen97 wants to merge 1 commit into
mainfrom
fix/mr7-crew-recency-admission-patch
Closed

bolichen97 wants to merge 1 commit into
mainfrom
fix/mr7-crew-recency-admission-patch

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Main's backend test shards stop failing on test/test_crew_recency.py for every PR.

test/test_crew_recency.py fails on main. Four tests raise AttributeError: <module 'kiro_crew.dashboard.chat_handlers'> does not have the attribute 'cron_creator_refusal', so every PR's backend shard that runs this file is red (for example Backend Tests (Windows) (1) on #18038, job 113183375816).

The cause is a semantic merge. #16867 renamed chat_handlers.cron_creator_refusal to cron_creator_admission, and the new function returns a (refusal, persisted_cron_slot, persisted_cron_meta) tuple. #17808 and #17953 brought in test/test_crew_recency.py, and its _send helper still patches the old name.

Why it matters

Main is red for every PR whose shard collects this file, and the failure has nothing to do with those PRs.

Not a goal

Any change to the admission fence or to crew recency. This only points the test's mock at the function the handler calls today.

What changed (motivation → approach → change)

In _send, the test patches kiro_crew.dashboard.chat_handlers.cron_creator_admission instead of the removed cron_creator_refusal. The mock returns the admitted answer for a live slot, (None, False, {}). That is the same "no refusal" the old AsyncMock(return_value=None) stood for, in the new return shape the /api/chat handler unpacks (chat_handlers.py:2124).

Backwards compatibility

Compatible: test-only; no product code, contract or data changes.

Removes nothing: the patch target moves to the function that exists today; no test is removed.

Tests

  • Before, on main 372915e: pytest -n0 test/test_crew_recency.py gives 4 failed, 14 passed.
  • After: 18 passed, 5 runs in a row at -n0.
  • After, with the two other admission-fence test files at -n 4: test/test_crew_recency.py, test/test_chat_mode_cron.py and test/test_chat_routes_cron_switch.py give 95 passed.

Manual verification

Not applicable (test-only).

Screenshots / video

Not applicable.

Related Issues

Part of #16536. Main-red fix after #16867, #17808 and #17953.

Pattern harvest

A rename that lands while another PR adds a patch("<module>.<old name>") merges cleanly and only fails at run time. patch.object(module, "name") against an imported module fails the same way, but names the attribute in the error.

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

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

#16867 renamed chat_handlers.cron_creator_refusal to cron_creator_admission,
which now returns (refusal, persisted_cron_slot, persisted_cron_meta). The
crew-recency tests that landed alongside it (#17808, #17953) still patched
the old name, so four of them fail with AttributeError on main. Patch the
new name with the admitted answer for a live slot: (None, False, {}).
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 8, 2026 06:52
@bolichen97
bolichen97 requested a review from CrysisDeu October 8, 2026 06:52
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 761fcefd328afefc063814ed22964ad0376aad00 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 761fcefd328afefc063814ed22964ad0376aad00 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 761fcefd328afefc063814ed22964ad0376aad00 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 761fcef

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 761fcefd328afefc063814ed22964ad0376aad00: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 761fcefd328afefc063814ed22964ad0376aad00 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 761fcef

Description read

[DESCRIPTION-READ] d830ceaccec4f83a007b9bb14e0e6cade33f1afd93082cee6ec54652ee09c9d2

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 8, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 761fcefd328afefc063814ed22964ad0376aad00 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 761fcef

Verdict parsed from the review's SHA-scoped output markers for commit 761fcefd328afefc063814ed22964ad0376aad00.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 761fcefd328afefc063814ed22964ad0376aad00: <one-sentence reason>

@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 8, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) October 8, 2026 07:53
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Closing as a duplicate: #18021 already landed this exact change on main (the patch target is cron_creator_admission with return value (None, False, {})), so this branch no longer changes anything.

@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 8, 2026
@bolichen97
bolichen97 deleted the fix/mr7-crew-recency-admission-patch branch October 8, 2026 08:11
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.

2 participants