From cb602088ddb6a53c357a20ca833ae846a4257d89 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Wed, 22 Nov 2023 15:18:52 +1100 Subject: [PATCH 01/10] Add a function to filter deployments by tenant --- .../Repositories/Async/DeploymentRepository.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs b/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs index a63594ccb..49fb62630 100644 --- a/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs +++ b/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs @@ -40,6 +40,11 @@ public async Task> FindBy(string[] projec { return await Client.List(await Repository.Link("Deployments").ConfigureAwait(false), new { skip, take, projects = projects ?? new string[0], environments = environments ?? new string[0] }).ConfigureAwait(false); } + + public async Task> FindBy(string[] projects, string[] environments, string[] tenants, int skip = 0, int? take = null) + { + return await Client.List(await Repository.Link("Deployments").ConfigureAwait(false), new { skip, take, projects = projects ?? new string[0], environments = environments ?? new string[0], tenants = tenants ?? new string[0] }).ConfigureAwait(false); + } [Obsolete("This method is not a find all, it still requires paging. So it has been renamed to `FindBy`")] public Task> FindAll(string[] projects, string[] environments, int skip = 0, int? take = null) From be1860bf51f82bb6ee2a8b714e300883b644cbd2 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 09:22:50 +1100 Subject: [PATCH 02/10] add to sync repo --- .../Repositories/Async/DeploymentRepository.cs | 12 ++++++++++++ .../Repositories/DeploymentRepository.cs | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs b/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs index 49fb62630..ff415a766 100644 --- a/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs +++ b/source/Octopus.Server.Client/Repositories/Async/DeploymentRepository.cs @@ -18,6 +18,18 @@ public interface IDeploymentRepository : IGet, ICreate Task> FindBy(string[] projects, string[] environments, int skip = 0, int? take = null); + /// + /// + /// + /// + /// + /// The tenantIds by which to filter deployments + /// Number of records to skip + /// Number of records to take (First supported in Server 3.14.15) + /// + Task> FindBy(string[] projects, string[] environments, string[] tenants, + int skip = 0, int? take = null); + [Obsolete("This method is not a find all, it still requires paging. So it has been renamed to `FindBy`")] Task> FindAll(string[] projects, string[] environments, int skip = 0, int? take = null); Task Paginate(string[] projects, string[] environments, Func, bool> getNextPage); diff --git a/source/Octopus.Server.Client/Repositories/DeploymentRepository.cs b/source/Octopus.Server.Client/Repositories/DeploymentRepository.cs index 98e8fbc30..9918f82b1 100644 --- a/source/Octopus.Server.Client/Repositories/DeploymentRepository.cs +++ b/source/Octopus.Server.Client/Repositories/DeploymentRepository.cs @@ -40,6 +40,11 @@ public ResourceCollection FindBy(string[] projects, string[] { return Client.List(Repository.Link("Deployments"), new { skip, take, projects = projects ?? new string[0], environments = environments ?? new string[0] }); } + + public ResourceCollection FindBy(string[] projects, string[] environments, string[] tenants, int skip = 0, int? take = null) + { + return Client.List(Repository.Link("Deployments"), new { skip, take, projects = projects ?? new string[0], environments = environments ?? new string[0], tenants = tenants ?? new string[0] }); + } [Obsolete("This method is not a find all, it still requires paging. So it has been renamed to `FindBy`")] public ResourceCollection FindAll(string[] projects, string[] environments, int skip = 0, int? take = null) From dfa8bef848f35c17beddde5fe6d9c9c14a71b6f8 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 09:35:48 +1100 Subject: [PATCH 03/10] fixed approved file --- ...re.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt index 7895823e3..3c0d7cd10 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt @@ -8321,6 +8321,7 @@ Octopus.Client.Repositories.Async { Task> FindAll(String[], String[], Int32, Nullable) Task> FindBy(String[], String[], Int32, Nullable) + Task> FindBy(String[], String[], String[], Int32, Nullable) Task GetTask(Octopus.Client.Model.DeploymentResource) Task Paginate(String[], String[], Func, Boolean>) Task Paginate(String[], String[], String[], Func, Boolean>) From bc88ddf66146d51cf3eda913ff0eacfc82e24f6f Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 10:11:20 +1100 Subject: [PATCH 04/10] add other approval file --- ...ublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index dae5d3b0b..44f8d382c 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -8346,6 +8346,7 @@ Octopus.Client.Repositories.Async { Task> FindAll(String[], String[], Int32, Nullable) Task> FindBy(String[], String[], Int32, Nullable) + Task> FindBy(String[], String[], String[], Int32, Nullable) Task GetTask(Octopus.Client.Model.DeploymentResource) Task Paginate(String[], String[], Func, Boolean>) Task Paginate(String[], String[], String[], Func, Boolean>) @@ -9201,4 +9202,4 @@ Octopus.Client.Validation .ctor() Boolean IsValid(Object) } -} \ No newline at end of file +} From ff26c28195edb0b769045aa2efb08f935d4e187f Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 10:38:19 +1100 Subject: [PATCH 05/10] fixed more --- ...ePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index 44f8d382c..c860220d8 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -7611,6 +7611,7 @@ Octopus.Client.Repositories { Octopus.Client.Model.ResourceCollection FindAll(String[], String[], Int32, Nullable) Octopus.Client.Model.ResourceCollection FindBy(String[], String[], Int32, Nullable) + Octopus.Client.Model.ResourceCollection FindBy(String[], String[], String[], Int32, Nullable) Octopus.Client.Model.TaskResource GetTask(Octopus.Client.Model.DeploymentResource) void Paginate(String[], String[], Func, Boolean>) void Paginate(String[], String[], String[], Func, Boolean>) From 0812c23ca13d547cc3a2cad923b7f61bc03e6083 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 10:50:56 +1100 Subject: [PATCH 06/10] change back --- ...ePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index c860220d8..44f8d382c 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -7611,7 +7611,6 @@ Octopus.Client.Repositories { Octopus.Client.Model.ResourceCollection FindAll(String[], String[], Int32, Nullable) Octopus.Client.Model.ResourceCollection FindBy(String[], String[], Int32, Nullable) - Octopus.Client.Model.ResourceCollection FindBy(String[], String[], String[], Int32, Nullable) Octopus.Client.Model.TaskResource GetTask(Octopus.Client.Model.DeploymentResource) void Paginate(String[], String[], Func, Boolean>) void Paginate(String[], String[], String[], Func, Boolean>) From 40af83a403c12dd117c8e8f77fbc2e692b6118a9 Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 11:25:27 +1100 Subject: [PATCH 07/10] add EOL at EOF --- ...ePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index 44f8d382c..fc4452227 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -9203,3 +9203,4 @@ Octopus.Client.Validation Boolean IsValid(Object) } } + From 446576256d8b5a26e97e8b1fd51ee15a4de8b54e Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 11:39:26 +1100 Subject: [PATCH 08/10] remove the line again --- ...ublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index fc4452227..c073d123d 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -9202,5 +9202,4 @@ Octopus.Client.Validation .ctor() Boolean IsValid(Object) } -} - +} From 4d2c9ebc5cad3da12af037a6a5e8a6a5f538593c Mon Sep 17 00:00:00 2001 From: Trent Mohay Date: Thu, 23 Nov 2023 11:40:57 +1100 Subject: [PATCH 09/10] remove EOL --- ...PublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index c073d123d..44f8d382c 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -9202,4 +9202,4 @@ Octopus.Client.Validation .ctor() Boolean IsValid(Object) } -} +} From 2d5f3d9fbc2039141e35c7fcd7b06e34fbb8dd88 Mon Sep 17 00:00:00 2001 From: Joel Skerman Date: Thu, 23 Nov 2023 11:19:44 +1000 Subject: [PATCH 10/10] Correct EOF in NET framework surface area assent tests --- ...PublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index 44f8d382c..4477d8c90 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -9202,4 +9202,4 @@ Octopus.Client.Validation .ctor() Boolean IsValid(Object) } -} +} \ No newline at end of file