Skip to content

Commit

Permalink
Merge pull request #1221 from tiago-soczek/main
Browse files Browse the repository at this point in the history
Fix #1220 - Unable to rewire pipeline when ADO Team Project has many BuildDefinitions (+10000)
  • Loading branch information
brianaj authored Feb 9, 2024
2 parents feba349 + 8402a76 commit b932e62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Add `--target-api-url` to `gh ado2gh migrate-repo`, `gh bbs2gh migrate-repo`, and `gh gei migrate-org` to support newer GitHub migration paths.
- Add `--target-api-url` to `gh ado2gh migrate-repo`, `gh bbs2gh migrate-repo`, and `gh gei migrate-org` to support newer GitHub migration paths.
- Fixed `gh ado2gh rewire-pipeline` command for ADO Team Projects with more than 10,000 Build Definitions.
2 changes: 1 addition & 1 deletion src/Octoshift/Services/AdoApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public virtual async Task<int> GetPipelineId(string org, string teamProject, str
return result;
}

var url = $"{_adoBaseUrl}/{org.EscapeDataString()}/{teamProject.EscapeDataString()}/_apis/build/definitions";
var url = $"{_adoBaseUrl}/{org.EscapeDataString()}/{teamProject.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = await _client.GetWithPagingAsync(url);

foreach (var item in response)
Expand Down
10 changes: 5 additions & 5 deletions src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public async Task GetPipelineId_Should_Return_PipelineId()
var pipeline = "foo-pipe";
var pipelineId = 36383;

var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions";
var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = new object[]
{
new
Expand Down Expand Up @@ -732,7 +732,7 @@ public async Task GetPipelineId_With_Pipeline_Path_Should_Return_PipelineId()
var pipeline = "\\some-folder\\another\\foo-pipe";
var pipelineId = 36383;

var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions";
var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = new object[]
{
new
Expand Down Expand Up @@ -762,7 +762,7 @@ public async Task GetPipelineId_With_Name_And_No_Path_Should_Succeed_When_Only_O
var pipeline = "foo-pipe";
var pipelineId = 36383;

var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions";
var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = new object[]
{
new
Expand Down Expand Up @@ -792,7 +792,7 @@ public async Task GetPipelineId_With_Name_And_No_Path_Should_Fail_When_Multiple_
var pipeline = "foo-pipe";
var pipelineId = 36383;

var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions";
var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = new object[]
{
new
Expand Down Expand Up @@ -823,7 +823,7 @@ public async Task GetPipelineId_When_Duplicate_Pipeline_Name_And_Path_Should_Ign
var pipeline = "\\some-folder\\foo-pipe";
var pipelineId = 36383;

var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions";
var endpoint = $"https://dev.azure.com/{ADO_ORG.EscapeDataString()}/{ADO_TEAM_PROJECT.EscapeDataString()}/_apis/build/definitions?queryOrder=definitionNameAscending";
var response = new object[]
{
new
Expand Down

0 comments on commit b932e62

Please sign in to comment.