Skip to content

HDDS-17509. Replace reusable check.yml workflow with an action - #11946

Draft
adoroszlai wants to merge 19 commits into
apache:masterfrom
adoroszlai:HDDS-17509
Draft

adoroszlai wants to merge 19 commits into
apache:masterfrom
adoroszlai:HDDS-17509

Conversation

@adoroszlai

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Replace workflows/check.yml (a reusable workflow) with actions/check/action.yaml (a reusable action).

Benefits:

  • Easier to add custom steps before/after the shared ones. Reusing workflow is all-or-nothing: a job cannot add custom steps without changing the reusable workflow. E.g. build uploads binary artifacts to be consumed by other jobs, this part previously had to be hard-coded in check.yml.
  • Environment variables defined in the calling workflow get passed to actions, while with reusable workflow we had to convert variables to inputs.

Drawbacks:

  • runs-on cannot use environment variables defined in the workflow

https://issues.apache.org/jira/browse/HDDS-17509

How was this patch tested?

CI:
https://github.com/adoroszlai/ozone/actions/runs/42025404878

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for working on this! @adoroszlai I found a few spots where steps from check.yml may not have carried over, see inline comments. 🙏

if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: ${{ (inputs.split && format('{0}-{1}', inputs.script, inputs.split)) || inputs.script }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed in the CI run that acceptance-ozone/test-s3a.sh was actually failed because artifact name is not valid. It's green because of continue-on-error.

Should we keep the name sanitizing from the old Calculate artifact name step?

Image

uses: actions/checkout@v7
with:
persist-credentials: false
ref: ${{ env.SHA }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we set SHA from needs.build-info.outputs.sha somewhere? I couldn't find it defined.

Comment thread .github/workflows/ci.yml
timeout-minutes: 60
steps:
- name: Run check
uses: $/.github/actions/check

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should the Hadoop/Ranger cache restore move here? The old check.yml steps seem to be dropped.

Comment thread .github/workflows/ci.yml
java-version: ${{ matrix.java }}
needs-ozone-source-tarball: true
ratis-args: ${{ inputs.ratis_args }}
runner: ${{ matrix.os }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if runs-on should use matrix.os here? The action has no runner input. Currently, the compile (21, macos-15) ran on ubuntu-24.04.

Image

start_end::group_start "Check if everything should be run"
local pattern_array=(
"^.github/workflows/check.yml"
"^.github/actions/check/action.yml"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be action.yaml?

Suggested change
"^.github/actions/check/action.yml"
"^.github/actions/check/action.yaml"

Comment thread .github/workflows/ci.yml
# `env` context cannot be used when calling reusable workflow, so we need to convert these to `outputs`
build-args: ${{ env.BUILD_ARGS }}
java-version: ${{ env.TEST_JAVA_VERSION }}
with-coverage: ${{ env.OZONE_WITH_COVERAGE }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I think we can probably drop the build-args, java-version and with-coverage here since jobs now read env directly, so they and the comment above look unused.

@adoroszlai
adoroszlai marked this pull request as draft November 6, 2026 07:44
@adoroszlai

adoroszlai commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @chihsuan for the review, very helpful as usual. Will address your comments, but also need to split the single check action. Also, this will conflict with #11949, so keeping draft until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants