Skip to content

Commit

Permalink
Added API Endpoints for account config
Browse files Browse the repository at this point in the history
This is where we will store config like the blast radius limits.
  • Loading branch information
dylanratcliffe authored and DavidS-ovm committed Jun 20, 2024
1 parent 0f1bcc3 commit 63503a4
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changes.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto";
import "bookmarks.proto";
import "items.proto";
import "snapshots.proto";
import "account.proto";

// ______
// ,'" "-._
Expand Down Expand Up @@ -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 {
Expand Down
41 changes: 41 additions & 0 deletions config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ option go_package = "github.com/overmindtech/sdp-go;sdp";

// a simple key-value store to store the config for the CLI
service ConfigService {
// GetConfig provides raw access to the underlying stored data. [experimental]
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
// SetConfig provides raw access to the underlying stored data. [experimental]
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) {}

// 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);
}

message GetConfigRequest {
Expand All @@ -22,3 +29,37 @@ message SetConfigRequest {
}
message SetConfigResponse {
}


// 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.
message UpdateAccountConfigRequest {
AccountConfig config = 1;
}

message UpdateAccountConfigResponse {
AccountConfig config = 1;
}

0 comments on commit 63503a4

Please sign in to comment.