Skip to content

Conversation

@brianaj
Copy link
Collaborator

@brianaj brianaj commented Dec 22, 2025

This PR merges external PR #1465 from @georgy-gorelko which improves error handling and monitoring for the rewire-pipeline command.

Summary

Comprehensive improvements to ADO pipeline rewiring with better error handling, especially around disabled repositories and branch policy checks. Fixes issues introduced in v1.19.0.

Key Changes

1. Fixed Branch Policy Check with Prefixed Repo Names

  • Now uses repository ID directly when available instead of just name
  • Prevents 404 errors during rewiring for classic pipelines with prefixed names
  • Smart fallback: uses ID if available, otherwise looks up by name

2. Disabled Repository Handling

  • Checks if repository is disabled before attempting operations
  • Skips pipeline rewiring entirely for disabled repos with clear warnings
  • Prevents unnecessary API calls that would fail
  • Returns proper status (true/false) to indicate success/skip

3. Pipeline Disabled Check

  • New IsPipelineEnabled() method checks queueStatus field
  • Prevents 400 Bad Request errors when trying to queue builds on disabled pipelines
  • Clear warning messages when pipeline is disabled

4. Fixed Misleading Success Messages

  • Changed RewirePipelineToGitHub to return bool instead of void
  • Only logs success when rewiring actually happened (not when skipped)
  • Caller checks return value before showing success message

5. Monitor Timeout Display

  • Only shows timeout minutes in dry-run mode (where it's relevant)
  • Updated description: "(Dry-run mode only)"
  • Custom Log() override in RewirePipelineCommandArgs excludes MonitorTimeoutMinutes

6. Caching Improvements

  • Enhanced cache to store both ID and disabled status
  • 404 responses treated as disabled repos and cached to avoid repeated calls
  • Reduces redundant API calls

Test Coverage

Excellent test coverage with 11 new tests:

  • IsPipelineEnabled tests (4 tests)
  • Branch policy tests (3 tests)
  • Rewiring tests (3 tests)
  • Pipeline test service (1 test)

Testing

  • All 1029 tests passing
  • Comprehensive coverage of disabled repo/pipeline scenarios

Closes #1465

cc: @georgy-gorelko

Georgy Gorelko and others added 13 commits December 3, 2025 15:12
… GitHub migration

- Added IsPipelineEnabled method to AdoApi to check if a pipeline is enabled, disabled, or paused.
- Updated AdoPipelineTriggerService to skip rewiring if the repository is disabled or returns a 404.
- Enhanced error handling in RewirePipelineToGitHub to return false when skipping due to disabled repositories.
- Added tests for IsPipelineEnabled to verify behavior for enabled, disabled, paused, and missing queue status.
- Updated tests in AdoPipelineTriggerService to ensure correct handling of disabled repositories and 404 responses.
- Improved logging in RewirePipelineCommandArgs to include relevant properties while excluding MonitorTimeoutMinutes.
- Set default value for MonitorTimeoutMinutes in RewirePipelineCommandArgs.
Updated release notes to reflect recent fixes and improvements in the pipeline rewiring process, including handling for disabled repositories and clearer error messages.
@github-actions
Copy link

github-actions bot commented Dec 22, 2025

Unit Test Results

    1 files      1 suites   10m 25s ⏱️
1 028 tests 1 028 ✅ 0 💤 0 ❌
1 029 runs  1 029 ✅ 0 💤 0 ❌

Results for commit f3c3440.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 71% 70% 737
Octoshift 84% 74% 1818
bbs2gh 83% 78% 663
gei 81% 73% 608
Summary 81% (7942 / 9824) 74% (1956 / 2657) 3826

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.

3 participants