Skip to content

OCPBUGS-78701: adm policy add-role-to-user: Fix --dry-run=server#2231

Open
tchap wants to merge 1 commit intoopenshift:mainfrom
tchap:admin-policy-server-dry-run
Open

OCPBUGS-78701: adm policy add-role-to-user: Fix --dry-run=server#2231
tchap wants to merge 1 commit intoopenshift:mainfrom
tchap:admin-policy-server-dry-run

Conversation

@tchap
Copy link
Contributor

@tchap tchap commented Mar 18, 2026

The flag is not being set when sending requests to the server. This is now fixed.

The flag is not being set when sending requests to the server.
This is now fixed.

Assisted-by: Claude Code
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important 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 Mar 18, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-78701, 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:

The flag is not being set when sending requests to the server. This is now fixed.

Assisted-by: Claude Code

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 Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc89c25c-d314-45fd-9e86-4533985bc4db

📥 Commits

Reviewing files that changed from the base of the PR and between 05fa7bb and d959057.

📒 Files selected for processing (2)
  • pkg/cli/admin/policy/modify_roles.go
  • pkg/cli/admin/policy/policy.go

Walkthrough

These changes introduce server-side dry-run support for role-binding operations and refactor the roleBindingAbstraction interface to accept customizable Kubernetes client options, allowing callers to control behavior such as DryRun and FieldManager per operation.

Changes

Cohort / File(s) Summary
Role-binding abstraction interface updates
pkg/cli/admin/policy/policy.go
Updated Create, Update, and Delete method signatures on roleBindingAbstraction to accept respective Kubernetes client option structs (CreateOptions, UpdateOptions, DeleteOptions) as parameters instead of using default options, enabling customization per operation.
Server-side dry-run support implementation
pkg/cli/admin/policy/modify_roles.go
Added serverDryRunFlags() helper method to compute DryRun options when server dry-run strategy is enabled, integrated dry-run support into AddRole and RemoveRole execution paths, and updated success messaging to distinguish server dry-run operations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@tchap
Copy link
Contributor Author

tchap commented Mar 18, 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 Mar 18, 2026
@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-78701, 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)
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.

@openshift-ci-robot
Copy link

@tchap: This pull request references Jira Issue OCPBUGS-78701, which is valid.

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 POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

The flag is not being set when sending requests to the server. 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.

@ardaguclu
Copy link
Member

/lgtm
/hold
feel free to unhold it anytime

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 18, 2026
@openshift-ci openshift-ci bot requested review from ardaguclu and ingvagabund March 18, 2026 14:04
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 18, 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 Mar 18, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 18, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 18, 2026

@tchap: 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.

@ardaguclu
Copy link
Member

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 19, 2026
@tchap
Copy link
Contributor Author

tchap commented Mar 19, 2026

/verified by @tchap
/unhold

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

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

Details

In response to this:

/verified by @tchap
/unhold

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.

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-important Referenced Jira bug's severity is important 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