Skip to content

Commit e08f80a

Browse files
committed
remove unintended change
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
1 parent 737fbaa commit e08f80a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

app/controlplane/pkg/biz/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (uc *WorkflowUseCase) Create(ctx context.Context, opts *WorkflowCreateOpts)
150150

151151
// Take the raw contract bytes and identify the format and validate it
152152
if opts.ContractBytes != nil {
153-
detectedContract, err := RawToSchemaContract(opts.ContractBytes)
153+
detectedContract, err := identifyUnMarshalAndValidateRawContract(opts.ContractBytes)
154154
if err != nil {
155155
return nil, fmt.Errorf("failed to load contract: %w", err)
156156
}

app/controlplane/pkg/biz/workflowcontract.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func (uc *WorkflowContractUseCase) Create(ctx context.Context, opts *WorkflowCon
257257
var contract *Contract
258258
if len(opts.RawSchema) > 0 {
259259
// Load the provided contract
260-
c, err := RawToSchemaContract(opts.RawSchema)
260+
c, err := identifyUnMarshalAndValidateRawContract(opts.RawSchema)
261261
if err != nil {
262262
return nil, fmt.Errorf("failed to load contract: %w", err)
263263
}
@@ -391,7 +391,7 @@ func (uc *WorkflowContractUseCase) Update(ctx context.Context, orgID, name strin
391391

392392
var contract *Contract
393393
if len(opts.RawSchema) > 0 {
394-
c, err := RawToSchemaContract(opts.RawSchema)
394+
c, err := identifyUnMarshalAndValidateRawContract(opts.RawSchema)
395395
if err != nil {
396396
return nil, fmt.Errorf("failed to load contract: %w", err)
397397
}
@@ -434,7 +434,7 @@ func (uc *WorkflowContractUseCase) Update(ctx context.Context, orgID, name strin
434434

435435
func (uc *WorkflowContractUseCase) ValidateContractPolicies(rawSchema []byte, token string) error {
436436
// Validate that externally provided policies exist
437-
c, err := RawToSchemaContract(rawSchema)
437+
c, err := identifyUnMarshalAndValidateRawContract(rawSchema)
438438
if err != nil {
439439
return NewErrValidation(err)
440440
}
@@ -716,8 +716,8 @@ func UnmarshalAndValidateRawContract(raw []byte, format unmarshal.RawFormat) (*C
716716
return nil, NewErrValidation(fmt.Errorf("contract validation failed:\n v2 Contract format error: %w\n v1 CraftingSchema format error: %w", v2Err, v1Err))
717717
}
718718

719-
// RawToSchemaContract Will try to figure out the format of the raw contract and validate it
720-
func RawToSchemaContract(raw []byte) (*Contract, error) {
719+
// Will try to figure out the format of the raw contract and validate it
720+
func identifyUnMarshalAndValidateRawContract(raw []byte) (*Contract, error) {
721721
format, err := unmarshal.IdentifyFormat(raw)
722722
if err != nil {
723723
return nil, fmt.Errorf("identify contract: %w", err)

0 commit comments

Comments
 (0)