migration

package
v0.0.0-...-ddee7fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package migration implements migration API to be called by CQDaemon.

The package is meant to be deleted after migration to CV is over. TODO(cbrug/1141880): delete this package.

Index

Constants

View Source
const AllowGroup = "luci-cv-migration-crbug-1141880"

AllowGroup is a Chrome Infra Auth group, members of which are allowed to call migration API. It's hardcoded here because this code is temporary.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrationServer

type MigrationServer struct {
	RunNotifier runNotifier
	GFactory    gerrit.Factory

	migrationpb.UnimplementedMigrationServer
}

MigrationServer implements CQDaemon -> CV migration API.

func (*MigrationServer) FetchActiveRuns

FetchActiveRuns returns all RUNNING runs without VerifiedCQDRun records.

func (*MigrationServer) FetchRunStatus

func (*MigrationServer) PostGerritMessage

func (*MigrationServer) ReportTryjobs

func (m *MigrationServer) ReportTryjobs(ctx context.Context, req *migrationpb.ReportTryjobsRequest) (resp *emptypb.Empty, err error)

ReportTryjobs notifies CV of the tryjobs which CQDaemon considers relevant to a Run.

func (*MigrationServer) ReportUsedNetrc

func (m *MigrationServer) ReportUsedNetrc(ctx context.Context, req *migrationpb.ReportUsedNetrcRequest) (resp *emptypb.Empty, err error)

func (*MigrationServer) ReportVerifiedRun

func (m *MigrationServer) ReportVerifiedRun(ctx context.Context, req *migrationpb.ReportVerifiedRunRequest) (resp *emptypb.Empty, err error)

ReportVerifiedRun notifies CV of the Run CQDaemon has just finished verifying.

Only called iff run was given to CQDaemon by CV via FetchActiveRuns.

type ReportedTryjobs

type ReportedTryjobs struct {

	// ID records RunID & when entity was inserted, see makeReportedTryjobsID().
	ID string `gae:"$id"`
	// Payload is what CQDaemon has reported.
	Payload *migrationpb.ReportTryjobsRequest
	// contains filtered or unexported fields
}

ReportTryjobs stores snapshots of Run's tryjobs reported by CQDaemon.

func ListReportedTryjobs

func ListReportedTryjobs(ctx context.Context, rid common.RunID, after time.Time, limit int32) ([]*ReportedTryjobs, error)

ListReportedTryjobs returns all ReportedTryjobs records reported by CQDaemon since a given time, ordered by time DESC.

`after` is exclusive.

func (*ReportedTryjobs) ReportTime

func (r *ReportedTryjobs) ReportTime() time.Time

func (*ReportedTryjobs) RunID

func (r *ReportedTryjobs) RunID() common.RunID

type VerifiedCQDRun

type VerifiedCQDRun struct {

	// ID is ID of this Run in CV.
	ID common.RunID `gae:"$id"`
	// Payload is what CQDaemon has reported.
	Payload *migrationpb.ReportVerifiedRunRequest
	// RecordTime is when this entity was inserted.
	UpdateTime time.Time `gae:",noindex"`
	// contains filtered or unexported fields
}

VerifiedCQDRun is the Run reported by CQDaemon after verification completes.

Directories

Path Synopsis
Package cqdfake implements fake CQDaemon for use in tests.
Package cqdfake implements fake CQDaemon for use in tests.
package migrationcfg contains config-related CQD migration funcs.
package migrationcfg contains config-related CQD migration funcs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL