blob: 975ad4fca12e4f2c0944fb059c025836564a42b7 [file] [log] [blame]
// Copyright 2020 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package cv.run;
option go_package = "go.chromium.org/luci/cv/internal/run;run";
import "google/protobuf/timestamp.proto";
// Status describes the status of a CV Run.
enum Status {
// Unspecified status.
STATUS_UNSPECIFIED = 0;
// Run is pending to start.
//
// It is either because Run Manager hasn't processed the StartEvent yet or
// the RunOwner has exhausted all the quota and waiting for new quota to
// be available.
PENDING = 1;
// Run is running.
RUNNING = 2;
// Run is waiting for submission.
//
// Run is in this status if one of the following scenario is true:
// 1. Tree is closed at the time Run attempts to submit.
// 2. There is another Run in the same LUCI Project that is currently
// submitting.
// 3. The submission is rate limited according to the submit option in
// Project Config.
//
// This status is cancellable.
WAITING_FOR_SUBMISSION = 4;
// Run is submitting.
//
// A Run can't be cancelled while submitting. A Run may transition from
// this status to either `WAITING_FOR_SUBMISSION` status or a non-cancelled
// terminal status.
SUBMITTING = 5;
// End of non-terminal status; MUST have value less than `ENDED_MASK`.
/////////////////////////////////////////////////////////////////////////////
// Terminal Status
// ENDED_MASK can be used as a bitmask to check if a Run has ended.
// This MUST NOT be used as the status of a Run.
ENDED_MASK = 64;
// Run ends successfully.
SUCCEEDED = 65;
// Run ends unsuccessfully.
FAILED = 66;
// Run is cancelled.
CANCELLED = 67;
}
// Trigger describes who/how CV was triggered on a specific CL.
message Trigger {
google.protobuf.Timestamp time = 1;
// Mode is string value of run.Mode.
string mode = 2;
// Additional label is recorded in case applicable ConfigGroup had additional
// modes, e.g. for QUICK_DRY_RUN mode.
string additional_label = 5;
// Triggering user email if known.
//
// Gerrit doesn't guarantee that every user has set their preferred email,
// but LUCI ACLs are based entirely on user emails. Thus, Runs with the email
// unset are quickly aborted by CQDaemon.
//
// TODO(tandrii): once CQDaemon is deleted, require email to start a Run,
// and remove Gerrit-specific gerrit_account_id.
string email = 3;
// Gerrit account ID. Always known.
int64 gerrit_account_id = 4;
}
// Submission describes the current state of Run submission.
message Submission {
// The deadline of this submission.
//
// If the deadline is not set or has already expired, a RunManager task
// can claim the exclusive privilege by setting the deadline to a future
// timestamp (generally, end of task deadline).
google.protobuf.Timestamp deadline = 1;
// ID of the task that executes this submission.
string task_id = 2;
// IDs of all CLs that should be submitted in this submission.
//
// Must be ordered in submission order.
repeated int64 cls = 3;
// IDs of all CLs that have been submitted successfully already.
repeated int64 submitted_cls = 4;
// If True, Tree is currently in open state.
bool tree_open = 10;
// The timestamp when the Tree status was last fetched.
google.protobuf.Timestamp last_tree_check_time = 11;
}