Skip to content

Commit

Permalink
Merge pull request #226 from overmindtech/blast-radius-limit-config
Browse files Browse the repository at this point in the history
Added API Endpoints for account config
  • Loading branch information
DavidS-ovm authored Jun 20, 2024
2 parents 0f1bcc3 + 04d8cf7 commit 33ceb68
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12 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 "config.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 config.BlastRadiusConfig blastRadiusConfigOverride = 3;
}

message ListAppChangesSummaryRequest {
Expand Down
24 changes: 24 additions & 0 deletions cli.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package cli;
option go_package = "github.com/overmindtech/sdp-go;sdp";

// a simple key-value store to store the config for the CLI
service ConfigService {
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
rpc SetConfig(SetConfigRequest) returns (SetConfigResponse) {}
}

message GetConfigRequest {
string key = 1;
}
message GetConfigResponse {
string value = 1;
}

message SetConfigRequest {
string key = 1;
string value = 2;
}
message SetConfigResponse {
}
45 changes: 33 additions & 12 deletions config.proto
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
syntax = "proto3";

package cli;
package config;
option go_package = "github.com/overmindtech/sdp-go;sdp";

// a simple key-value store to store the config for the CLI
// a simple key-value store to store configuration data for accounts and users (TODO)
service ConfigService {
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
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 {
string key = 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 GetConfigResponse {
string value = 1;

message GetAccountConfigRequest {}

message GetAccountConfigResponse {
AccountConfig config = 1;
}

message SetConfigRequest {
string key = 1;
string value = 2;
// Updates the account config for the user's account.
message UpdateAccountConfigRequest {
AccountConfig config = 1;
}
message SetConfigResponse {

message UpdateAccountConfigResponse {
AccountConfig config = 1;
}

0 comments on commit 33ceb68

Please sign in to comment.