Skip to content

sssctl: add group_show#216

Closed
thalman wants to merge 1 commit intoSSSD:masterfrom
thalman:sssctl_group_show
Closed

sssctl: add group_show#216
thalman wants to merge 1 commit intoSSSD:masterfrom
thalman:sssctl_group_show

Conversation

@thalman
Copy link
Contributor

@thalman thalman commented Nov 3, 2025

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @thalman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new capability to the sssctl test framework utility, enabling the programmatic retrieval of cached group details. By adding a dedicated group_show method, it streamlines the process of interacting with the sssctl group-show command, which is crucial for testing and automation involving group management within SSSD.

Highlights

  • New group_show method: Implemented a group_show method within the sssctl utility to programmatically query cached group information.
  • sssctl command integration: The new method wraps the sssctl group-show command, allowing searches by group name, Security Identifier (SID), or Group ID (GID.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@thalman thalman requested review from danlavu and pbrezina November 3, 2025 11:27
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a group_show method to SSSCTLUtils to wrap the sssctl group-show command. The implementation is similar to the existing user_show method. My review focuses on ensuring the correct usage of the sssctl command. I've found a potential issue where mutually exclusive arguments can be passed simultaneously, and I've suggested a fix to enforce this constraint and improve the robustness of the new method.

Comment on lines +227 to +233
options = []
if group is not None:
options += [group]
if sid is not None:
options += ["-s", sid]
if gid is not None:
options += ["-g", str(gid)]

Choose a reason for hiding this comment

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

high

The sssctl group-show command expects only one of group, sid, or gid at a time, as they are mutually exclusive options. The current implementation allows multiple of these to be passed simultaneously, which will likely cause the sssctl command to fail.

To make this wrapper safer and more robust, you should add a check to ensure that at most one of these arguments is provided. Using an if/elif structure for building the options would also make the mutual exclusivity clearer.

A similar issue exists in the user_show method.

Suggested change
options = []
if group is not None:
options += [group]
if sid is not None:
options += ["-s", sid]
if gid is not None:
options += ["-g", str(gid)]
if sum(x is not None for x in (group, sid, gid)) > 1:
raise ValueError("Only one of 'group', 'sid', or 'gid' can be specified.")
options = []
if group is not None:
options.append(group)
elif sid is not None:
options.extend(["-s", sid])
elif gid is not None:
options.extend(["-g", str(gid)])

@thalman
Copy link
Contributor Author

thalman commented Nov 3, 2025

Oh, someone did that already, never mind

@thalman thalman closed this Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant