Skip to content

Commit ecaf8c2

Browse files
authored
feat: remove workflow-name org scoping (#1414)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent 98099fc commit ecaf8c2

38 files changed

+330
-385
lines changed

app/cli/cmd/attestation_init.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ func newAttestationInitCmd() *cobra.Command {
107107
cobra.CheckErr(cmd.Flags().MarkDeprecated("name", "please use --workflow instead"))
108108
cmd.Flags().StringVar(&workflowName, "workflow-name", "", "name of the workflow to run the attestation")
109109
cobra.CheckErr(cmd.Flags().MarkDeprecated("workflow-name", "please use --workflow instead"))
110+
110111
cmd.Flags().StringVar(&projectName, "project", "", "name of the project of this workflow")
112+
cobra.CheckErr(cmd.MarkFlagRequired("project"))
113+
111114
return cmd
112115
}

app/controlplane/api/controlplane/v1/workflow_run.pb.go

Lines changed: 243 additions & 243 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/controlplane/v1/workflow_run.proto

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ message AttestationServiceGetPolicyGroupResponse {
8787
message AttestationServiceGetContractRequest {
8888
int32 contract_revision = 1;
8989
string workflow_name = 2 [(buf.validate.field).string.min_len = 1];
90-
// optional for now for compatibility with the CLI
91-
string project_name = 3;
90+
string project_name = 3 [(buf.validate.field).string.min_len = 1];
9291
}
9392

9493
message AttestationServiceGetContractResponse {
@@ -104,9 +103,8 @@ message AttestationServiceInitRequest {
104103
int32 contract_revision = 1;
105104
string job_url = 2;
106105
workflowcontract.v1.CraftingSchema.Runner.RunnerType runner = 3;
107-
string workflow_name = 4;
108-
// optional for now for compatibility with the CLI
109-
string project_name = 5;
106+
string workflow_name = 4 [(buf.validate.field).string.min_len = 1];
107+
string project_name = 5 [(buf.validate.field).string.min_len = 1];
110108
}
111109

112110
message AttestationServiceInitResponse {

app/controlplane/api/gen/frontend/controlplane/v1/workflow_run.ts

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.AttestationServiceGetContractRequest.jsonschema.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.AttestationServiceGetContractRequest.schema.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.AttestationServiceInitRequest.jsonschema.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/controlplane.v1.AttestationServiceInitRequest.schema.json

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/internal/dispatcher/dispatcher_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ func (s *dispatcherTestSuite) SetupTest() {
221221
assert.NoError(s.T(), err)
222222

223223
// Workflow
224-
s.workflow, err = s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow", OrgID: s.org.ID})
224+
s.workflow, err = s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow", OrgID: s.org.ID, Project: "test-project"})
225225
assert.NoError(s.T(), err)
226226

227227
// Workflow
228-
s.emptyWorkflow, err = s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "empty-workflow", OrgID: s.org.ID})
228+
s.emptyWorkflow, err = s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "empty-workflow", OrgID: s.org.ID, Project: "test-project"})
229229
assert.NoError(s.T(), err)
230230

231231
customImplementation := mockedSDK.NewFanOutPlugin(s.T())

app/controlplane/pkg/biz/casmapping_integration_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,10 @@ func (s *casMappingIntegrationSuite) SetupTest() {
353353

354354
// Create workflowRun in the database
355355
// Workflow
356-
workflow, err := s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow", OrgID: s.org1.ID})
356+
workflow, err := s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow", OrgID: s.org1.ID, Project: "test-project"})
357357
assert.NoError(err)
358358

359-
publicWorkflow, err := s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow-public", OrgID: s.org1.ID, Public: true})
359+
publicWorkflow, err := s.Workflow.Create(ctx, &biz.WorkflowCreateOpts{Name: "test-workflow-public", OrgID: s.org1.ID, Public: true, Project: "test-project"})
360360
assert.NoError(err)
361361

362362
// Find contract revision

0 commit comments

Comments
 (0)