go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cipkg/core/action.proto (about)

     1  // Copyright 2023 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  option go_package = "go.chromium.org/luci/cipkg/core";
    18  
    19  import "google/protobuf/any.proto";
    20  import "go.chromium.org/luci/cipkg/core/specs.proto";
    21  
    22  // Action is a high level description of one node in the build graph.
    23  //
    24  // It includes a set of predefined verbs (e.g. `command`, `reexec`, ...) and
    25  // provides the ability to add additional high level verbs within a single
    26  // application // (`extension` field, see `cipkg/base/actions.SetTransformer`
    27  // for additional details).
    28  //
    29  // Typically, Actions are produced via the Generation process (see
    30  // `cipkg/base/generators`` for more details).
    31  //
    32  // An action's dependency on additional Actions forms the high level build
    33  // graph.
    34  //
    35  // The Action graph is transformed into a Derivation graph via the
    36  // ActionProcessor (see `cipkg/base/actions.ActionProcessor` for additional
    37  // details).
    38  //
    39  // Actions exist apart from Derivations in order to maintain a
    40  // serializable/debuggable structure which is higher level than the raw
    41  // Derivations, which end up including system specific details.
    42  message Action {
    43    // Name is required for all actions. It's the name of the action's output.
    44    // The name shouldn't include version of the package and should represents
    45    // its content (e.g. cpython3, curl, ninja), NOT the action taken place
    46    // (e.g. build_cpython3, build_curl, build_ninja).
    47    // This name doesn't need to be unique and won't be used for deduplication,
    48    // but may be used as the placeholder for the path to the package during
    49    // transformation.
    50    string name = 1;
    51  
    52    // Metadata contains metadata information which won't affect the result of the
    53    // output. It can be used by package manager for cache/store packages and
    54    // helping users to identify its content.
    55    Metadata metadata = 2;
    56    message Metadata {
    57      // Dependencies which PackageManager will ensure being available prior to the
    58      // use of this Action's output.
    59      repeated Action runtime_deps = 1;
    60  
    61      CIPD cipd = 2;
    62      message CIPD {
    63        // Name is the cipd package name for the Action's output.
    64        string name = 1;
    65        // version is the cipd version tag for action's output.
    66        string version = 2;
    67      }
    68    }
    69  
    70    // Dependencies which PackageManager will ensure being available prior to the
    71    // execution of this Action.
    72    // TODO: Maybe move dependencies into specs?
    73    repeated Action deps = 3;
    74  
    75    // Spec is the action spec describing what action we want to perform.
    76    // It can be extended using extension for domain-specific use cases.
    77    // See cipkg/base/actions.ActionProcessor for additional details.
    78    oneof spec {
    79      ActionCommand command = 4;
    80      ActionURLFetch url = 5;
    81      ActionFilesCopy copy = 6;
    82  
    83      ActionCIPDExport cipd = 7;
    84  
    85      google.protobuf.Any extension = 99;
    86    }
    87  }