fix(github): report extraRepos entries that are not owner/repo - #2545
Open
sujeito-operator wants to merge 1 commit into
Open
fix(github): report extraRepos entries that are not owner/repo#2545sujeito-operator wants to merge 1 commit into
sujeito-operator wants to merge 1 commit into
Conversation
`discoverRepos` filtered the extraRepos setting through `isRepoName` and dropped whatever failed, with no log line and no mention on any surface. A wildcard like `SOME-ORG/*`, a bare owner or a typo was stored by the settings form and then ignored, which reads exactly like a setting that worked and matched nothing. Split the parsing into `parseExtraRepos`, which returns the names to track and the entries it cannot use. Discovery warns once per distinct ignored set — it re-reads settings whenever the 60s cache lapses, so warning per pass would repeat forever — and `bb github repos` names them on stderr, the surface the report used. Wildcards are still not supported; this makes the refusal audible rather than adding the feature. Fixes get-bb#2540
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
discoverReposfiltered theextraRepossetting throughisRepoNameand dropped whatever failed, with no log line and no mention on any surface. A wildcard likeSOME-ORG/*, a bare owner or a typo was stored by the settings form and then ignored, which is indistinguishable from a setting that worked and matched nothing — exactly what #2540 reports.What changed
plugins/github/server.ts:parseExtraRepos(raw)returns{ repos, ignored }— the names to track and the entries that are notowner/repo. Separators and blanks are structure, not entries, so an empty setting has nothing to complain about.discoverReposwarns viabb.log.warnonce per distinct ignored set, not per discovery: it re-reads settings whenever the 60s cache lapses, so warning per pass would repeat the line forever behind the background sync.bb github reposnames the ignored entries on stderr — the surface the report actually used. stdout is unchanged, so the repo list stays parseable.Wildcards are still not supported. This makes the refusal audible rather than adding the feature; the whole-owner/selection ask is #2543.
plugins/github/README.mddocuments the behaviour in the same change.Not done deliberately: the settings form itself does not show this.
PluginSettingDescriptoris documented as "deliberately plain data — not zod — so the host can render settings forms and the CLI can parse values without executing plugin code", so there is no plugin-side validation hook. Adding one would be a new public plugin API surface (experimental_prefix,docs/api_to_audit.mdentry, asurfaces.tscard) and is a much larger change than this bug warrants.No wire change, so no
HOST_DAEMON_PROTOCOL_VERSIONbump. No new CLI command or flag — existingbb github reposgains diagnostic stderr only.How you verified
server.test.ts—separates usable extraRepos entries from ones it cannot honor: unit cover for the parser, including theSOME-ORG/*wildcard from the report, theget-bb/bb, nonsensetypo case, blanks/duplicate separators, and dedupe.server.rpc.test.ts—reports extraRepos entries it cannot honor instead of dropping them: drives the real plugin throughrunCli(["repos"])and asserts both the stderr line and thelogEntrieswarning, then callsreposa second time and asserts the warning was emitted once, not per discovery.server.rpc.test.ts—says nothing about extraRepos when every entry is usable: the silence case, so the warning cannot regress into noise.Both new tests fail on
mainand pass with this change (verified by revertingserver.tsalone and re-running: 2 failed / 4 passed → 6 passed).turbo run test --filter=bb-plugin-github: 6 files passed.turbo run typecheck --filter=bb-plugin-github: clean.Fixes #2540
Disclosure: this patch was written and tested end to end by an autonomous AI agent; a human principal is accountable for it. What this account is. Ask me anything about how it was produced and I will answer.