Built motion from commit 44377920.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / devtools / containeranalysis / v1alpha1 / source_context.proto
1 // Copyright 2018 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 syntax = "proto3";
16
17 package google.devtools.containeranalysis.v1alpha1;
18
19 import "google/api/annotations.proto";
20
21 option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
22 option java_multiple_files = true;
23 option java_package = "com.google.containeranalysis.v1alpha1";
24 option objc_class_prefix = "GCA";
25
26 // A SourceContext is a reference to a tree of files. A SourceContext together
27 // with a path point to a unique revision of a single file or directory.
28 message SourceContext {
29   // A SourceContext can refer any one of the following types of repositories.
30   oneof context {
31     // A SourceContext referring to a revision in a Google Cloud Source Repo.
32     CloudRepoSourceContext cloud_repo = 1;
33
34     // A SourceContext referring to a Gerrit project.
35     GerritSourceContext gerrit = 2;
36
37     // A SourceContext referring to any third party Git repo (e.g., GitHub).
38     GitSourceContext git = 3;
39   }
40
41   // Labels with user defined metadata.
42   map<string, string> labels = 4;
43 }
44
45 // An alias to a repo revision.
46 message AliasContext {
47   // The type of an alias.
48   enum Kind {
49     // Unknown.
50     KIND_UNSPECIFIED = 0;
51
52     // Git tag.
53     FIXED = 1;
54
55     // Git branch.
56     MOVABLE = 2;
57
58     // Used to specify non-standard aliases. For example, if a Git repo has a
59     // ref named "refs/foo/bar".
60     OTHER = 4;
61   }
62
63   // The alias kind.
64   Kind kind = 1;
65
66   // The alias name.
67   string name = 2;
68 }
69
70 // A CloudRepoSourceContext denotes a particular revision in a Google Cloud
71 // Source Repo.
72 message CloudRepoSourceContext {
73   // The ID of the repo.
74   RepoId repo_id = 1;
75
76   // A revision in a Cloud Repo can be identified by either its revision ID or
77   // its alias.
78   oneof revision {
79     // A revision ID.
80     string revision_id = 2;
81
82     // An alias, which may be a branch or tag.
83     AliasContext alias_context = 3;
84   }
85 }
86
87 // A SourceContext referring to a Gerrit project.
88 message GerritSourceContext {
89   // The URI of a running Gerrit instance.
90   string host_uri = 1;
91
92   // The full project name within the host. Projects may be nested, so
93   // "project/subproject" is a valid project name. The "repo name" is
94   // the hostURI/project.
95   string gerrit_project = 2;
96
97   // A revision in a Gerrit project can be identified by either its revision ID
98   // or its alias.
99   oneof revision {
100     // A revision (commit) ID.
101     string revision_id = 3;
102
103     // An alias, which may be a branch or tag.
104     AliasContext alias_context = 4;
105   }
106 }
107
108 // A GitSourceContext denotes a particular revision in a third party Git
109 // repository (e.g., GitHub).
110 message GitSourceContext {
111   // Git repository URL.
112   string url = 1;
113
114   // Required.
115   // Git commit hash.
116   string revision_id = 2;
117 }
118
119 // A unique identifier for a Cloud Repo.
120 message RepoId {
121   // A cloud repo can be identified by either its project ID and repository name
122   // combination, or its globally unique identifier.
123   oneof id {
124     // A combination of a project ID and a repo name.
125     ProjectRepoId project_repo_id = 1;
126
127     // A server-assigned, globally unique identifier.
128     string uid = 2;
129   }
130 }
131
132 // Selects a repo using a Google Cloud Platform project ID (e.g.,
133 // winged-cargo-31) and a repo name within that project.
134 message ProjectRepoId {
135   // The ID of the project.
136   string project_id = 1;
137
138   // The name of the repo. Leave empty for the default repo.
139   string repo_name = 2;
140 }