From 8cc0c0ab98916e5834d01a7b999a549578c509c0 Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Sat, 15 Jun 2024 10:23:48 +0000 Subject: [PATCH 1/3] Added API Endpoints for account config This is where we will store config for the blast radius --- account.proto | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/account.proto b/account.proto index 1dbb973..aa548d2 100644 --- a/account.proto +++ b/account.proto @@ -164,6 +164,11 @@ service ManagementService { rpc RevlinkWarmup(RevlinkWarmupRequest) returns (stream RevlinkWarmupResponse); rpc GetTrialEnd(GetTrialEndRequest) returns (GetTrialEndResponse); + + // Get the account config for the user's account + rpc GetAccountConfig(GetAccountConfigRequest) returns (GetAccountConfigResponse); + // Update the account config for the user's account + rpc UpdateAccountConfig(UpdateAccountConfigRequest) returns (UpdateAccountConfigResponse); } enum SourceStatus { @@ -322,3 +327,37 @@ message GetTrialEndRequest {} message GetTrialEndResponse { google.protobuf.Timestamp endsAt = 1; } + +// The config that is used when calculating the blast radius for a change, this +// does not affect manually requested blast radii vie the "Explore" view or the +// API +message BlastRadiusConfig { + // The maximum number of items that can be returned in a single blast radius + // request. Once a request has hit this limit, all currently running + // requests will be cancelled and the blast radius returned as-is + int32 maxItems = 1; + + // How deeply to link when calculating the blast radius for a change + int32 linkDepth = 2; +} + +message AccountConfig { + // The blast radius config for this account + BlastRadiusConfig blastRadius = 1; +} + +message GetAccountConfigRequest {} + +message GetAccountConfigResponse { + AccountConfig config = 1; +} + +// Updates the account config for the user's account. All fields are optional +// and only ones that are supplied will actually be updated +message UpdateAccountConfigRequest { + optional BlastRadiusConfig blastRadius = 1; +} + +message UpdateAccountConfigResponse { + AccountConfig config = 1; +} \ No newline at end of file From 9862425c2f2d219a4188b838f2094a69c180512c Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Sat, 15 Jun 2024 14:19:17 +0000 Subject: [PATCH 2/3] Allow overriding of the blast radius config This allows someone to customise the behaviour to for example calculate a lightweight blast radius for less important changes --- changes.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changes.proto b/changes.proto index e0ad0df..ed25ff7 100644 --- a/changes.proto +++ b/changes.proto @@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto"; import "bookmarks.proto"; import "items.proto"; import "snapshots.proto"; +import "account.proto"; // ______ // ,'" "-._ @@ -231,6 +232,9 @@ message UpdatePlannedChangesRequest { // the changing items repeated MappedItemDiff changingItems = 2; + + // Overrides the stored blast radius config for this change + optional account.BlastRadiusConfig blastRadiusConfigOverride = 3; } message ListAppChangesSummaryRequest { From 02598b3f8dcc33f0f19492b8957405c4c3df7611 Mon Sep 17 00:00:00 2001 From: Dylan Ratcliffe Date: Wed, 19 Jun 2024 16:35:35 +0000 Subject: [PATCH 3/3] Simply config --- account.proto | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/account.proto b/account.proto index aa548d2..db9e465 100644 --- a/account.proto +++ b/account.proto @@ -352,10 +352,9 @@ message GetAccountConfigResponse { AccountConfig config = 1; } -// Updates the account config for the user's account. All fields are optional -// and only ones that are supplied will actually be updated +// Updates the account config for the user's account. message UpdateAccountConfigRequest { - optional BlastRadiusConfig blastRadius = 1; + AccountConfig config = 1; } message UpdateAccountConfigResponse {