Skip to content

Conversation

@christophermancini
Copy link
Contributor

Enable three new golangci-lint checks to improve code quality:

errcheck - Detects unchecked errors that could lead to silent failures. Ensures all error returns are explicitly handled or intentionally ignored.

Changes:

  • Wrapped async audit logging call in closure to explicitly discard error (audit logging is fire-and-forget to avoid blocking sanitization)

nolintlint - Validates proper formatting and usage of //nolint directives. Prevents malformed suppressions and removes unused directives.

Changes:

  • Fixed //nolint formatting in cluster.go and cmd.go (removed spaces)
  • Excluded pkg/common/concurrentviper/generated.go from linting in config (file is generated but generator is currently broken)

nilnil - Prevents functions from returning (nil, nil) which is ambiguous. Callers cannot distinguish between success-with-no-data and error states.

Changes:

  • Added ErrS3Disabled sentinel error for disabled S3 upload
  • Updated NewS3Uploader caller to check for ErrS3Disabled
  • Changed clusterutil.go to return ErrReserveFull instead of (nil, nil)
  • Changed terraform destroy to return empty map instead of nil

All changes maintain existing behavior while making error handling and API contracts more explicit and type-safe.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christophermancini

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 Feb 10, 2026
Enable three new golangci-lint checks to improve code quality:

**errcheck** - Detects unchecked errors that could lead to silent failures.
Ensures all error returns are explicitly handled or intentionally ignored.

Changes:

- Wrapped async audit logging call in closure to explicitly discard error
  (audit logging is fire-and-forget to avoid blocking sanitization)

**nolintlint** - Validates proper formatting and usage of //nolint directives.
Prevents malformed suppressions and removes unused directives.

Changes:

- Fixed //nolint formatting in cluster.go and cmd.go (removed spaces)
- Excluded pkg/common/concurrentviper/generated.go from linting in config
  (file is generated but generator is currently broken)

**nilnil** - Prevents functions from returning (nil, nil) which is ambiguous.
Callers cannot distinguish between success-with-no-data and error states.

Changes:

- Added ErrS3Disabled sentinel error for disabled S3 upload
- Updated NewS3Uploader caller to check for ErrS3Disabled
- Changed clusterutil.go to return ErrReserveFull instead of (nil, nil)
- Changed terraform destroy to return empty map instead of nil

All changes maintain existing behavior while making error handling and
API contracts more explicit and type-safe.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@@ -256,11 +257,11 @@ func (o *E2EOrchestrator) uploadToS3() error {
component := deriveComponentFromTestImage()
uploader, err := aws.NewS3Uploader(component)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uploader, err := aws.NewS3Uploader(component)
if viper.GetString(config.Tests.LogBucket)!=""{
uploader, err := aws.NewS3Uploader(component)
} else{
return nil
}

Comment on lines 145 to 149
bucket := viper.GetString(config.Tests.LogBucket)
if bucket == "" {
// S3 upload disabled - no bucket configured
return nil, nil
return nil, ErrS3Disabled
}
Copy link
Contributor

Choose a reason for hiding this comment

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

if errors.Is(err, ErrReserveFull) {
log.Printf("Reserve full, exiting without provisioning")
return nil, nil
return nil, ErrReserveFull
Copy link
Contributor

Choose a reason for hiding this comment

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

is this returned error being handled? we would not want the execution to error out because of this new return value.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 10, 2026

@christophermancini: 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-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2026
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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.

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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants