Skip to content

Commit

Permalink
Added UI screens for Resiliency probes (#4154)
Browse files Browse the repository at this point in the history
* updated backend with the latest frontend changes

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* Added UI screens for resilience probes

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* resolved review comments

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* fixed imports

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* fixed css issues and updated probe mode UI

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* fixed imports

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

---------

Signed-off-by: Saranya-jena <saranya.jena@harness.io>
  • Loading branch information
Saranya-jena committed Sep 6, 2023
1 parent a962937 commit 0cf13c9
Show file tree
Hide file tree
Showing 176 changed files with 11,901 additions and 3,086 deletions.
12 changes: 12 additions & 0 deletions chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls
Expand Up @@ -413,6 +413,14 @@ type ExperimentRun implements Audit {
User who has created the experiment run
"""
createdBy: UserDetails
"""
Notify ID of the experiment run
"""
notifyID: ID
"""
runSequence is the sequence number of experiment run
"""
runSequence: Int!
}

"""
Expand Down Expand Up @@ -532,6 +540,10 @@ type RecentExperimentRun implements Audit {
User who updated the experiment run
"""
updatedBy: UserDetails
"""
runSequence is the sequence number of experiment run
"""
runSequence: Int!
}

"""
Expand Down
Expand Up @@ -2,7 +2,7 @@ extend type Query {
"""
Returns experiment run based on experiment run ID
"""
getExperimentRun(projectID: ID!, experimentRunID: String!): ExperimentRun!
getExperimentRun(projectID: ID!, experimentRunID: ID, notifyID: ID): ExperimentRun!

"""
Returns the list of experiment run based on various filter parameters
Expand Down
Expand Up @@ -121,8 +121,7 @@ type Infra implements ResourceDetails & Audit {
}

enum InfrastructureType {
INTERNAL
EXTERNAL
Kubernetes
}

"""
Expand Down
157 changes: 138 additions & 19 deletions chaoscenter/graphql/definitions/shared/probe.graphqls
Expand Up @@ -217,13 +217,17 @@ input ProbeRequest {
"""
type: ProbeType!
"""
Infrastructure type of the Probe
"""
infrastructureType: InfrastructureType!
"""
HTTP Properties of the specific type of the Probe
"""
httpProperties: HTTPProbeRequest
kubernetesHTTPProperties: KubernetesHTTPProbeRequest
"""
CMD Properties of the specific type of the Probe
"""
cmdProperties: CMDProbeRequest
kubernetesCMDProperties: KubernetesCMDProbeRequest
"""
K8S Properties of the specific type of the Probe
"""
Expand All @@ -234,6 +238,57 @@ input ProbeRequest {
promProperties: PROMProbeRequest
}

"""
Defines the input for Kubernetes HTTP probe properties
"""
input KubernetesHTTPProbeRequest {
"""
Timeout of the Probe
"""
probeTimeout: String!
"""
Interval of the Probe
"""
interval: String!
"""
Retry interval of the Probe
"""
retry: Int
"""
Attempt contains the total attempt count for the probe
"""
attempt: Int
"""
Polling interval of the Probe
"""
probePollingInterval: String
"""
Initial delay interval of the Probe in seconds
"""
initialDelay: String
"""
EvaluationTimeout is the timeout window in which the SLO metrics
"""
evaluationTimeout: String
"""
Is stop on failure enabled in the Probe
"""
stopOnFailure: Boolean
"""
URL of the Probe
"""
url: String!
"""
HTTP method of the Probe
"""
method: MethodRequest!
"""
If Insecure HTTP verification should be skipped
"""
insecureSkipVerify: Boolean
}


"""
Defines the properties of the comparator
"""
Expand Down Expand Up @@ -294,20 +349,28 @@ type ExecutedByExperiment {
updatedBy: UserDetails
}


"""
Defines the Execution History of experiment referenced by the Probe
"""
type ExecutionHistory {
"""
Fault Status
"""
status: Status!
"""
Fault executed by which experiment
"""
executedByExperiment: ExecutedByExperiment!
"""
Probe Mode
"""
mode: Mode!
"""
Fault Name
"""
faultName: String!
"""
Fault Status
"""
status: Status!
"""
Fault executed by which experiment
"""
executedByExperiment: ExecutedByExperiment!
}

"""
Defines the Recent Executions of global probe in ListProbe API with different fault and execution history each time
"""
Expand Down Expand Up @@ -369,7 +432,7 @@ type GetProbeReferenceResponse {
"""
Defines the CMD probe properties
"""
type CMDProbe implements CommonProbeProperties {
type KubernetesCMDProbe implements CommonProbeProperties {
"""
Timeout of the Probe
"""
Expand Down Expand Up @@ -441,13 +504,17 @@ type Probe implements ResourceDetails & Audit {
"""
type: ProbeType!
"""
HTTP Properties of the specific type of the Probe
Infrastructure type of the Probe
"""
httpProperties: HTTPProbe
infrastructureType: InfrastructureType!
"""
CMD Properties of the specific type of the Probe
Kubernetes HTTP Properties of the specific type of the Probe
"""
kubernetesHTTPProperties: KubernetesHTTPProbe
"""
cmdProperties: CMDProbe
Kubernetes CMD Properties of the specific type of the Probe
"""
kubernetesCMDProperties: KubernetesCMDProbe
"""
K8S Properties of the specific type of the Probe
"""
Expand Down Expand Up @@ -725,9 +792,60 @@ type PROMProbe implements CommonProbeProperties {
}

"""
Defines the HTTP probe properties
Defines the input for Kubernetes CMD probe properties
"""
type HTTPProbe implements CommonProbeProperties {
input KubernetesCMDProbeRequest {
"""
Timeout of the Probe
"""
probeTimeout: String!
"""
Interval of the Probe
"""
interval: String!
"""
Retry interval of the Probe
"""
retry: Int
"""
Attempt contains the total attempt count for the probe
"""
attempt: Int
"""
Polling interval of the Probe
"""
probePollingInterval: String
"""
Initial delay interval of the Probe in seconds
"""
initialDelay: String
"""
EvaluationTimeout is the timeout window in which the SLO metrics
"""
evaluationTimeout: String
"""
Is stop on failure enabled in the Probe
"""
stopOnFailure: Boolean
"""
Command of the Probe
"""
command: String!
"""
Comparator of the Probe
"""
comparator: ComparatorInput!
"""
Source of the Probe
"""
source: String
}


"""
Defines the Kubernetes HTTP probe properties
"""
type KubernetesHTTPProbe implements CommonProbeProperties {
"""
Timeout of the Probe
"""
Expand Down Expand Up @@ -774,6 +892,7 @@ type HTTPProbe implements CommonProbeProperties {
insecureSkipVerify: Boolean
}


"""
Defines the input for CMD probe properties
"""
Expand Down Expand Up @@ -941,7 +1060,7 @@ extend type Query {
"""
Returns the list of Probes based on various filter parameters
"""
listProbes(projectID: ID!, probeNames: [ID!], filter: ProbeFilterInput): [Probe]!
listProbes(projectID: ID!, infrastructureType: InfrastructureType, probeNames: [ID!], filter: ProbeFilterInput): [Probe]!
@authorized

"""
Expand Down
Expand Up @@ -53,7 +53,7 @@ func (r *mutationResolver) RunChaosExperiment(ctx context.Context, experimentID
return &model.RunChaosExperimentResponse{NotifyID: uiResponse.NotifyID}, err
}

func (r *queryResolver) GetExperimentRun(ctx context.Context, projectID string, experimentRunID string) (*model.ExperimentRun, error) {
func (r *queryResolver) GetExperimentRun(ctx context.Context, projectID string, experimentRunID *string, notifyID *string) (*model.ExperimentRun, error) {
logFields := logrus.Fields{
"projectId": projectID,
"chaosExperimentRunId": experimentRunID,
Expand All @@ -66,7 +66,7 @@ func (r *queryResolver) GetExperimentRun(ctx context.Context, projectID string,
return nil, err
}

expRunResponse, err := r.chaosExperimentRunHandler.GetExperimentRun(ctx, projectID, experimentRunID)
expRunResponse, err := r.chaosExperimentRunHandler.GetExperimentRun(ctx, projectID, experimentRunID, notifyID)
if err != nil {
logrus.WithFields(logFields).Error(err)
return nil, err
Expand Down

0 comments on commit 0cf13c9

Please sign in to comment.