go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/resultdb/proto/v1/artifact.proto (about)

     1  // Copyright 2020 The LUCI Authors.
     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 luci.resultdb.v1;
    18  
    19  import "google/api/field_behavior.proto";
    20  import "google/protobuf/timestamp.proto";
    21  
    22  option go_package = "go.chromium.org/luci/resultdb/proto/v1;resultpb";
    23  
    24  // A file produced during a build/test, typically a test artifact.
    25  // The parent resource is either a TestResult or an Invocation.
    26  //
    27  // An invocation-level artifact might be related to tests, or it might not, for
    28  // example it may be used to store build step logs when streaming support is
    29  // added.
    30  // Next id: 9.
    31  message Artifact {
    32    // Can be used to refer to this artifact.
    33    // Format:
    34    // - For invocation-level artifacts:
    35    //   "invocations/{INVOCATION_ID}/artifacts/{ARTIFACT_ID}".
    36    // - For test-result-level artifacts:
    37    //   "invocations/{INVOCATION_ID}/tests/{URL_ESCAPED_TEST_ID}/results/{RESULT_ID}/artifacts/{ARTIFACT_ID}".
    38    // where URL_ESCAPED_TEST_ID is the test_id escaped with
    39    // https://golang.org/pkg/net/url/#PathEscape (see also https://aip.dev/122),
    40    // and ARTIFACT_ID is documented below.
    41    // Examples: "screenshot.png", "traces/a.txt".
    42    string name = 1;
    43  
    44    // A local identifier of the artifact, unique within the parent resource.
    45    // MAY have slashes, but MUST NOT start with a slash.
    46    // SHOULD not use backslashes.
    47    // Regex: ^(?:[[:word:]]|\.)([\p{L}\p{M}\p{N}\p{P}\p{S}\p{Zs}]{0,254}[[:word:]])?$
    48    string artifact_id = 2;
    49  
    50    // A signed short-lived URL to fetch the contents of the artifact.
    51    // See also fetch_url_expiration.
    52    string fetch_url = 3;
    53  
    54    // When fetch_url expires. If expired, re-request this Artifact.
    55    google.protobuf.Timestamp fetch_url_expiration = 4;
    56  
    57    // Media type of the artifact.
    58    // Logs are typically "text/plain" and screenshots are typically "image/png".
    59    // Optional.
    60    string content_type = 5;
    61  
    62    // Size of the file.
    63    // Can be used in UI to decide between displaying the artifact inline or only
    64    // showing a link if it is too large.
    65    // If you are using the gcs_uri, this field is not verified, but only treated as a hint.
    66    int64 size_bytes = 6;
    67  
    68    // Contents of the artifact.
    69    // This is INPUT_ONLY, and taken by BatchCreateArtifacts().
    70    // All getter RPCs, such as ListArtifacts(), do not populate values into
    71    // the field in the response.
    72    // If specified, `gcs_uri` must be empty.
    73    bytes contents = 7 [ (google.api.field_behavior) = INPUT_ONLY ];
    74  
    75    // The GCS URI of the artifact if it's stored in GCS.  If specified, `contents` must be empty.
    76    string gcs_uri = 8;
    77  }