-
Notifications
You must be signed in to change notification settings - Fork 123
Enhance RewirePipeline command to support optional pipeline ID vs pipeline name #1416
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
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 RewirePipeline command to support optional pipeline ID vs pipeline name, adds comprehensive trigger preservation logic, and introduces a new pipeline testing framework.
Key changes include:
- Added
--ado-pipeline-idoption as an alternative to--ado-pipeline - Implemented comprehensive trigger preservation logic with branch policy awareness
- Added dry-run testing mode and new batch testing command
- Enhanced pipeline rewiring to preserve original ADO trigger configurations
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ado2gh/Commands/RewirePipeline/RewirePipelineCommand.cs | Added pipeline ID option, dry-run mode, and parameter validation |
| src/ado2gh/Commands/RewirePipeline/RewirePipelineCommandArgs.cs | Added new properties for pipeline ID, dry-run mode, and timeout settings |
| src/ado2gh/Commands/RewirePipeline/RewirePipelineCommandHandler.cs | Enhanced with pipeline ID resolution, dry-run testing, and trigger preservation |
| src/Octoshift/Services/AdoPipelineTriggerService.cs | New service for managing complex pipeline trigger configuration during rewiring |
| src/Octoshift/Services/AdoApi.cs | Added new methods for build operations and pipeline repository management |
| src/Octoshift/Services/PipelineTestService.cs | New service for testing pipelines by temporarily rewiring them |
| src/ado2gh/Commands/TestPipelines/*.cs | New batch testing command for testing multiple pipelines concurrently |
| Multiple test files | Comprehensive test coverage for new functionality |
Comments suppressed due to low confidence (1)
src/OctoshiftCLI.Tests/ado2gh/Commands/RewirePipeline/RewirePipelineCommandHandlerTests.cs:162
- The URL is missing the base URL scheme and host. It should start with the full ADO service URL (e.g., 'https://dev.azure.com') instead of just '/'.
await _handler.Handle(args);
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
src/OctoshiftCLI.Tests/Octoshift/Services/AdoPipelineTriggerService_BranchPolicyTests.cs
Show resolved
Hide resolved
Unit Test Results 1 files 1 suites 10m 24s ⏱️ Results for commit ce9c4c0. ♻️ This comment has been updated with latest results. |
offbyone
left a comment
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.
It's really hard to review this in isolation, as it seems to include the changes in #1417 as well.
…eCommandHandler - Added try-catch blocks to handle HTTP request exceptions in AdoPipelineTriggerService. - Implemented logging for 404 errors and other HTTP errors during pipeline retrieval. - Updated RewirePipelineCommandHandler to throw exceptions for pipeline not found and lookup failures, with appropriate logging. - Introduced unit tests for error handling scenarios in both AdoPipelineTriggerService and RewirePipelineCommandHandler.
Pipeline ID Support
--ado-pipeline-idoption 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