blob: 7e4ca692116c3a6c969e95bd11b39f24753dcad1 [file] [log] [blame]
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.1.0
// - protoc v3.17.0
// source: go.chromium.org/luci/cv/api/migration/migration.proto
package migrationpb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// MigrationClient is the client API for Migration service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MigrationClient interface {
// ReportRuns notifies CV of the Runs CQDaemon is currently working with.
//
// Used to determine whether CV's view of the world matches that of CQDaemon.
// Initially, this is just FYI for CV.
ReportRuns(ctx context.Context, in *ReportRunsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// ReportFinishedRun notifies CV of the Run CQDaemon has just finalized.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CQDaemon is in charge of run management.
ReportFinishedRun(ctx context.Context, in *ReportFinishedRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// ReportVerifiedRun notifies CV of the Run CQDaemon has just finished
// verifying.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CV is in charge of run management.
ReportVerifiedRun(ctx context.Context, in *ReportVerifiedRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// FetchRunStatus provides to CQDaemon info about a completed Run in order to
// send to CQ Status app.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CV is in charge of run management.
FetchRunStatus(ctx context.Context, in *FetchRunStatusRequest, opts ...grpc.CallOption) (*FetchRunStatusResponse, error)
// PostGerritMessage posts a unique per run message to Gerrit.
//
// Best effort, since Gerrit doesn't provide for idempotent or conditional
// (etag like) updates.
//
// Use-cases:
// * CQDaemon linter posting a warning/error.
// * GerritCQAbility verifier posting error on each of Run's CL before
// failing entire attempt.
//
// Error handling:
// * If presumably transient Gerrit error, fails with Internal error (for
// simplicity). CQDaemon will have to retry.
// * If Gerrit error is 403, 404 or 412 (Precondition error), responds with
// corresponding gRPC code.
PostGerritMessage(ctx context.Context, in *PostGerritMessageRequest, opts ...grpc.CallOption) (*PostGerritMessageResponse, error)
// FetchActiveRuns returns all currently RUNNING runs in CV for the given
// project.
FetchActiveRuns(ctx context.Context, in *FetchActiveRunsRequest, opts ...grpc.CallOption) (*FetchActiveRunsResponse, error)
// FetchExcludedCLs returns all CLs referenced by ReportVerifiedRuns but with
// not yet ended Runs.
//
// CQDaemon uses this to avoid processing these CLs when computing its own
// list of candidates.
//
// Called by CQDaemon when CQDaemon is in charge of run management.
FetchExcludedCLs(ctx context.Context, in *FetchExcludedCLsRequest, opts ...grpc.CallOption) (*FetchExcludedCLsResponse, error)
// ReportUsedNetrc notifies CV of the legacy .netrc credentials used by
// CQDaemon.
ReportUsedNetrc(ctx context.Context, in *ReportUsedNetrcRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type migrationClient struct {
cc grpc.ClientConnInterface
}
func NewMigrationClient(cc grpc.ClientConnInterface) MigrationClient {
return &migrationClient{cc}
}
func (c *migrationClient) ReportRuns(ctx context.Context, in *ReportRunsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/migration.Migration/ReportRuns", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) ReportFinishedRun(ctx context.Context, in *ReportFinishedRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/migration.Migration/ReportFinishedRun", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) ReportVerifiedRun(ctx context.Context, in *ReportVerifiedRunRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/migration.Migration/ReportVerifiedRun", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) FetchRunStatus(ctx context.Context, in *FetchRunStatusRequest, opts ...grpc.CallOption) (*FetchRunStatusResponse, error) {
out := new(FetchRunStatusResponse)
err := c.cc.Invoke(ctx, "/migration.Migration/FetchRunStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) PostGerritMessage(ctx context.Context, in *PostGerritMessageRequest, opts ...grpc.CallOption) (*PostGerritMessageResponse, error) {
out := new(PostGerritMessageResponse)
err := c.cc.Invoke(ctx, "/migration.Migration/PostGerritMessage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) FetchActiveRuns(ctx context.Context, in *FetchActiveRunsRequest, opts ...grpc.CallOption) (*FetchActiveRunsResponse, error) {
out := new(FetchActiveRunsResponse)
err := c.cc.Invoke(ctx, "/migration.Migration/FetchActiveRuns", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) FetchExcludedCLs(ctx context.Context, in *FetchExcludedCLsRequest, opts ...grpc.CallOption) (*FetchExcludedCLsResponse, error) {
out := new(FetchExcludedCLsResponse)
err := c.cc.Invoke(ctx, "/migration.Migration/FetchExcludedCLs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *migrationClient) ReportUsedNetrc(ctx context.Context, in *ReportUsedNetrcRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/migration.Migration/ReportUsedNetrc", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MigrationServer is the server API for Migration service.
// All implementations must embed UnimplementedMigrationServer
// for forward compatibility
type MigrationServer interface {
// ReportRuns notifies CV of the Runs CQDaemon is currently working with.
//
// Used to determine whether CV's view of the world matches that of CQDaemon.
// Initially, this is just FYI for CV.
ReportRuns(context.Context, *ReportRunsRequest) (*emptypb.Empty, error)
// ReportFinishedRun notifies CV of the Run CQDaemon has just finalized.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CQDaemon is in charge of run management.
ReportFinishedRun(context.Context, *ReportFinishedRunRequest) (*emptypb.Empty, error)
// ReportVerifiedRun notifies CV of the Run CQDaemon has just finished
// verifying.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CV is in charge of run management.
ReportVerifiedRun(context.Context, *ReportVerifiedRunRequest) (*emptypb.Empty, error)
// FetchRunStatus provides to CQDaemon info about a completed Run in order to
// send to CQ Status app.
//
// The Run may not contain CV's id, but CV can figure out the the ID using
// Run.Attempt.Key.
//
// Called by CQDaemon when CV is in charge of run management.
FetchRunStatus(context.Context, *FetchRunStatusRequest) (*FetchRunStatusResponse, error)
// PostGerritMessage posts a unique per run message to Gerrit.
//
// Best effort, since Gerrit doesn't provide for idempotent or conditional
// (etag like) updates.
//
// Use-cases:
// * CQDaemon linter posting a warning/error.
// * GerritCQAbility verifier posting error on each of Run's CL before
// failing entire attempt.
//
// Error handling:
// * If presumably transient Gerrit error, fails with Internal error (for
// simplicity). CQDaemon will have to retry.
// * If Gerrit error is 403, 404 or 412 (Precondition error), responds with
// corresponding gRPC code.
PostGerritMessage(context.Context, *PostGerritMessageRequest) (*PostGerritMessageResponse, error)
// FetchActiveRuns returns all currently RUNNING runs in CV for the given
// project.
FetchActiveRuns(context.Context, *FetchActiveRunsRequest) (*FetchActiveRunsResponse, error)
// FetchExcludedCLs returns all CLs referenced by ReportVerifiedRuns but with
// not yet ended Runs.
//
// CQDaemon uses this to avoid processing these CLs when computing its own
// list of candidates.
//
// Called by CQDaemon when CQDaemon is in charge of run management.
FetchExcludedCLs(context.Context, *FetchExcludedCLsRequest) (*FetchExcludedCLsResponse, error)
// ReportUsedNetrc notifies CV of the legacy .netrc credentials used by
// CQDaemon.
ReportUsedNetrc(context.Context, *ReportUsedNetrcRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedMigrationServer()
}
// UnimplementedMigrationServer must be embedded to have forward compatible implementations.
type UnimplementedMigrationServer struct {
}
func (UnimplementedMigrationServer) ReportRuns(context.Context, *ReportRunsRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportRuns not implemented")
}
func (UnimplementedMigrationServer) ReportFinishedRun(context.Context, *ReportFinishedRunRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportFinishedRun not implemented")
}
func (UnimplementedMigrationServer) ReportVerifiedRun(context.Context, *ReportVerifiedRunRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportVerifiedRun not implemented")
}
func (UnimplementedMigrationServer) FetchRunStatus(context.Context, *FetchRunStatusRequest) (*FetchRunStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FetchRunStatus not implemented")
}
func (UnimplementedMigrationServer) PostGerritMessage(context.Context, *PostGerritMessageRequest) (*PostGerritMessageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PostGerritMessage not implemented")
}
func (UnimplementedMigrationServer) FetchActiveRuns(context.Context, *FetchActiveRunsRequest) (*FetchActiveRunsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FetchActiveRuns not implemented")
}
func (UnimplementedMigrationServer) FetchExcludedCLs(context.Context, *FetchExcludedCLsRequest) (*FetchExcludedCLsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FetchExcludedCLs not implemented")
}
func (UnimplementedMigrationServer) ReportUsedNetrc(context.Context, *ReportUsedNetrcRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportUsedNetrc not implemented")
}
func (UnimplementedMigrationServer) mustEmbedUnimplementedMigrationServer() {}
// UnsafeMigrationServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MigrationServer will
// result in compilation errors.
type UnsafeMigrationServer interface {
mustEmbedUnimplementedMigrationServer()
}
func RegisterMigrationServer(s grpc.ServiceRegistrar, srv MigrationServer) {
s.RegisterService(&Migration_ServiceDesc, srv)
}
func _Migration_ReportRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportRunsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).ReportRuns(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/ReportRuns",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).ReportRuns(ctx, req.(*ReportRunsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_ReportFinishedRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportFinishedRunRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).ReportFinishedRun(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/ReportFinishedRun",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).ReportFinishedRun(ctx, req.(*ReportFinishedRunRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_ReportVerifiedRun_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportVerifiedRunRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).ReportVerifiedRun(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/ReportVerifiedRun",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).ReportVerifiedRun(ctx, req.(*ReportVerifiedRunRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_FetchRunStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRunStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).FetchRunStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/FetchRunStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).FetchRunStatus(ctx, req.(*FetchRunStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_PostGerritMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PostGerritMessageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).PostGerritMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/PostGerritMessage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).PostGerritMessage(ctx, req.(*PostGerritMessageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_FetchActiveRuns_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchActiveRunsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).FetchActiveRuns(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/FetchActiveRuns",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).FetchActiveRuns(ctx, req.(*FetchActiveRunsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_FetchExcludedCLs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchExcludedCLsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).FetchExcludedCLs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/FetchExcludedCLs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).FetchExcludedCLs(ctx, req.(*FetchExcludedCLsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Migration_ReportUsedNetrc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportUsedNetrcRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MigrationServer).ReportUsedNetrc(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/migration.Migration/ReportUsedNetrc",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MigrationServer).ReportUsedNetrc(ctx, req.(*ReportUsedNetrcRequest))
}
return interceptor(ctx, in, info, handler)
}
// Migration_ServiceDesc is the grpc.ServiceDesc for Migration service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Migration_ServiceDesc = grpc.ServiceDesc{
ServiceName: "migration.Migration",
HandlerType: (*MigrationServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ReportRuns",
Handler: _Migration_ReportRuns_Handler,
},
{
MethodName: "ReportFinishedRun",
Handler: _Migration_ReportFinishedRun_Handler,
},
{
MethodName: "ReportVerifiedRun",
Handler: _Migration_ReportVerifiedRun_Handler,
},
{
MethodName: "FetchRunStatus",
Handler: _Migration_FetchRunStatus_Handler,
},
{
MethodName: "PostGerritMessage",
Handler: _Migration_PostGerritMessage_Handler,
},
{
MethodName: "FetchActiveRuns",
Handler: _Migration_FetchActiveRuns_Handler,
},
{
MethodName: "FetchExcludedCLs",
Handler: _Migration_FetchExcludedCLs_Handler,
},
{
MethodName: "ReportUsedNetrc",
Handler: _Migration_ReportUsedNetrc_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "go.chromium.org/luci/cv/api/migration/migration.proto",
}