What's wrong
SyncGitHubRepoInfoForOwner (ProjectDirector/ProjectDirector.cs ~L997-1035) only ever adds or overwrites entries in Options.Repos (~L1020). Nothing removes an entry once GitHub stops returning it. The only removal in the codebase is RejectUnsupportedRepos, which handles non-GitHub repo types.
Failure scenarios
- Rename:
owner/Foo is cloned at <dev>/owner/Foo and then renamed upstream to Bar. On the next Scan > GitHub Owners, owner.Bar is added with LocalPath = <dev>/owner/Bar. That path isn't cloned, so its panel offers Clone. Meanwhile the old owner.Foo entry stays, still holds the clone, and is still auto-fetched. The owner now lists both. Clicking Clone on Bar makes a second full copy of the same repo, and from then on Similar Repos and file propagation compare and propagate against both copies.
- Delete or transfer: the repo stays listed under its old owner, shows up in every Similar Repos table and as a propagation target, and Clone fails with
Repository not found every time.
Suggested fix
- After an owner's listing fully succeeds (never on an
ApiException or a partial result), find the Options.Repos entries for that OwnerName that the listing didn't return.
- Remove the ones that aren't cloned.
- Keep the ones that are cloned, and log
"<name> is no longer on GitHub (deleted, renamed or transferred); local clone at <path> kept". Optionally pair a kept clone with its renamed entry by comparing git remote get-url origin to the new CloneUrl, since GitHub redirects old URLs.
- Clear
BaseRepo/CompareRepo if either names a removed entry. ClearSelectionIfRejected can be reused for this.
Acceptance criteria
- Rescanning after an upstream delete removes the uncloned entry.
- After an upstream rename, no stale uncloned entry remains, and any cloned entry that was kept is reported in the log.
- A failed or partial listing prunes nothing.
- A test covers pruning, keeping a cloned entry, and the failed-listing case.
What's wrong
SyncGitHubRepoInfoForOwner(ProjectDirector/ProjectDirector.cs~L997-1035) only ever adds or overwrites entries inOptions.Repos(~L1020). Nothing removes an entry once GitHub stops returning it. The only removal in the codebase isRejectUnsupportedRepos, which handles non-GitHub repo types.Failure scenarios
owner/Foois cloned at<dev>/owner/Fooand then renamed upstream toBar. On the next Scan > GitHub Owners,owner.Baris added withLocalPath = <dev>/owner/Bar. That path isn't cloned, so its panel offers Clone. Meanwhile the oldowner.Fooentry stays, still holds the clone, and is still auto-fetched. The owner now lists both. Clicking Clone onBarmakes a second full copy of the same repo, and from then on Similar Repos and file propagation compare and propagate against both copies.Repository not foundevery time.Suggested fix
ApiExceptionor a partial result), find theOptions.Reposentries for thatOwnerNamethat the listing didn't return."<name> is no longer on GitHub (deleted, renamed or transferred); local clone at <path> kept". Optionally pair a kept clone with its renamed entry by comparinggit remote get-url originto the newCloneUrl, since GitHub redirects old URLs.BaseRepo/CompareRepoif either names a removed entry.ClearSelectionIfRejectedcan be reused for this.Acceptance criteria