Skip to content

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

Merged
merged 59 commits into from
Jul 14, 2025

Conversation

anweshadas
Copy link
Contributor

@anweshadas anweshadas commented Jul 14, 2023

Depends on ansible-community/ansible-build-data#265. This workflow will need manual trigger with the following inputs -> ansible-major-version and ansible-build-data-branch (the release PR branch), to run. The workflow creates the draft PR to the ansible-documentation repository fetching the Porting Guide from the ansible-build-data repository. A member of the Release Management Working Group will move manually the PR from draft state to the ready to review which will trigger the CI.

The workflow is being tested here in the following runs :

@github-actions github-actions bot added the needs_triage Needs a first human triage before being processed. label Aug 3, 2023
@gotmax23
Copy link
Collaborator

Retriggering CI. @anweshadas, what's the current status of this?

@gotmax23 gotmax23 closed this Oct 26, 2023
@gotmax23 gotmax23 reopened this Oct 26, 2023
@gotmax23 gotmax23 temporarily deployed to github-bot October 26, 2023 02:48 — with GitHub Actions Inactive
@anweshadas
Copy link
Contributor Author

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.

@anweshadas anweshadas marked this pull request as ready for review January 2, 2024 12:58
Removes extra step, fixes typo and ANSIBLE-VERSION-MAJOR
calculation in Bash.
@anweshadas
Copy link
Contributor Author

anweshadas commented Jul 8, 2025


- name: Copy the RST file to the correct path
env:
ANSIBLE_VERSION_MAJOR: ${{ steps.context.outputs.ansible-version-major }}
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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.

or
- name: Set the production branch and url

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @webknjaz and @oraNod . I updated PR based on the suggestion. Tested the same here.


- name: Copy the RST file to the correct path
env:
ANSIBLE_VERSION_MAJOR: ${{ steps.context.outputs.ansible-version-major }}
Copy link
Member

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%%.*}"
Copy link
Member

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)

Copy link
Contributor Author

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.

https://github.com/anweshadas/actiontesting/actions/runs/16153164763/job/45589227987#step:5:10

The current variant I tested with 4 different version numbers as input.

Copy link
Member

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
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@felixfontein
Copy link
Collaborator

I ran these against the main branch, since the PR branches for releases were deleted after merging.

The refs/pull/XXX/merge branches should still work, or at least refs/pull/XXX/head (which is the PR's HEAD).

Copy link
Collaborator

@felixfontein felixfontein left a 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.

@anweshadas
Copy link
Contributor Author

I ran these against the main branch, since the PR branches for releases were deleted after merging.

The refs/pull/XXX/merge branches should still work, or at least refs/pull/XXX/head (which is the PR's HEAD).

@felixfontein

  • refs/pull/XXX/head ( refs/pull/569/head) worked see here
  • refs/pull/XXX/merge did not see here

@felixfontein felixfontein merged commit efb5f3e into ansible:devel Jul 14, 2025
12 checks passed
@felixfontein
Copy link
Collaborator

@anweshadas thanks a lot for implementing this!
@webknjaz @gotmax23 @oraNod @samccann thanks a lot for reviewing and improving this!

@oraNod
Copy link
Contributor

oraNod commented Jul 14, 2025

thanks @anweshadas and thank you for merging @felixfontein

@anweshadas
Copy link
Contributor Author

Thank you @webknjaz @gotmax23 @oraNod @samccann and @felixfontein for the helping. Excited to use this workflow for 11.8.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants