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

[Bug] Ignoring a SHA in the configuration does not seem to exclude it from the version calculation #3427

Closed
andysbolton opened this issue Mar 6, 2023 · 6 comments · Fixed by #3953
Labels
Milestone

Comments

@andysbolton
Copy link

Describe the bug
I may be confused about how this feature works, but when trying to ignore a given SHA (or a commit-befores date) from the version calculation, it seems to be included anyway.

Expected Behavior

Given this line from /showconfig:

...
ignore:
  sha:
  - 619b00106f14ccff9406aa07391eb42433b4cd4d

I would expect this commit to be excluded from the versioning calculation.

Actual Behavior

When I look into the diagnostic logs, I see the commit is still being considered for version calculation:
INFO [03/06/23 8:38:22:48] Merge commit 619b001 Merge pull request #43 from repo/OPS-698 incremented base versions Major, now 2.0.0

Possible Fix

Steps to Reproduce

When I have a bit more time, I will try to recreate this, but I wanted to rule out that this is due to a misunderstanding of this feature on my part.

Context

An accidental commit has caused the versioning to increment a Major version.

Your Environment

  • Version Used: 5.12.0+Branch.support-5.x.Sha.3f75764963eb3d7956dcd5a40488c074dd9faf9e
  • Operating System and version (Windows 10, Ubuntu 18.04): Windows 11
  • Link to your project:
  • Link to your CI build (if appropriate):
@andysbolton andysbolton added the bug label Mar 6, 2023
@HHobeck HHobeck added this to the 6.x milestone Mar 18, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jun 16, 2023
@arturcic arturcic removed the stale label Jun 30, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Sep 29, 2023
@arturcic arturcic removed the stale label Sep 29, 2023
@corentinvds
Copy link

Hello,

I have the same issue: A commit message accidentally contains "+semver: major" and adding its Sha to the "ignore:sha" list in the config does not prevent Git Version to increment the major version.

Do you have a workaround other than rewriting the git history?

Thanks

@corentinvds
Copy link

I had a look at the code and found out that the "ignore" list is only used to filter out "base version" candidates but not to prevent bad commits from incrementing the version. To do that, the "ignore" list should be use near IncrementStrategyFinder.FindCommitMessageIncrement.

Would it be possible to update the code to implement this filter too ?

If not, what would be the recommended workaround for a bad commit message causing a major version update ?

Thanks.

@arturcic arturcic added stale and removed stale labels Oct 30, 2023
@HHobeck HHobeck modified the milestones: 6.x, 7.x Jan 11, 2024
@asbjornu
Copy link
Member

@corentinvds, we could make such backwards-incompatible changes in v6. I think it makes sense that all ignore properties lead to the ignored commits to be excluded from all version calculation. Pull requests are welcome!

@arturcic
Copy link
Member

🎉 This issue has been resolved in version 6.0.0-beta.7 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants