-
Notifications
You must be signed in to change notification settings - Fork 502
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
Ensure release-notes tool doesn't skip automated cherry picks #2689
Ensure release-notes tool doesn't skip automated cherry picks #2689
Conversation
9d4020c
to
785113b
Compare
/hold |
Signed-off-by: Marko Mudrinić <[email protected]>
785113b
to
226c674
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, this seems to fix a valid bug and simplifies the code. Great work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: saschagrunert, xmudrii 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 |
/hold cancel |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Motivation
We've recently discovered a bug in the release-notes tool causing automated cherry picks to be skipped. This is because those PRs have an empty release note block, which is handled like the release note is present. This is not correct behavior, instead, those PRs should be skipped. Instead of those PRs, the release-notes tool should take the parent PR and its release note.
Problem explained
Before I start with the problem explanation, the following diagram shows our workflow:
The release-notes tool calls a bunch of functions to determine a release note for PRs. We first take a list of commits for which we need to determine PRs. Those list of commits is passed to
gatherNotes
which takes each commit and passes it tonotesForCommit
. After calling a few more functions (as shown in the diagram), we end up with a list of candidate PRs for that commit (prsNumForCommitFromMessage
function). Those candidate PRs are the original PR, parent PR if it's a cherry-pick, and we have special handling for squashed commits.Those candidate PRs are passed back to
notesForCommit
where we select a single PR out of those candidate PRs.This is where the problem appears. This function takes the PR body and checks if it contains the release-note block OR the
Does this PR introduce a user-facing change?
text. However, we do NOT check if it's a valid release note. We pass that single PR togatherNotes
where we check if it's actually a valid release note. However, we pass only that one single PR, we don't pass other candidate PRs. If it turns out to be an invalid release note, we can't check other PRs because we discarded them.That's not a problem for PRs targeting the master/main branch. However, that is a problem for cherry picks where we have an empty release note block and where we excpect to inherit release note from the parent PR. In this case,
notesForCommit
will think that the cherry pick has a valid release note (even if it's empty) and will discard the parent PR. This causes release notes to lose release note for that change/PR.Fix explained
This PR introduces two major changes:
notesForCommit
checks if the release note is valid instead of just checking for the presence of the release-note block orDoes this PR introduce a user-facing change?
textnoteExclusionFilters
is updated so that the release note MUST contain NONE/NO/NA. Currently, it excludes PRs with empty release notes, but this seems wrong because a PR without a release note should be considered as invalidWhich issue(s) this PR fixes:
xref #2679
ListReleaseNotesV2 is affected as well, but not fixed by this PR. It'll be done in a follow up PR.
Special notes for your reviewer:
Release note for this PR might include more details, I can update it if needed.
Does this PR introduce a user-facing change?
/assign @puerco @jeremyrickard @cpanato @Verolop @palnabarun
cc @kubernetes/release-engineering