-
Notifications
You must be signed in to change notification settings - Fork 2
Add Plan button #2250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Plan button #2250
Conversation
a40ad4a
to
c581858
Compare
c581858
to
847a2ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @opudrovs 🥇
Just quick change suggestions to prevent nil, empty values and we'll be good to go.
92f4d64
to
352fad4
Compare
@chanwit the suggested changes have been addressed. The only change: I removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend LGTM 🥇 !!
@AlinaGoaga as @chanwit said, the backend part should be OK. 😄 |
352fad4
to
149ea96
Compare
Haha oki coolio :D Testing locally with Looking good! Clicked Plan, got a success notification:
which I assume is to be expected given that its not actually approved in our scenario? |
@AlinaGoaga thank you so much for picking up this PR! 🌟 Could you please run the following command
and let me know if the result of the command looks similar to this
or if it is empty? Maybe the ConfigMap with the plan was not created successfully (at all or yet). |
@AlinaGoaga in addition, I think I need to check how the Plan button is enabled. Maybe there is a check for the Plan being a non-empty string lost somewhere. Thank you for catching this potential issue! |
@AlinaGoaga I got what it wrong. It's not a check missing it's that there is a small conflict between enable plan viewing vs show the Plan button logic. I will discuss it with Chanwit. Maybe we can just check for the error instead. |
Hey! Just ran this and it's empty |
@AlinaGoaga thank you! So, the ConfigMap has not been created. I will take such case into account. |
No worries, let me know when/if you want me to look at any other scenarios ;) |
@AlinaGoaga thank you! ✨ Looking at the code and writing to Chanwit now. I will ping you when we decide what to do with it and when/if there are changes added for re-testing. |
149ea96
to
903cd23
Compare
@AlinaGoaga added changes we discussed with @chanwit and @josefaworks So, now the Plan button should be displayed when the This should cover the current desired logic well. If there are more logic changes, we'll cover them in a new issue. The UI is ready for re-testing! 🙏 |
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.
903cd23
to
03cab34
Compare
Closes weaveworks/weave-gitops#3238
Added the
ReplanTerraformObject
endpoint.Added the
useReplanTerraformObject
hook calling theReplanTerraformObject
endpoint.Added the Plan button.
Added the
TerraformPlanView
component.Added a link to WW TF docs to the "No plan available" message.
Added unit tests for the
ReplanTerraformObject
endpoint and the replan Terraform object UI.Questions:
EnablePlanViewing
flag we agreed to add in the previous PR to smth. likeEnableReplanning
?Testing:
Terraform plan is displayed for a TF object if the
storeReadablePlan
field of this object is set tohuman
.The new Plan button is displayed for a TF object if the
storeReadablePlan
field of this object is set tohuman
orjson
. So, if the value equalsjson
, the plan is not displayed for the object, but the Plan button is still available, it's a normal case.The repo I use for testing is:
https://github.com/opudrovs/gitops-vault-demo
To create demo TF objects, please run:
The
k8s-vault-config
object should have a valid plan + the Plan button visible. It might take some time for the corresponding ConfigMap with the plan for this object to be created.I hope it will work without forking the repo (I only tested it from my own repo). If it does not, just fork it and replace your username everywhere in the fork.
k8s-vault-config
object or another object withstoreReadablePlan
set tohuman
orjson
you can click the Plan button and see that replan had been requested successfully (we are only able to confirm that it has been requested not approved) .