Skip to content

Commit 03cab34

Browse files
committed
Add the ReplanTerraformObject endpoint.
Add the `useReplanTerraformObject` hook calling the `ReplanTerraformObject` endpoint. Add the Plan button. Add the `TerraformPlanView` component. Add a link to WW TF docs to the "No plan available" message. Add unit tests for the `ReplanTerraformObject` endpoint and the replan Terraform object UI.
1 parent d37a4ae commit 03cab34

File tree

18 files changed

+680
-117
lines changed

18 files changed

+680
-117
lines changed

api/terraform/terraform.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ service Terraform {
5353
};
5454
}
5555

56+
rpc ReplanTerraformObject(ReplanTerraformObjectRequest) returns (ReplanTerraformObjectResponse) {
57+
option (google.api.http) = {
58+
post : "/v1/terraform_objects/replan"
59+
body: "*"
60+
};
61+
}
5662
}
5763

5864
message ListTerraformObjectsRequest {
@@ -111,3 +117,13 @@ message GetTerraformObjectPlanResponse {
111117
bool enablePlanViewing = 2;
112118
string error = 3;
113119
}
120+
121+
message ReplanTerraformObjectRequest {
122+
string clusterName = 1;
123+
string name = 2;
124+
string namespace = 3;
125+
}
126+
127+
message ReplanTerraformObjectResponse {
128+
bool replanRequested = 1;
129+
}

api/terraform/terraform.swagger.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,38 @@
108108
]
109109
}
110110
},
111+
"/v1/terraform_objects/replan": {
112+
"post": {
113+
"operationId": "Terraform_ReplanTerraformObject",
114+
"responses": {
115+
"200": {
116+
"description": "A successful response.",
117+
"schema": {
118+
"$ref": "#/definitions/v1ReplanTerraformObjectResponse"
119+
}
120+
},
121+
"default": {
122+
"description": "An unexpected error response.",
123+
"schema": {
124+
"$ref": "#/definitions/rpcStatus"
125+
}
126+
}
127+
},
128+
"parameters": [
129+
{
130+
"name": "body",
131+
"in": "body",
132+
"required": true,
133+
"schema": {
134+
"$ref": "#/definitions/v1ReplanTerraformObjectRequest"
135+
}
136+
}
137+
],
138+
"tags": [
139+
"Terraform"
140+
]
141+
}
142+
},
111143
"/v1/terraform_objects/suspend": {
112144
"post": {
113145
"operationId": "Terraform_ToggleSuspendTerraformObject",
@@ -348,6 +380,28 @@
348380
}
349381
}
350382
},
383+
"v1ReplanTerraformObjectRequest": {
384+
"type": "object",
385+
"properties": {
386+
"clusterName": {
387+
"type": "string"
388+
},
389+
"name": {
390+
"type": "string"
391+
},
392+
"namespace": {
393+
"type": "string"
394+
}
395+
}
396+
},
397+
"v1ReplanTerraformObjectResponse": {
398+
"type": "object",
399+
"properties": {
400+
"replanRequested": {
401+
"type": "boolean"
402+
}
403+
}
404+
},
351405
"v1ResourceRef": {
352406
"type": "object",
353407
"properties": {

pkg/api/gitauth/gitauth.pb.go

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

pkg/api/gitauth/gitauth_grpc.pb.go

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

pkg/api/pipelines/pipelines.pb.go

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

pkg/api/pipelines/types.pb.go

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

0 commit comments

Comments
 (0)