-
Notifications
You must be signed in to change notification settings - Fork 119
Enhance rewire-pipeline command to support optional pipeline ID vs pipeline name #1415
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
Conversation
… the migration process. 1. Enhanced Branch Policy Failure Logging ✅ Added detailed logging to CheckBranchPolicyRequirement method: Logs when repository name is not available Logs specific error messages for each type of failure: Network/HTTP errors Timeout errors JSON parsing errors Invalid argument errors Invalid operation errors Each log includes the pipeline ID, organization, team project, and repository for easy identification ✅ Enhanced IsPipelineRequiredByBranchPolicy method with verbose logging: Logs when repository ID cannot be found Logs when no branch policies exist (verbose) Logs when a pipeline IS required by branch policy (verbose) Logs when a pipeline is NOT required by branch policy (verbose) Logs specific error details for HTTP, JSON, and argument errors ✅ Added migration summary logging to ChangePipelineRepo method: Provides clear, informational messages about branch policy check results Explains the trigger configuration decision being made Helps users understand whether their branch policies were preserved.
- Introduced `--dry-run` option for single pipeline testing, allowing temporary rewiring to GitHub and build execution. - Implemented `test-pipelines` command for batch testing of multiple Azure DevOps pipelines with concurrency control. - Added `PipelineTestResult` and `PipelineTestSummary` models for detailed reporting of test results. - Enhanced `RewirePipelineCommand` to include new options for dry-run and monitoring timeout. - Created comprehensive documentation for pipeline testing feature, including usage examples and error handling. - Implemented logging and error handling for restoration processes during testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the rewire-pipeline
command to support optional pipeline ID vs pipeline name identification, along with several substantial improvements to pipeline testing and trigger preservation functionality. The changes add a new --ado-pipeline-id
option that provides a more reliable way to identify pipelines by their numeric ID, eliminating the need for name-based lookups which can be unreliable.
Key changes include:
- Added optional
--ado-pipeline-id
parameter with proper validation ensuring mutual exclusivity with--ado-pipeline
- Enhanced trigger preservation logic with branch policy awareness and YAML-controlled configurations
- Added comprehensive dry-run testing capabilities for single pipeline validation
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
RewirePipelineCommandArgs.cs |
Added AdoPipelineId property and dry-run/monitoring options |
RewirePipelineCommand.cs |
Added new command options and updated help text for pipeline ID support |
RewirePipelineCommandHandler.cs |
Enhanced with validation logic, pipeline ID resolution, and comprehensive dry-run functionality |
AdoApi.cs |
Extensive trigger preservation improvements with branch policy checks and YAML control |
Test files | Updated existing tests and added comprehensive new test coverage |
TestPipelinesCommand*.cs |
New batch testing command implementation |
PipelineTestResult.cs |
New model classes for test result tracking |
Comments suppressed due to low confidence (1)
src/ado2gh/Commands/RewirePipeline/RewirePipelineCommandHandler.cs:236
- Catching all exceptions without specifying the exception type violates guideline #6 about never silently swallowing exceptions. Either specify the specific exception types expected or let the exception bubble up.
}
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
originalRepoName, originalDefaultBranch, originalClean, originalCheckoutSubmodules, originalTriggers); | ||
testResult.RestoredSuccessfully = true; | ||
} | ||
catch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching all exceptions without specifying the exception type violates guideline #6 about never silently swallowing exceptions. Either specify the specific exception types expected or let the exception bubble up.
Copilot uses AI. Check for mistakes.
Pipeline ID Support
--ado-pipeline-id
option to support optional numeric pipeline IDsKey Features Implemented:
Mutual Exclusion Validation: The command now properly validates that users specify either --ado-pipeline OR --ado-pipeline-id, but not both or neither
Backward Compatibility: Existing functionality with --ado-pipeline continues to work exactly as before
Enhanced Help Text: The help output clearly explains both options and their usage
Robust Testing: Added comprehensive unit tests for all validation scenarios and functionality paths
Improved Reliability: Using pipeline IDs eliminates the need for name-based lookups, making pipeline identification more reliable