Skip to content
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

Initial (GHA) Workflow for creating the Porting Guide #121

Open
wants to merge 24 commits into
base: devel
Choose a base branch
from

Conversation

anweshadas
Copy link
Contributor

@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
- name: Create the PR body
working-directory: antsibull/build/ansible-build-data
run: |
gh pr create -B test -H "publish-${{ inputs.ansible_version }}" --title "${CI_COMMIT_MESSAGE}" --body "${CI_PR_BODY}"
Copy link
Member

@webknjaz webknjaz Apr 19, 2024

Choose a reason for hiding this comment

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

Should the branch be called test? (I assume that capital B means branch.. It's a good tone to use long explicit argument names in scripts since it makes it possible to read them easily)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's stick to the test branch name for now. I have edited -B to --base and -H to --head.

.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
.github/workflows/docsbuild-release.yaml Outdated Show resolved Hide resolved
##### COMPONENT NAME
docs/docsite/rst/porting_guides/porting_guide_"${{ steps.compute-version.outputs.major-version }}".rst
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry but it doesn't look like Sviat's suggestion has been applied. Or am I crazy?

Co-authored-by: Don Naro <dnaro@redhat.com>
@oraNod oraNod removed the needs_triage Needs a first human triage before being processed. label May 16, 2024
@oraNod
Copy link
Contributor

oraNod commented May 16, 2024

@anweshadas Hey, I just pushed a commit to your branch. I thought that might be easier than adding a load of review comments here.

Anyway I hope the changes are OK. Feel free to take them or leave them. I did use yamllint to check the syntax and tried to make things a bit more descriptive in the workflow. For instance, I renamed the job from "build" to "porting-guide" and also changed the name of the workflow file.

Hopefully I have the right flow here too. My understanding is that this workflow is intended to extract the porting guide from the package tarball and then add it to the ansible-documentation and ansible-build-data repositories. It looked like there were some missing steps and parameters in the original workflow so I've tried to fix that and get the correct order of steps.

I was also thinking we could break this into three separate jobs:

  • Job one: Extract the RST file from the package tarball and upload it as a workflow artifact.
  • Job two: Download the RST file artifact and add it to the ansible-documentation repo.
  • Job three: Download the RST file artifact and add it to the ansible-build-data repo.

Not sure what folks might think about that so I didn't go that far in my changes. Happy to take a stab at it if that would be useful.

Hope these changes help! Cheers.

@oraNod
Copy link
Contributor

oraNod commented May 16, 2024

Also it seemed unnecessary to me to have a step that uses sed to extract the major version and thought it could just be passed as an input. Guess we could change it back.

@oraNod
Copy link
Contributor

oraNod commented May 16, 2024

Thinking about it some more and I think we could break the proposed jobs two and three into a reusable workflow. That should reduce duplication. The main difference between the two jobs is the path where the RST file goes. We could pass that as an input to the reusable workflow. Having the separate jobs should also mean that they run in parallel.

@oraNod
Copy link
Contributor

oraNod commented May 16, 2024

Just pushed another commit with the reusable workflow. I think it's a bit nicer because the jobs run more independently. Here's what it looks like in the sidebar view:

image

I found that using an action for the PR means we can reduce some of the steps: https://github.com/marketplace/actions/create-pull-request

However it ran into a permissions issue (always). I guess we'll need to work through that. It should be fine for this repo (ansible-documentation) because the settings allow for actions to create PRs. For the build-data repo I suppose we'll need a token or something.

Another nice thing about using the PR action means we'll be able to specify things like labels, assignees, and reviewers.

@oraNod oraNod requested a review from gotmax23 May 16, 2024 20:28
@oraNod
Copy link
Contributor

oraNod commented May 17, 2024

Another commit to add back the plain git steps instead of using that PR action. I guess we can decide which method to use. Just thought maybe I shouldn't change things too much. @anweshadas feel free to either squash that last commit or drop it.

Copy link
Contributor Author

@anweshadas anweshadas left a comment

Choose a reason for hiding this comment

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

The changes look good to me. Thank you @oraNod for working on it.

@anweshadas
Copy link
Contributor Author

@felixfontein can you please have a look at it?

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.

None yet

5 participants