Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions third_party/buildbuddy/proto/api/v1/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
syntax = "proto3";

package api.v1;

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

enum Status {
// The implicit default enum value. Should never be set.
STATUS_UNSPECIFIED = 0;

// Displays as "Building". Means the target is compiling, linking, etc.
BUILDING = 1;

// Displays as "Built". Means the target was built successfully.
// If testing was requested, it should never reach this status: it should go
// straight from BUILDING to TESTING.
BUILT = 2;

// Displays as "Broken". Means build failure such as compile error.
FAILED_TO_BUILD = 3;

// Displays as "Testing". Means the test is running.
TESTING = 4;

// Displays as "Passed". Means the test was run and passed.
PASSED = 5;

// Displays as "Failed". Means the test was run and failed.
FAILED = 6;

// Displays as "Timed out". Means the test didn't finish in time.
TIMED_OUT = 7;

// Displays as "Cancelled". Means the build or test was cancelled.
// E.g. User hit control-C.
CANCELLED = 8;

// Displays as "Tool Failed". Means the build or test had internal tool
// failure.
TOOL_FAILED = 9;

// Displays as "Incomplete". Means the build or test did not complete. This
// might happen when a build breakage or test failure causes the tool to stop
// trying to build anything more or run any more tests, with the default
// bazel --nokeep_going option or the --notest_keep_going option.
INCOMPLETE = 10;

// Displays as "Flaky". Means the aggregate status contains some runs that
// were successful, and some that were not.
FLAKY = 11;

// Displays as "Unknown". Means the tool uploading to the server died
// mid-upload or does not know the state.
UNKNOWN = 12;

// Displays as "Skipped". Means building and testing were skipped.
// (E.g. Restricted to a different configuration.)
SKIPPED = 13;
}

// These correspond to the suffix of the rule name. Eg cc_test has type TEST.
enum TargetType {
// Unspecified by the build system.
TARGET_TYPE_UNSPECIFIED = 0;

// An application e.g. ios_application.
APPLICATION = 1;

// A binary target e.g. cc_binary.
BINARY = 2;

// A library target e.g. java_library
LIBRARY = 3;

// A package
PACKAGE = 4;

// Any test target, in bazel that means a rule with a '_test' suffix.
TEST = 5;
}

// Indicates how big the user indicated the test action was.
enum TestSize {
// Unspecified by the user.
TEST_SIZE_UNSPECIFIED = 0;

// Unit test taking less than 1 minute.
SMALL = 1;

// Integration tests taking less than 5 minutes.
MEDIUM = 2;

// End-to-end tests taking less than 15 minutes.
LARGE = 3;

// Even bigger than LARGE.
ENORMOUS = 4;

// Something that doesn't fit into the above categories.
OTHER_SIZE = 5;
}

// The timing of a particular Invocation, Action, etc. The start_time is
// specified, stop time can be calculated by adding duration to start_time.
message Timing {
// The time the resource started running. This is in UTC Epoch time.
google.protobuf.Timestamp start_time = 1;

// The duration for which the resource ran.
google.protobuf.Duration duration = 2;
}
152 changes: 152 additions & 0 deletions third_party/buildbuddy/proto/api_key.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
syntax = "proto3";

import "third_party/buildbuddy/proto/context.proto";

package api_key;

// An API key used to access BuildBuddy.
message ApiKey {
// The unique ID of this API key.
// ex: "AK123456789"
string id = 1;

// The string value of this API key which is passed in API requests.
string value = 2;

// Optional. The user-specified label of this API key that helps them
// remember what it's for.
string label = 3;

// A capability associated with an API key.
//
// Values are powers of 2 so that bitmask operations can be used
// to check capabilities.
enum Capability {
UNKNOWN_CAPABILITY = 0;
// Allows writing to the content-addressable store and action cache.
CACHE_WRITE_CAPABILITY = 1; // 2^0
// Allows registering an executor with the scheduler.
REGISTER_EXECUTOR_CAPABILITY = 2; // 2^1
// Allows writing to the content-addressable store only.
CAS_WRITE_CAPABILITY = 4; // 2^2
// Allows changing org-level settings and managing org users, such as via
// the settings UI or via the SCIM API.
ORG_ADMIN_CAPABILITY = 8; // 2^3
}

// Capabilities associated with this API key.
repeated Capability capability = 4;

// True if this API key is visible to developers.
bool visible_to_developers = 5;

// True if this is a user owned key.
bool user_owned = 6;

// Optional time after which this API key is no longer valid.
int64 expiry_usec = 7;
}

message CreateApiKeyRequest {
context.RequestContext request_context = 1;

// The ID of the group to create the API key for.
// ex: "GR123456789"
string group_id = 2;

// Optional. The user-specified label of this API key that helps them
// remember what it's for.
string label = 3;

// Optional. Capabilities granted to this API key.
repeated ApiKey.Capability capability = 4;

// True if this API key should be visible to developers.
bool visible_to_developers = 5;
}

message CreateApiKeyResponse {
context.ResponseContext response_context = 1;

// The API key that was created.
ApiKey api_key = 2;
}

message GetApiKeysRequest {
context.RequestContext request_context = 1;

// The ID of the group to get API keys for.
// ex: "GR123456789"
string group_id = 2;
}

message GetApiKeysResponse {
context.ResponseContext response_context = 1;

// The API keys owned by the requested group.
repeated ApiKey api_key = 2;
}

message GetApiKeyRequest {
context.RequestContext request_context = 1;

// The ID of the API key to retrieve.
// ex: "AK123456789"
string api_key_id = 2;
}

message GetApiKeyResponse {
context.ResponseContext response_context = 1;

ApiKey api_key = 2;
}

message UpdateApiKeyRequest {
context.RequestContext request_context = 1;

// The unique ID of the API key to be updated.
// ex: "AK123456789"
string id = 2;

// Optional. The user-specified label of this API key that helps them
// remember what it's for.
//
// NOTE: If this is empty, the label will be deleted.
string label = 3;

// Optional. The capabilities associated with this API key.
//
// NOTE: If this is empty, all capabilities will be removed as part of
// this update.
repeated ApiKey.Capability capability = 4;

// True if this API key should be visible to developers.
bool visible_to_developers = 5;
}

message UpdateApiKeyResponse {
context.ResponseContext response_context = 1;
}

message DeleteApiKeyRequest {
context.RequestContext request_context = 1;

// The unique ID of the API key to be updated.
// ex: "AK123456789"
string id = 2;
}

message DeleteApiKeyResponse {
context.ResponseContext response_context = 1;
}

message CreateImpersonationApiKeyRequest {
context.RequestContext request_context = 1;
}

message CreateImpersonationApiKeyResponse {
context.ResponseContext response_context = 1;

// The API key that was created.
ApiKey api_key = 2;
}
Loading