Commit d050161
committed
Don't preserve old repository on URL change
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:
libraries-repository-engine modify --repo-url
Previously, this command did three things:
- Update the DB entry for the library
- Move the release archives to the new location (the storage structure is based on the repository URL for some reason)
- Move the cached library repository clone to the new location
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.
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.1 parent 087e041 commit d050161
2 files changed
+7
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
177 | 169 | | |
178 | 170 | | |
179 | 171 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 172 | + | |
| 173 | + | |
188 | 174 | | |
189 | 175 | | |
190 | | - | |
191 | | - | |
| 176 | + | |
| 177 | + | |
192 | 178 | | |
193 | 179 | | |
194 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | 230 | | |
234 | 231 | | |
235 | 232 | | |
| |||
281 | 278 | | |
282 | 279 | | |
283 | 280 | | |
284 | | - | |
285 | 281 | | |
286 | 282 | | |
287 | 283 | | |
| |||
314 | 310 | | |
315 | 311 | | |
316 | 312 | | |
317 | | - | |
318 | 313 | | |
319 | 314 | | |
320 | 315 | | |
| |||
0 commit comments