OLD | NEW |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 // Recompile with libprotoc 2.5.0: | 5 // Recompile with libprotoc 2.5.0: |
6 // protoc -I recipe_engine recipe_engine/package.proto --python_out=recipe_engin
e | 6 // protoc -I recipe_engine recipe_engine/package.proto --python_out=recipe_engin
e |
7 | 7 |
8 syntax = "proto2"; | 8 syntax = "proto2"; |
9 | 9 |
10 package recipe_engine; | 10 package recipe_engine; |
11 | 11 |
12 message DepSpec { | 12 message DepSpec { |
| 13 // Same meaning as Package.project_id, but the id for this dependency. This |
| 14 // should always match the project_id of the repo that we're depending on. |
13 optional string project_id = 1; | 15 optional string project_id = 1; |
| 16 |
| 17 // The URL of where to fetch the package data. Must always be a git repo URL. |
14 optional string url = 2; | 18 optional string url = 2; |
| 19 |
| 20 // The ref to git-fetch when syncing this dependency. |
15 optional string branch = 3; | 21 optional string branch = 3; |
| 22 |
| 23 // The git commit that we depend on. |
16 optional string revision = 4; | 24 optional string revision = 4; |
17 | 25 |
18 // Treat a subtree of a repo as a whole repo unto itself. | 26 // Treat a subtree of a repo as a whole repo unto itself. This must match |
| 27 // the value of `recipes_path` in the target repo. |
19 optional string path_override = 5; | 28 optional string path_override = 5; |
20 | 29 |
21 enum RepoType { | 30 enum RepoType { |
| 31 // Do a full 'git clone' of this dependency. |
22 GIT = 0; | 32 GIT = 0; |
| 33 |
| 34 // Use GITILES to fetch the dependency data via the GITILES REST API. |
23 GITILES = 1; | 35 GITILES = 1; |
24 } | 36 } |
| 37 // How this dependency should be fetched. |
| 38 // |
| 39 // NOTE: this option may be removed in the future in preference for |
| 40 // automatically picking the repo fetch method. |
25 optional RepoType repo_type = 6 [default = GIT]; | 41 optional RepoType repo_type = 6 [default = GIT]; |
26 } | 42 } |
27 | 43 |
28 message Package { | 44 message Package { |
| 45 // The "API Version" of this proto. Should always equal 1, currently. This may |
| 46 // change if a backwards-incompatible update must be done for the proto. In |
| 47 // the event that a backwards incompatible change happens, however, |
| 48 // api_version will remain at tag 1. |
29 optional int32 api_version = 1; // Version 1 | 49 optional int32 api_version = 1; // Version 1 |
| 50 |
| 51 // The "id" of how this package is referred to within recipes. This becomes |
| 52 // the prefix in DEPS when something depends on one of this package's modules |
| 53 // (e.g. DEPS=["recipe_engine/path"]). This should match the name of the repo |
| 54 // in the luci-config service associated with the repo, and should not contain |
| 55 // slashes. |
30 optional string project_id = 2; | 56 optional string project_id = 2; |
| 57 |
| 58 // The path (using forward slashes) to where the base of the recipes are found |
| 59 // in the repo (i.e. where the "recipes" and/or "recipe_modules" directories |
| 60 // live). |
31 optional string recipes_path = 3; | 61 optional string recipes_path = 3; |
| 62 |
| 63 // Any package dependencies that this package has. |
32 repeated DepSpec deps = 4; | 64 repeated DepSpec deps = 4; |
| 65 |
| 66 // The "source of truth" for this package's data, e.g. |
| 67 // "https://github.com/luci/recipes-py" |
| 68 // This is used for documentation purposes, and does NOT need to match the |
| 69 // `url` field in any other package's deps (in order to allow for mirroring). |
| 70 // |
| 71 // The documentation generator will infer paths to files that are relative to |
| 72 // this URL, and knows about the following git host URL schemes: |
| 73 // * GitHub |
| 74 // * Gitiles |
| 75 optional string canonical_base_url = 5; |
33 } | 76 } |
OLD | NEW |