Skip to content

Commit

Permalink
fix: add remote version compatibility (chainloop-dev#1474)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Martinez <[email protected]>
  • Loading branch information
migmartri authored Nov 5, 2024
1 parent b12cf9a commit bb34525
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 81 deletions.
4 changes: 2 additions & 2 deletions app/cli/internal/action/attestation_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (action *AttestationInit) Run(ctx context.Context, opts *AttestationInitRun
Project: workflow.GetProject(),
Team: workflow.GetTeam(),
SchemaRevision: strconv.Itoa(int(contractVersion.GetRevision())),
ProjectVersion: &clientAPI.ProjectVersion{
Version: &clientAPI.ProjectVersion{
Version: opts.ProjectVersion,
MarkAsReleased: opts.ProjectVersionMarkAsReleased,
},
Expand Down Expand Up @@ -169,7 +169,7 @@ func (action *AttestationInit) Run(ctx context.Context, opts *AttestationInitRun
workflowRun := runResp.GetResult().GetWorkflowRun()
workflowMeta.WorkflowRunId = workflowRun.GetId()
workflowMeta.Organization = runResp.GetResult().GetOrganization()
workflowMeta.ProjectVersion.Prerelease = runResp.GetResult().GetWorkflowRun().Version.GetPrerelease()
workflowMeta.Version.Prerelease = runResp.GetResult().GetWorkflowRun().Version.GetPrerelease()
action.Logger.Debug().Str("workflow-run-id", workflowRun.GetId()).Msg("attestation initialized in the control plane")
attestationID = workflowRun.GetId()
}
Expand Down
2 changes: 1 addition & 1 deletion app/cli/internal/action/attestation_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (action *AttestationPush) Run(ctx context.Context, attestationID string, ru

workflow := crafter.CraftingState.Attestation.GetWorkflow()

attestationResult.Digest, err = pushToControlPlane(ctx, action.ActionsOpts.CPConnection, envelope, workflow.GetWorkflowRunId(), workflow.GetProjectVersion().GetMarkAsReleased())
attestationResult.Digest, err = pushToControlPlane(ctx, action.ActionsOpts.CPConnection, envelope, workflow.GetWorkflowRunId(), workflow.GetVersion().GetMarkAsReleased())
if err != nil {
return nil, fmt.Errorf("pushing to control plane: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions app/cli/internal/action/attestation_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (action *AttestationStatus) Run(ctx context.Context, attestationID string)
Team: workflowMeta.GetTeam(),
ContractRevision: workflowMeta.GetSchemaRevision(),
ProjectVersion: &ProjectVersion{
Version: workflowMeta.GetProjectVersion().GetVersion(),
Version: workflowMeta.GetVersion().GetVersion(),
},
},
InitializedAt: toTimePtr(att.InitializedAt.AsTime()),
Expand All @@ -113,8 +113,8 @@ func (action *AttestationStatus) Run(ctx context.Context, attestationID string)
}

if !action.skipReleaseInfo {
res.WorkflowMeta.ProjectVersion.Prerelease = workflowMeta.ProjectVersion.Prerelease
res.WorkflowMeta.ProjectVersion.MarkAsReleased = workflowMeta.ProjectVersion.MarkAsReleased
res.WorkflowMeta.ProjectVersion.Prerelease = workflowMeta.Version.Prerelease
res.WorkflowMeta.ProjectVersion.MarkAsReleased = workflowMeta.Version.MarkAsReleased
}

// Let's perform the following steps in order to show all possible materials:
Expand Down
41 changes: 31 additions & 10 deletions app/controlplane/api/gen/frontend/attestation/v1/crafting_state.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bb34525

Please sign in to comment.