Skip to content

Commit 46c9a79

Browse files
authored
fix(controlplane): detect environment in server (#520)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent d73b062 commit 46c9a79

File tree

6 files changed

+281
-234
lines changed

6 files changed

+281
-234
lines changed

app/cli/internal/action/attestation_init.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ func (action *AttestationInit) Run(ctx context.Context, contractRevision int) (s
116116
runResp, err := client.Init(
117117
ctx,
118118
&pb.AttestationServiceInitRequest{
119+
Runner: discoveredRunner.ID(),
119120
JobUrl: discoveredRunner.RunURI(),
120121
ContractRevision: int32(contractRevision),
121122
},

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

Lines changed: 251 additions & 232 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.pb.validate.go

Lines changed: 6 additions & 0 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/con
2222
import "validate/validate.proto";
2323
import "controlplane/v1/response_messages.proto";
2424
import "controlplane/v1/pagination.proto";
25+
import "workflowcontract/v1/crafting_schema.proto";
2526

2627
// This service is used by the CLI to generate attestation
2728
service AttestationService {
@@ -56,6 +57,7 @@ message AttestationServiceGetContractResponse {
5657
message AttestationServiceInitRequest {
5758
int32 contract_revision = 1;
5859
string job_url = 2;
60+
workflowcontract.v1.CraftingSchema.Runner.RunnerType runner = 3;
5961
}
6062

6163
message AttestationServiceInitResponse {

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

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

app/controlplane/internal/service/attestation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (s *AttestationService) Init(ctx context.Context, req *cpAPI.AttestationSer
142142
WorkflowID: robotAccount.WorkflowID, RobotaccountID: robotAccount.ID,
143143
ContractRevisionUUID: contractVersion.Version.ID,
144144
RunnerRunURL: req.GetJobUrl(),
145-
RunnerType: contractVersion.Version.BodyV1.GetRunner().GetType().String(),
145+
RunnerType: req.GetRunner().String(),
146146
CASBackendID: backend.ID,
147147
}
148148
run, err := s.wrUseCase.Create(ctx, opts)

0 commit comments

Comments
 (0)