Fix rewire-pipeline for Classic (Designer) pipelines#1526
Open
Fix rewire-pipeline for Classic (Designer) pipelines#1526
Conversation
The rewire-pipeline command fails with HTTP 400 Bad Request when targeting Classic Build pipelines because BuildPipelinePayload unconditionally sets settingsSourceType=2 (YAML definitions). Classic pipelines use a Designer process (process.type=1) and don't have YAML definitions, causing the ADO API to reject the update. Changes: - Detect pipeline process type from the definition response - Use settingsSourceType=1 for Classic pipelines, 2 for YAML - Preserve original trigger configuration for Classic pipelines instead of reconfiguring for YAML Fixes classic pipeline rewiring (e.g. pipeline ID 11 test-CI) while keeping existing YAML pipeline behavior unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes rewire-pipeline updates for Azure DevOps Classic (Designer) build definitions by aligning the update payload with the pipeline’s actual process type, avoiding invalid YAML-only settings for Classic pipelines.
Changes:
- Detects
process.typefrom the build definition response to distinguish Classic (Designer) vs YAML pipelines. - Sets
settingsSourceType=1for Classic pipelines andsettingsSourceType=2for YAML pipelines. - Preserves Classic pipeline trigger configuration instead of reconfiguring it for YAML behavior, and adds unit tests covering these cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Octoshift/Services/AdoPipelineTriggerService.cs | Determines pipeline process type and adjusts payload (settingsSourceType, trigger handling) for Classic vs YAML definitions. |
| src/OctoshiftCLI.Tests/Octoshift/Services/AdoPipelineTriggerService_ClassicPipelineTests.cs | Adds unit tests validating settingsSourceType selection and trigger preservation for Classic pipelines. |
Unit Test Results 1 files 1 suites 10m 25s ⏱️ Results for commit 4cd38dd. |
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
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.
The rewire-pipeline command fails with HTTP 400 Bad Request when targeting Classic Build pipelines because BuildPipelinePayload unconditionally sets settingsSourceType=2 (YAML definitions). Classic pipelines use a Designer process (process.type=1) and don't have YAML definitions, causing the ADO API to reject the update.
Changes:
process typefrom the definition responsesettingsSourceType=1for Classic pipelines,2for YAMLFixes classic pipeline rewiring while keeping existing YAML pipeline behavior unchanged.
ThirdPartyNotices.txt(if applicable)