diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 74ffdc37a..6bd248fa0 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -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. \ No newline at end of file +- 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. diff --git a/src/Octoshift/Services/AdoApi.cs b/src/Octoshift/Services/AdoApi.cs index 28e1c422e..c0db6abb5 100644 --- a/src/Octoshift/Services/AdoApi.cs +++ b/src/Octoshift/Services/AdoApi.cs @@ -423,7 +423,7 @@ public virtual async Task 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) diff --git a/src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs b/src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs index ea037ffb1..1b79b132c 100644 --- a/src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs +++ b/src/OctoshiftCLI.Tests/Octoshift/Services/AdoApiTests.cs @@ -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 @@ -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 @@ -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 @@ -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 @@ -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