Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / devtools / containeranalysis / v1alpha1 / provenance.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 import "google/devtools/containeranalysis/v1alpha1/source_context.proto";
21 import "google/protobuf/timestamp.proto";
22
23 option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1alpha1;containeranalysis";
24 option java_multiple_files = true;
25 option java_package = "com.google.containeranalysis.v1alpha1";
26 option objc_class_prefix = "GCA";
27
28 // Provenance of a build. Contains all information needed to verify the full
29 // details about the build from source to completion.
30 message BuildProvenance {
31   // Unique identifier of the build.
32   string id = 1;
33
34   // ID of the project.
35   string project_id = 2;
36
37   // Commands requested by the build.
38   repeated Command commands = 5;
39
40   // Output of the build.
41   repeated Artifact built_artifacts = 6;
42
43   // Time at which the build was created.
44   google.protobuf.Timestamp create_time = 7;
45
46   // Time at which execution of the build was started.
47   google.protobuf.Timestamp start_time = 8;
48
49   // Time at which execution of the build was finished.
50   google.protobuf.Timestamp finish_time = 9;
51
52   // E-mail address of the user who initiated this build. Note that this was the
53   // user's e-mail address at the time the build was initiated; this address may
54   // not represent the same end-user for all time.
55   string creator = 11;
56
57   // Google Cloud Storage bucket where logs were written.
58   string logs_bucket = 13;
59
60   // Details of the Source input to the build.
61   Source source_provenance = 14;
62
63   // Trigger identifier if the build was triggered automatically; empty if not.
64   string trigger_id = 15;
65
66   // Special options applied to this build. This is a catch-all field where
67   // build providers can enter any desired additional details.
68   map<string, string> build_options = 16;
69
70   // Version string of the builder at the time this build was executed.
71   string builder_version = 17;
72 }
73
74 // Source describes the location of the source used for the build.
75 message Source {
76   // Source location information.
77   oneof source {
78     // If provided, get the source from this location in in Google Cloud
79     // Storage.
80     StorageSource storage_source = 1;
81
82     // If provided, get source from this location in a Cloud Repo.
83     RepoSource repo_source = 2;
84   }
85
86   // If provided, the input binary artifacts for the build came from this
87   // location.
88   StorageSource artifact_storage_source = 4;
89
90   // Hash(es) of the build source, which can be used to verify that the original
91   // source integrity was maintained in the build.
92   //
93   // The keys to this map are file paths used as build source and the values
94   // contain the hash values for those files.
95   //
96   // If the build source came in a single package such as a gzipped tarfile
97   // (.tar.gz), the FileHash will be for the single path to that file.
98   map<string, FileHashes> file_hashes = 3;
99
100   // If provided, the source code used for the build came from this location.
101   SourceContext context = 7;
102
103   // If provided, some of the source code used for the build may be found in
104   // these locations, in the case where the source repository had multiple
105   // remotes or submodules. This list will not include the context specified in
106   // the context field.
107   repeated SourceContext additional_contexts = 8;
108 }
109
110 // Container message for hashes of byte content of files, used in Source
111 // messages to verify integrity of source input to the build.
112 message FileHashes {
113   // Collection of file hashes.
114   repeated Hash file_hash = 1;
115 }
116
117 // Container message for hash values.
118 message Hash {
119   // Specifies the hash algorithm, if any.
120   enum HashType {
121     // No hash requested.
122     NONE = 0;
123
124     // A sha256 hash.
125     SHA256 = 1;
126   }
127
128   // The type of hash that was performed.
129   HashType type = 1;
130
131   // The hash value.
132   bytes value = 2;
133 }
134
135 // StorageSource describes the location of the source in an archive file in
136 // Google Cloud Storage.
137 message StorageSource {
138   // Google Cloud Storage bucket containing source (see [Bucket Name
139   // Requirements]
140   // (https://cloud.google.com/storage/docs/bucket-naming#requirements)).
141   string bucket = 1;
142
143   // Google Cloud Storage object containing source.
144   string object = 2;
145
146   // Google Cloud Storage generation for the object.
147   int64 generation = 3;
148 }
149
150 // RepoSource describes the location of the source in a Google Cloud Source
151 // Repository.
152 message RepoSource {
153   // ID of the project that owns the repo.
154   string project_id = 1;
155
156   // Name of the repo.
157   string repo_name = 2;
158
159   // A revision within the source repository must be specified in
160   // one of these ways.
161   oneof revision {
162     // Name of the branch to build.
163     string branch_name = 3;
164
165     // Name of the tag to build.
166     string tag_name = 4;
167
168     // Explicit commit SHA to build.
169     string commit_sha = 5;
170   }
171 }
172
173 // Command describes a step performed as part of the build pipeline.
174 message Command {
175   // Name of the command, as presented on the command line, or if the command is
176   // packaged as a Docker container, as presented to `docker pull`.
177   string name = 1;
178
179   // Environment variables set before running this Command.
180   repeated string env = 2;
181
182   // Command-line arguments used when executing this Command.
183   repeated string args = 3;
184
185   // Working directory (relative to project source root) used when running
186   // this Command.
187   string dir = 4;
188
189   // Optional unique identifier for this Command, used in wait_for to reference
190   // this Command as a dependency.
191   string id = 5;
192
193   // The ID(s) of the Command(s) that this Command depends on.
194   repeated string wait_for = 6;
195 }
196
197 // Artifact describes a build product.
198 message Artifact {
199   // Name of the artifact. This may be the path to a binary or jar file, or in
200   // the case of a container build, the name used to push the container image to
201   // Google Container Registry, as presented to `docker push`.
202   //
203   // This field is deprecated in favor of the plural `names` field; it continues
204   // to exist here to allow existing BuildProvenance serialized to json in
205   // google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to
206   // deserialize back into proto.
207   string name = 1;
208
209   // Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
210   // container.
211   string checksum = 2;
212
213   // Artifact ID, if any; for container images, this will be a URL by digest
214   // like gcr.io/projectID/imagename@sha256:123456
215   string id = 3;
216
217   // Related artifact names. This may be the path to a binary or jar file, or in
218   // the case of a container build, the name used to push the container image to
219   // Google Container Registry, as presented to `docker push`. Note that a
220   // single Artifact ID can have multiple names, for example if two tags are
221   // applied to one image.
222   repeated string names = 4;
223 }