Skip to content

Commit

Permalink
fix: added running context to execution details
Browse files Browse the repository at this point in the history
  • Loading branch information
exu committed Aug 7, 2024
1 parent ce018a9 commit 22481ed
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion api/v1/testkube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7899,6 +7899,8 @@ components:
type: boolean
description: whether webhooks on the execution of this test workflow are disabled
default: false
runningContext:
$ref: "#/components/schemas/RunningContext"

TestWorkflowWithExecution:
type: object
Expand Down Expand Up @@ -7990,9 +7992,11 @@ components:
example:
- true
- false
runnerID:
runnerId:
type: string
description: Runner id that executed the test workflow
runningContext:
$ref: "#/components/schemas/RunningContext"
required:
- id
- name
Expand Down
5 changes: 3 additions & 2 deletions cmd/api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ func main() {
features, err := featureflags.Get()
exitOnError("error getting application feature flags", err)

log.DefaultLogger.Infow("Feature flags configured", "ff", features)
logger := log.DefaultLogger.With("apiVersion", version.Version)

logger.Infow("Feature flags configured", "ff", features)

// Run services within an errgroup to propagate errors between services.
g, ctx := errgroup.WithContext(ctx)
Expand Down Expand Up @@ -455,7 +457,6 @@ func main() {
proContext.OrgID = environment.OrganizationId
proContext.OrgName = environment.OrganizationName
proContext.OrgSlug = environment.OrganizationSlug

}

serviceAccountNames := map[string]string{
Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1/testkube/model_test_workflow_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ type TestWorkflowExecution struct {
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
// Runner id that executed the test workflow
RunnerID string `json:"runnerID,omitempty"`
RunnerId string `json:"runnerId,omitempty"`
RunningContext *RunningContext `json:"runningContext,omitempty"`
}
3 changes: 2 additions & 1 deletion pkg/api/v1/testkube/model_test_workflow_execution_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ type TestWorkflowExecutionRequest struct {
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
RunningContext *RunningContext `json:"runningContext,omitempty"`
}
3 changes: 2 additions & 1 deletion pkg/testworkflows/testworkflowexecutor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ func (e *executor) Execute(ctx context.Context, workflow testworkflowsv1.TestWor
ResolvedWorkflow: testworkflowmappers.MapKubeToAPI(resolvedWorkflow),
TestWorkflowExecutionName: testWorkflowExecutionName,
DisableWebhooks: request.DisableWebhooks,
RunnerID: e.runnerID,
RunnerId: e.runnerID,
RunningContext: request.RunningContext,
}
err = e.repository.Insert(ctx, execution)
if err != nil {
Expand Down

0 comments on commit 22481ed

Please sign in to comment.