Don't preserve old repository on URL change #107
Merged
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.
The library maintainers may request a change to the repository URL in the library registration data.
This operation is performed by the backend maintainer via the command:
Previously, this command did three things:
Problem
The last of these is problematic because the remote of that repository is still configured for the original URL, meaning
the fetch done during the
sync
command execution were still done against the old URL.This bug is not noticeable under either of the following scenarios:
The repository was renamed or transferred
This produces a redirect from the old URL to the new one, so the fetch is done from the intended repo despite the
outdated remote configuration.
The original repository was deleted
If a fetch fails, the engine deletes the repository and clones from the URL in the DB. The newly cloned repo will have
the correct remote configuration.
The bug is noticeable under the following scenario:
The original repository still exists
The sync process continues to fetch from the old URL.
Example: arduino/library-registry#1179 (comment)
Solution
Change the
modify --repo-url
command behavior to delete the cached library repository clone.The repository will be cloned from the updated URL on the next run of the
sync
command.