Skip to content

fix(ci): add GHA structured output to verify-ci#9049

Open
devguyio wants to merge 2 commits into
openshift:mainfrom
devguyio:verify-ci-gha-output
Open

fix(ci): add GHA structured output to verify-ci#9049
devguyio wants to merge 2 commits into
openshift:mainfrom
devguyio:verify-ci-gha-output

Conversation

@devguyio

@devguyio devguyio commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add run-verify-step Makefile function that detects GITHUB_ACTIONS env var
  • When in GHA: wraps each step with ::group::/::endgroup:: for collapsible log sections and emits ::error:: on failure
  • When local or Prow: plain $(MAKE) calls, no change in behavior
  • Converts verify-ci from a prerequisite chain to explicit step calls so each step gets its own group

Test plan

  • make verify-ci locally produces plain output (no :: markers)
  • GITHUB_ACTIONS=true make verify-ci produces ::group::Verify: <step> / ::endgroup:: for each step
  • On failure, ::error::Verify step '<step>' failed is emitted after closing the group

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Improved automated test execution with clearer progress, failure reporting, and CI-friendly output.
    • Updated service validation expectations to reflect the correct service port configuration.
  • Chores

    • Streamlined source verification checks and made failures easier to identify.
    • Updated CI workflow labeling for clearer visibility into source freshness checks.
    • Standardized command execution across verification and test runs.

@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

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The Makefile now uses Bash, records verification failures, detects step-generated changes in GitHub Actions, and reports grouped annotations. CI verification and test shards use shared failure handling. Tests run through a built gotestsum binary with environment-specific formatting. The verification workflow metadata was renamed, and one service test expectation now uses port 9999. An import entry in support/util/util.go was updated.

Sequence Diagram(s)

sequenceDiagram
  participant VerifyCI as verify-ci
  participant RunStep as run-step
  participant Target as verification target
  participant CheckFailures as check-failures
  VerifyCI->>RunStep: run named verification target
  RunStep->>Target: execute target and record failures
  RunStep->>RunStep: detect changed files under GitHub Actions
  VerifyCI->>CheckFailures: evaluate recorded failures
Loading

Possibly related PRs

Suggested reviewers: enxebre, bryan-cox

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main CI change: adding GitHub Actions structured output to verify-ci.
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 No Ginkgo titles were added; the changed test file uses static t.Run case names, with no dynamic or generated values in titles.
Test Structure And Quality ✅ Passed PASS: The changed test is a table-driven unit test with no cluster waits/resources, and it matches existing package patterns; no new structure/quality issues.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: Diff only touches Makefile, a workflow, a test expectation, and an import; no pod specs, replicas, node selectors, anti-affinity, or topology logic changed.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the touched test is a standard Go unit test using t.Run, with no IPv4 or external connectivity assumptions.
No-Weak-Crypto ✅ Passed Touched files are Makefile/workflow/test-only; scans found no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or secret/token comparisons added.
Container-Privileges ✅ Passed PR diff only changes Makefile, workflow, a test, and util import; no container/K8s manifest privilege flags appear in the diff.
No-Sensitive-Data-In-Logs ✅ Passed No new logging of secrets/PII/customer data was added; the new GHA output only reports step names, file paths, and hashes, and other touched files don’t log data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
.github/workflows/verify.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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

@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.

🧹 Nitpick comments (1)
Makefile (1)

174-183: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Resolve the checkmake max-body-length warning.

verify-ci now has nine recipe lines while the configured limit is five. Keep the required ordered execution, but move the step list into a helper construct or add a narrowly scoped, documented exemption.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 174 - 183, Reduce the recipe body of verify-ci to
satisfy checkmake’s five-line limit while preserving the current ordered
execution of all nine run-verify-step targets. Move the step list into a
dedicated helper construct, or add a narrowly scoped documented exemption if
that matches the Makefile’s existing conventions.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Makefile`:
- Around line 174-183: Reduce the recipe body of verify-ci to satisfy
checkmake’s five-line limit while preserving the current ordered execution of
all nine run-verify-step targets. Move the step list into a dedicated helper
construct, or add a narrowly scoped documented exemption if that matches the
Makefile’s existing conventions.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 8df14bea-c7eb-48ae-a9d2-a098e947c424

📥 Commits

Reviewing files that changed from the base of the PR and between 6919168 and 20f81b2.

📒 Files selected for processing (1)
  • Makefile

@openshift-ci
openshift-ci Bot requested review from bryan-cox and enxebre July 21, 2026 19:16
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: devguyio

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 Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.44%. Comparing base (0a7e9d4) to head (ecc4742).
⚠️ Report is 4 commits behind head on main.

⚠️ Current head ecc4742 differs from pull request most recent head 61c15f0

Please upload reports for the commit 61c15f0 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9049   +/-   ##
=======================================
  Coverage   44.44%   44.44%           
=======================================
  Files         774      774           
  Lines       96977    96977           
=======================================
  Hits        43105    43105           
  Misses      50897    50897           
  Partials     2975     2975           
Flag Coverage Δ
cmd-support 38.39% <ø> (ø)
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.22% <ø> (ø)
other 32.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devguyio
devguyio force-pushed the verify-ci-gha-output branch from 20f81b2 to c6e418d Compare July 21, 2026 19:27

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/v2/kas/config_test.go`:
- Around line 30-32: Update the test case using modifyKasConfig so the default
test compares against the valid defaultKASConfig() bind address and remains
green with empty parameters. Move the deliberately invalid
ServingInfo.BindAddress value into a separate opt-in or manual test/CI fixture
that specifically exercises failure annotations.
🪄 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: 152fe08f-2797-4712-bb22-eebdb4557d58

📥 Commits

Reviewing files that changed from the base of the PR and between c6e418d and ecc4742.

📒 Files selected for processing (1)
  • control-plane-operator/controllers/hostedcontrolplane/v2/kas/config_test.go

Comment on lines +30 to +32
expected: modifyKasConfig(defaultKASConfig(), func(kasc *kcpv1.KubeAPIServerConfig) {
kasc.ServingInfo.BindAddress = "DELIBERATELY_BROKEN_TO_TEST_GHA_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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Do not commit a permanently failing default test.

With empty parameters, this case compares the generated config against a deliberately invalid bind address instead of defaultKASConfig()’s normal 0.0.0.0:0, so cmp.Diff will fail in every environment—not only GitHub Actions. Keep the production test green and exercise failure annotations with a separate opt-in/manual test or CI fixture.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@control-plane-operator/controllers/hostedcontrolplane/v2/kas/config_test.go`
around lines 30 - 32, Update the test case using modifyKasConfig so the default
test compares against the valid defaultKASConfig() bind address and remains
green with empty parameters. Move the deliberately invalid
ServingInfo.BindAddress value into a separate opt-in or manual test/CI fixture
that specifically exercises failure annotations.

@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release and removed do-not-merge/needs-area labels Jul 21, 2026
@deads2k

deads2k commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

/test

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@deads2k: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

/test e2e-aks
/test e2e-aks-4-22
/test e2e-aks-override
/test e2e-aws
/test e2e-aws-4-22
/test e2e-aws-override
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-v2-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-gke
/test images
/test okd-scos-images
/test security
/test unit
/test verify
/test verify-deps

The following commands are available to trigger optional jobs:

/test address-review-comments
/test agentic-qe-aws
/test e2e-agent-connected-ovn-ipv4-metal-backuprestore
/test e2e-aro-hcp
/test e2e-aws-autonode
/test e2e-aws-external-oidc-techpreview
/test e2e-aws-metrics
/test e2e-aws-minimal
/test e2e-aws-ovn-conformance-ccm
/test e2e-aws-ovn-conformance-techpreview
/test e2e-aws-techpreview
/test e2e-azure-aks-external-oidc-techpreview
/test e2e-azure-aks-ovn-conformance
/test e2e-azure-aks-ovn-conformance-fips
/test e2e-azure-kubevirt-ovn
/test e2e-conformance
/test e2e-conformance-fips
/test e2e-kubevirt-aws-ovn
/test e2e-kubevirt-azure-ovn
/test e2e-kubevirt-metal-ovn-backuprestore
/test e2e-openstack-aws
/test e2e-openstack-aws-conformance
/test e2e-openstack-aws-csi-cinder
/test e2e-openstack-aws-csi-manila
/test e2e-openstack-aws-nfv
/test e2e-v2-aws-backuprestore
/test okd-scos-e2e-aws-ovn
/test reqserving-e2e-aws

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-hypershift-main-images
pull-ci-openshift-hypershift-main-okd-scos-images
pull-ci-openshift-hypershift-main-security
pull-ci-openshift-hypershift-main-verify-deps
Details

In response to this:

/test

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.

@devguyio
devguyio force-pushed the verify-ci-gha-output branch from ecc4742 to 61c15f0 Compare July 22, 2026 09:22
@openshift-ci openshift-ci Bot added the area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release label Jul 22, 2026

@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: 4

🧹 Nitpick comments (1)
Makefile (1)

165-214: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated run-step logic across ifdef/else branches.

The two macro definitions are nearly identical (172-178 vs 197-203 for snapshotting/dirty-detection), differing only in the group/annotation echoes. Checking $$GITHUB_ACTIONS at shell runtime instead of ifdef GITHUB_ACTIONS at Make-parse time would collapse this into a single definition and remove the duplication (also incidentally fixes the checkmake body-length warning on verify-ci by shrinking overall macro size).

♻️ Proposed consolidation
-ifdef GITHUB_ACTIONS
 define run-step
 	`@git` diff --name-only HEAD 2>/dev/null | while read f; do echo "$$f $$(git hash-object "$$f" 2>/dev/null)"; done > $(SNAPSHOT_FILE); \
 	git ls-files --others --exclude-standard 2>/dev/null | while read f; do echo "$$f $$(git hash-object "$$f" 2>/dev/null)"; done >> $(SNAPSHOT_FILE); \
-	echo "::group::$(1)"; \
+	if [ -n "$$GITHUB_ACTIONS" ]; then echo "::group::$(1)"; fi; \
 	$(MAKE) $(1) 2>&1; rc=$$?; \
 	new_dirty=""; \
 	for f in $$(git diff --name-only HEAD 2>/dev/null) $$(git ls-files --others --exclude-standard 2>/dev/null); do \
 		cur_hash=$$(git hash-object "$$f" 2>/dev/null); \
 		prev_hash=$$(grep "^$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \
 		if [ "$$cur_hash" != "$$prev_hash" ]; then \
 			new_dirty="$$new_dirty $$f"; \
 		fi; \
 	done; \
 	if [ $$rc -ne 0 ]; then \
-		echo "::error::Step '$(1)' failed"; \
+		if [ -n "$$GITHUB_ACTIONS" ]; then echo "::error::Step '$(1)' failed"; else echo "Step '$(1)' failed"; fi; \
 		echo "$(1)" >> $(FAILURES_FILE); \
 	fi; \
 	if [ -n "$$new_dirty" ]; then \
-		for f in $$new_dirty; do \
-			echo "::error file=$$f::File changed during '$(1)'. Run 'make $(1)' locally."; \
-		done; \
+		if [ -n "$$GITHUB_ACTIONS" ]; then \
+			for f in $$new_dirty; do echo "::error file=$$f::File changed during '$(1)'. Run 'make $(1)' locally."; done; \
+		else \
+			echo "Files changed during '$(1)'. Run 'make $(1)' locally:"; \
+			echo "$$new_dirty" | tr ' ' '\n' | grep -v '^$$'; \
+		fi; \
 		echo "$(1):dirty" >> $(FAILURES_FILE); \
-	fi; \
-	echo "::endgroup::"
+	fi; \
+	if [ -n "$$GITHUB_ACTIONS" ]; then echo "::endgroup::"; fi
 endef
-else
-define run-step
-	...
-endef
-endif
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 165 - 214, Consolidate the duplicated run-step macro
into one definition instead of separate ifdef GITHUB_ACTIONS branches. Preserve
the shared snapshot, nested make, failure tracking, and dirty-file detection
logic, while selecting the GitHub Actions grouping/error annotations versus
local output through a shell-time GITHUB_ACTIONS check within run-step.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 172-178: Fix dirty-file detection in both mirrored loops by
preserving filenames containing spaces, matching snapshot paths literally rather
than as regular expressions, and assigning a distinct sentinel when git
hash-object cannot hash a missing file so deletions are added to new_dirty.
Update the loops around cur_hash, prev_hash, and new_dirty consistently in both
blocks.
- Around line 162-163: Change the top-level FAILURES_FILE and SNAPSHOT_FILE
definitions to be exported so recursive invocations through run-step reuse the
parent’s temporary files instead of creating new ones during Makefile parsing.
Update the cleanup logic in check-failures to remove both files, including the
snapshot file, while preserving existing failure handling.
- Around line 228-239: Update the verify-ci recipe to restore the explicit
full-tree cleanliness check after the existing run-step checks and before
check-failures, using the established verify-git-clean target so pre-existing
staged, unstaged, and untracked changes are detected.

In `@support/certs/tls_test.go`:
- Around line 229-232: Remove the unconditional failing TestDeliberatelyBroken
test from the test suite, or gate its failure behind an explicit opt-in
test-only mechanism so normal run-tests and check-failures executions pass.

---

Nitpick comments:
In `@Makefile`:
- Around line 165-214: Consolidate the duplicated run-step macro into one
definition instead of separate ifdef GITHUB_ACTIONS branches. Preserve the
shared snapshot, nested make, failure tracking, and dirty-file detection logic,
while selecting the GitHub Actions grouping/error annotations versus local
output through a shell-time GITHUB_ACTIONS check within run-step.
🪄 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: 435fce14-f8ec-4942-97e4-5801c37bac25

📥 Commits

Reviewing files that changed from the base of the PR and between ecc4742 and 61c15f0.

📒 Files selected for processing (3)
  • Makefile
  • support/certs/tls_test.go
  • support/util/util.go

Comment thread Makefile
Comment on lines +162 to +163
FAILURES_FILE := $(shell mktemp)
SNAPSHOT_FILE := $(shell mktemp)

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Temp files leak on every invocation, amplified by recursive $(MAKE) calls.

FAILURES_FILE/SNAPSHOT_FILE are created via $(shell mktemp) in a := assignment, which runs at Makefile-parse time for every make invocation, even unrelated targets. Worse, run-step invokes $(MAKE) $(1) (lines 231-238, 501-502), and each such sub-make re-parses the whole Makefile from scratch, re-running mktemp again — so a single make verify-ci run leaks roughly 2×(N+1) temp files (8 steps → ~18 files), and SNAPSHOT_FILE is never removed anywhere (check-failures, lines 216-226, only cleans FAILURES_FILE).

🛠️ Proposed fix: export so sub-makes reuse the parent's files, and clean up both
-FAILURES_FILE := $(shell mktemp)
-SNAPSHOT_FILE := $(shell mktemp)
+FAILURES_FILE ?= $(shell mktemp)
+SNAPSHOT_FILE ?= $(shell mktemp)
+export FAILURES_FILE SNAPSHOT_FILE
 define check-failures
 	`@if` [ -s $(FAILURES_FILE) ]; then \
 		echo ""; \
 		echo "Failed steps:"; \
 		cat $(FAILURES_FILE); \
 		rm -f $(FAILURES_FILE); \
+		rm -f $(SNAPSHOT_FILE); \
 		exit 1; \
 	else \
 		rm -f $(FAILURES_FILE); \
+		rm -f $(SNAPSHOT_FILE); \
 	fi
 endef
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 162 - 163, Change the top-level FAILURES_FILE and
SNAPSHOT_FILE definitions to be exported so recursive invocations through
run-step reuse the parent’s temporary files instead of creating new ones during
Makefile parsing. Update the cleanup logic in check-failures to remove both
files, including the snapshot file, while preserving existing failure handling.

Comment thread Makefile
Comment on lines +172 to +178
for f in $$(git diff --name-only HEAD 2>/dev/null) $$(git ls-files --others --exclude-standard 2>/dev/null); do \
cur_hash=$$(git hash-object "$$f" 2>/dev/null); \
prev_hash=$$(grep "^$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \
if [ "$$cur_hash" != "$$prev_hash" ]; then \
new_dirty="$$new_dirty $$f"; \
fi; \
done; \

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Dirty-file detection has a few correctness gaps (also present in the mirrored block at lines 197-203).

  • grep "^$$f " treats the filename as a basic regex, so a literal . (present in nearly every Go/YAML filename) matches any character, risking false matches against a different file with a similar name.
  • The for f in $$(git diff ...) $$(git ls-files ...) loops (172, 197) word-split on unquoted command substitution, breaking on filenames containing spaces.
  • If a step deletes a previously-clean tracked file, git hash-object on the now-missing file fails silently (cur_hash=""), and since the file was never in $(SNAPSHOT_FILE) (it wasn't dirty pre-step), prev_hash is also "" — the deletion is never flagged as new_dirty.
🩹 Suggested fix for the regex-matching issue
-		prev_hash=$$(grep "^$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \
+		prev_hash=$$(grep -F "$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \

The deleted-file case would need a sentinel (e.g. treat a missing file as a distinct hash value rather than empty string) to be fully correct.

📝 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
for f in $$(git diff --name-only HEAD 2>/dev/null) $$(git ls-files --others --exclude-standard 2>/dev/null); do \
cur_hash=$$(git hash-object "$$f" 2>/dev/null); \
prev_hash=$$(grep "^$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \
if [ "$$cur_hash" != "$$prev_hash" ]; then \
new_dirty="$$new_dirty $$f"; \
fi; \
done; \
for f in $$(git diff --name-only HEAD 2>/dev/null) $$(git ls-files --others --exclude-standard 2>/dev/null); do \
cur_hash=$$(git hash-object "$$f" 2>/dev/null); \
prev_hash=$$(grep -F "$$f " $(SNAPSHOT_FILE) 2>/dev/null | awk '{print $$2}'); \
if [ "$$cur_hash" != "$$prev_hash" ]; then \
new_dirty="$$new_dirty $$f"; \
fi; \
done; \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 172 - 178, Fix dirty-file detection in both mirrored
loops by preserving filenames containing spaces, matching snapshot paths
literally rather than as regular expressions, and assigning a distinct sentinel
when git hash-object cannot hash a missing file so deletions are added to
new_dirty. Update the loops around cur_hash, prev_hash, and new_dirty
consistently in both blocks.

Comment thread Makefile
Comment on lines 228 to +239
.PHONY: verify-ci
verify-ci: generate update staticcheck fmt vet verify-api-deps verify-crd-schema verify-docs-nav ## Run the same checks as the GHA verify workflow.
$(MAKE) verify-git-clean
verify-ci: ## Run the same checks as the GHA verify workflow.
@truncate -s0 $(FAILURES_FILE)
$(call run-step,generate)
$(call run-step,update)
$(call run-step,staticcheck)
$(call run-step,fmt)
$(call run-step,vet)
$(call run-step,verify-api-deps)
$(call run-step,verify-crd-schema)
$(call run-step,verify-docs-nav)
$(call check-failures)

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Dropping the explicit verify-git-clean call narrows the "clean tree" guarantee.

Per the AI summary, the previous verify-ci recipe ended with $(MAKE) verify-git-clean, which checks the entire git status (staged/unstaged diffs, untracked files) regardless of cause. The new per-step dirty-detection in run-step only flags files that change during a given step's snapshot window — it will not catch files that were already modified/untracked before verify-ci started (e.g. a dirty local checkout, or stale artifacts from a previous run). Since this target is documented as running "the same checks as the GHA verify workflow" and is also meant for local use, this is a real regression in coverage versus the old behavior.

🛡️ Proposed fix: restore the full-tree clean check as a tracked step
 	$(call run-step,verify-docs-nav)
+	$(call run-step,verify-git-clean)
 	$(call check-failures)
📝 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
.PHONY: verify-ci
verify-ci: generate update staticcheck fmt vet verify-api-deps verify-crd-schema verify-docs-nav ## Run the same checks as the GHA verify workflow.
$(MAKE) verify-git-clean
verify-ci: ## Run the same checks as the GHA verify workflow.
@truncate -s0 $(FAILURES_FILE)
$(call run-step,generate)
$(call run-step,update)
$(call run-step,staticcheck)
$(call run-step,fmt)
$(call run-step,vet)
$(call run-step,verify-api-deps)
$(call run-step,verify-crd-schema)
$(call run-step,verify-docs-nav)
$(call check-failures)
.PHONY: verify-ci
verify-ci: ## Run the same checks as the GHA verify workflow.
`@truncate` -s0 $(FAILURES_FILE)
$(call run-step,generate)
$(call run-step,update)
$(call run-step,staticcheck)
$(call run-step,fmt)
$(call run-step,vet)
$(call run-step,verify-api-deps)
$(call run-step,verify-crd-schema)
$(call run-step,verify-docs-nav)
$(call run-step,verify-git-clean)
$(call check-failures)
🧰 Tools
🪛 checkmake (0.3.2)

[warning] 229-229: Target body for "verify-ci" exceeds allowed length of 5 lines (10).

(maxbodylength)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 228 - 239, Update the verify-ci recipe to restore the
explicit full-tree cleanliness check after the existing run-step checks and
before check-failures, using the established verify-git-clean target so
pre-existing staged, unstaged, and untracked changes are detected.

Comment thread support/certs/tls_test.go Outdated
Comment on lines +229 to +232
func TestDeliberatelyBroken(t *testing.T) {
t.Error("deliberately broken to test GHA 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.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Remove the unconditional failing test before merge.

TestDeliberatelyBroken always fails, so run-tests records a failure and check-failures exits with status 1 on every CI run. Remove it after validating the annotation flow, or gate it behind an explicit opt-in test-only mechanism.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@support/certs/tls_test.go` around lines 229 - 232, Remove the unconditional
failing TestDeliberatelyBroken test from the test suite, or gate its failure
behind an explicit opt-in test-only mechanism so normal run-tests and
check-failures executions pass.

@devguyio
devguyio force-pushed the verify-ci-gha-output branch from 61c15f0 to 10d9590 Compare July 22, 2026 11:27
devguyio and others added 2 commits July 22, 2026 16:49
Add run-step Makefile macro that detects GITHUB_ACTIONS and wraps each
step with ::group::/::endgroup:: for collapsible sections and ::error::
annotations on failure. Uses git hash-object to detect per-step content
changes (not just filename presence), so if step A dirties a file and
step B modifies it further, both steps report it. All steps run without
fail-early; failures are aggregated and reported at the end.

For test-shard, use gotestsum with github-actions format for per-test
collapsible groups on failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
Signed-off-by: Ahmed Abdalla <aabdelre@redhat.com>
@devguyio
devguyio force-pushed the verify-ci-gha-output branch from 10d9590 to 0e2842a Compare July 22, 2026 14:57

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@control-plane-operator/controllers/hostedcontrolplane/kas/service_test.go`:
- Line 97: Correct the expected ServicePort.Port value in the ReconcileService
test to match the apiServerPort fixture input of 1125, unless the intended
contract is 9999, in which case update that fixture input accordingly. Keep the
test expectation and ReconcileService behavior consistent.

In `@Makefile`:
- Around line 499-514: Update the test-shard execution flow around run-tests and
test-shard so GitHub Actions does not create nested log groups: when
GITHUB_ACTIONS is enabled, use a non-grouping GOTESTSUM_FORMAT such as pkgname
or standard-verbose, while preserving the existing format for other environments
and the run-step wrapper.
🪄 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: b6eb54c1-4e90-4c3d-a62e-174a7781858e

📥 Commits

Reviewing files that changed from the base of the PR and between 61c15f0 and 0e2842a.

📒 Files selected for processing (4)
  • .github/workflows/verify.yaml
  • Makefile
  • control-plane-operator/controllers/hostedcontrolplane/kas/service_test.go
  • support/util/util.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • support/util/util.go

{
Protocol: corev1.ProtocolTCP,
Port: 1125,
Port: 9999,

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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the expected port mismatch.

This test passes apiServerPort: 1125, and ReconcileService assigns that value directly to ServicePort.Port; therefore the result is 1125, not 9999. Restore the expectation or update the fixture input to 9999 if that is the intended contract.

Proposed fix
-						Port:       9999,
+						Port:       1125,
📝 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
Port: 9999,
Port: 1125,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@control-plane-operator/controllers/hostedcontrolplane/kas/service_test.go` at
line 97, Correct the expected ServicePort.Port value in the ReconcileService
test to match the apiServerPort fixture input of 1125, unless the intended
contract is 9999, in which case update that fixture input accordingly. Keep the
test expectation and ReconcileService behavior consistent.

Comment thread Makefile
Comment on lines +499 to +514
ifdef GITHUB_ACTIONS
GOTESTSUM_FORMAT ?= github-actions
else
GOTESTSUM_FORMAT ?= pkgname
endif

.PHONY: run-tests
run-tests: $(GOTESTSUM)
GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor $(GOTESTSUM) --format=$(GOTESTSUM_FORMAT) -- $(GO_TEST_FLAGS) -parallel=$(NUM_CORES) -count=1 -timeout=30m $(TEST_PACKAGES) -coverprofile $(COVER_PROFILE)

.PHONY: test-shard
test-shard: generate
@echo "Running shard tests for packages: $(TEST_PACKAGES)"
$(GO) test $(GO_TEST_FLAGS) -parallel=$(NUM_CORES) -count=1 -timeout=30m $(TEST_PACKAGES) -coverprofile $(COVER_PROFILE)
test-shard:
@truncate -s0 $(FAILURES_FILE)
$(call run-step,generate)
$(call run-step,run-tests)
$(call check-failures)

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does GitHub Actions correctly render nested ::group:: log sections, or does it break/confuse the collapsible UI?

💡 Result:

GitHub Actions does not natively support nested::group:: log sections [1]. If you attempt to nest groups by placing one::group::...::endgroup:: block inside another, the GitHub Actions log UI often fails to render them correctly [2][3]. Specifically, the UI logic typically treats the first::endgroup:: it encounters as the closing marker for the outermost (parent) group, regardless of how many groups were opened [2]. This causes the collapsible sections to behave unexpectedly—often breaking the folding functionality for the parent group or causing the nested structure to flatten and render incorrectly [2][3]. Key technical points regarding this limitation: 1. No Hierarchical Support: The workflow commands::group:: and::endgroup:: do not accept identifiers or keys, meaning the system has no way to match a specific "end" command to its corresponding "start" command [4]. 2. UI Parsing: The log viewer parses these markers linearly. Because there is no pairing mechanism, the renderer cannot maintain a proper tree-view or hierarchical state for nested sections [2][4]. 3. Recommended Practice: Official documentation and established community guidelines advise against nesting log groups [1]. You should maintain a flat structure of independent, sequential groups [1]. While GitHub has received numerous requests to support hierarchical or named log groups, it remains an unsupported feature [2][4][3]. Note that while the system internally uses different, non-user-accessible markers (like ##[start-action] and ##[end-action]) to render collapsible steps for composite actions, these cannot be triggered by user-defined script commands [5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant Makefile sections and references to run-step / GOTESTSUM_FORMAT.
git ls-files Makefile .github/workflows | sed -n '1,200p'
printf '\n--- Makefile excerpt ---\n'
sed -n '150,220p;490,530p' Makefile
printf '\n--- References ---\n'
rg -n "GOTESTSUM_FORMAT|run-step|github-actions|pkgname|standard-verbose" Makefile .github/workflows -n

Repository: openshift/hypershift

Length of output: 7360


Avoid nested GitHub Actions log groups in run-tests.
run-step already wraps test-shard in a ::group::, so GOTESTSUM_FORMAT=github-actions adds another layer of groups and the Actions log UI can collapse them incorrectly. Use a non-grouping format like pkgname or standard-verbose here, or skip the outer group for run-tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 499 - 514, Update the test-shard execution flow around
run-tests and test-shard so GitHub Actions does not create nested log groups:
when GITHUB_ACTIONS is enabled, use a non-grouping GOTESTSUM_FORMAT such as
pkgname or standard-verbose, while preserving the existing format for other
environments and the run-step wrapper.

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@devguyio: 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.

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/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants