Skip to content

Commit

Permalink
fix: change running context model
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Oct 7, 2024
1 parent 6e5d1e3 commit b68824d
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 37 deletions.
45 changes: 32 additions & 13 deletions api/v1/testkube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7171,35 +7171,53 @@ components:
actor:
$ref: "#/components/schemas/TestWorkflowRunningContextActor"

TestWorkflowRunningContextCaller:
description: running context caller for test workflow execution
TestWorkflowRunningContextInterface:
description: running context interface for test workflow execution
type: object
required:
- callerResourceType
- callerResourceName
- type
properties:
callerResourceType:
$ref: "#/components/schemas/TestWorkflowRunningContextCallerResourceType"
callerResourceName:
name:
type: string
description: caller resource name
callerResourceExecutionID:
description: interface name
type:
$ref: "#/components/schemas/TestWorkflowRunningContextInterfaceType"

TestWorkflowRunningContextActor:
description: running context actor for test workflow execution
type: object
required:
- type
properties:
name:
type: string
description: actor name
username:
type: string
description: caller resource execution id
fullExecutionPath:
description: actor username
email:
type: string
description: actor email
executionId:
type: string
description: test workflow execution id
executionPath:
type: string
description: all test workflow execution ids starting from the root
type:
$ref: "#/components/schemas/TestWorkflowRunningContextActorType"

TestWorkflowRunningContextInterface:
TestWorkflowRunningContextInterfaceType:
description: supported interfaces for test workflow running context
type: string
enum:
- cli
- ui
- api
- ci/cd
- internal

TestWorkflowRunningContextActor:
TestWorkflowRunningContextActorType:
description: supported actors for test workflow running context
type: string
enum:
Expand All @@ -7208,6 +7226,7 @@ components:
- user
- testworkflow
- testworkflowexecution
- program

Webhook:
description: CRD based webhook data
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/v1/testkube/model_test_workflow_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type TestWorkflowExecution struct {
ResolvedWorkflow *TestWorkflow `json:"resolvedWorkflow,omitempty"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks on the executions of this test workflow are disabled
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
// running context for the test workflow execution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TestWorkflowExecutionRequest struct {
Config map[string]string `json:"config,omitempty"`
// test workflow execution name started the test workflow execution
TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"`
// whether webhooks on the executions of this test workflow are disabled
// whether webhooks on the execution of this test workflow are disabled
DisableWebhooks bool `json:"disableWebhooks,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
// running context for the test workflow execution
Expand Down
1 change: 0 additions & 1 deletion pkg/api/v1/testkube/model_test_workflow_running_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ package testkube
type TestWorkflowRunningContext struct {
Interface_ *TestWorkflowRunningContextInterface `json:"interface"`
Actor *TestWorkflowRunningContextActor `json:"actor"`
Caller *TestWorkflowRunningContextCaller `json:"caller,omitempty"`
}
25 changes: 14 additions & 11 deletions pkg/api/v1/testkube/model_test_workflow_running_context_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
*/
package testkube

// TestWorkflowRunningContextActor : supported actors for test workflow running context
type TestWorkflowRunningContextActor string

// List of TestWorkflowRunningContextActor
const (
CRON_TestWorkflowRunningContextActor TestWorkflowRunningContextActor = "cron"
TESTRIGGER_TestWorkflowRunningContextActor TestWorkflowRunningContextActor = "testrigger"
USER_TestWorkflowRunningContextActor TestWorkflowRunningContextActor = "user"
TESTWORKFLOW_TestWorkflowRunningContextActor TestWorkflowRunningContextActor = "testworkflow"
TESTWORKFLOWEXECUTION_TestWorkflowRunningContextActor TestWorkflowRunningContextActor = "testworkflowexecution"
)
// running context actor for test workflow execution
type TestWorkflowRunningContextActor struct {
// actor name
Name string `json:"name,omitempty"`
// actor username
Username string `json:"username,omitempty"`
// actor email
Email string `json:"email,omitempty"`
// test workflow execution id
ExecutionId string `json:"executionId,omitempty"`
// all test workflow execution ids starting from the root
ExecutionPath string `json:"executionPath,omitempty"`
Type_ *TestWorkflowRunningContextActorType `json:"type"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Testkube API
*
* Testkube provides a Kubernetes-native framework for test definition, execution and results
*
* API version: 1.0.0
* Contact: [email protected]
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package testkube

// TestWorkflowRunningContextActorType : supported actors for test workflow running context
type TestWorkflowRunningContextActorType string

// List of TestWorkflowRunningContextActorType
const (
CRON_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "cron"
TESTRIGGER_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "testrigger"
USER_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "user"
TESTWORKFLOW_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "testworkflow"
TESTWORKFLOWEXECUTION_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "testworkflowexecution"
PROGRAM_TestWorkflowRunningContextActorType TestWorkflowRunningContextActorType = "program"
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
*/
package testkube

// TestWorkflowRunningContextInterface : supported interfaces for test workflow running context
type TestWorkflowRunningContextInterface string

// List of TestWorkflowRunningContextInterface
const (
CLI_TestWorkflowRunningContextInterface TestWorkflowRunningContextInterface = "cli"
UI_TestWorkflowRunningContextInterface TestWorkflowRunningContextInterface = "ui"
API_TestWorkflowRunningContextInterface TestWorkflowRunningContextInterface = "api"
INTERNAL_TestWorkflowRunningContextInterface TestWorkflowRunningContextInterface = "internal"
)
// running context interface for test workflow execution
type TestWorkflowRunningContextInterface struct {
// interface name
Name string `json:"name,omitempty"`
Type_ *TestWorkflowRunningContextInterfaceType `json:"type"`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Testkube API
*
* Testkube provides a Kubernetes-native framework for test definition, execution and results
*
* API version: 1.0.0
* Contact: [email protected]
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package testkube

// TestWorkflowRunningContextInterfaceType : supported interfaces for test workflow running context
type TestWorkflowRunningContextInterfaceType string

// List of TestWorkflowRunningContextInterfaceType
const (
CLI_TestWorkflowRunningContextInterfaceType TestWorkflowRunningContextInterfaceType = "cli"
UI_TestWorkflowRunningContextInterfaceType TestWorkflowRunningContextInterfaceType = "ui"
API_TestWorkflowRunningContextInterfaceType TestWorkflowRunningContextInterfaceType = "api"
CICD_TestWorkflowRunningContextInterfaceType TestWorkflowRunningContextInterfaceType = "ci/cd"
INTERNAL_TestWorkflowRunningContextInterfaceType TestWorkflowRunningContextInterfaceType = "internal"
)

0 comments on commit b68824d

Please sign in to comment.