// Copyright 2024 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

syntax = "proto3";

package recipe_modules.pigweed.cipd_roll;

message Package {
  // Path to json file (relative to checkout root). Default is
  // 'pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json'.
  string json_path = 1;

  // Name of CIPD package. Default is to extract from package_spec.
  string name = 2;

  // Path to CIPD package (as specificed in json file, maybe using
  // "${platform}"). Required.
  string spec = 3;

  // Ref to update tag to. Default: 'latest'.
  string ref = 4;

  // Key of tag to use (e.g., "git_revision" or "version"). Default:
  // "git_revision".
  string tag = 5;

  // Do not consider it an error if the package versions with the requested ref
  // have different tags for different platforms.  Instead, find a tag such
  // that (1) for *some* platform, the package with this tag has the requested
  // ref, and (2) a package with this tag exists for *all* platforms.
  bool allow_mismatched_refs = 6;
}
