Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controlplane/pkg/biz/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ type Workflow struct {
// This field is also used to calculate if an user can download attestations/materials from the CAS
Public bool
ProjectID uuid.UUID
// WorkflowTemplateID references the platform workflow template this workflow was created from
WorkflowTemplateID *uuid.UUID
}

// WorkflowRef is a reference to a workflow
Expand Down Expand Up @@ -88,6 +90,8 @@ type WorkflowCreateOpts struct {
UserIsOrgAdmin bool
// OrgRestrictContractCreationToAdmins is the organization's setting for restricting contract creation
OrgRestrictContractCreationToAdmins bool
// WorkflowTemplateID optionally references the platform workflow template this workflow is created from
WorkflowTemplateID *uuid.UUID
}

type WorkflowUpdateOpts struct {
Expand Down
14 changes: 8 additions & 6 deletions app/controlplane/pkg/data/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
SetContractID(contractUUID).
SetOrganizationID(orgUUID).
SetDescription(opts.Description).
SetNillableWorkflowTemplateID(opts.WorkflowTemplateID).
Save(ctx)
if err != nil {
if ent.IsConstraintError(err) {
Expand Down Expand Up @@ -492,12 +493,13 @@

func entWFToBizWF(ctx context.Context, w *ent.Workflow) (*biz.Workflow, error) {
wf := &biz.Workflow{Name: w.Name, ID: w.ID,
CreatedAt: toTimePtr(w.CreatedAt), Team: w.Team,
RunsCounter: w.RunsCount,
Public: w.Public,
Description: w.Description,
OrgID: w.OrganizationID,
ProjectID: w.ProjectID,
CreatedAt: toTimePtr(w.CreatedAt), Team: w.Team,

Check failure on line 496 in app/controlplane/pkg/data/workflow.go

View workflow job for this annotation

GitHub Actions / lint (controlplane)

File is not properly formatted (gofmt)

Check failure on line 496 in app/controlplane/pkg/data/workflow.go

View workflow job for this annotation

GitHub Actions / lint (main-module)

File is not properly formatted (gofmt)
RunsCounter: w.RunsCount,
Public: w.Public,
Description: w.Description,
OrgID: w.OrganizationID,
ProjectID: w.ProjectID,
WorkflowTemplateID: w.WorkflowTemplateID,
}

// Set p either pre-loaded or queried
Expand Down
Loading