Skip to content
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

Implement validation flow before rendering #18

Open
antonbabenko opened this issue Nov 19, 2019 · 0 comments
Open

Implement validation flow before rendering #18

antonbabenko opened this issue Nov 19, 2019 · 0 comments

Comments

@antonbabenko
Copy link
Owner

antonbabenko commented Nov 19, 2019

Validation flow:

  • Once a user clicks “Export as Terraform code”, POST to endpoint “/validate” and JSON (with comments, severity, and recommendations) is returned.
  • Show scrollable text block with actual comments and recommendations in modal
  • Add two buttons to modal - “Edit” and “Download archive”
  • Start with single "error" to try out UI

Examples of JSON responses from modules.tf /validate endpoint:

When there are errors:

{
"comments": [
  {"severity": "INFO", "text": "Network load-balancer does not have Terraform module yet, and it will not be exported"},
  {"severity": "ERROR", "text": "VPC 'vpcname' can't span across multiple regions (eu-west-1, eu-west-2, us-east-1). VPC can be only in one region."},
  {"severity": "ERROR", "text": "VPC 'vpcname' and resources it contains should be in the same region."}
],
"summary": "Please correct blueprint and try again",
"valid": false
}

When success:

{
"comments": [
  {"severity": "INFO", "text": "Network load-balancer does not have Terraform module yet, and it will not be exported"},
],
"summary": "Validation passed",
"valid": true
}

Description:

  1. If there is at least one hard-failure valid is set to false. This means the user can't see the "Continue" button and get zip-archive.
  2. summary - is a human-friendly text to show.
  3. comments - is a list of severity and text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant