Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better AutoFreezer PR continuation #281

Merged
merged 2 commits into from
Feb 20, 2023

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Feb 20, 2023

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

  • Now the AutoFreezer uses the shared NetkanRepo.change_branch function instead of rolling its own version of that logic, which will fix the problem and reduce code duplication
  • To help with review, the bot will now post its intended PR body as a comment when it pushes commits to an existing open PR. This way the person reviewing will see the table of the newly added mods with their last update and links.

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 HebaruSan added Bug Something isn't working Auto Freezer Finds idle mods and submits pull requests to freeze them labels Feb 20, 2023
@HebaruSan HebaruSan force-pushed the fix/auto-freezer-checkout branch from 003967d to 13f38c2 Compare February 20, 2023 00:20
@HebaruSan HebaruSan force-pushed the fix/auto-freezer-checkout branch from 13f38c2 to 73732ab Compare February 20, 2023 02:27
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That all makes sense, lgtm!

@HebaruSan HebaruSan merged commit b23f531 into KSP-CKAN:master Feb 20, 2023
@HebaruSan HebaruSan deleted the fix/auto-freezer-checkout branch February 20, 2023 05:41
@HebaruSan
Copy link
Member Author

HebaruSan commented Mar 2, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto Freezer Finds idle mods and submits pull requests to freeze them Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants