KSP-CKAN / NetKAN-Infra

NetKAN Infrastructure Repo
MIT License
3 stars 6 forks source link

Better AutoFreezer PR continuation #281

Closed HebaruSan closed 1 year ago

HebaruSan commented 1 year ago

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

This 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.

HebaruSan commented 1 year ago

Huh, that just didn't work at all. It was supposed to push more commits and add a comment:

KSP-CKAN/NetKAN#9580

image

Not even an exception to investigate.

I checked the repo.get_pulls(head=... syntax in a Python REPL, and it works flawlessly.