MCPcopy Create free account
hub / github.com/bytebase/bytebase / listPlanUIDs

Function listPlanUIDs

backend/tests/collision_helper_test.go:397–412  ·  view source on GitHub ↗

listPlanUIDs returns every plan UID in the project, via the public gRPC ListPlans API. UIDs are parsed from the resource names.

(ctx context.Context, t *testing.T, ctl *controller, projectName string)

Source from the content-addressed store, hash-verified

395// listPlanUIDs returns every plan UID in the project, via the public gRPC
396// ListPlans API. UIDs are parsed from the resource names.
397func listPlanUIDs(ctx context.Context, t *testing.T, ctl *controller, projectName string) []int64 {
398 t.Helper()
399 a := require.New(t)
400 resp, err := ctl.planServiceClient.ListPlans(ctx, connect.NewRequest(&v1pb.ListPlansRequest{
401 Parent: projectName,
402 PageSize: 1000,
403 }))
404 a.NoError(err, "ListPlans(%s)", projectName)
405 out := make([]int64, 0, len(resp.Msg.Plans))
406 for _, p := range resp.Msg.Plans {
407 _, uid, err := common.GetProjectIDPlanID(p.Name)
408 a.NoError(err, "parse plan name %q", p.Name)
409 out = append(out, uid)
410 }
411 return out
412}
413
414// listIssueUIDs returns every issue UID in the project.
415func listIssueUIDs(ctx context.Context, t *testing.T, ctl *controller, projectName string) []int64 {

Callers 1

assertFixtureIDsCollideFunction · 0.85

Calls 2

GetProjectIDPlanIDFunction · 0.92
ListPlansMethod · 0.65

Tested by

no test coverage detected