Skip to content

ci(golangci): roll out goconst conservatively - #4976

Open
tuxerrante wants to merge 4 commits into
masterfrom
tuxerrante/ARO-28459/goconst-rollout-master
Open

ci(golangci): roll out goconst conservatively#4976
tuxerrante wants to merge 4 commits into
masterfrom
tuxerrante/ARO-28459/goconst-rollout-master

Conversation

@tuxerrante

@tuxerrante tuxerrante commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • enable goconst conservatively in .golangci.yml
  • add explicit generated and generated-like path exclusions to keep rollout noise low
  • fix the small remaining in-scope duplicate-string findings
  • merge reusable linter-rollout guidance into docs/agent-guides/multi-module-build.md

Related

Validation

  • make lint-go
  • make unit-test-go (fails in existing baseline tests unrelated to this diff)
    • pkg/frontend/adminactions TestTopPodsTable/Client_Initialization_Failure
    • pkg/frontend/adminactions TestTopNodesTable/Client_Initialization_Failure
  • go test -v ./pkg/frontend/adminactions -run 'TestTop(Pods|Nodes)Table' on clean master reproduces the same failures

Jira

  • ARO-28459

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

@tuxerrante
tuxerrante force-pushed the tuxerrante/ARO-28459/goconst-rollout-master branch from 5d1fe63 to 6e24c15 Compare July 17, 2026 09:10
@tuxerrante
tuxerrante marked this pull request as ready for review July 21, 2026 07:56
Copilot AI review requested due to automatic review settings July 21, 2026 07:56

Copilot AI 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.

Pull request overview

This PR rolls out the goconst linter in ARO-RP with conservative thresholds to reduce rollout noise, adds targeted exclusions for generated/generated-like code, and applies a small set of in-scope duplicate-string cleanups (primarily via shared constants) to reach a clean baseline.

Changes:

  • Enable goconst in .golangci.yml with conservative settings and add path-based exclusions to avoid churn in generated/generated-like code.
  • Replace repeated ARM template schema/resourceId strings with shared constants in pkg/cluster and pkg/deploy/generator.
  • Add an agent-guide note documenting the measured goconst threshold sweep and chosen settings.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/monitor/cluster/clusteroperatorconditions.go Deduplicates a repeated operator name string using a const to satisfy goconst.
pkg/deploy/generator/templates_dev.go Reuses a shared devVPNVnet resourceId constant to reduce duplicate strings.
pkg/deploy/generator/resources_dev.go Introduces devVPNVnetResourceID constant to dedupe ARM resourceId(...) usage.
pkg/cluster/workloadidentityresources.go Switches ARM template schema string to a shared constant.
pkg/cluster/template.go Adds shared deploymentTemplateSchema constant for the cluster package.
pkg/cluster/storageaccounts.go Switches ARM template schema string to a shared constant.
pkg/cluster/gatewayprivateendpoint.go Switches ARM template schema string to a shared constant.
pkg/cluster/deploybaseresources.go Switches ARM template schema string to a shared constant.
pkg/cluster/denyassignment.go Switches ARM template schema string to a shared constant.
pkg/cluster/clusterserviceprincipal.go Switches ARM template schema string to a shared constant.
docs/agent-guides/goconst-rollout-note.md Documents the conservative goconst rollout and chosen thresholds/exclusions.
.golangci.yml Enables/configures goconst and adds explicit exclusions for generated/generated-like paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +7
This note records the conservative `goconst` rollout for PR2.

## Measured Findings

The counts below were measured from the PR2 worktree with the planned generated/generated-like exclusions in place:

Why this threshold:

- `20/4` and `24/4` still produced a broader cross-package cleanup than PR2 should carry.
Comment thread docs/agent-guides/goconst-rollout-note.md Outdated
Comment thread docs/agent-guides/goconst-rollout-note.md Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 08:25
@tuxerrante tuxerrante added the priority-low Low priority issue or pull request label Jul 23, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

docs/agent-guides/goconst-rollout-note.md:7

  • This doc refers to "PR2", which is ambiguous and will quickly become outdated. Consider phrasing it relative to the current change (e.g., "this PR") or using a concrete PR number.
This note records the conservative `goconst` rollout for PR2.

## Measured Findings

The counts below were measured from the PR2 worktree with the planned generated/generated-like exclusions in place:

docs/agent-guides/goconst-rollout-note.md:27

  • This bullet uses "PR2" as a moving reference. Rewording to "this PR" (or a concrete PR number) will keep the note accurate over time.
- `20/4` and `24/4` still produced a broader cross-package cleanup than PR2 should carry.

@tuxerrante
tuxerrante force-pushed the tuxerrante/ARO-28459/goconst-rollout-master branch from 34b74fc to 2b95bf9 Compare July 23, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority-low Low priority issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants