-
Notifications
You must be signed in to change notification settings - Fork 86
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
[RHELC-1748] Manpage generation check #1422
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1422 +/- ##
=======================================
Coverage ? 96.11%
=======================================
Files ? 72
Lines ? 5178
Branches ? 896
=======================================
Hits ? 4977
Misses ? 119
Partials ? 82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
a88ffb5
to
d7b5428
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.
In short, I would want to see
- Manpages are generated and checked to see if there are changes
- Manpages are checked for each commit on main and commit in a PR
- Manpages workflow fails if there is a difference and passes if there are no changes
.github/workflows/build-rpm.yml
Outdated
- name: Trigger Manpage Generation | ||
run: | | ||
oamg/convert2rhel/.github/workflows/generate_manpage.yml@main | ||
|
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.
To get this to work generate_manpage.yml
needs to be a runnable workflow. But don't think it's necessary to run it here tbh, we can keep to just running it on every 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.
It's not enough to check with the previous version. I would like to see the manpages generated and the difference checked to see if there are any changes. Not just if the version changed.
As this will fail every time we submit a new version it's already too late to update too.
|
||
# Generate the manpage using argparse-manpage | ||
PYTHONPATH=. /usr/bin/python /home/runner/.local/bin/argparse-manpage --pyfile man/__init__.py --function get_parser --manual-title="General Commands Manual" --description="Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux." --project-name "convert2rhel $VER" --prog="convert2rhel" --include man/distribution --include man/synopsis > "$MANPAGE_DIR/convert2rhel.8" | ||
PYTHONPATH=. argparse-manpage --pyfile man/__init__.py --function get_parser --manual-title="General Commands Manual" --description="Automates the conversion of Red Hat Enterprise Linux derivative distributions to Red Hat Enterprise Linux." --project-name "convert2rhel $CURRENT_VER" --prog="convert2rhel" --include man/distribution --include man/synopsis > "$MANPAGE_DIR/convert2rhel.8" |
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.
We're missing python call here. Does it still work locally?
if ! git diff --quiet HEAD -- "$MANPAGE_DIR/convert2rhel.8"; then | ||
echo "Manpages are outdated. Please update them." | ||
exit 1 | ||
else | ||
echo "Manpages are up-to-date." | ||
exit 0 | ||
fi |
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.
Perfect!
# Ensure the manpage directory exists | ||
mkdir -p "$MANPAGE_DIR" |
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
ac655b7
to
9c0900b
Compare
* Added in the the check to see if the manpages should be generated or not * Changed the generate_manpage.yml file so that it sets up the action as needed, and removed some of the things not needed
* The main thing we should check here is to make sure the manpages needed to be updated so we don't need to see the version as it would be too late and we want this to happen on all PRs
* on the last commit some of the set up for the action was removed and now it is back * added in the manpage generation command back to the manpage_generation.sh script
* How cli.py was calling the atributes from rpm for the pre and post RPM_VA_LOG_FILENAME was causing an error whenever I tried to run the GitHub action and the manpage command locally so to fix it I imported the the vars directly into cli.py
aa5bcf3
to
874e81a
Compare
* reveted back a bit because the action is failing with some old errors that were already fixed
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 noticed the workflow is not using a container or the script. But if this container works locally it's just a matter of running it in the GitHub workflow
Since we don't need the results exported in any way, but rather to exit the container with a code if there is a change
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 talked about this PR with Mb, and they suggested that if everything could just be done in the action, that could fix some of the issues that I was having. The action works as it should. The error shown now is a separate issue from this PR, but you can see that at the end of it, it does show the correct message for the manpages, as currently, in this PR, there are changes in the manpages file.
This PR sets up the GitHub action so that going forward we will be able to know if we need to generate the manpages per PR basis so that we can always have the manpages up to date.
Jira Issues:
-RHELC-1748
Checklist
[RHELC-]
or[HMS-]
is part of the PR titleRelease Pending
if relevant