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
- type MigrationServer
- func (m *MigrationServer) FetchActiveRuns(ctx context.Context, req *migrationpb.FetchActiveRunsRequest) (resp *migrationpb.FetchActiveRunsResponse, err error)
- func (m *MigrationServer) FetchRunStatus(ctx context.Context, req *migrationpb.FetchRunStatusRequest) (resp *migrationpb.FetchRunStatusResponse, err error)
- func (m *MigrationServer) PostGerritMessage(ctx context.Context, req *migrationpb.PostGerritMessageRequest) (resp *migrationpb.PostGerritMessageResponse, err error)
- func (m *MigrationServer) ReportTryjobs(ctx context.Context, req *migrationpb.ReportTryjobsRequest) (resp *emptypb.Empty, err error)
- func (m *MigrationServer) ReportUsedNetrc(ctx context.Context, req *migrationpb.ReportUsedNetrcRequest) (resp *emptypb.Empty, err error)
- func (m *MigrationServer) ReportVerifiedRun(ctx context.Context, req *migrationpb.ReportVerifiedRunRequest) (resp *emptypb.Empty, err error)
- type ReportedTryjobs
- type VerifiedCQDRun
Constants ¶
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 ¶
func (m *MigrationServer) FetchActiveRuns(ctx context.Context, req *migrationpb.FetchActiveRunsRequest) (resp *migrationpb.FetchActiveRunsResponse, err error)
FetchActiveRuns returns all RUNNING runs without VerifiedCQDRun records.
func (*MigrationServer) FetchRunStatus ¶
func (m *MigrationServer) FetchRunStatus(ctx context.Context, req *migrationpb.FetchRunStatusRequest) (resp *migrationpb.FetchRunStatusResponse, err error)
func (*MigrationServer) PostGerritMessage ¶
func (m *MigrationServer) PostGerritMessage(ctx context.Context, req *migrationpb.PostGerritMessageRequest) (resp *migrationpb.PostGerritMessageResponse, err error)
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. |