Skip to content

Fix rewire-pipeline for Classic (Designer) pipelines#1526

Open
mulana wants to merge 1 commit intomainfrom
fix/classic-pipeline-rewire-support
Open

Fix rewire-pipeline for Classic (Designer) pipelines#1526
mulana wants to merge 1 commit intomainfrom
fix/classic-pipeline-rewire-support

Conversation

@mulana
Copy link
Contributor

@mulana mulana commented Mar 14, 2026

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 while keeping existing YAML pipeline behavior unchanged.

  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

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.
Copilot AI review requested due to automatic review settings March 14, 2026 00:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.type from the build definition response to distinguish Classic (Designer) vs YAML pipelines.
  • Sets settingsSourceType=1 for Classic pipelines and settingsSourceType=2 for 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.

@github-actions
Copy link

Unit Test Results

    1 files      1 suites   10m 25s ⏱️
1 034 tests 1 034 ✅ 0 💤 0 ❌
1 035 runs  1 035 ✅ 0 💤 0 ❌

Results for commit 4cd38dd.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 71% 70% 737
bbs2gh 83% 78% 663
gei 81% 73% 608
Octoshift 84% 74% 1822
Summary 81% (7945 / 9830) 74% (1958 / 2661) 3830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants