-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for optional README path flag to list and track parts used in README file. #840
Conversation
…d more easily in README.
@sergio-costas Could you please review this PR? Regarding the test failures, the unittests are still passing locally, but they seem to fail in the workflow due to a 403 status code error. This might be caused by rate limiting on the GitHub API. |
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.
Some little details.
for part in parts if part | ||
]) | ||
formatted_contents = f"## Included Components\n{parts_contents}" | ||
updated_readme = re.sub( |
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.
Maybe a check for the existence of the tags would be a good idea. That allows to ensure that they are correct (a typo would result in the data not being updated).
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.
Why do we need to check for the existence of a tag? The included components are defined in the snapcraft.yaml
file, not determined by the user. If there is any typo, it will automatically be corrected in the next workflow run as defined in the snapcraft.yaml
file.
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 mean: if the user specifies a README file, do check in that README if the <!-- Begin Included Components -->
and <!-- End Included Components -->
tags are specified in it.
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.
Done
for part in parts if part | ||
]) | ||
formatted_contents = f"## Included Components\n{parts_contents}" | ||
updated_readme = re.sub( |
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 mean: if the user specifies a README file, do check in that README if the <!-- Begin Included Components -->
and <!-- End Included Components -->
tags are specified in it.
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 update introduces a new
--readme-path
argument that allows users to specify the file path to theREADME
(or any Markdown file) where the parts used in a YAML file (such as snapcraft or rockcraft) will be listed (with their updated versions).Key Changes:
--readme-path
argument is added to specify the path to the target README file.Usage:
--readme-path
flag. For example:--readme-path: 'path/to/readme/file'
This will automatically list the parts (with their updated version) used in the YAML file within the specified Markdown file, as demonstrated in the image below.