Skip to content

NE-2094: Use go.mod tool directives - #316

Open
Miciah wants to merge 1 commit into
openshift:mainfrom
redhat-chai-bot:fix-replace-tools-go
Open

NE-2094: Use go.mod tool directives#316
Miciah wants to merge 1 commit into
openshift:mainfrom
redhat-chai-bot:fix-replace-tools-go

Conversation

@Miciah

@Miciah Miciah commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Go 1.24 introduced the tool directive in go.mod for tracking executable tool dependencies, replacing the previous tools.go blank-import convention. Migrate the five executable tool imports to go.mod tool directives and retain tools/tools.go only for the non-executable CRD manifests data package, which cannot use the tool directive.

Go 1.24 introduced the `tool` directive in go.mod for
tracking executable tool dependencies, replacing the
previous tools.go blank-import convention.  Migrate the
five executable tool imports to go.mod tool directives
and retain tools/tools.go only for the non-executable
CRD manifests data package, which cannot use the `tool`
directive.

This commit resolves NE-2094.

https://issues.redhat.com/browse/NE-2094

* go.mod: Add tool directive block for
  golangci-lint, yq/v4, setup-envtest,
  controller-gen, kustomize/v5.  Remove
  their entries from the require block.
* go.sum: Refresh checksums.
* tools/tools.go: Remove executable tool blank
  imports (golangci-lint, yq/v4,
  setup-envtest, controller-gen,
  kustomize/v5).  Keep only the
  non-executable crd-manifests import.
  Remove redundant +build constraint.
  Add package comment explaining purpose.
* vendor/: Update vendored dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 1, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 1, 2026

Copy link
Copy Markdown

@Miciah: This pull request references NE-2094 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Go 1.24 introduced the tool directive in go.mod for tracking executable tool dependencies, replacing the previous tools.go blank-import convention. Migrate the five executable tool imports to go.mod tool directives and retain tools/tools.go only for the non-executable CRD manifests data package, which cannot use the tool directive.

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 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thealisyed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Updated go.mod dependencies and added a tool block for Go tooling executables. Updated tools/tools.go to use //go:build tools, added package documentation, and removed obsolete tool imports while retaining the OpenShift CRD manifests import.

Suggested reviewers: alebedev87


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error Vendored yq logs raw YAML values with Debugf/Warningf; -v enables debug output, and EnvSubstOperator warnings include node.Value, which may contain secrets. Use a yq version without raw-value logging, or patch/configure yq to redact values before logging, including debug and warning paths.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the migration of executable tool dependencies to go.mod tool directives.
Description check ✅ Passed The description directly explains the migration from tools.go imports to go.mod tool directives.
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 patch changes only go.mod, go.sum, and tools/tools.go; it adds no test files or Ginkgo title declarations.
Test Structure And Quality ✅ Passed The PR changes only dependency metadata, tool directives, and tools/tools.go; no repository Ginkgo test files or test logic changed.
Microshift Test Compatibility ✅ Passed The PR adds no Ginkgo tests or non-vendor test files; it changes only tool dependency metadata, tools/tools.go, and vendored dependencies.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit changes only go.mod, go.sum, and tools/tools.go; no first-party test files or added Ginkgo declarations are present, so SNO compatibility is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The non-vendor diff only changes go.mod, go.sum, and tools/tools.go; it adds no deployment manifests, operator/controller code, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes dependency metadata and tools/tools.go only; no OTE binary or process-level stdout code is added or changed.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Outside vendor, the patch changes only go.mod, go.sum, and tools/tools.go; it adds no Ginkgo tests or test files requiring IPv4 or external connectivity.
No-Weak-Crypto ✅ Passed The PR changes only tool declarations, dependency metadata, and one CRD-manifest import; no weak-crypto API, custom crypto, or secret comparison was added.
Container-Privileges ✅ Passed The PR adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings; the changed yq image retains non-root USER yq.
✨ 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.

🔧 golangci-lint (2.12.2)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@openshift-ci

openshift-ci Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@Miciah: The following test 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/e2e-aws-rosa-operator 8fc999f link true /test e2e-aws-rosa-operator

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

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants