forked from moul/depviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dvmodel.proto
160 lines (137 loc) · 7.79 KB
/
dvmodel.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
syntax = "proto3";
package depviz.model;
import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "moul.io/depviz/internal/dvmodel";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;
option (gogoproto.populate_all) = false;
option (gogoproto.equal_all) = false;
//
// Owner
//
// Owner is like a container of tasks or other containers.
// It's something that is rarely deleted and cannot really "closed" or "due".
// It's the entity used for Organizations, Teams, Groups, Users
// and for Projects, Workspaces, Repos, or a Provider.
message Owner {
enum Kind {
UnknownKind = 0;
User = 1;
Organization = 2;
Team = 3;
Repo = 4;
Provider = 5;
}
enum ForkStatus {
UnknownForkStatus = 0;
IsFork = 1;
IsSource = 2;
}
string id = 1 [(gogoproto.casttype) = "github.com/cayleygraph/quad.IRI", (gogoproto.moretags) = "quad:\"@id\"", (gogoproto.customname) = "ID"]; // canonical URI
google.protobuf.Timestamp created_at = 3 [(gogoproto.moretags) = "quad:\"schema:createdAt,optional\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = true];
google.protobuf.Timestamp updated_at = 4 [(gogoproto.moretags) = "quad:\"schema:updatedAt,optional\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = true];
string local_id = 5 [(gogoproto.customname) = "LocalID", (gogoproto.moretags) = "quad:\"schema:localId,optional\""];
Kind kind = 10 [(gogoproto.moretags) = "quad:\"schema:kind,optional\""];
string short_name = 11 [(gogoproto.moretags) = "quad:\"schema:shortName,optional\""];
string full_name = 12 [(gogoproto.moretags) = "quad:\"schema:fullName,optional\""];
Driver driver = 13 [(gogoproto.moretags) = "quad:\"schema:driver,optional\""];
string homepage = 14 [(gogoproto.moretags) = "quad:\"schema:homepage,optional\""];
string description = 15 [(gogoproto.moretags) = "quad:\"schema:description,optional\""];
ForkStatus fork_status = 16 [(gogoproto.moretags) = "quad:\"schema:forkStatus,optional\""];
string avatar_url = 17 [(gogoproto.moretags) = "quad:\"schema:avatarUrl,optional\"", (gogoproto.customname) = "AvatarURL"];
// relationships
string has_owner = 100 [(gogoproto.moretags) = "quad:\"hasOwner,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
}
//
// Task
//
// Task defines a step or an action.
// It is owned by an owner and can link to other Owners.
// A task can contain other tasks (epic, story, milestone).
// It can be closed and can have due dates.
// It's the entity used for Issues, Pull Requests, Merge Requests, Cards, Epics, Milestones, Stories.
message Task {
enum Kind {
UnknownKind = 0;
Issue = 1;
MergeRequest = 2;
Milestone = 3;
Epic = 4;
Story = 5;
Card = 6;
}
enum State {
UnknownState = 0;
Open = 1;
Closed = 2;
}
string id = 1 [(gogoproto.casttype) = "github.com/cayleygraph/quad.IRI", (gogoproto.moretags) = "quad:\"@id\"", (gogoproto.customname) = "ID"]; // canonical URI
google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:createdAt,optional\""];
google.protobuf.Timestamp updated_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:updatedAt,optional\""];
string local_id = 5 [(gogoproto.customname) = "LocalID", (gogoproto.moretags) = "quad:\"schema:localId,optional\""];
Kind kind = 10 [(gogoproto.moretags) = "quad:\"schema:kind,optional\""];
string title = 11 [(gogoproto.moretags) = "quad:\"schema:title,optional\""];
string description = 12 [(gogoproto.moretags) = "quad:\"schema:description,optional\""];
Driver driver = 13 [(gogoproto.moretags) = "quad:\"schema:driver,optional\""];
google.protobuf.Timestamp due_on = 14 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:dueOn,optional\""];
google.protobuf.Timestamp completed_at = 15 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:completedAt,optional\""];
State state = 16 [(gogoproto.moretags) = "quad:\"schema:state,optional\""];
bool is_locked = 17 [(gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:isLocked,optional\""];
int32 num_comments = 18 [(gogoproto.moretags) = "quad:\"schema:numComments,optional\""];
int32 num_upvotes = 19 [(gogoproto.moretags) = "quad:\"schema:numUpvotes,optional\""];
int32 num_downvotes = 20 [(gogoproto.moretags) = "quad:\"schema:numDownvotes,optional\""];
// relationships
string has_author = 100 [(gogoproto.moretags) = "quad:\"hasAuthor,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
string has_owner = 101 [(gogoproto.moretags) = "quad:\"hasOwner,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
string has_milestone = 102 [(gogoproto.moretags) = "quad:\"hasMilestone,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string has_assignee = 103 [(gogoproto.moretags) = "quad:\"hasAssignee,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string has_reviewer = 104 [(gogoproto.moretags) = "quad:\"hasReviewer,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string has_label = 105 [(gogoproto.moretags) = "quad:\"hasLabel,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string is_depending_on = 106 [(gogoproto.moretags) = "quad:\"isDependingOn,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string is_blocking = 107 [(gogoproto.moretags) = "quad:\"isBlocking,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string is_related_with = 108 [(gogoproto.moretags) = "quad:\"isRelatedWith,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string is_part_of = 109 [(gogoproto.moretags) = "quad:\"isPartOf,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
repeated string has_part = 110 [(gogoproto.moretags) = "quad:\"isPartOf,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
}
//
// Topic
//
message Topic {
enum Kind {
UnknownKind = 0;
Label = 1; // standard GitHub/GitLab label
}
string id = 1 [(gogoproto.casttype) = "github.com/cayleygraph/quad.IRI", (gogoproto.moretags) = "quad:\"@id\"", (gogoproto.customname) = "ID"]; // canonical URI
google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:createdAt,optional\""];
google.protobuf.Timestamp updated_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true, (gogoproto.moretags) = "quad:\"schema:updatedAt,optional\""];
string local_id = 5 [(gogoproto.customname) = "LocalID", (gogoproto.moretags) = "quad:\"schema:localId,optional\""];
Kind kind = 10 [(gogoproto.moretags) = "quad:\"schema:kind,optional\""];
string title = 11 [(gogoproto.moretags) = "quad:\"schema:title,optional\""];
Driver driver = 12 [(gogoproto.moretags) = "quad:\"schema:driver,optional\""];
string color = 13 [(gogoproto.moretags) = "quad:\"schema:color,optional\""];
string description = 14 [(gogoproto.moretags) = "quad:\"schema:description,optional\""];
// relationships
string has_owner = 100 [(gogoproto.moretags) = "quad:\"hasOwner,optional\"", (gogoproto.casttype) = "github.com/cayleygraph/quad.IRI"];
}
//
// Constants
//
enum Driver {
UnknownDriver = 0;
GitHub = 1;
//GitLab = 2;
//Trello = 3;
//Jira = 4;
}
//
// internal
//
message Batch {
repeated Task tasks = 1;
repeated Owner owners = 2;
repeated Topic topics = 3;
}