blob: 9343c9843fee95a88f368443c6da183db5bd7ca5 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
// This file defines protobufs for issues and related business
// objects, e.g., field values, comments, and attachments.
syntax = "proto3";
package monorail;
import "google/protobuf/wrappers.proto";
import "api/api_proto/common.proto";
// Next available tag: 8
message Approval {
FieldRef field_ref = 1;
repeated UserRef approver_refs = 2;
ApprovalStatus status = 3;
fixed32 set_on = 4;
UserRef setter_ref = 5;
PhaseRef phase_ref = 7;
}
// Next available tag: 8
enum ApprovalStatus {
NOT_SET = 0;
NEEDS_REVIEW = 1;
NA = 2;
REVIEW_REQUESTED = 3;
REVIEW_STARTED = 4;
NEED_INFO = 5;
APPROVED = 6;
NOT_APPROVED = 7;
}
// This message is only suitable for displaying the amendment to users.
// We don't currently offer structured amendments that client code can
// reason about, field names can be ambiguous, and we don't have
// old_value for most changes.
// Next available tag: 4
message Amendment {
// This may be the name of a built-in or custom field, or relative to
// an approval field name.
string field_name = 1;
// This may be a new value that overwrote the old value, e.g., "Assigned",
// or it may be a space-separated list of changes, e.g., "Size-L -Size-S".
string new_or_delta_value = 2;
// old_value is only used when the user changes the summary.
string old_value = 3;
}
// Next available tag: 9
message Attachment {
uint64 attachment_id = 1;
string filename = 2;
uint64 size = 3; // Size in bytes.
string content_type = 4;
bool is_deleted = 5;
string thumbnail_url = 6;
string view_url = 7;
string download_url = 8;
}
// Next available tag: 16
message Comment {
string project_name = 1;
uint32 local_id = 2;
uint32 sequence_num = 3;
bool is_deleted = 4;
UserRef commenter = 5;
fixed32 timestamp = 6;
string content = 7;
string inbound_message = 8;
repeated Amendment amendments = 9;
repeated Attachment attachments = 10;
FieldRef approval_ref = 11;
// If set, this comment is an issue description.
uint32 description_num = 12;
bool is_spam = 13;
bool can_delete = 14;
bool can_flag = 15;
}
// Next available tag: 5
message FieldValue {
FieldRef field_ref = 1;
string value = 2;
bool is_derived = 3;
PhaseRef phase_ref = 4;
}
// Next available tag: 28
message Issue {
string project_name = 1;
uint32 local_id = 2;
string summary = 3;
StatusRef status_ref = 4;
UserRef owner_ref = 5;
repeated UserRef cc_refs = 6;
repeated LabelRef label_refs = 7;
repeated ComponentRef component_refs = 8;
repeated IssueRef blocked_on_issue_refs = 9;
repeated IssueRef blocking_issue_refs = 10;
repeated IssueRef dangling_blocked_on_refs = 23;
repeated IssueRef dangling_blocking_refs = 24;
IssueRef merged_into_issue_ref = 11;
repeated FieldValue field_values = 12;
bool is_deleted = 13;
UserRef reporter_ref = 14;
fixed32 opened_timestamp = 15;
fixed32 closed_timestamp = 16;
fixed32 modified_timestamp = 17;
fixed32 component_modified_timestamp = 25;
fixed32 status_modified_timestamp = 26;
fixed32 owner_modified_timestamp = 27;
uint32 star_count = 18;
bool is_spam = 19;
uint32 attachment_count = 20;
repeated Approval approval_values = 21;
repeated PhaseDef phases = 22;
}
// Next available tag: 18
message IssueDelta {
// Note: We use StringValue instead of string so that we can
// check if delta.HasField('status'). Proto3 only allows that
// for nested messages and provides "boxed" values for this purpose.
// In JSON, a StringValue is represented as a simple string.
google.protobuf.StringValue status = 1;
UserRef owner_ref = 2;
repeated UserRef cc_refs_add = 3;
repeated UserRef cc_refs_remove = 4;
repeated ComponentRef comp_refs_add = 5;
repeated ComponentRef comp_refs_remove = 6;
repeated LabelRef label_refs_add = 7;
repeated LabelRef label_refs_remove = 8;
repeated FieldValue field_vals_add = 9;
repeated FieldValue field_vals_remove = 10;
repeated FieldRef fields_clear = 11;
repeated IssueRef blocked_on_refs_add = 12;
repeated IssueRef blocked_on_refs_remove = 13;
repeated IssueRef blocking_refs_add = 14;
repeated IssueRef blocking_refs_remove = 15;
IssueRef merged_into_ref = 16;
google.protobuf.StringValue summary = 17;
}
// Next available tag: 7
message ApprovalDelta {
ApprovalStatus status = 1;
repeated UserRef approver_refs_add = 2;
repeated UserRef approver_refs_remove = 3;
repeated FieldValue field_vals_add = 4;
repeated FieldValue field_vals_remove = 5;
repeated FieldRef fields_clear = 6;
}
// Next available tag: 3
message AttachmentUpload {
string filename = 1;
bytes content = 2;
}
// Next available tag: 4
message IssueSummary {
string project_name = 1;
uint32 local_id = 2;
string summary = 3;
}
// Next available tag: 3
message PhaseDef {
PhaseRef phase_ref = 1;
uint32 rank = 2;
}
// Next available tag: 2
message PhaseRef {
string phase_name = 1;
}
// Next available tag: 7
enum SearchScope {
ALL = 0;
NEW = 1;
OPEN = 2;
OWNED = 3;
REPORTED = 4;
STARRED = 5;
TO_VERIFY = 6;
}