-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 🎉 Implement azdo security permission show command, fix errors and tests
#112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…he scripts/AGENTS.md file with detailed step-by-step instructions on updating the checkin.sh script. Added sections on identifying changes, generating verbose Conventional Commit messages with emojis, logical grouping of commits, preserving helper functions, and preventive measures for common pitfalls such as missing new directories or non-Go files. Also included explanations for CHECKIN delimiters and how to commit changes to the script itself when necessary. This update improves consistency and predictability in maintaining granular commit history.
…\nUpdated internal/template/template.go to support rendering detailed permission information for the new show command. This includes adjustments to handle shared ACL data and target types in the output templates, ensuring consistent and customizable output formats for security permission displays.
…rnal/text/text.go with enhanced formatting options for security permission outputs, ensuring consistent display of ACLs, descriptors, and permission states across table and plain text formats. Added support for new fields from the refactored shared modules.
…internal/docs/man.go to include documentation for the new security permission show subcommand and updated sections for refactored permission list and namespace commands. Ensured man pages reflect the latest CLI hierarchy and flag options.
…al/docs/markdown.go to generate accurate markdown documentation for the refactored security permission structure, including the new show subcommand and shared utilities. Improved handling of command examples and output formats in the generated docs.
…omprehensive test cases in internal/docs/markdown_test.go to verify correct generation of documentation for security permission namespaces, shared components, and the new show command. Included assertions for output structure, links, and code blocks to ensure doc quality.
…ed updated help text and usage examples for the new subcommand into the root help system in internal/cmd/root/help.go. Also refreshed help for related permission list and namespace commands to reflect recent refactors.
…\nDeprecated and removed acl.go from the namespace/shared subdirectory as part of reorganizing the security permission package structure. The functionality has been relocated to the top-level shared directory to streamline imports, reduce nesting, and improve modularity across permission subcommands.
…o\n\nDeprecated and removed shared.go from the namespace/shared subdirectory to flatten the package hierarchy in security permissions. Shared logic for descriptor resolution and scope handling is now consolidated in the top-level shared package for better accessibility and maintenance.
…\nIntroduced a new shared/acl.go module in the security permission package to centralize access control list (ACL) handling. This module provides reusable functions for parsing, validating, and manipulating ACLs from Azure DevOps API responses, reducing code duplication in list, show, and future permission commands. Includes nil-safe dereferencing and structured output preparation.
…ded shared.go to the security permission package, implementing utility functions for common operations such as scope descriptor resolution using graph.Client.GetDescriptor, permission namespace fetching, and target validation. These utilities are shared across subcommands to ensure consistent API interaction and error handling.
…\nImplemented target.go in the shared package to handle various permission target types (e.g., projects, repositories, namespaces) uniformly. This includes type-safe parsing of target identifiers, validation against Azure DevOps scopes, and preparation of args for API calls, promoting reuse and reducing errors in target-specific logic.
…anized the main permission command factory in permission.go to support the new show subcommand and integrate the refactored shared package structure. Updated command registration, option binding, and RunE logic to delegate to specialized run functions, improving maintainability and extensibility for future permission-related features.
…L support\n\nEnhanced the permission list command in list.go to utilize the new shared/acl.go and target.go modules for improved ACL display and target resolution. Updated table output to include effective permission states, token-based pagination for large results, and JSON export support via the exporter interface. Added progress indicators for API calls and nil checks for response fields.
…d issues in the namespace list command following the package refactor, ensuring correct resolution of security namespaces using core.Client and graph.Client. Updated output formatting to align with new shared utilities, added handling for empty results, and improved error messages for invalid organization/project specifications. Verified hermetic tests pass with mocks.
…s\n\nUpdated the namespace show command to integrate with the relocated shared modules (acl.go, shared.go, target.go), enhancing descriptor fetching via GetDescriptor and output consistency. Refactored RunE to use updated option structs and added support for JSON output with omitempty tags for optional fields. Ensured safe dereferencing of API pointers using types.GetValue.
…command to retrieve and display detailed information about a specific security permission, including ACL entries, target details, and effective allow/deny settings from the Azure DevOps REST API. Implements table and JSON output using ctx.Printer and exporter, with progress indicators, confirmation for destructive flags if applicable, and hermetic black-box tests using vendored API mocks. Supports pagination if needed and wraps errors with %w for chainability. Documentation updated via make docs.
…ded generated markdown documentation in docs/azdo_security_permission_show.md for the new permission show subcommand, detailing syntax, positional arguments, flags (e.g., --namespace, --json), examples for different scopes, output formats (table/JSON), and troubleshooting tips based on Azure DevOps REST API 7.1 specs. This ensures users have clear guidance on querying individual permissions.
…d docs/azdo_graph_user_list.md following updates to related core libraries and CLI help. Ensured examples reflect current flag options, output formats, and integration with graph.Client for user queries in Azure DevOps. Verified links and code snippets for accuracy.
…\nUpdated the comprehensive help reference in docs/azdo_help_reference.md to include the new permission show subcommand and refactored structures. Added sections on usage, global flags, and command hierarchy for security permissions, aligning with recent changes in root/help.go and command factories.
…zdo_pr_comment.md after core text and template updates. Refreshed examples for adding comments to pull requests, including JSON output options and line-specific commenting via Azure DevOps API. Confirmed compatibility with updated iostreams and printer helpers.
….md to reflect enhancements in diff handling from text.go refactors. Included new examples for viewing pull request diffs with pagination and format options, ensuring documentation matches the current CLI behavior and API integration.
…docs/azdo_pr_list.md following core library changes. Added details on filtering PRs by state, author, and labels, with table output examples and JSON export usage, aligned with updated printer and exporter logic.
…ge.md to include latest merge method options and confirmation prompts after template refactors. Provided examples for squash, rebase, and merge commits, emphasizing --yes flag for automation and error handling for conflicted merges.
…md with refreshed content from markdown.go updates. Enhanced sections on viewing PR details, timelines, and labels, including JSON templating examples and progress indicator descriptions for long-running API calls.
….md to reflect any text formatting improvements. Included examples for voting on pull requests (approve, approve-with-suggestions, reject) with optional comments, and explained integration with review APIs using vendored clients.
…zdo_project_create.md following docs generation fixes in man.go and markdown.go. Verified examples for creating projects with visibility, description, and process templates, including error cases for invalid organization URLs.
…azdo_project_delete.md with current confirmation prompt details and --yes flag usage after core updates. Added warnings about destructive nature and examples for deleting projects in specified organizations.
…o_project_list.md to include updated table columns and JSON output from recent printer enhancements. Examples now cover listing projects across organizations with pagination and filtering by state.
…po_clone.md reflecting text.go changes for clone URLs and local path handling. Included examples for cloning with authentication, custom directories, and error handling for non-existent repos.
…azdo_repo_list.md with latest output formats post-refactor. Added details on listing repositories by project, with options for remote URLs, sizes, and JSON export for scripting.
…ed docs/azdo_security_group_membership_list.md to align with shared utility refactors. Enhanced examples for listing group members with descriptor resolution and table output customization.
…ted the main docs/azdo_security_permission.md with updated command hierarchy, including the new show subcommand and refactored namespace integration. Refreshed global flags and positional argument parsing examples.
…s/azdo_security_permission_list.md to document enhancements in ACL display and target support from list.go refactor. Included examples for listing permissions by namespace and project scopes with JSON filtering.
Moved member lookup logic from security group shared package to azdo extensions, introducing ResolveMemberDescriptor in the Client interface.
Updated group membership add/remove commands to use the Extensions client for resolving member descriptors.
Updated ParseSubjectTarget to return a new SubjectTarget struct instead of multiple values, improving clarity and encapsulation of scope and subject data.
Replaced usage of groupShared.ResolveMemberDescriptor with Extensions client’s ResolveMemberDescriptor in `list` and `show` commands to standardize subject resolution.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #85