rajatjindal / krew-release-bot

bot to bump version of plugin in krew-index on new releases
Apache License 2.0
46 stars 16 forks source link

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

Open marccampbell opened 2 years ago

marccampbell commented 2 years ago

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?

rajatjindal commented 2 years ago

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.

rajatjindal commented 2 years ago

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?