Skip to content

CNTRLPLANE-3352: Add reusable GHA workflow definitions - #8386

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:migrate-gh-jobs-reusable
Apr 30, 2026
Merged

CNTRLPLANE-3352: Add reusable GHA workflow definitions#8386
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
bryan-cox:migrate-gh-jobs-reusable

Conversation

@bryan-cox

@bryan-cox bryan-cox commented Apr 30, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Adds 9 dormant reusable workflow files (*-reusable.yaml) that will be referenced by caller stubs in a follow-up PR. This is the first of two PRs implementing reusable workflows to eliminate the verify-workflows Prow job and forced rebases.

Workflows added:

  • codespell-reusable.yaml
  • cpo-container-sync-reusable.yaml
  • docs-build-reusable.yaml
  • envtest-kube-reusable.yaml
  • envtest-ocp-reusable.yaml
  • gitlint-reusable.yaml
  • lint-reusable.yaml
  • test-reusable.yaml
  • verify-reusable.yaml

Improvements over originals:

  • lint: adds persist-credentials: false (was missing in original)
  • test: pins actions/setup-go to SHA 40f1582b2485089dde7abd97c1529aa768e1baff (v5.6.0)
  • envtest-kube/ocp: updates change detection grep to match both original and reusable filenames

These files are inert until callers reference them. The follow-up PR (#8387) converts all 9 callers to thin stubs that uses: ...@main.

Why two PRs: The @main ref in caller stubs requires the reusable files to exist on main first. Merging the reusable files first avoids this bootstrap problem.

Future release branches (4.23+): Will need push/PR trigger branch lists updated in both caller and reusable files.

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3352

Special notes for your reviewer:

  • These files are dormant — nothing calls them yet. They will only activate when the follow-up PR converts callers to use @main refs.
  • The envtest and test reusable workflows have both workflow_call and push triggers so direct pushes to main/release branches still work after the caller conversion.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code

Add dormant reusable workflow files that will be referenced by caller
stubs in a follow-up commit. This two-step approach avoids the bootstrap
problem where @main refs would fail if reusable files don't exist on
main yet.

Reusable workflows include three improvements over the originals:
- lint: add persist-credentials: false (was missing)
- test: pin actions/setup-go to SHA (v5.6.0)
- envtest-kube/ocp: update change detection grep to match both
  original and reusable filenames

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot

openshift-ci-robot commented Apr 30, 2026

Copy link
Copy Markdown

@bryan-cox: This pull request references CNTRLPLANE-3352 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Adds 9 dormant reusable workflow files (*-reusable.yaml) that will be referenced by caller stubs in a follow-up PR. This is the first of two PRs implementing reusable workflows to eliminate the verify-workflows Prow job and forced rebases.

Workflows added:

  • codespell-reusable.yaml
  • cpo-container-sync-reusable.yaml
  • docs-build-reusable.yaml
  • envtest-kube-reusable.yaml
  • envtest-ocp-reusable.yaml
  • gitlint-reusable.yaml
  • lint-reusable.yaml
  • test-reusable.yaml
  • verify-reusable.yaml

Improvements over originals:

  • lint: adds persist-credentials: false (was missing in original)
  • test: pins actions/setup-go to SHA 40f1582b2485089dde7abd97c1529aa768e1baff (v5.6.0)
  • envtest-kube/ocp: updates change detection grep to match both original and reusable filenames

These files are inert until callers reference them. The follow-up PR (#2) converts all 9 callers to thin stubs that uses: ...@main.

Why two PRs: The @main ref in caller stubs requires the reusable files to exist on main first. Merging the reusable files first avoids this bootstrap problem.

Future release branches (4.23+): Will need push/PR trigger branch lists updated in both caller and reusable files.

Which issue(s) this PR fixes:

Fixes CNTRLPLANE-3352

Special notes for your reviewer:

  • These files are dormant — nothing calls them yet. They will only activate when the follow-up PR converts callers to use @main refs.
  • The envtest and test reusable workflows have both workflow_call and push triggers so direct pushes to main/release branches still work after the caller conversion.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 30, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 30, 2026
@openshift-ci

openshift-ci Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request introduces nine new reusable GitHub Actions workflows that standardize CI/CD operations across the repository. The workflows include checks for code spelling, CPO container synchronization, documentation building, Kubernetes and OpenShift Container Platform API validation via envtest, git commit linting, general linting, unit testing with coverage reporting, and code verification. Each workflow is triggered via workflow_call and configured with appropriate timeouts, permissions, dependencies, and job parameters specific to its purpose.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically summarizes the main change: adding nine reusable GitHub Actions workflow definition files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR adds only GitHub Actions workflow YAML files with no Go test files or Ginkgo test code.
Test Structure And Quality ✅ Passed This check is not applicable to the PR. The PR contains only GitHub Actions workflow YAML files, not Ginkgo test code.
Microshift Test Compatibility ✅ Passed This PR adds nine new GitHub Actions reusable workflow files that contain only YAML configuration for CI/CD pipeline definitions with no Ginkgo e2e test code.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only GitHub Actions workflow YAML files; no Ginkgo e2e test files or Go test code is present.
Topology-Aware Scheduling Compatibility ✅ Passed This pull request adds GitHub Actions reusable workflow files for CI/CD automation, not Kubernetes deployment manifests or controllers. The workflow files contain only CI/CD steps and no Kubernetes scheduling directives.
Ote Binary Stdout Contract ✅ Passed The custom check for OTE Binary Stdout Contract is not applicable to this PR. The PR adds only GitHub Actions workflow YAML files, not executable binaries or Go source code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR adds only GitHub Actions reusable workflow configuration files (.yaml) in .github/workflows/, not Ginkgo e2e test code. The custom check is specifically designed to assess Ginkgo e2e tests (Go files with patterns like It(), Describe(), Context(), When()) for IPv4 assumptions and external connectivity requirements. Since no test files are added in this PR, the check does not apply.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Comment @coderabbitai help to get the list of available commands and usage tips.

@bryan-cox
bryan-cox marked this pull request as ready for review April 30, 2026 19:49
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 30, 2026
@openshift-ci

openshift-ci Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2026
@openshift-ci
openshift-ci Bot requested review from devguyio and sjenning April 30, 2026 19:52
@csrwng

csrwng commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@bryan-cox

Copy link
Copy Markdown
Member Author

/area ci-tooling

@openshift-ci openshift-ci Bot added area/ci-tooling Indicates the PR includes changes for CI or tooling and removed do-not-merge/needs-area labels Apr 30, 2026
@bryan-cox

Copy link
Copy Markdown
Member Author

/verified bypass

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 30, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@bryan-cox: The verified label has been added.

Details

In response to this:

/verified bypass

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/envtest-ocp-reusable.yaml:
- Around line 27-44: The workflow's ref and event handling uses context fields
that can be empty in reusable/workflow_call contexts (EVENT_NAME, CREATED,
PR_DIFF_REF, PUSH_DIFF_REF) which breaks the git diff; fix by computing refs
from explicit SHAs: set CREATED based on github.event_name ==
'workflow_dispatch' (don’t rely on github.event.created), build PR_DIFF_REF
using github.event.pull_request.base.sha...github.sha (use
github.event.pull_request.base.sha only when pull_request exists), build
PUSH_DIFF_REF using github.event.before..github.sha (and if github.event.before
is empty fall back to github.sha..github.sha), then use that computed ref for
git diff --name-only; update the ref selection logic (the ref variable and the
git diff call) to use these explicit SHA-based values so git diff never receives
an empty ref.

In @.github/workflows/lint-reusable.yaml:
- Line 19: Guard the git fetch step that uses the refspec "git fetch origin ${{
github.base_ref }}:${{ github.base_ref }}" so it only runs when github.base_ref
is non-empty (e.g., PR runs); update the workflow step that contains that run
command to check the variable first (either with an if: conditional on
github.base_ref or by wrapping the fetch in a shell check like "if [ -n '${{
github.base_ref }}' ]; then ...; fi") to avoid executing "git fetch origin :"
when base_ref is empty.

In @.github/workflows/verify-reusable.yaml:
- Around line 19-32: The git-clean validation block (the sequence starting with
the git update-index --refresh / git diff-* / STATUS checks) is placed before
running make staticcheck, make fmt, and make vet so any changes those targets
introduce won't be detected; move that entire git-state check block to after the
make staticcheck, make fmt, and make vet runs so the workflow re-checks the
working tree after formatting/linting, ensuring no changes remain uncommitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9398d6af-a9cb-4815-8b6c-03a033bc465a

📥 Commits

Reviewing files that changed from the base of the PR and between 540acc8 and 3b1adfa.

📒 Files selected for processing (9)
  • .github/workflows/codespell-reusable.yaml
  • .github/workflows/cpo-container-sync-reusable.yaml
  • .github/workflows/docs-build-reusable.yaml
  • .github/workflows/envtest-kube-reusable.yaml
  • .github/workflows/envtest-ocp-reusable.yaml
  • .github/workflows/gitlint-reusable.yaml
  • .github/workflows/lint-reusable.yaml
  • .github/workflows/test-reusable.yaml
  • .github/workflows/verify-reusable.yaml

Comment on lines +27 to +44
EVENT_NAME: ${{ github.event_name }}
CREATED: ${{ github.event.created }}
PR_DIFF_REF: origin/${{ github.base_ref }}...HEAD
PUSH_DIFF_REF: ${{ github.event.before }}..HEAD
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ] || [ "$CREATED" = "true" ]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
ref="$PUSH_DIFF_REF"
if [ "$EVENT_NAME" = "pull_request" ]; then
ref="$PR_DIFF_REF"
fi
if git diff --name-only "$ref" | grep -qE '^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-ocp(-reusable)?\.yaml$)'; then
echo "should_run=true"
else
echo "should_run=false"
fi >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For a called reusable workflow, what are the documented behaviors of github.event_name, github.eventpayload inheritance, andgithub.base_ref availability?

💡 Result:

In a called reusable workflow (triggered by workflow_call): - github.event_name: Inherits the event name from the calling (top-level) workflow. It is NOT workflow_call; instead, it reflects the original trigger event of the caller (e.g., push, pull_request, workflow_dispatch). This is confirmed by GitHub Docs stating the github context is associated with the caller workflow, and practical evidence from GitHub issues where echo ${{ github.event_name }} in called workflows shows the caller's event. - github.event payload: Fully inherits the event payload from the calling workflow. Official GitHub Docs explicitly state: "When a workflow is triggered with the workflow_call event, the event payload in the called workflow is the same event payload from the calling workflow." Also, GITHUB_SHA and GITHUB_REF are the same as the caller. - github.base_ref availability: Available if the inherited github.event_name is pull_request or pull_request_target (from the caller). Per contexts docs, github.base_ref is set for those event types, containing the target branch of the PR. For other inherited events (e.g., push), it is empty/undefined.

Citations:


🏁 Script executed:

find .github/workflows -type f -name "*.yaml" -o -name "*.yml" | head -20

Repository: openshift/hypershift

Length of output: 817


🏁 Script executed:

cat -n .github/workflows/envtest-kube-reusable.yaml | head -80

Repository: openshift/hypershift

Length of output: 3210


🏁 Script executed:

cat -n .github/workflows/envtest-ocp-reusable.yaml | head -80

Repository: openshift/hypershift

Length of output: 3266


🏁 Script executed:

cat -n .github/workflows/envtest-ocp.yaml | head -40

Repository: openshift/hypershift

Length of output: 1373


🏁 Script executed:

git log --oneline -20 -- .github/workflows/envtest-kube-reusable.yaml .github/workflows/envtest-ocp-reusable.yaml 2>/dev/null || echo "Git history not available"

Repository: openshift/hypershift

Length of output: 136


🏁 Script executed:

cd .github/workflows && git log --all --source --grep="workflow_call\|ref-resolution" -i --oneline 2>/dev/null | head -20 || echo "No relevant commits found"

Repository: openshift/hypershift

Length of output: 46


Apply ref-resolution fix for workflow_call context in this reusable workflow.

This workflow has the same event/ref handling issues that affect workflow_call contexts. When called as a reusable workflow with push, pull_request, or workflow_dispatch triggers, the current code relies on context variables that may be undefined:

  • Line 29: github.base_ref is only populated for pull_request events; it will be empty in other contexts
  • Line 28: github.event.created is only set for workflow_dispatch events
  • The ref resolution logic doesn't account for all event types properly

This causes git diff to fail or produce incorrect results, potentially skipping OCP envtest runs unintentionally.

Use direct SHA references instead of event name/payload assumptions:

Suggested fix
       - name: Check for relevant file changes
         id: check
         env:
-          EVENT_NAME: ${{ github.event_name }}
-          CREATED: ${{ github.event.created }}
-          PR_DIFF_REF: origin/${{ github.base_ref }}...HEAD
-          PUSH_DIFF_REF: ${{ github.event.before }}..HEAD
+          PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
+          PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+          PUSH_BEFORE_SHA: ${{ github.event.before }}
         run: |
-          if [ "$EVENT_NAME" = "workflow_dispatch" ] || [ "$CREATED" = "true" ]; then
-            echo "should_run=true" >> "$GITHUB_OUTPUT"
-            exit 0
-          fi
-          ref="$PUSH_DIFF_REF"
-          if [ "$EVENT_NAME" = "pull_request" ]; then
-            ref="$PR_DIFF_REF"
-          fi
+          set -euo pipefail
+          if [ -n "${PR_BASE_SHA:-}" ] && [ -n "${PR_HEAD_SHA:-}" ]; then
+            ref="${PR_BASE_SHA}...${PR_HEAD_SHA}"
+          elif [ -n "${PUSH_BEFORE_SHA:-}" ] && [ "$PUSH_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
+            ref="${PUSH_BEFORE_SHA}..HEAD"
+          else
+            echo "should_run=true" >> "$GITHUB_OUTPUT"
+            exit 0
+          fi
           if git diff --name-only "$ref" | grep -qE '^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-ocp(-reusable)?\.yaml$)'; then
             echo "should_run=true"
           else
             echo "should_run=false"
           fi >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
EVENT_NAME: ${{ github.event_name }}
CREATED: ${{ github.event.created }}
PR_DIFF_REF: origin/${{ github.base_ref }}...HEAD
PUSH_DIFF_REF: ${{ github.event.before }}..HEAD
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ] || [ "$CREATED" = "true" ]; then
echo "should_run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
ref="$PUSH_DIFF_REF"
if [ "$EVENT_NAME" = "pull_request" ]; then
ref="$PR_DIFF_REF"
fi
if git diff --name-only "$ref" | grep -qE '^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-ocp(-reusable)?\.yaml$)'; then
echo "should_run=true"
else
echo "should_run=false"
fi >> "$GITHUB_OUTPUT"
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PUSH_BEFORE_SHA: ${{ github.event.before }}
run: |
set -euo pipefail
if [ -n "${PR_BASE_SHA:-}" ] && [ -n "${PR_HEAD_SHA:-}" ]; then
ref="${PR_BASE_SHA}...${PR_HEAD_SHA}"
elif [ -n "${PUSH_BEFORE_SHA:-}" ] && [ "$PUSH_BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
ref="${PUSH_BEFORE_SHA}..HEAD"
else
echo "should_run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if git diff --name-only "$ref" | grep -qE '^(api/|test/envtest/|cmd/install/assets/crds/hypershift-operator/tests/|karpenter-operator/controllers/karpenter/assets/tests/|\.github/workflows/envtest-ocp(-reusable)?\.yaml$)'; then
echo "should_run=true"
else
echo "should_run=false"
fi >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/envtest-ocp-reusable.yaml around lines 27 - 44, The
workflow's ref and event handling uses context fields that can be empty in
reusable/workflow_call contexts (EVENT_NAME, CREATED, PR_DIFF_REF,
PUSH_DIFF_REF) which breaks the git diff; fix by computing refs from explicit
SHAs: set CREATED based on github.event_name == 'workflow_dispatch' (don’t rely
on github.event.created), build PR_DIFF_REF using
github.event.pull_request.base.sha...github.sha (use
github.event.pull_request.base.sha only when pull_request exists), build
PUSH_DIFF_REF using github.event.before..github.sha (and if github.event.before
is empty fall back to github.sha..github.sha), then use that computed ref for
git diff --name-only; update the ref selection logic (the ref variable and the
git diff call) to use these explicit SHA-based values so git diff never receives
an empty ref.

with:
fetch-depth: 0
persist-credentials: false
- run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard base-ref fetch to avoid invalid refspec failures.

Line 19 can fail when github.base_ref is empty (non-PR caller), causing git fetch origin :. Add a guard before fetching.

Proposed fix
-      - run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
+      - run: |
+          if [ -n "${{ github.base_ref }}" ]; then
+            git fetch origin "${{ github.base_ref }}:${{ github.base_ref }}"
+          fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/lint-reusable.yaml at line 19, Guard the git fetch step
that uses the refspec "git fetch origin ${{ github.base_ref }}:${{
github.base_ref }}" so it only runs when github.base_ref is non-empty (e.g., PR
runs); update the workflow step that contains that run command to check the
variable first (either with an if: conditional on github.base_ref or by wrapping
the fetch in a shell check like "if [ -n '${{ github.base_ref }}' ]; then ...;
fi") to avoid executing "git fetch origin :" when base_ref is empty.

Comment on lines +19 to +32
- run: |
git update-index --refresh
git diff-index --cached --quiet --ignore-submodules HEAD --
git diff-files --quiet --ignore-submodules
git diff --exit-code HEAD --
STATUS=$(git status -s)
if [ -n "$STATUS" ]; then
echo "untracked files detected:"
echo "$STATUS"
exit 1
fi
- run: make staticcheck
- run: make fmt
- run: make vet

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Git-clean validation is in the wrong position.

The git-state check runs before make fmt/make vet. If Line 31 (make fmt) changes files, this workflow won’t catch it. Move the git-clean block to the end.

Proposed fix
       - run: make generate update
-      - run: |
-          git update-index --refresh
-          git diff-index --cached --quiet --ignore-submodules HEAD --
-          git diff-files --quiet --ignore-submodules
-          git diff --exit-code HEAD --
-          STATUS=$(git status -s)
-          if [ -n "$STATUS" ]; then
-            echo "untracked files detected:"
-            echo "$STATUS"
-            exit 1
-          fi
       - run: make staticcheck
       - run: make fmt
       - run: make vet
+      - run: |
+          git update-index --refresh
+          git diff-index --cached --quiet --ignore-submodules HEAD --
+          git diff-files --quiet --ignore-submodules
+          git diff --exit-code HEAD --
+          STATUS=$(git status -s)
+          if [ -n "$STATUS" ]; then
+            echo "untracked files detected:"
+            echo "$STATUS"
+            exit 1
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: |
git update-index --refresh
git diff-index --cached --quiet --ignore-submodules HEAD --
git diff-files --quiet --ignore-submodules
git diff --exit-code HEAD --
STATUS=$(git status -s)
if [ -n "$STATUS" ]; then
echo "untracked files detected:"
echo "$STATUS"
exit 1
fi
- run: make staticcheck
- run: make fmt
- run: make vet
- run: make staticcheck
- run: make fmt
- run: make vet
- run: |
git update-index --refresh
git diff-index --cached --quiet --ignore-submodules HEAD --
git diff-files --quiet --ignore-submodules
git diff --exit-code HEAD --
STATUS=$(git status -s)
if [ -n "$STATUS" ]; then
echo "untracked files detected:"
echo "$STATUS"
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/verify-reusable.yaml around lines 19 - 32, The git-clean
validation block (the sequence starting with the git update-index --refresh /
git diff-* / STATUS checks) is placed before running make staticcheck, make fmt,
and make vet so any changes those targets introduce won't be detected; move that
entire git-state check block to after the make staticcheck, make fmt, and make
vet runs so the workflow re-checks the working tree after formatting/linting,
ensuring no changes remain uncommitted.

@bryan-cox

Copy link
Copy Markdown
Member Author

/override "ci/prow/verify-workflows"

@openshift-ci

openshift-ci Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/verify-workflows

Details

In response to this:

/override "ci/prow/verify-workflows"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

@bryan-cox: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 5e3afb8 into openshift:main Apr 30, 2026
19 checks passed
@bryan-cox
bryan-cox deleted the migrate-gh-jobs-reusable branch April 30, 2026 20:32
openshift-merge-bot Bot pushed a commit to openshift/release that referenced this pull request May 1, 2026
…#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
mhanss pushed a commit to mhanss/release that referenced this pull request May 26, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
andrej1991 pushed a commit to andrej1991/release that referenced this pull request Jul 6, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
TimurMP pushed a commit to TimurMP/release that referenced this pull request Jul 8, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
SachinNinganure pushed a commit to SachinNinganure/release that referenced this pull request Jul 20, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
malingatembo pushed a commit to malingatembo/release that referenced this pull request Aug 5, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
TimurMP pushed a commit to TimurMP/release that referenced this pull request Sep 5, 2026
…openshift#78674)

GHA workflows in openshift/hypershift now use reusable workflow callers
that reference definitions via @main, so PRs always run the latest
workflow version without needing to rebase. The verify-workflows job
that enforced rebasing is no longer needed.

See openshift/hypershift#8386 and openshift/hypershift#8387.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci-tooling Indicates the PR includes changes for CI or tooling jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants