rajatjindal/krew-release-bot

When a release fails, it's difficult to recover because the bot uses the same branch name

marccampbell opened this issue · 4 comments

Occasionally we have a release fail. This isn't due to any bugs in the bot code, but maybe we generated an invalid krew-index update, and this can't be merged because it fails CI.

When this happens, we get stuck, unable to use the bot and have to manually create a krew release because the bot uses deterministic branch names that can't be pushed to.

For example, after creating a broken krew-index release for an update to a project, I fixed the problem and the bot fails with:

time="2021-07-20T15:18:53Z" level=fatal msg="expected status code 200 got 500. body: opening pr: non-fast-forward update: refs/heads/schemahero-schemahero-schemahero-v0.12.3"
Post Checkout

From what I understand this is doing, if the bot were to use a new branch name, we wouldn't have this problem and the bot would recover from this error state properly.

Are there options today that we can specify to remediate, or do we need to manually create the krew-index PR after this state?

yeah i can see why this is problematic. would you be able to submit the PR with the proposed fix? i would be more than happy to review and merge.

Hey @marccampbell

i looked at code again. this is what we use for creating branch name:

fmt.Sprintf("%s-%s-%s-%s", request.PluginOwner, request.PluginName, request.PluginRepo, request.TagName)

lets say you had a mistake in krew template or any other issue, and to fix it you make a new commit. Won't you have to give it a new tag in that case to create a new release?