-
Notifications
You must be signed in to change notification settings - Fork 519
Add a patch-to-latest discover mode #1245
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
Conversation
27a7974
to
2d26fff
Compare
pkg/git/git_integration_test.go
Outdated
|
||
result, err := testRepo.sut.LatestPatchToLatest(testRepo.branchName) | ||
require.Nil(t, err) | ||
require.Equal(t, result.StartSHA(), testRepo.firstCommit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is surprising to me. I expected it to use secondBranchCommit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe the return value of LatestTagForBranch
is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the issue appears to be that TagsForBranch
orders the tags not by timestamp, but by tag value, ie: 0.1.1, 0.1.2, 1.17.0 even though they were committed in a different order. I'm not sure if this is an issue with the gogit library or if this is how a real git repo behaves.
Do you expect a scenario where the intermediate tags on a branch are of a completely different major/minor version?
Anyway, what I did was change the v0.1.2 tag to v1.17.1 so that the test branch contains both kinds of tags. Basically, the v0.1.2 tag gets ignored for the most part since it's last in the ordering, and now the test cases work as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thank you for the test-fix :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @msau42, thank you for the valuable addition! Let’s just find out why the test did not behave as expected. The rest LGTM
pkg/git/git_integration_test.go
Outdated
|
||
result, err := testRepo.sut.LatestPatchToLatest(testRepo.branchName) | ||
require.Nil(t, err) | ||
require.Equal(t, result.StartSHA(), testRepo.firstCommit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe the return value of LatestTagForBranch
is wrong.
2e0fc9b
to
b50b09c
Compare
d19f100
to
044b945
Compare
… from the latest patch release to the top of the release branch
044b945
to
1765c99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msau42, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a patch-to-latest discover mode, that generates the release notes from the latest patch release to the top of the release branch.
We use this tool to generate release notes for kubernetes-csi repos. Our release model is to generate the release notes before tagging the release, so the existing "patch-to-patch" doesn't work for us.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?