Skip to content

feat(terraform): add environment variables to creation flow - #2900

Merged
rmnbrd merged 17 commits into
stagingfrom
feat/terraform-creation-variables
Aug 27, 2026
Merged

feat(terraform): add environment variables to creation flow#2900
rmnbrd merged 17 commits into
stagingfrom
feat/terraform-creation-variables

Conversation

@RemiBonnet

@RemiBonnet RemiBonnet commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

Issue: Follow-up to the Terraform variables tab feedback

  • Adds an Environment variables step to the Terraform creation flow
  • Clearly separates environment variables injected into the Terraform execution context from Terraform manifest inputs
  • Reuses the existing environment variable creation UI, including variable and secret support
  • Imports configured environment variables after the Terraform service is created and before an optional plan is run
  • Displays both environment variables and Terraform inputs in the creation summary

Screenshots / Recordings

Screenshot 2026-08-25 at 11 24 27 Screenshot 2026-08-25 at 11 24 57

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible - required for semantic-release
  • I only kept necessary comments, written in English
  • I involved a designer to validate UI changes if I am not a designer
  • New creation-flow logic reuses the existing variables form and import API
  • I confirmed CI is green (Codecov red can be accepted)

Summary by cubic

Adds an Environment variables step to the Terraform creation flow and makes submit/retry resume-safe to prevent duplicate services and double-submits. Environment variables are separate from Terraform variables; we import them only when provided and skip empty imports.

  • New Features

    • Adds /environment-variables route via @tanstack/react-router and sets the document title.
    • Orders steps: General → Terraform configuration → Environment variables → Terraform variables → Summary.
    • Reuses the variables UI in Terraform scope with secrets; introduces allowEmpty and enables empty submissions in Terraform and job creation flows.
    • Shows environment variables in the Summary with scope labels and masked secrets; renames “Input variables” to “Terraform variables.”
    • Imports environment variables after service create/update and before an optional PLAN; uses shared variable import and skips empty requests.
    • Persists createdServiceId to update the existing service on retry; surfaces update errors and narrows the service payload type to literal TERRAFORM.
    • Disables action buttons and shows progress during submit; navigation respects the submitting state.
    • Updates navigation: configuration advances to environment variables; Terraform variables “Back” goes to environment variables.
  • Migration

    • If you use TerraformCreateContext, read env vars from variablesForm and handle createdServiceId/setCreatedServiceId.
    • Update deep-links to /terraform/environment-variables and account for shifted step indices.

Written for commit 7d33ab9. Summary will update on new commits.

Review in cubic

@nx-cloud

nx-cloud Bot commented Aug 24, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ed8554c

Command Status Duration Result
nx run console:build --parallel=3 --configurati... ✅ Succeeded 1m 3s View ↗
nx affected --target=test --parallel=3 --config... ✅ Succeeded 50s View ↗
nx affected --target=lint --parallel=3 ✅ Succeeded 2m 44s View ↗
nx-cloud record -- yarn nx format:check ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-25 10:44:26 UTC

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.85714% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.46%. Comparing base (cb1e15e) to head (7d33ab9).
⚠️ Report is 2 commits behind head on staging.

Files with missing lines Patch % Lines
...raform-creation-flow/step-summary/step-summary.tsx 0.00% 42 Missing ⚠️
...vironment-variables/step-environment-variables.tsx 0.00% 19 Missing ⚠️
.../lib/flow-create-variable/flow-create-variable.tsx 33.33% 3 Missing and 1 partial ⚠️
...erraform-creation-flow/terraform-creation-flow.tsx 0.00% 2 Missing ⚠️
...rm-creation-flow/step-variables/step-variables.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2900      +/-   ##
===========================================
- Coverage    50.09%   45.46%   -4.64%     
===========================================
  Files          897      523     -374     
  Lines        22006    14149    -7857     
  Branches      6590     4388    -2202     
===========================================
- Hits         11025     6433    -4592     
+ Misses        9133     6560    -2573     
+ Partials      1848     1156     -692     
Flag Coverage Δ
unittests 45.46% <2.85%> (-4.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

@rmnbrd rmnbrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the creation flow fails when I define a variable.
Here is the error:
Image

When no variable is set, the flow works fine though.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

@RemiBonnet
RemiBonnet requested a review from rmnbrd August 26, 2026 12:55

@rmnbrd rmnbrd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and approved, LGTM 💯

@rmnbrd
rmnbrd merged commit f83cd7d into staging Aug 27, 2026
8 of 9 checks passed
@rmnbrd
rmnbrd deleted the feat/terraform-creation-variables branch August 27, 2026 15:02
@RemiBonnet

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 1.345.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants