-
Notifications
You must be signed in to change notification settings - Fork 500
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
Change ReleaseNotes to an own struct #1423
Change ReleaseNotes to an own struct #1423
Conversation
This gives us the possibility to streamline the API surface to: ``` releaseNotes, err := notes.GatherReleaseNotes(notesOptions) if err != nil { … } doc, err := document.New( releaseNotes, notesOptions.StartRev, notesOptions.EndRev, ) if err != nil { … } ``` The ReleaseNotesHistory is mostly not used by consumers and wrapping it in a struct makes it easier to understand for readers. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
func (r *ReleaseNotes) Get(prNumber int) *ReleaseNote { | ||
return r.byPR[prNumber] | ||
} | ||
|
||
// Set can be used to set a release note for the provided prNumber | ||
func (r *ReleaseNotes) Set(prNumber int, note *ReleaseNote) { | ||
r.byPR[prNumber] = note | ||
r.history = append(r.history, prNumber) | ||
} |
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.
Nice 👍
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.
Nice @saschagrunert besides the API streamline, thanks for abstracting them behind Get/Set methods they will make handling the notes easier once we merge the rest of the maps project.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: puerco, 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 api-change
What this PR does / why we need it:
This gives us the possibility to streamline the API surface to:
The ReleaseNotesHistory is mostly not used by consumers and wrapping it
in a struct makes it easier to understand for readers.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
/assign @puerco
Does this PR introduce a user-facing change?