Skip to content

Commit

Permalink
Do not exclude mapped notes
Browse files Browse the repository at this point in the history
If a note PR get's modified to remove the release note, then the label
`release-note-none` will get applied to it. If a map for that note
exists, then it will excluded based on that. We now still provide the
mapped value to ensure a higher priority over the original PR.

Signed-off-by: Sascha Grunert <[email protected]>
  • Loading branch information
saschagrunert committed Mar 13, 2024
1 parent 9d09f87 commit 19f2eca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/notes/document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func New(
doc.CVEList = append(doc.CVEList, newcve)
}

if note.DoNotPublish {
if !note.IsMapped && note.DoNotPublish {
logrus.Debugf("Skipping PR %d as (marked to not be published)", pr)
continue
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/notes/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ type ReleaseNote struct {

// DataFields a key indexed map of data fields
DataFields map[string]ReleaseNotesDataField `json:"-"`

// IsMapped is set if the note got modified from a map
IsMapped bool `json:"is_mapped,omitempty"`
}

type Documentation struct {
Expand Down Expand Up @@ -1146,6 +1149,8 @@ func (rn *ReleaseNote) ApplyMap(noteMap *ReleaseNotesMap, markdownLinks bool) er
logrus.WithFields(logrus.Fields{
"pr": rn.PrNumber,
}).Debugf("Applying map to note")
rn.IsMapped = true

reRenderMarkdown := false
if noteMap.ReleaseNote.Author != nil {
rn.Author = *noteMap.ReleaseNote.Author
Expand Down

0 comments on commit 19f2eca

Please sign in to comment.