Skip to content

OCPBUGS-76318: pkg/helpers: Print the right error object#2197

Open
tchap wants to merge 1 commit intoopenshift:mainfrom
tchap:auth-groups-error
Open

OCPBUGS-76318: pkg/helpers: Print the right error object#2197
tchap wants to merge 1 commit intoopenshift:mainfrom
tchap:auth-groups-error

Conversation

@tchap
Copy link
Contributor

@tchap tchap commented Feb 6, 2026

CheckOAuthDisabledErr prints a wrong error object. This is now fixed.

Also improved readability a bit and fixed some typos.

CheckOAuthDisabledErr prints a wrong error object. This is now fixed.
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 6, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76318, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

CheckOAuthDisabledErr prints a wrong error object. This is now fixed.

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.

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

The pull request modifies error handling in pkg/helpers/cmd/errors.go, replacing a set-based group membership check with direct pairwise comparison for two known groups, fixing a typographical error in a comment, updating error message formatting to reference the original error variable, and correcting embedded server message grammar.

Changes

Cohort / File(s) Summary
Error handling logic
pkg/helpers/cmd/errors.go
Replaces set-based group membership check with direct pairwise comparison for oauthv1/userv1 groups; fixes typographical error ("object iself" → "object itself") in comment; updates error formatting to reference originalError variable instead of local err; corrects embedded OAuth server message grammar and formatting from "Error: … are not enabled" to "%s.%s are not enabled".
Dependency management
go.mod
Minor version or dependency updates reflecting changes in the main package.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@tchap
Copy link
Contributor Author

tchap commented Feb 6, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 6, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-76318, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

Details

In response to this:

/jira refresh

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.


Original error:
%w`, details.Kind, details.Group, err))
%w`, details.Kind, details.Group, originalError))
Copy link
Member

Choose a reason for hiding this comment

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

Nice catch

}

if !sets.New[string](oauthv1.GroupVersion.Group, userv1.GroupVersion.Group).Has(details.Group) {
if details.Group != oauthv1.GroupVersion.Group && details.Group != userv1.GroupVersion.Group {
Copy link
Member

Choose a reason for hiding this comment

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

The reason of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's IMO more readable, but I can change it back 🙂

Copy link
Member

Choose a reason for hiding this comment

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

It works for me. No need to change :)

@ardaguclu
Copy link
Member

Thank you
/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 6, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, tchap

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 6, 2026
@tchap
Copy link
Contributor Author

tchap commented Feb 6, 2026

/verified by @tchap

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 6, 2026
@openshift-ci-robot
Copy link

@tchap: This PR has been marked as verified by @tchap.

Details

In response to this:

/verified by @tchap

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-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 894e94b and 2 for PR HEAD c9f1f7c in total

@tchap
Copy link
Contributor Author

tchap commented Feb 6, 2026

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

@tchap: 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-ovn-serial-1of2 c9f1f7c link true /test e2e-aws-ovn-serial-1of2

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.

@tchap
Copy link
Contributor Author

tchap commented Feb 8, 2026

/retest

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. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants