-
Notifications
You must be signed in to change notification settings - Fork 21
coreos-release-notes-generator: init script for generating release notes #119
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
c83c744
to
e37a70a
Compare
310170f
to
c985d06
Compare
Thanks @zonggen for working on this! A few questions/comments:
|
@dustymabe Thanks for reviewing! Will cleanup the code and add a README for documentation. Also will update with the updated schema in coreos/fedora-coreos-config#550 |
ec2edc6
to
fa5f509
Compare
Removed Currently working on adding a list of file names such that no duplication between multiple |
@@ -0,0 +1,82 @@ | |||
# coreos-release-note-generator |
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.
Should we rename to coreos-release-notes-generator
?
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.
Agreed 👍
`coreos-release-note-generator` generates `release-notes.yaml` from `release-notes.d` yaml snippets using the specified build id using `--build-id` option. | ||
|
||
## Options | ||
- `--build-id`: build id of the latest release note |
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.
- `--build-id`: build id of the latest release note | |
- `--build-id`: build id of the latest release |
args.config_dir, 'release-notes.d/*.yaml')) | ||
if len(snippet_yaml_list) == 0: | ||
print("release-notes.d/ does not contain any yaml snippets under '{}'".format(args.config_dir)) | ||
exit(0) |
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.
Can we return here instead of exiting in the middle of a function?
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.
Also, we should probably consider the case where we haven't added any release-notes.d/ files for a particular release. I guess in that case we should just put an empty entry in the list saying there are not release notes or something.
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.
Also, we should probably consider the case where we haven't added any release-notes.d/ files for a particular release. I guess in that case we should just put an empty entry in the list saying there are not release notes or something.
Or, we could just merge this list of build_id: release_notes items into a single dictionary so that we could query whether a release note exists for a release just by checking if the key build_id exists. This could be done when we are converting to JSON format for website consumption, on the other hand I think it makes sense to use YAML file for human readability on other places like fedora-coreos-config
.
note = {'subject': item.get( | ||
'subject', ''), 'body': item.get('body', '')} | ||
# purposely avoid item.get('component', '') to error out if the component key does not exist | ||
project_name = item['component'] |
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.
instead of using project
throughout this file should we just call it component
instead?
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.
Agreed 👍
fa5f509
to
6389966
Compare
one small nit and then we can merge: Change commit subject line to |
`coreos-release-notes-generator` generates `release-notes.yaml` from `release-notes.d` yaml snippets using the specified build id using `--build-id` option. Supported options include: - `--build-id`(required): build id of the latest release note - `--config-dir`(required): path to the directory where `release-notes.d/` lives - `--release-notes-file`(optional): path to the input `release-notes.yaml` file for update, the script uses this option to determine whether to update an existing `release-notes.yaml` or to create a new one. By default create a new `release-notes.yaml` - `--output-dir`(optional): output directory for `release-notes.yaml`, by default outputs to STDOUT - `--json`(optional): output JSON format instead of YAML for easier consumption by Fedora CoreOS website (https://getfedora.org/en/coreos?stream=stable), by default uses YAML Related: coreos/fedora-coreos-tracker#194 Signed-off-by: Allen Bai <abai@redhat.com>
6389966
to
28376c3
Compare
Fixed commit subject, thanks for pointing that out! |
LGTM - I think we can merge this and do fixups for things we find in a followup PR. |
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 script generates Fedora CoreOS release note from pre-mature release note snippets. Takes two arguments:
--config-dir
and--output-dir
.The
config_dir
is the directory where a'release-notes.d
directory resides, typically afedora-coreos-config
directory, which has pre-mature release notes yaml snippets.The
output_dir
is the directory where arelease-notes.yaml
resides. If there's no such file then a new file will be created. If arelease-notes.yaml
already exists, then checks if thenext-release
field is present in the file. It inserts thenext-release
field to the front of the file if none is present or updates the existingnext-release
field if one already exists.Related: coreos/fedora-coreos-tracker#194
Signed-off-by: Allen Bai abai@redhat.com