Skip to content

fix: do not rename a repo back when its old name redirects - #1142

Open
lhoupert wants to merge 1 commit into
github-community-projects:main-enterprisefrom
lhoupert:fix/1123-rename-back
Open

lhoupert wants to merge 1 commit into
github-community-projects:main-enterprisefrom
lhoupert:fix/1123-rename-back

Conversation

@lhoupert

Copy link
Copy Markdown

A renamed repo's old name still resolves to the repo on GitHub, so syncing a stale name (a removed old-name.yml in a push, or a name listed before a rename during a full sync) sent name: old-name back and undid the rename. A repo whose live name differs from the requested one is now skipped unless the config asks for the rename (repository.name, or the oldname set by BLOCK_REPO_RENAME_BY_HUMAN). Closes #1123.

For reviewers: this overlaps with #1136 and is deliberately smaller (two guards, no new feature). The guard sits in the repository plugin as well as in updateRepos, so it also holds when archive is in disable_plugins, the case where #1136 still renames back. Not covered: in a full sync where the repository plugin does not run for a repo, child plugins can still apply the old name's config through the redirect; closing that needs one extra GET per repo.

GitHub resolves a renamed repo's old name to the renamed repo, so syncing a stale name undid the rename. Such a repo is now skipped before any plugin runs, unless the config asks for the rename.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.0.0: renamed repos get renamed back to their old name (removed config files and stale full-sync names follow GitHub's rename redirect)

1 participant