Warn when an extraRepos entry cannot track a repository - #2541
Open
MPIsaac-Per wants to merge 1 commit into
Open
Warn when an extraRepos entry cannot track a repository#2541MPIsaac-Per wants to merge 1 commit into
MPIsaac-Per wants to merge 1 commit into
Conversation
The GitHub plugin's extraRepos setting filtered its entries through isRepoName and dropped everything that failed, with no log line and no error. A typo or a wildcard such as "owner/*" was therefore indistinguishable from a setting that worked: the panel simply showed the repos discovered from BB project checkouts. Split the parse into valid and invalid entries and warn for each entry that cannot become a repository, naming the entry and the expected owner/repo shape.
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.
What was wrong
discoverReposparsed theextraRepossetting by filtering the split entries throughisRepoNameand keeping the survivors. Anything that failed the test had noelsebranch: no warning, no error, no record. A wildcard such asowner/*, or a plain typo, therefore behaved exactly like a setting that was working and had simply found nothing, and the only way to discover the difference was to read the regex.Fixes #2540
What changed
plugins/github/server.ts: added an exportedparseExtraReposthat splits the setting intovalidandinvalidentries instead of filtering in place.discoverRepostracks the valid ones as before and emitsbb.log.warnfor each invalid one, naming the entry and the expectedowner/reposhape.No wire, CLI, or settings-schema changes.
extraReposkeeps its meaning and its type; wildcards remain unsupported, they are just no longer silent about it.How you verified
plugins/github/server.test.ts: a unit test overparseExtraReposcovering a wildcard, a typo, a mixed list, and blank or separator-only input.plugins/github/server.rpc.test.ts: a behavioral test asserting that withextraRepos: "acme/widgets, ACME/*"the valid sibling still syncs one repo and awarnentry namingACME/*reachesharness.logEntries.Both fail before this change and pass after. Reverting
server.tsalone: 25 passed, 2 failed. With the change: 27 passed.pnpm exec turbo run typecheck test --filter=bb-plugin-githubpasses.Manually on a dev instance at this commit:
extraRepos = "MPIV-AI/*, mpiv-ai/clipscript"now logswhile
mpiv-ai/clipscriptbeside it still tracks and syncs.