blob: bbd835a1ca7ad24f64436902ab2ca694f2a9ff14 [file] [log] [blame]
syntax = "proto3";
package chromite.api;
option go_package = "go.chromium.org/chromiumos/infra/proto/go/chromite/api";
// Added in R77.
import "chromite/api/artifacts.proto";
import "chromite/api/build_api.proto";
import "chromite/api/sysroot.proto";
// TODO(crbug/1027720): Migrate BuilderConfig.Artifacts.ArtifactType to
// common.proto, and stop including builder_config.proto.
import "chromiumos/builder_config.proto";
import "chromiumos/common.proto";
// Information about a collection of artifacts.
message ArtifactInfo {
// The ArtifactType.
chromiumos.BuilderConfig.Artifacts.ArtifactTypes artifact_type = 1;
// Artifacts for this ArtifactType.
repeated Artifact artifacts = 2;
}
// TODO(crbug/1034529): Migrate this to ArtifactsService/BuildSetup.
//
// Prepare the build for artifact building.
message PrepareForToolchainBuildRequest {
// The artifact types that this build should make.
repeated chromiumos.BuilderConfig.Artifacts.ArtifactTypes artifact_types = 1;
// Note: both chroot and sysroot may be unspecified, when the endpoint is
// called prior to their creation.
// The chroot where the sysroot lives.
chromiumos.Chroot chroot = 2;
// The sysroot where the files live.
chromite.api.Sysroot sysroot = 3;
// Information about artifacts available when preparing.
repeated chromiumos.BuilderConfig.Artifacts.InputArtifactInfo input_artifacts = 4;
// Additional arguments used in PrepareForBuild.
// TODO(crbug/1019868): Transition to artifact_profile_info.
chromiumos.PrepareForBuildAdditionalArgs additional_args = 5;
// Profile information used for the artifact.
chromiumos.ArtifactProfileInfo profile_info = 6;
}
message PrepareForToolchainBuildResponse {
// Does this artifact require a build? See artifacts.proto in this directory.
PrepareForBuildResponse.BuildRelevance build_relevance = 1;
}
message BundleToolchainRequest {
// The chroot where the sysroot lives.
chromiumos.Chroot chroot = 1;
// The sysroot where the files live.
chromite.api.Sysroot sysroot = 2;
// Absolute path to the directory in which artifacts should be dropped.
string output_dir = 3;
// Which artifacts are wanted?
repeated chromiumos.BuilderConfig.Artifacts.ArtifactTypes artifact_types = 4;
// Additional arguments that were used in PrepareForBuild.
// TODO(crbug/1019868): Transition to artifact_profile_info.
chromiumos.PrepareForBuildAdditionalArgs additional_args = 5;
// Profile information used for the artifact.
chromiumos.ArtifactProfileInfo profile_info = 6;
}
// Response describing which bundles were dumped to the given output directory.
message BundleToolchainResponse {
// In R80 and earlier, artifacts_info had a different type.
reserved 1;
// The artifacts that added to the output directory.
repeated ArtifactInfo artifacts_info = 2;
}
message GetUpdatedFilesRequest {
// We need the artifact info from BundleResponse and the profile info
// as the input of the request.
message UploadedArtifacts {
ArtifactInfo artifact_info = 1;
chromiumos.ArtifactProfileInfo profile_info = 2;
}
repeated UploadedArtifacts uploaded_artifacts = 1;
}
message GetUpdatedFilesResponse {
message UpdatedFile {
// The path to the (uncommitted) file.
string path = 1;
}
repeated UpdatedFile updated_files = 1;
// The commit message to use.
string commit_message = 2;
// The Cq-Depend footer is used by LUCI (and Chrome OS Recipes) to operate
// on interdependent changes at various steps.
message CqDependFooter {
// The gerrit change(s) we depend on.
repeated chromiumos.GerritChange gerrit_change = 1;
}
// The Cq-Cl-Tag footer is used by cq-orchestrator to choose quota pools.
message CqClTagFooter {
// The Cq-Cl-Tag value.
string tag = 1;
}
message CommitFooter {
oneof footer {
CqDependFooter cq_depend = 1;
CqClTagFooter cq_cl_tag = 2;
}
}
// Any footers to use. Formatted to the current standard by Recipes.
repeated CommitFooter commit_footer = 3;
}
// A diagnostic finding from a Linter.
message LinterFinding {
string message = 1;
repeated LinterFindingLocation locations = 2;
enum Linters {
LINTER_UNSPECIFIED = 0;
CLANG_TIDY = 1;
CARGO_CLIPPY = 2;
}
Linters linter = 3;
}
// The code location of some linter finding.
message LinterFindingLocation {
string filepath = 1;
int32 line_start = 2;
int32 line_end = 3;
}
// Request lints from some packages.
message LinterRequest {
repeated chromiumos.PackageInfo packages = 1;
Sysroot sysroot = 2;
chromiumos.Chroot chroot = 3;
// Filter findings to only keep lints in modified lines
bool filter_modified = 4;
}
// Linter findings generated when emerging some package.
message LinterResponse {
repeated LinterFinding findings = 1;
}
// Request toolchains info for a board.
message ToolchainsRequest {
string board = 1;
}
// Toolchains info for a board.
message ToolchainsResponse {
// e.g. x86_64-cros-linux-gnu
repeated string default_toolchains = 1;
// e.g. i686-cros-linux-gnu
repeated string nondefault_toolchains = 2;
}
// Service for Android/ARC related functionality.
service ToolchainService {
option (service_options) = {
module: "toolchain",
service_chroot_assert: OUTSIDE,
};
// TODO(crbug/1034529): Migrate this to ArtifactsService/BuildSetup.
// Prepare to build toolchain artifacts. This will be called twice:
// Once with chroot and sysroot = None, before the chroot is created, and
// again at the start of the 'install packages' step, if the build gets that
// far. Added in R80.
rpc PrepareForBuild(PrepareForToolchainBuildRequest)
returns (PrepareForToolchainBuildResponse);
// TODO(crbug/1034529): Migrate this to ArtifactsService/Get.
// Bundle toolchain artifacts. Added in R80.
rpc BundleArtifacts(BundleToolchainRequest)
returns (BundleToolchainResponse);
// Added in R90.
rpc GetUpdatedFiles(GetUpdatedFilesRequest)
returns (GetUpdatedFilesResponse);
// Emerge the given packages and retrieve any findings from linters.
rpc EmergeWithLinting(LinterRequest) returns (LinterResponse) {
option (method_options) = {
method_chroot_assert: INSIDE,
};
};
// Emerge the given Rust packages and retrieve any findings from Cargo Clippy.
// FIXME(b/187790543): remove this endpoint oboleted by "EmergeWithLinting".
// This refactor has the following dependency chain:
// 1) Create EmergeWithLinting endpoint
// 2) Let Recipe Roller update the Build API for recipes
// 3) Update the recipe to use EmergeWithLinting
// 4) Delete GetClippyLints endpoint
rpc GetClippyLints(LinterRequest) returns (LinterResponse) {
option (method_options) = {
method_chroot_assert: INSIDE,
};
};
// Get the default and non-default toolchains for a board.
rpc GetToolchainsForBoard(ToolchainsRequest) returns (ToolchainsResponse);
}