-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ✨Implement azdo service-endpoint update command
#174
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
Add support for reading service endpoints from files or stdin with validation. Includes JSON parsing, encoding handling, and baseline validation for required fields (name, type, url). The implementation supports both direct file input and stdin piping for flexible integration with other tools.
Add AuthorizationScheme() to retrieve endpoint authorization scheme and RedactSecrets() to mask sensitive parameters in service endpoints. These utilities support secure handling of service endpoint credentials.
Add comprehensive input handling utilities for service endpoint commands, including: - Encoding normalization and validation - Content decoding for UTF-8, ASCII, UTF-16LE, and UTF-16BE - Input path description utility - Comprehensive test coverage for all encoding scenarios
Add shared functionality to render service endpoint details using templates or JSON exporters. Includes template helpers for safe value rendering and field selection support for JSON output.
Add `authorized` parameter to `SetAllPipelinesAccessToEndpoint` to allow both granting and revoking pipeline access to service endpoints. Rename function from `GrantAllPipelinesAccessToEndpoint` to reflect its expanded capability. The change enables users to control pipeline permissions for service endpoints in both directions (authorize/unauthorize) through a single function call.
Add utility function to ensure project references are included in service endpoint configurations with ID and name matching logic. Includes comprehensive test coverage for edge cases and matching scenarios.
FormatProjectReference function converts service endpoint project references into a display-friendly string representation, handling various edge cases including nil values and partial data availability.
Add validation logic for service endpoint payloads with two modes: - Baseline validation: trims whitespace and checks for empty fields when present - Strict validation: requires name, type, and url fields to be non-nil Includes comprehensive test coverage for all validation scenarios
Move common service endpoint functionality to the shared package to reduce code duplication across commands. Key changes include: - Consolidate JSON field definitions in shared.ServiceEndpointJSONFields - Add shared.Output() for consistent command output handling - Introduce shared.RedactSecrets() for secure JSON output - Add shared.ValidateEndpointPayload() for payload validation - Create shared utility functions for project reference handling - Standardize encoding and file reading logic in shared package - Replace duplicated output rendering code with shared implementation
Adds a new `update` subcommand to the service endpoint command group, allowing users to modify existing service endpoints. The implementation supports: - Individual field updates (name, description, URL) - Bulk updates via JSON file input - Pipeline permission management (enable-for-all) - Input validation and error handling - Progress feedback and structured logging
Add comprehensive documentation for the new `azdo service-endpoint update` command including usage examples, option details, and JSON field reference. Update help reference and command index to include the new command.
3192761 to
775c518
Compare
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.
This PR introduces a update capability for Azure DevOps service endpoints, enabling users to modify existing service endpoints through both individual field updates and bulk JSON-based configuration. The implementation includes robust input validation, pipeline permission management, and secure handling of sensitive credentials.
Detailed Breakdown
🚀 New Features
Service Endpoint Update Command
azdo service-endpoint updatecommand with support for:--enable-for-allflagEnhanced Pipeline Authorization
GrantAllPipelinesAccessToEndpointtoSetAllPipelinesAccessToEndpointwith newauthorizedparameter🏗️ Shared Infrastructure & Refactoring
Centralized Service Endpoint Logic
shared.ServiceEndpointJSONFieldsshared.Output()for consistent command output handling across all service endpoint commandsshared.RedactSecrets()for secure JSON output with masked credentialsshared.ValidateEndpointPayload()with baseline and strict validation modesUtility Functions
FormatProjectReference()for display-friendly project reference formatting🧪 Testing & Quality
Test Infrastructure
shared/input_test.golocationCode Quality
📚 Documentation
Command Documentation
azdo service-endpoint updatecommandCloses: #68