Skip to content

CMP-4464: Add fmt-check target to gate CI on Go formatting - #1300

Open
rhmdnd wants to merge 1 commit into
ComplianceAsCode:masterfrom
rhmdnd:fail-on-gofmt-drift
Open

CMP-4464: Add fmt-check target to gate CI on Go formatting#1300
rhmdnd wants to merge 1 commit into
ComplianceAsCode:masterfrom
rhmdnd:fail-on-gofmt-drift

Conversation

@rhmdnd

@rhmdnd rhmdnd commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Add a fmt-check target that fails if any Go source files need
formatting. The build, run, test-unit, and test-coverage targets
now depend on fmt-check instead of fmt, so CI rejects unformatted
code. The existing fmt target is unchanged so contributors can
still auto-fix formatting with make fmt.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@rhmdnd: This pull request references CMP-4464 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:

Add a fmt-check target that fails if any Go source files need
formatting. The build, run, test-unit, and test-coverage targets
now depend on fmt-check instead of fmt, so CI rejects unformatted
code. The existing fmt target is unchanged so contributors can
still auto-fix formatting with make fmt.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

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 requested review from jhrozek and mrogers950 July 7, 2026 11:21
@openshift-ci openshift-ci Bot added the approved label Jul 7, 2026
@rhmdnd
rhmdnd requested review from Vincent056, taimurhafeez and yuumasato and removed request for jhrozek and mrogers950 July 7, 2026 11:21
@rhmdnd

rhmdnd commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

#1292 needs to land to fix current gofmt drift before this will pass.

Add a fmt-check target that fails if any Go source files need
formatting. The build, run, test-unit, and test-coverage targets
now depend on fmt-check instead of fmt, so CI rejects unformatted
code. The existing fmt target is unchanged so contributors can
still auto-fix formatting with make fmt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rhmdnd
rhmdnd force-pushed the fail-on-gofmt-drift branch from 6c98d14 to 7456eb8 Compare July 13, 2026 11:13
@openshift-ci openshift-ci Bot removed the lgtm label Jul 13, 2026
@rhmdnd

rhmdnd commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator Author

@taimurhafeez thanks for the reviews here. I needed to rebase so CI passes now that the gofmt changes are in.

@github-actions

Copy link
Copy Markdown

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1300-7456eb848fde1ab007c6c10c4a2d45acbd6db4dc

@Vincent056

Copy link
Copy Markdown

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, taimurhafeez, Vincent056

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:
  • OWNERS [Vincent056,rhmdnd,taimurhafeez]

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

@vickeybrown

Copy link
Copy Markdown
Collaborator

/retest

@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown

@rhmdnd: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 7456eb8 link true /test images
ci/prow/e2e-aws-parallel 7456eb8 link true /test e2e-aws-parallel

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.

@vickeybrown

vickeybrown commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Looks like tests are failing because the test coverage went down - do we wanna have the test coverage ignore specific files? Or should we add some unit tests?

@openshift-ci

openshift-ci Bot commented Aug 24, 2026

Copy link
Copy Markdown

Stale PRs are closed after 21d of inactivity.

If this PR is still relevant, comment to refresh it or remove the stale label.
Mark the PR as fresh by commenting /remove-lifecycle stale.

If this PR is safe to close now please do so with /close.

/lifecycle stale

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants