databuild/databuild/databuild.proto
2025-08-20 23:34:37 -07:00

1087 lines
32 KiB
Protocol Buffer

syntax = "proto3";
package databuild.v1;
message PartitionRef {
string str = 1;
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Jobs
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Job Config
//
// The type of dependency
enum DepType {
QUERY = 0; // Default
MATERIALIZE = 1;
}
// Represents a data dependency
message DataDep {
DepType dep_type_code = 1; // Enum for programmatic use
string dep_type_name = 2; // Human-readable string ("query", "materialize")
PartitionRef partition_ref = 3; // Moved from field 2 to 3
}
// Configuration for a job
message JobConfig {
// The partitions that this parameterization produces
repeated PartitionRef outputs = 1;
// Required data dependencies
repeated DataDep inputs = 2;
// Command line arguments
repeated string args = 3;
// Environment variables
map<string, string> env = 4;
}
// Request message for job configuration service
message JobConfigureRequest { repeated PartitionRef outputs = 1; }
// Response message for job configuration service
message JobConfigureResponse { repeated JobConfig configs = 1; }
// Implemented by the job.cfg bazel rule
service JobConfigure {
rpc Configure(JobConfigureRequest) returns (JobConfigureResponse);
}
//
// Job Exec
//
// Manifest that records the literal partitions consumed (and their manifests) in order to
// produce the specified partitions
message PartitionManifest {
// The refs of the partitions produced by this job
repeated PartitionRef outputs = 1;
// Input partition manifests
repeated PartitionManifest inputs = 2;
// Start time of job execution (Unix timestamp seconds)
int64 start_time = 3;
// End time of job execution (Unix timestamp seconds)
int64 end_time = 4;
// The configuration used to run the job
Task task = 5;
// Arbitrary metadata about the produced partitions, keyed by partition ref
map<string, string> metadata = 6;
}
message JobExecuteRequest { repeated PartitionRef outputs = 1; }
// Metadata for the complete set of partitions produced by this job
message JobExecuteResponse { repeated PartitionManifest manifests = 1; }
// Implemented by the job.exec bazel rule
service JobExecute {
rpc Execute(JobExecuteRequest) returns (JobExecuteResponse);
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Graphs
///////////////////////////////////////////////////////////////////////////////////////////////
//
// GraphLookup
//
message JobLabel {
// The bazel label the references the job_target
string label = 1;
}
message GraphLookupRequest { repeated PartitionRef outputs = 1; }
// Represents a not-yet configured task
message TaskRef {
// The job whose configure/exec targets will be used
JobLabel job = 1;
// The partition refs this task is responsible for producing, and with which the configure
// target will be invoked
repeated PartitionRef outputs = 2;
}
// Represents the complete set of tasks needed to produce the requested partitions
message GraphLookupResponse { repeated TaskRef task_refs = 1; }
// Implemented per graph
service GraphLookup {
rpc Lookup(GraphLookupRequest) returns (GraphLookupResponse);
}
// Request message for graph analyze service
message GraphAnalyzeRequest { repeated PartitionRef outputs = 1; }
//
// JobGraph
//
message Task {
// The bazel label uniquely identifying the job
JobLabel job = 1;
// The configuration for the job
JobConfig config = 2;
}
// The bazel label referencing the graph
message GraphLabel { string label = 1; }
// Represents a job graph
message JobGraph {
// The bazel label of the graph to be executed
GraphLabel label = 1;
// The output partitions to be produced by this graph
repeated PartitionRef outputs = 2;
// The job configurations that make up this graph
repeated Task nodes = 3;
}
// Response message for graph analyze service
message GraphAnalyzeResponse { JobGraph graph = 1; }
message GraphExecuteResponse { repeated PartitionManifest manifests = 1; }
message GraphBuildRequest { repeated PartitionRef outputs = 1; }
message GraphBuildResponse { repeated PartitionManifest manifests = 1; }
///////////////////////////////////////////////////////////////////////////////////////////////
// Build Event Log
///////////////////////////////////////////////////////////////////////////////////////////////
// Filter for querying build events
message EventFilter {
repeated string partition_refs = 1;
repeated string partition_patterns = 2;
repeated string job_labels = 3;
repeated string job_run_ids = 4;
repeated string build_request_ids = 5;
}
// Paginated response for build events
message EventPage {
repeated BuildEvent events = 1;
int64 next_idx = 2;
bool has_more = 3;
}
// Partition lifecycle states
enum PartitionStatus {
PARTITION_UNKNOWN = 0;
PARTITION_REQUESTED = 1; // Partition requested but not yet analyzed
PARTITION_ANALYZED = 2; // Partition analyzed successfully
PARTITION_BUILDING = 3; // Job actively building this partition
PARTITION_AVAILABLE = 4; // Partition successfully built and available
PARTITION_FAILED = 5; // Partition build failed
PARTITION_DELEGATED = 6; // Request delegated to existing build
}
// Job execution lifecycle
enum JobStatus {
JOB_UNKNOWN = 0;
JOB_SCHEDULED = 1; // Job scheduled for execution
JOB_RUNNING = 2; // Job actively executing
JOB_COMPLETED = 3; // Job completed successfully
JOB_FAILED = 4; // Job execution failed
JOB_CANCELLED = 5; // Job execution cancelled
JOB_SKIPPED = 6; // Job skipped because target partitions already available
}
// Build request lifecycle
enum BuildRequestStatusCode {
// Not good
BUILD_REQUEST_UNKNOWN = 0;
// Build request received
BUILD_REQUEST_RECEIVED = 1;
// Graph analysis in progress
BUILD_REQUEST_PLANNING = 2;
// Graph analysis completed successfully
BUILD_REQUEST_ANALYSIS_COMPLETED = 7;
// Jobs are being executed
BUILD_REQUEST_EXECUTING = 3;
// All requested partitions built
BUILD_REQUEST_COMPLETED = 4;
// Build precondition failed (e.g. required external data was not available)
BUILD_REQUEST_PRECONDITION_FAILED = 8;
// Build request failed
BUILD_REQUEST_FAILED = 5;
// Build request cancelled
BUILD_REQUEST_CANCELLED = 6;
}
message BuildRequestStatus {
// Enum for programmatic use
BuildRequestStatusCode code = 1;
// Human readable string
string name = 2;
}
// Build request lifecycle event
message BuildRequestEvent {
// The status that this event indicates
BuildRequestStatus status = 1;
// Output partitions requested to be built as part of this build
repeated PartitionRef requested_partitions = 3;
// Optional status message
string message = 4;
// The comment attached to the request - contains arbitrary text
optional string comment = 5;
// The id of the want that triggered this build
optional string want_id = 6;
}
// Partition state change event
message PartitionEvent {
PartitionRef partition_ref = 1;
PartitionStatus status_code = 2; // Enum for programmatic use
string status_name = 3; // Human-readable string
string message = 4; // Optional status message
string job_run_id = 5; // UUID of job run producing this partition (if applicable)
}
// Job execution event
message JobEvent {
string job_run_id = 1; // UUID for this job run
JobLabel job_label = 2; // Job being executed
repeated PartitionRef target_partitions = 3; // Partitions this job run produces
JobStatus status_code = 4; // Enum for programmatic use
string status_name = 5; // Human-readable string
string message = 6; // Optional status message
JobConfig config = 7; // Job configuration used (for SCHEDULED events)
repeated PartitionManifest manifests = 8; // Results (for COMPLETED events)
}
// Delegation event (when build request delegates to existing build)
message DelegationEvent {
PartitionRef partition_ref = 1;
string delegated_to_build_request_id = 2; // Build request handling this partition
string message = 3; // Optional message
}
// Job graph analysis result event (stores the analyzed job graph)
message JobGraphEvent {
JobGraph job_graph = 1; // The analyzed job graph
string message = 2; // Optional message
}
// Partition invalidation event
message PartitionInvalidationEvent {
PartitionRef partition_ref = 1; // Partition being invalidated
string reason = 2; // Reason for invalidation
}
// Job run cancellation event
message JobRunCancelEvent {
string job_run_id = 1; // UUID of the job run being cancelled
string reason = 2; // Reason for cancellation
}
// Build cancellation event
message BuildCancelEvent {
string reason = 1; // Reason for cancellation
}
message WantEvent {
repeated PartitionRef requested_partitions = 1;
// Unique identifier
string want_id = 2;
// How this want was created
WantSource source = 3;
string comment = 4;
}
message PartitionWant {
string want_id = 1;
// The ref we want to materialize
PartitionRef ref = 2;
// Server time when want registered
uint64 created_at = 3;
// Business time this partition represents
uint64 data_timestamp = 4;
// Give up after this long (from created_at)
optional uint64 ttl_seconds = 5;
// SLA violation after this long (from data_timestamp)
optional uint64 sla_seconds = 6;
// Cross-graph dependencies determined in the analysis phase triggered upon want submission
// These are per-partition, since wants can be partially, marginally materialized
repeated string external_dependencies = 7;
}
message WantSource {
// The source of the want
SourceType source_type = 1;
// TODO implement something to record want actual want source for external requests when we have real use case
}
message SourceType {
SourceTypeCode code = 1;
string name = 2;
}
enum SourceTypeCode {
// Manual CLI request
CLI_MANUAL = 0;
// Manual dashboard request
DASHBOARD_MANUAL = 1;
// Scheduled/triggered job
SCHEDULED = 2;
// External API call
API_REQUEST = 3;
}
// Marks a partition as tainted, so that it will be rebuilt if a data dep points to it, and will be rebuilt if a live
// want points to it.
message TaintEvent {
// The list of partitions to be tainted
repeated PartitionRef refs = 1;
// When the taint was created
uint64 created_at = 2;
// The source of the taint event
SourceType source_type = 3;
// Free text comment attached to the taint
string comment = 4;
}
// Individual build event
message BuildEvent {
// Event metadata
string event_id = 1; // UUID for this event
int64 timestamp = 2; // Unix timestamp (nanoseconds)
optional string build_request_id = 3;
// Event type and payload (one of)
oneof event_type {
BuildRequestEvent build_request_event = 10;
PartitionEvent partition_event = 11;
JobEvent job_event = 12;
DelegationEvent delegation_event = 13;
JobGraphEvent job_graph_event = 14;
PartitionInvalidationEvent partition_invalidation_event = 15;
JobRunCancelEvent job_run_cancel_event = 16;
BuildCancelEvent build_cancel_event = 17;
WantEvent want_event = 18;
TaintEvent taint_event = 19;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Job Wrapper Log Protocol
///////////////////////////////////////////////////////////////////////////////////////////////
// Structured log entry emitted by job wrapper to stdout
message JobLogEntry {
string timestamp = 1; // Unix timestamp
string job_id = 2; // UUID for this job execution
repeated PartitionRef outputs = 3; // Partitions being processed by this job
uint64 sequence_number = 4; // Monotonic sequence starting from 1
oneof content {
LogMessage log = 5;
MetricPoint metric = 6;
WrapperJobEvent job_event = 7; // Wrapper-specific job events
PartitionManifest manifest = 8;
}
}
// Log message from job stdout/stderr
message LogMessage {
enum LogLevel {
DEBUG = 0;
INFO = 1;
WARN = 2;
ERROR = 3;
}
LogLevel level = 1;
string message = 2;
map<string, string> fields = 3;
}
// Metric point emitted by job
message MetricPoint {
string name = 1;
double value = 2;
map<string, string> labels = 3;
string unit = 4;
}
// Job wrapper event (distinct from build event log JobEvent)
message WrapperJobEvent {
string event_type = 1; // "config_validate_success", "task_launch_success", etc
map<string, string> metadata = 2;
optional string job_status = 3; // JobStatus enum as string
optional int32 exit_code = 4;
optional string job_label = 5; // Job label for low-cardinality metrics
}
///////////////////////////////////////////////////////////////////////////////////////////////
// List Operations (Unified CLI/Service Responses)
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Partitions List
//
message PartitionsListRequest {
optional uint32 limit = 1;
optional uint32 offset = 2;
optional string status_filter = 3;
}
message PartitionsListResponse {
repeated PartitionSummary partitions = 1;
uint32 total_count = 2;
bool has_more = 3;
}
message PartitionSummary {
PartitionRef partition_ref = 1;
PartitionStatus status_code = 2; // Enum for programmatic use
string status_name = 3; // Human-readable string
int64 last_updated = 4;
uint32 builds_count = 5;
uint32 invalidation_count = 6;
optional string last_successful_build = 7;
}
//
// Jobs List
//
message JobsListRequest {
optional uint32 limit = 1;
optional string search = 2;
}
message JobsListResponse {
repeated JobSummary jobs = 1;
uint32 total_count = 2;
}
message JobSummary {
string job_label = 1;
uint32 total_runs = 2;
uint32 successful_runs = 3;
uint32 failed_runs = 4;
uint32 cancelled_runs = 5;
double average_partitions_per_run = 6;
int64 last_run_timestamp = 7;
JobStatus last_run_status_code = 8; // Enum for programmatic use
string last_run_status_name = 9; // Human-readable string
repeated string recent_builds = 10;
}
//
// Job Runs List
//
message JobRunsListRequest {
optional uint32 limit = 1;
}
message JobRunsListResponse {
repeated JobRunSummary tasks = 1;
uint32 total_count = 2;
}
message JobRunSummary {
string job_run_id = 1;
string job_label = 2;
string build_request_id = 3;
JobStatus status_code = 4; // Enum for programmatic use
string status_name = 5; // Human-readable string
repeated PartitionRef target_partitions = 6;
int64 scheduled_at = 7;
optional int64 started_at = 8;
optional int64 completed_at = 9;
optional int64 duration_ms = 10;
bool cancelled = 11;
string message = 12;
}
//
// Builds List
//
message BuildsListRequest {
optional uint32 limit = 1;
optional uint32 offset = 2;
optional string status_filter = 3;
}
message BuildsListResponse {
repeated BuildSummary builds = 1;
uint32 total_count = 2;
bool has_more = 3;
}
message BuildSummary {
string build_request_id = 1;
BuildRequestStatus status = 2;
repeated PartitionRef requested_partitions = 3;
uint32 total_jobs = 4;
uint32 completed_jobs = 5;
uint32 failed_jobs = 6;
uint32 cancelled_jobs = 7;
int64 requested_at = 8;
optional int64 started_at = 9;
optional int64 completed_at = 10;
optional int64 duration_ms = 11;
bool cancelled = 12;
optional string comment = 13;
}
//
// Activity Summary
//
message ActivityResponse {
uint32 active_builds_count = 1;
repeated BuildSummary recent_builds = 2;
repeated PartitionSummary recent_partitions = 3;
uint32 total_partitions_count = 4;
string system_status = 5;
string graph_name = 6;
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Detail Operations (Unified CLI/Service Detail Responses)
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Build Detail
//
message BuildDetailRequest {
string build_request_id = 1;
}
message BuildDetailResponse {
string build_request_id = 1;
BuildRequestStatus status = 2;
repeated PartitionRef requested_partitions = 3;
uint32 total_jobs = 4;
uint32 completed_jobs = 5;
uint32 failed_jobs = 6;
uint32 cancelled_jobs = 7;
int64 requested_at = 8;
optional int64 started_at = 9;
optional int64 completed_at = 10;
optional int64 duration_ms = 11;
bool cancelled = 12;
optional string cancel_reason = 13;
repeated BuildTimelineEvent timeline = 14;
}
message BuildTimelineEvent {
int64 timestamp = 1;
optional BuildRequestStatus status = 2;
string message = 3;
string event_type = 4;
optional string cancel_reason = 5;
}
//
// Partition Detail
//
message PartitionDetailRequest {
PartitionRef partition_ref = 1;
}
message PartitionDetailResponse {
PartitionRef partition_ref = 1;
PartitionStatus status_code = 2; // Enum for programmatic use
string status_name = 3; // Human-readable string
int64 last_updated = 4;
uint32 builds_count = 5;
optional string last_successful_build = 6;
uint32 invalidation_count = 7;
repeated PartitionTimelineEvent timeline = 8;
}
message PartitionTimelineEvent {
int64 timestamp = 1;
PartitionStatus status_code = 2; // Enum for programmatic use
string status_name = 3; // Human-readable string
string message = 4;
string build_request_id = 5;
optional string job_run_id = 6;
}
//
// Job Detail
//
message JobDetailRequest {
string job_label = 1;
}
message JobDetailResponse {
string job_label = 1;
uint32 total_runs = 2;
uint32 successful_runs = 3;
uint32 failed_runs = 4;
uint32 cancelled_runs = 5;
double average_partitions_per_run = 6;
int64 last_run_timestamp = 7;
JobStatus last_run_status_code = 8; // Enum for programmatic use
string last_run_status_name = 9; // Human-readable string
repeated string recent_builds = 10;
repeated JobRunDetail runs = 11;
}
message JobRunDetail {
string job_run_id = 1;
string build_request_id = 2;
repeated PartitionRef target_partitions = 3;
JobStatus status_code = 4; // Enum for programmatic use
string status_name = 5; // Human-readable string
optional int64 started_at = 6;
optional int64 completed_at = 7;
optional int64 duration_ms = 8;
string message = 9;
}
//
// Job Run Detail
//
message JobRunDetailRequest {
string job_run_id = 1;
}
message JobRunDetailResponse {
string job_run_id = 1;
string job_label = 2;
string build_request_id = 3;
JobStatus status_code = 4; // Enum for programmatic use
string status_name = 5; // Human-readable string
repeated PartitionRef target_partitions = 6;
int64 scheduled_at = 7;
optional int64 started_at = 8;
optional int64 completed_at = 9;
optional int64 duration_ms = 10;
bool cancelled = 11;
optional string cancel_reason = 12;
string message = 13;
repeated JobRunTimelineEvent timeline = 14;
}
message JobRunTimelineEvent {
int64 timestamp = 1;
optional JobStatus status_code = 2; // Enum for programmatic use
optional string status_name = 3; // Human-readable string
string message = 4;
string event_type = 5;
optional string cancel_reason = 6;
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Job Log Access (Unified CLI/Service Interface)
///////////////////////////////////////////////////////////////////////////////////////////////
// Request for retrieving job logs
message JobLogsRequest {
string job_run_id = 1; // UUID of the job run
int64 since_timestamp = 2; // Unix timestamp (nanoseconds) - only logs after this time
int32 min_level = 3; // Minimum LogLevel enum value (0=DEBUG, 1=INFO, 2=WARN, 3=ERROR)
uint32 limit = 4; // Maximum number of entries to return
}
// Response containing job log entries
message JobLogsResponse {
repeated JobLogEntry entries = 1; // Log entries matching the request criteria
bool has_more = 2; // True if more entries exist beyond the limit
}
///////////////////////////////////////////////////////////////////////////////////////////////
// Currently unused - implemented via HTTP REST API instead
///////////////////////////////////////////////////////////////////////////////////////////////
// Partition Want (Future feature - currently unused)
// message WantSource {
// // TODO
// }
// message PartitionWant {
// PartitionRef partition_ref = 1; // Partition being requested
// uint64 created_at = 2; // Server time when want registered
// optional uint64 data_timestamp = 3; // Business time this partition represents
// optional uint64 ttl_seconds = 4; // Give up after this long (from created_at)
// optional uint64 sla_seconds = 5; // SLA violation after this long (from data_timestamp)
// repeated string external_dependencies = 6; // Cross-graph dependencies
// string want_id = 7; // Unique identifier
// WantSource source = 8; // How this want was created
// }
// Service for job configuration and graph analysis
// service DataBuildService {
// // Get job configurations for the specified output references
// // rpc GetJobConfigs(JobConfigureRequest) returns (JobConfigureResponse) {}
// // Analyze and get the job graph for the specified output references
// rpc AnalyzeGraph(GraphAnalyzeRequest) returns (GraphAnalyzeResponse);
// // Execute the specified job graph (implemented by databuild)
// rpc Execute(JobGraph) returns (GraphExecuteResponse);
// // User-facing: build the desired partitions
// rpc Build(GraphBuildRequest) returns (GraphBuildResponse);
// }
///////////////////////////////////////////////////////////////////////////////////////////////
// DataBuildService - v2 of service and CLI interface below
///////////////////////////////////////////////////////////////////////////////////////////////
// The service that vends all build status information
// Core objects are:
// - Build events - events emitted as part of the build process that indicate status/state
// - BuildRequests - the literal request to build 1+ partitions
// - Partitions - Atomic units of data that represent results of jobs, and act as sufficiency signals for other jobs
// - Jobs - the units of work that build partitions (a single run of one is a JobRun)
// - JobRuns - the specific runs of Jobs
// - Wants - the recorded "want" to build a partition, which will be acted on ASAP
// - Taints - invalidate built partitions, in cases where the result should not be used or should be rebuilt
// Each of these will have a list page, and all but build events will have a summary page.
service DataBuildService {
// Build events - exposes literal events from build event log with filters
rpc GetBuildEvents(ListBuildEventsRequest) returns (ListBuildEventsResponse);
// For batched requests
rpc Batched(BatchedRequest) returns (BatchedResponse);
// BUILDS
// List the available build requests with limited metadata about them (requested partitions, status, requested time, etc)
rpc ListBuildRequests(ListBuildsRequest) returns (ListBuildsResponse);
// Get build status, summary, and paginated lists of produced partitions, and other related metadata
rpc GetBuildSummary(BuildSummaryRequest) returns (BuildSummaryResponse);
// Get a mermaid description of the build request graph with its current status rendered
rpc GetBuildMermaid(BuildSummaryRequest) returns (BuildMermaidResponse);
// PARTITIONS
// List partitions (built, building, wanted)
rpc ListPartitions(ListPartitionsRequest) returns (ListPartitionsResponse);
// Get details about a specific partition (status, created at, past builds, job runs that built or are building it, etc)
rpc GetPartitionsSummary(PartitionSummaryRequest) returns (PartitionSummaryResponse);
// JOBS
// List jobs described in the graph plus metadata (success rate, last result, last run at, etc)
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse);
// Get details for a specific job
rpc GetJobSummary(JobSummaryRequest) returns (JobSummaryResponse);
// JOB RUNS
// List job runs plus basic metadata (job they ran, result, runtime, etc)
rpc ListJobRuns(ListJobRunsRequest) returns (ListJobRunsResponse);
// Get details of a specific job run (above details plus produced partitions, paginated logs, etc)
rpc GetJobRunSummary(JobRunSummaryRequest) returns (JobRunSummaryResponse);
// Wants
// List wants plus metadata (wanted partitions, created at, status)
rpc ListWants(ListWantsRequest) returns (ListWantsResponse);
// Get details for a want (above plus reasons for want being in current state, etc)
rpc GetWantSummary(WantSummaryRequest) returns (WantSummaryResponse);
// Register a want (list of partition refs, with user, reason, etc)
rpc PutWants(PutWantsRequest) returns (PutWantsResponse);
// Taints
// List taints plus metadata (tainted partitions, created at, status)
rpc ListTaints(ListTaintsRequest) returns (ListTaintsResponse);
// Summarize the requested taint
rpc GetTaintSummary(TaintSummaryRequest) returns (TaintSummaryResponse);
// Register a taint (list of partition refs, with user, reason, etc)
rpc PutTaints(PutTaintsRequest) returns (PutTaintsResponse);
}
message RequestContainer {
ListBuildEventsResponse list_build_events = 1;
BuildSummaryRequest build_request_status = 2;
// TODO
}
message ResponseContainer {
ListBuildEventsResponse list_build_events = 1;
BuildSummaryResponse build_request_status = 2;
// TODO
}
message ErrorContainer {
string error_message = 1;
}
message BatchedRequest {
map<string, RequestContainer> requests = 1;
}
message BatchedResponse {
map<string, ResponseContainer> responses = 1;
map<string, ErrorContainer> errors = 2;
}
// BEL events
message ListBuildEventsRequest {
EventFilter filters = 1;
// Either one of the following must be provided
// Scrolls backwards from the specified timestamp
uint64 max_timestamp_ns = 2;
// Scrolls forward from the specified timestamp
uint64 min_timestamp_ns = 3;
}
message ListBuildEventsResponse {
// Resulting events are ordered
repeated BuildEvent events = 1;
bool has_more = 2;
}
// BUILD REQUESTS
// ANDed filters
message ListBuildsRequest {
// The max time the service will search until to find build requests
uint64 started_until = 1;
// Filters returned build requests those that currently have this status
repeated string build_status = 2;
// Filters build requests to those that built one of these partitions
repeated string built_partition = 3;
// Filters build requests to those that output one of these partitions (excluding those that were not explicitly
// requested in the build request)
repeated string output_partition = 4;
// Filters by jobs that were run as part of the build
repeated string run_jobs = 5;
// Filters by the ID of the want that triggered the build
repeated string triggering_want_ids = 6;
// Filters by contains match against build request comment
string comment_contains = 7;
}
// Ordered and paginated by build start time
message ListBuildsResponse {
// Resulting builds
repeated BuildSummary builds = 1;
// Paging bounds for requesting next page
uint64 min_started = 2;
// Indicates if there are more to request
bool has_more = 3;
}
message BuildSummaryRequest {
string build_id = 1;
}
message BuildSummaryResponse {
string build_id = 1;
// Overall status of the build
BuildRequestStatusCode status = 2;
// Summary of the build
BuildSummary summary = 3;
// Partitions produced by the build
repeated PartitionBuildStatus partitions = 4;
}
message PartitionBuildStatus {
PartitionRef ref = 1;
PartitionStatus status = 2;
}
message BuildMermaidResponse {
string build_id = 1;
string mermaid = 2;
}
// PARTITIONS
message ListPartitionsRequest {
// Optional regex filter
string ref_pattern = 1;
// Optional ORing partition status filter
repeated PartitionStatus partition_status = 2;
// Basic pagination mechanism - returns partitions sorted after the provided ref
string last_partition = 3;
}
message ListPartitionsResponse {
repeated PartitionSummaryV2 refs = 1;
}
message PartitionStatusV2 {
PartitionStatus code = 1;
string name = 2;
}
message PartitionSummaryV2 {
PartitionRef partition_ref = 1;
PartitionStatusV2 status = 2;
uint64 last_updated = 4;
uint64 last_invalidated_at = 6;
repeated string past_build_request = 7;
}
message PartitionSummaryRequest {
PartitionRef ref = 1;
}
message PartitionSummaryResponse {
PartitionSummaryV2 partition = 1;
}
// JOBS
// No query params - if you need to paginate here something is insane or you're google
message ListJobsRequest {}
message ListJobsResponse {
repeated JobSummary jobs = 1;
}
message JobSummaryRequest {
string job_label = 1;
}
message JobSummaryResponse {
JobSummary job = 1;
}
// JOB RUNS
// Paginates backwards
message ListJobRunsRequest {
// Filters to job runs started until this point
uint64 started_until = 1;
// ORing filter matching job run IDs
repeated string job_run_ids = 2;
// ORing filters to job runs that are defined by one of these job labels
repeated string job_labels = 3;
// ORing filters to job runs that were involved in one of these build requests
repeated string build_reqeust_ids = 4;
// ORing filters to partitions produced by these job runs
repeated string built_partition_refs = 5;
}
message ListJobRunsResponse {
repeated JobRunSummary job_runs = 1;
uint64 min_start_at = 2;
}
message JobRunSummaryRequest {
string job_run_id = 1;
}
message JobRunSummaryResponse {
JobRunSummary job_run = 1;
}
// WANTS
message ListWantsRequest {
// Filters the latest time the want could been requested until
uint64 requested_until = 1;
// Filters to wants whose ttl expires after ttl_until (allows querying "currently wanted"
uint64 ttl_until = 2;
}
message ListWantsResponse {
repeated PartitionWantSummary wants = 1;
uint64 min_requested_at = 2;
}
message LabeledPartitionBuildStatus {
PartitionRef ref = 1;
PartitionBuildStatus status = 2;
}
message PartitionWantSummary {
PartitionWant want = 1;
repeated PartitionSummary partitions = 2;
repeated LabeledPartitionBuildStatus external_partitions = 3;
string comment = 4;
}
message WantSummaryRequest {
string want_id = 1;
}
message WantSummaryResponse {
PartitionWantSummary want = 1;
}
message IndividualWantRequest {
PartitionRef ref = 1;
uint64 date_timestamp = 2;
uint64 ttl_seconds = 3;
uint64 sla_seconds = 4;
}
message PutWantsRequest {
repeated IndividualWantRequest wants = 1;
WantSource source = 2;
string comment = 3;
}
message CreatedWant {
PartitionRef ref = 1;
string want_id = 2;
}
message PutWantsResponse {
repeated CreatedWant wants = 1;
}
// TAINTS
message ListTaintsRequest {
uint64 tainted_at_until = 1;
}
message ListTaintsResponse {
repeated PartitionTaintSummary taints = 1;
uint64 min_tainted_at = 2;
}
message PartitionTaintSummary {
string taint_id = 1;
repeated PartitionRef refs = 2;
uint64 tainted_at = 3;
SourceType source = 4;
string comment = 5;
}
message TaintSummaryRequest {
string taint_id = 1;
}
message TaintSummaryResponse {
PartitionTaintSummary taint = 1;
}
message PutTaintsRequest {
repeated PartitionRef refs = 1;
SourceType source = 2;
string comment = 3;
}
message PutTaintsResponse {
string taint_id = 1;
}