Better AutoFreezer PR continuation #281
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.
Problem
I let KSP-CKAN/NetKAN#9471 sit without review for quite a while, and in the meantime we had 9 weekly checks go by without any new commits pushed. Probably quite a few abandoned mods have slipped through the cracks, which we should probably catch up at some point.
Cause
The branch checkout logic in the AutoFreezer was trying to re-use an existing branch if there was one, but it was missing a step: it fetched the remote branch, and it tried to check it out, but it never created a local branch corresponding to the remote branch. So checking it out failed, and it always fell back to creating a new branch. Then later the attempt to push to the server would fail because the branch already existed with conflicts.
Changes
NetkanRepo.change_branch
function instead of rolling its own version of that logic, which will fix the problem and reduce code duplicationThis way if we miss a week of review, the next week's idle mods will get cleanly added on to the existing PR, and none will be missed.
Note that this branch shares the test-fixes commit with #280, but not the one with that PR's actual functionality. I think we can merge either one first or not at all and the other one should be fine to continue or not.