-
Notifications
You must be signed in to change notification settings - Fork 659
Initial (GHA) Workflow for creating the Porting Guide #121
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
Retriggering CI. @anweshadas, what's the current status of this? |
I have worked on the feedbacks and tested the same here. https://github.com/anweshadas/ansible-documentation/actions/runs/7265670213 This works and is ready to be reviewed. |
Removes extra step, fixes typo and ANSIBLE-VERSION-MAJOR calculation in Bash.
I tested workflow with the following version numbers :
I ran these against the |
|
||
- name: Copy the RST file to the correct path | ||
env: | ||
ANSIBLE_VERSION_MAJOR: ${{ steps.context.outputs.ansible-version-major }} |
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.
Couldn't you define this env at the job level instead of twice within different steps?
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.
No, because it is calculated in the first step of the job. See here
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 could modify the job to set the ANSIBLE_VERSION_FULL
env here.
env:
ANSIBLE_VERSION_FULL: ${{ inputs.ansible-version }}
In the Compute derived context
step you could then do:
run: |
echo "ANSIBLE_VERSION_MAJOR=${ANSIBLE_VERSION_FULL%%.*}" >> "${GITHUB_ENV}"
And other steps should then just use ${{ env.ANSIBLE_VERSION_MAJOR }}
directly.
That would make this workflow more consistent with others in the repo, e.g.
- name: Set the VERSION variable |
- name: Set the production branch and url |
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.
@oraNod that would work. In my initial suggestion, I was focusing on scoping definitions to where they are used, but there's no reason not to refactor it further.
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.
|
||
- name: Copy the RST file to the correct path | ||
env: | ||
ANSIBLE_VERSION_MAJOR: ${{ steps.context.outputs.ansible-version-major }} |
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.
@oraNod that would work. In my initial suggestion, I was focusing on scoping definitions to where they are used, but there's no reason not to refactor it further.
|
||
steps: | ||
- name: Compute derived context | ||
id: context | ||
env: | ||
ANSIBLE_VERSION_FULL: ${{ inputs.ansible-version }} | ||
run: >- | ||
echo ansible-version-major="${ANSIBLE_VERSION_FULL//\.+([[:digit:]])}" | ||
echo ansible-version-major="${ANSIBLE_VERSION_FULL%%.*}" |
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 did you change this? The original variant was functional in bash for me locally (with extglob
being mandatory, of course)
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.
When I used the original variant it failed for 12.0.0a7
ansible version, it calculated the major version as 12a7
.
The current variant I tested with 4 different version numbers as input.
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.
Oh, I didn't account for pre-releases in that. Makes sense.
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
|
||
steps: | ||
- name: Compute derived context | ||
id: context |
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 trim this id
now that it is no longer used?
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.
Updated.
Co-authored-by: Don Naro <[email protected]>
The |
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.
Once this is fixed, LGTM.
Co-authored-by: Felix Fontein <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
|
@anweshadas thanks a lot for implementing this! |
thanks @anweshadas and thank you for merging @felixfontein |
Thank you @webknjaz @gotmax23 @oraNod @samccann and @felixfontein for the helping. Excited to use this workflow for |
Depends on ansible-community/ansible-build-data#265. This workflow will need manual trigger with the following inputs ->
ansible-major-version
andansible-build-data-branch
(the release PR branch), to run. The workflow creates the draft PR to theansible-documentation
repository fetching the Porting Guide from theansible-build-data
repository. A member of the Release Management Working Group will move manually the PR fromdraft
state to theready to review
which will trigger the CI.The workflow is being tested here in the following runs :