This section is empty.


This section is empty.


func SetTestClientFactory

func SetTestClientFactory(ctx context.Context, clientMap map[string]Client) context.Context

    SetTestClientFactory sets up a ClientFactory for testing, where clientMap is a map whose keys are gerrit hosts, values are corresponding testing Gerrit clients.

    func Setup

    func Setup(ctx context.Context) context.Context

      Setup puts a production ClientFactory into the context.


      type CLReaderClient

      type CLReaderClient interface {
      	// Lists changes that match a query.
      	ListChanges(ctx context.Context, in *gerritpb.ListChangesRequest, opts ...grpc.CallOption) (*gerritpb.ListChangesResponse, error)
      	// Lists the files that were modified, added or deleted in a revision.
      	ListFiles(ctx context.Context, in *gerritpb.ListFilesRequest, opts ...grpc.CallOption) (*gerritpb.ListFilesResponse, error)
      	// Check if the given change is a pure revert of the change it references in
      	// revertOf. See also ChangeInfo.revert_of.
      	GetPureRevert(ctx context.Context, in *gerritpb.GetPureRevertRequest, opts ...grpc.CallOption) (*gerritpb.PureRevertInfo, error)
      	// Loads a change by id.
      	GetChange(ctx context.Context, in *gerritpb.GetChangeRequest, opts ...grpc.CallOption) (*gerritpb.ChangeInfo, error)
      	// Gets Mergeable status for a change.
      	GetMergeable(ctx context.Context, in *gerritpb.GetMergeableRequest, opts ...grpc.CallOption) (*gerritpb.MergeableInfo, error)

        CLReaderClient defines a subset of Gerrit API used by rubber-stamper to fetch CL details.

        type CLWriterClient

          CLWriterClient defines a subset of Gerrit API used by rubber-stamper to review CLs.

          type Client

          type Client interface {

            Client defines a subset of Gerrit API used by rubber-stamper.

            func GetCurrentClient

            func GetCurrentClient(ctx context.Context, gerritHost string) (Client, error)

              GetCurrentClient returns the Client in the context or an error.

              type ClientFactory

              type ClientFactory func(ctx context.Context, gerritHost string) (Client, error)

                ClientFactory creates Client tied to Gerrit host and LUCI project.

                Source Files