-
Notifications
You must be signed in to change notification settings - Fork 507
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
Release notes mappings libraries and in krel release-notes #1373
Conversation
/assign @saschagrunert |
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.
Good good, I added some notes on the general design that we can agree on an overall direction. 👍
pkg/notes/maps/testdata/fullmap.yaml
Outdated
url: https://wkdkjdjkdkfj | ||
type: kep | ||
datafields: | ||
score: 5.2 |
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.
The score should be part of the cve
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.
You're right. I thought this was the ML quality score.
The idea was to illustrate a different field. In this case the ML quality score. While cve data would be a whole struct this is only a float .
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.
Okay, I guess we do not have to add anything related to ML for now. In any case I guess the CVE needs a score. The idea was to highlight high impact CVE's or sort them by severity.
(I was thinking about being able to link multiple PRs together, so we could add something like linkedPRs
. The overall implementation might be a bit complicated, but features made of multiple PRs are a common use-case in Kubernetes.)
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.
I've added more (hypothetical) examples to the fullmap.yaml file and updated the cve field. Although right now i'm only adjusting how the data would fit in the map. Once we settle how we inject the new fields we can decide on the actual formats for the fields and how they would render.
Thanks for your review @saschagrunert this is precisely what I was hoping for, laying out a bit of code to kick start the design discussion 😀 |
Hey sascha, I've pushed a new prototype addressing the following:
Needless to say, it is still a rough demo until we settle on a design. |
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.
Pretty good, I like the implementation and just have a few minor nits left. Do you wanna merge that PR before the demo or do we wanna demo it first and then gather further feedback?
I've pushed another commit addressing these nits. I think we should merge it because it does not alter the current tools but we need these if we want to produce some output (in a document, not just yamls) we can show. What do you say if I give it a final polish tonight, squash the commits and resubmit. Then, based on this, we can start thinking how to assert the datafield interfaces and where/how we would add the data (like the CVE info) on the final documents. Sounds good? |
7db1216
to
be7dd24
Compare
Yep, sounds wonderful to me :) |
42a1e10
to
78f1d8e
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
/approve |
/kind feature |
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
@justaugustus do you think we can merge this one to get the next ones rolling ? :) |
OK, this this PR and its following changes are officially in rebase hell. I was trying to push the enhancement in steps: first the libraries, then the tools and finally the template and its tests. I think that now I will rebase and push these changes again but along the rest of the steps (except the template) in the same PR. |
Whoops big sorry for that! Let's try to get those changes in ASAP. |
No worries :) We cannot stop pushing ahead just for a small part getting stuck. Lets code some more! 💪 |
78f1d8e
to
45e4104
Compare
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
45e4104
to
643d5b8
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: hasheddan, 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 |
@puerco can we lift the hold? |
Sorry, yes. It was intended to be there while we decided on the approach. This one is fairly innocuous as it does not alter the output until we change the template. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This is the first effort to add the capability to process mapping files to the release notes package.
The release notes mapping files (format is detailed below) will allow expanding the information in release notes in two ways:
Modifying original data: The map can supersede release note data defined in the original pull request by overriding certain fields in a file which will eventually end up in the release notes document.
Adding new fields of information: A map file can define new data structures which can be associated with the release note to add more information to the release note. Current plans include adding security information and a quality score.
Mapping files can come from a variety of sources. This PR adds a new interface
MapProvider
whose job is to obtain and parse map files. MapProviders can be written to collect release notes files from a variety of sources: reading from a directory (a proof of concept is included), a bucket, a private GitHub repo, an encrypted archive, etc.The krel release-notes subcommand has been modified with a new
--maps-from
flag to enable MapProviders when generating release notes. For example, to invoke it with aDirectoryMapProvider
we would use the following flagsWhen MapProviders are active, the notes gatherer will query the provider for mappings for a specific note when generating it. Using a new method ApplyMap() the gatherer will modify the release note with data from the map.
The proposed map file format has two parts: one that overrides the original release note data and one that adds data fields, which are free-form data structures keyed in associative array fashion by a keyword. An example:
Which issue(s) this PR fixes:
Related to
Special notes for your reviewer:
This PR is a proof of concept, should run but is still untested.
I've provided a few sample maps in pkg/notes/maps/testdata/ to illustrate the format and its capabilities.
A simple implementation of a
MapProvider
is included in this PR:DirectoryMapProvider
. This MapProvider is the simplest provider possible: it reads a directory, looking for yaml files and tries to open them as release notes maps.Does this PR introduce a user-facing change?