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

version bumping in a PR creates a git tag with that version, breaking auto #410

Closed
1 task done
surchs opened this issue Dec 19, 2024 · 3 comments
Closed
1 task done
Assignees
Labels
process Improvement to internal processes

Comments

@surchs
Copy link
Contributor

surchs commented Dec 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

Running a release pre-computation that bumps package.json to what would be the next release version does not create any side effects outside the PR and definitely does not cause any other workflows to break.

Current Behavior

Running a version compute and version bump on a PR branch via In #390 we introduced https://github.com/neurobagel/query-tool/blob/31832382990b4e40631f3b8753b765b459e83ade/.github/workflows/bump_version.yml to pre-compute the next version, should we make a release generates a tag with the name of the next version. If we are merging a different PR before the "to be released" PR, e.g. if 2 PRs are open or we have a dependabot PR come in, then this can cause the auto-release workflow that always runs on push to main to fail (e.g. here https://github.com/neurobagel/query-tool/actions/runs/12405614948/job/34632783246) because somewhere in its process it checks if a tag with the next version already exists - and then fails if it does.

Error message

from a failed auto-release workflow: https://github.com/neurobagel/query-tool/actions/runs/12405614948/job/34632783246

✔  success   Calculated SEMVER bump: minor
ℹ  info      Calculated next version to be: 0.8.0
ℹ  info      Old changelog exists, prepending changes.
ℹ  info      Wrote new changelog to filesystem.
[main 424a750] Update CHANGELOG.md [skip ci]
 1 file changed, 17 insertions(+)
ℹ  info      Committed new changelog.
ℹ  info      Calling version hook
v0.7.2
ℹ  info      Tagging new tag: v0.7.2 => v0.8.0
fatal: tag 'v0.8.0' already exists
Error: Running command 'git' with args [tag, v0.8.0, -m, "Update version to v0.8.0"] failed

fatal: tag 'v0.8.0' already exists

Environment

No response

How to reproduce

No response

Anything else?

I am not sure if the problem is primarily caused by bump-version creating the tag (from the PR branch), or if the auto-release is confused about when to release. I.e. I am not sure if auto is trying to release in the following scenario:

  1. I open PR 1
  2. I open PR 2
  3. I apply a "release" label to PR 1, but keep PR 1 open (e.g. because of requested changes) -> this seems to create an unwanted git tag as a side effect
  4. I merge PR 2
  5. auto-release triggers on PR 2 merge and breaks

I am unclear if auto breaks because the tag exists or because it erroneously is trying to create a release (even though the merged PR2 is not supposed to trigger one)

@surchs surchs added the process Improvement to internal processes label Dec 19, 2024
@surchs surchs added the flag:schedule Flag issue that should go on the roadmap or backlog. label Dec 19, 2024
@rmanaem
Copy link
Contributor

rmanaem commented Dec 19, 2024

It seems we merged #401 shortly after #406 (which had a release tag), and before the release workflow was able to finalize the release, it only managed to create a tag for v0.8.0 before another commit was added to the main branch. Once auto noticed the commit, it errored out, and even though the tag was created, the release was never finalized.

Image

@rmanaem
Copy link
Contributor

rmanaem commented Dec 19, 2024

Findings written to dev docs are available here

@rmanaem rmanaem removed the flag:schedule Flag issue that should go on the roadmap or backlog. label Dec 19, 2024
@rmanaem rmanaem moved this to Backlog in Neurobagel Dec 19, 2024
@rmanaem rmanaem moved this from Backlog to Implement - Active in Neurobagel Dec 19, 2024
@rmanaem rmanaem self-assigned this Dec 19, 2024
@rmanaem rmanaem moved this from Implement - Active to Implement - Done in Neurobagel Dec 19, 2024
@rmanaem
Copy link
Contributor

rmanaem commented Dec 19, 2024

The fix is essentially to wait for the release workflow to run before making another commit.

@rmanaem rmanaem closed this as completed Dec 19, 2024
@github-project-automation github-project-automation bot moved this from Implement - Done to Review - Done in Neurobagel Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
process Improvement to internal processes
Projects
Status: Review - Done
Development

No branches or pull requests

2 participants