Skip to content

Commit bb34525

Browse files
authored
fix: add remote version compatibility (#1474)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent b12cf9a commit bb34525

File tree

8 files changed

+130
-81
lines changed

8 files changed

+130
-81
lines changed

app/cli/internal/action/attestation_init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (action *AttestationInit) Run(ctx context.Context, opts *AttestationInitRun
125125
Project: workflow.GetProject(),
126126
Team: workflow.GetTeam(),
127127
SchemaRevision: strconv.Itoa(int(contractVersion.GetRevision())),
128-
ProjectVersion: &clientAPI.ProjectVersion{
128+
Version: &clientAPI.ProjectVersion{
129129
Version: opts.ProjectVersion,
130130
MarkAsReleased: opts.ProjectVersionMarkAsReleased,
131131
},
@@ -169,7 +169,7 @@ func (action *AttestationInit) Run(ctx context.Context, opts *AttestationInitRun
169169
workflowRun := runResp.GetResult().GetWorkflowRun()
170170
workflowMeta.WorkflowRunId = workflowRun.GetId()
171171
workflowMeta.Organization = runResp.GetResult().GetOrganization()
172-
workflowMeta.ProjectVersion.Prerelease = runResp.GetResult().GetWorkflowRun().Version.GetPrerelease()
172+
workflowMeta.Version.Prerelease = runResp.GetResult().GetWorkflowRun().Version.GetPrerelease()
173173
action.Logger.Debug().Str("workflow-run-id", workflowRun.GetId()).Msg("attestation initialized in the control plane")
174174
attestationID = workflowRun.GetId()
175175
}

app/cli/internal/action/attestation_push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (action *AttestationPush) Run(ctx context.Context, attestationID string, ru
177177

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

180-
attestationResult.Digest, err = pushToControlPlane(ctx, action.ActionsOpts.CPConnection, envelope, workflow.GetWorkflowRunId(), workflow.GetProjectVersion().GetMarkAsReleased())
180+
attestationResult.Digest, err = pushToControlPlane(ctx, action.ActionsOpts.CPConnection, envelope, workflow.GetWorkflowRunId(), workflow.GetVersion().GetMarkAsReleased())
181181
if err != nil {
182182
return nil, fmt.Errorf("pushing to control plane: %w", err)
183183
}

app/cli/internal/action/attestation_status.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (action *AttestationStatus) Run(ctx context.Context, attestationID string)
104104
Team: workflowMeta.GetTeam(),
105105
ContractRevision: workflowMeta.GetSchemaRevision(),
106106
ProjectVersion: &ProjectVersion{
107-
Version: workflowMeta.GetProjectVersion().GetVersion(),
107+
Version: workflowMeta.GetVersion().GetVersion(),
108108
},
109109
},
110110
InitializedAt: toTimePtr(att.InitializedAt.AsTime()),
@@ -113,8 +113,8 @@ func (action *AttestationStatus) Run(ctx context.Context, attestationID string)
113113
}
114114

115115
if !action.skipReleaseInfo {
116-
res.WorkflowMeta.ProjectVersion.Prerelease = workflowMeta.ProjectVersion.Prerelease
117-
res.WorkflowMeta.ProjectVersion.MarkAsReleased = workflowMeta.ProjectVersion.MarkAsReleased
116+
res.WorkflowMeta.ProjectVersion.Prerelease = workflowMeta.Version.Prerelease
117+
res.WorkflowMeta.ProjectVersion.MarkAsReleased = workflowMeta.Version.MarkAsReleased
118118
}
119119

120120
// Let's perform the following steps in order to show all possible materials:

app/controlplane/api/gen/frontend/attestation/v1/crafting_state.ts

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

app/controlplane/api/gen/jsonschema/attestation.v1.WorkflowMetadata.jsonschema.json

Lines changed: 8 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/attestation.v1.WorkflowMetadata.schema.json

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

0 commit comments

Comments
 (0)