Repository navigation
test(crew-recency): patch the renamed cron creator admission fence - #18045
bolichen97 wants to merge 1 commit into
Conversation
#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, {}).
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Closing as a duplicate: #18021 already landed this exact change on main (the patch target is |
Problem / Motivation
Goal: Main's backend test shards stop failing on
test/test_crew_recency.pyfor every PR.test/test_crew_recency.pyfails on main. Four tests raiseAttributeError: <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_refusaltocron_creator_admission, and the new function returns a(refusal, persisted_cron_slot, persisted_cron_meta)tuple. #17808 and #17953 brought intest/test_crew_recency.py, and its_sendhelper 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 patcheskiro_crew.dashboard.chat_handlers.cron_creator_admissioninstead of the removedcron_creator_refusal. The mock returns the admitted answer for a live slot,(None, False, {}). That is the same "no refusal" the oldAsyncMock(return_value=None)stood for, in the new return shape the/api/chathandler 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
pytest -n0 test/test_crew_recency.pygives 4 failed, 14 passed.-n0.-n 4:test/test_crew_recency.py,test/test_chat_mode_cron.pyandtest/test_chat_routes_cron_switch.pygive 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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.