fix(task-board): a stale card repo must not veto binding the sole repo - #7163
Open
viktormarinho wants to merge 1 commit into
Open
viktormarinho wants to merge 1 commit into
viktormarinho wants to merge 1 commit into
Conversation
`pickSoleTaskRepo`'s `preferredRepo` (added in #7159) filtered the choices, and an empty filter result meant no bind. But `task.repo` is free text that goes stale — a renamed repository, a value from the github-connection era, a typo — so an org with exactly ONE repo stopped binding it whenever a card named something else, falling back to the mid-run `TASK_ADD_REPO` pick and costing a turn. That org bound its sole repo before the parameter existed. The preference is now a hint: it narrows when it matches, and is discarded when it doesn't. Multi-repo behavior is unchanged — a preference matching nothing or matching ambiguously still declines to bind and defers to the mid-run pick, which the existing tests cover. Unflagged on purpose, like the regression it repairs: this sits on the Super Agent dispatch path for every org, so leaving it half-applied behind a flag would keep the broken case live.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regression from #7159, on the Super Agent dispatch path and not behind a flag — so it's live for every org.
pickSoleTaskRepogained apreferredRepoparameter that filtered the choices, and an empty filter result meant "don't bind". Buttask.repois free text (z.string()) that goes stale — a renamed repository, a value from the github-connection era, a typo. So an org with exactly one repo stopped binding it whenever a card named something else, falling through to the mid-runTASK_ADD_REPOpick and costing a turn. That org bound its sole repo before the parameter existed.The preference is now a hint: it narrows when it matches, and is discarded when it doesn't.
Multi-repo behavior is unchanged — a preference that matches nothing, or matches ambiguously, still declines to bind and defers to the mid-run pick. The existing test asserting that (
pickSoleTaskRepo(twoChoices, "other/repo") === null) still passes, and still for the right reason: the filter empties, the original two choices stand, andlength !== 1declines.task.repoDeliberately unflagged, like the regression it repairs: flagging it off would leave the broken case live.
Validation: the new unit test fails on
main(expect(pickSoleTaskRepo(sole, "acme/renamed-away")?.id).toBe("one")→ receivedundefined) and passes here. Workspace type checks, lint (14 pre-existing warnings, 0 errors), knip, formatting, and 8,717 unit tests all pass.Summary by cubic
Fixes a regression where a card's stale
repovalue prevented binding an org's sole repository, forcing a mid-run pick that costs a turn. The card'srepois now a hint: it narrows the choices when it matches and is discarded when it doesn't.mainand passes here.Written for commit 1c6767e. Summary will update on new commits.