MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Create

Method Create

app/controlplane/pkg/data/project.go:114–124  ·  view source on GitHub ↗
(ctx context.Context, orgID uuid.UUID, name string)

Source from the content-addressed store, hash-verified

112}
113
114func (r *ProjectRepo) Create(ctx context.Context, orgID uuid.UUID, name string) (*biz.Project, error) {
115 ctx, span := otelx.Start(ctx, projectRepoTracer, "ProjectRepo.Create")
116 defer span.End()
117
118 pro, err := r.data.DB.Project.Create().SetOrganizationID(orgID).SetName(name).Save(ctx)
119 if err != nil && !ent.IsNotFound(err) {
120 return nil, err
121 }
122
123 return entProjectToBiz(pro), nil
124}
125
126// ListMembers lists all members of a project (both users and groups)
127func (r *ProjectRepo) ListMembers(ctx context.Context, orgID uuid.UUID, projectID uuid.UUID, paginationOpts *pagination.OffsetPaginationOpts) ([]*biz.ProjectMembership, int, error) {

Callers

nothing calls this directly

Calls 7

StartFunction · 0.92
IsNotFoundFunction · 0.92
entProjectToBizFunction · 0.85
SaveMethod · 0.65
CreateMethod · 0.65
SetNameMethod · 0.45
SetOrganizationIDMethod · 0.45

Tested by

no test coverage detected