Skip to content

feat(new-nav): add Terraform variables settings page#2546

Merged
rmnbrd merged 10 commits intonew-navigationfrom
feat/new-nav/terraform-variables-settings
Mar 27, 2026
Merged

feat(new-nav): add Terraform variables settings page#2546
rmnbrd merged 10 commits intonew-navigationfrom
feat/new-nav/terraform-variables-settings

Conversation

@rmnbrd
Copy link
Copy Markdown
Contributor

@rmnbrd rmnbrd commented Mar 26, 2026

Summary

PR adding the "Terraform variables" settings page

Screenshots / Recordings

📺 https://www.loom.com/share/1b14e1b6f028431b889673d4b4c73faa

@RemiBonnet
Copy link
Copy Markdown
Member

Qovery Preview

Qovery can create a Preview Environment for this PR.
To trigger its creation, please post a comment with one of the following command.

Command Blueprint environment
/qovery preview 15d69f24-9bc1-4a8d-80fe-d1bb1b2bcd00 New Navigation
/qovery preview {all|UUID1,UUID2,...} To preview multiple environments

This comment has been generated from Qovery AI 🤖.
Below, a word from its wisdom :

One day they will all understand

@rmnbrd rmnbrd force-pushed the feat/new-nav/terraform-variables-settings branch from 7fba65e to 90abb19 Compare March 26, 2026 17:06
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 42.10526% with 11 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (new-navigation@9ba2f2d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...form-variables-table/terraform-variables-table.tsx 18.18% 3 Missing and 6 partials ⚠️
...raform-tfvars-popover/terraform-tfvars-popover.tsx 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             new-navigation    #2546   +/-   ##
=================================================
  Coverage                  ?   44.94%           
=================================================
  Files                     ?     1057           
  Lines                     ?    21289           
  Branches                  ?     6269           
=================================================
  Hits                      ?     9569           
  Misses                    ?     9983           
  Partials                  ?     1737           
Flag Coverage Δ
unittests 44.94% <42.10%> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@rmnbrd rmnbrd marked this pull request as ready for review March 27, 2026 08:12
@rmnbrd rmnbrd self-assigned this Mar 27, 2026
@rmnbrd rmnbrd added the V5 label Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Terraform variables” settings page to the console-v5 settings routes, and refactors/shared-exports Terraform variable context + utilities so the service-settings UI can consume them.

Changes:

  • Adds a console-v5 route for Terraform variables with provider + save action wiring.
  • Re-exports Terraform variables context/utils from @qovery/domains/service-terraform/feature and updates service-settings tests/usages accordingly.
  • Updates Terraform variables table + .tfvars popover styling to newer design token classnames.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/domains/service-terraform/feature/src/lib/terraform-variables-utils.ts Updates badge class tokens for variable source display.
libs/domains/service-terraform/feature/src/lib/terraform-variables-context.tsx Switches params lookup to TanStack router and renames param usage to serviceId.
libs/domains/service-terraform/feature/src/index.ts Changes public exports to expose context/utils (and removes settings exports).
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-utils.spec.ts Updates test imports to consume utils/types from service-terraform feature package.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-table/terraform-variables-table.tsx Restyles table and switches to shared context/utils imports from service-terraform feature.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-table/terraform-variables-table.spec.tsx Updates test imports for moved context/types.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-settings.tsx Adds a settings wrapper component rendering the variables table.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-tfvars-popover/terraform-tfvars-popover.tsx Updates popover styling and context import source.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-tfvars-popover/terraform-tfvars-popover.spec.tsx Updates test imports for moved context/types.
libs/domains/service-settings/feature/src/index.ts Exposes the variables table via service-settings feature public API.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/$serviceId/settings/terraform-variables.tsx Implements the new console-v5 Terraform variables settings page + save behavior.
Comments suppressed due to low confidence (4)

libs/domains/service-terraform/feature/src/lib/terraform-variables-context.tsx:93

  • TerraformVariablesProvider now reads params via @tanstack/react-router's useParams and expects a serviceId param. This provider is also rendered under react-router-dom routes that use an applicationId param (e.g. libs/pages/application/...page-settings-terraform-variables.tsx) and in the service creation flow, so it will either throw (no TanStack router context) or fail to resolve the correct ID. Consider making this provider router-agnostic by accepting organizationId/serviceId (or applicationId) as props from the app layer, instead of importing a specific router hook inside the domain library.
    libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-table/terraform-variables-table.tsx:11
  • TerraformVariablesTable is imported and used from the TanStack Router app (apps/console-v5/.../settings/terraform-variables.tsx), but this component depends on react-router-dom's useParams to get environmentId. Rendering it outside a React Router context will throw. To make it usable across both routers, pass environmentId in as a prop (or via a context) and remove the direct react-router-dom dependency from this library component.
    libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-table/terraform-variables-table.tsx:188
  • The error border class uses border-surface-negative, but elsewhere the codebase uses tokenized border classes like border-negative-component / border-surface-negative-solid. If border-surface-negative isn't a defined Tailwind token, the error state won't render. Consider aligning with the existing negative border tokens used in other forms.
    libs/domains/service-terraform/feature/src/lib/terraform-variables-utils.ts:61
  • getSourceBadgeClassName was partially migrated to design tokens, but the default/fallback branch still returns hard-coded hex colors. This leaves inconsistent styling and makes future theme changes harder; consider converting the fallback branch to the corresponding token classes as well.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

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

Thanks Romain 💯 !!

Quick question, when we navigate to this page we always see the loading state. Is there a reason we don’t leverage react-query’s cache here? If we do need to keep the loader, could we match the height and spacing of the final content/placeholder? Right now the spacing and the loader/icon size look a bit different!

const TerraformVariablesWrapper = () => {
const { serviceId } = useParams({ strict: false })
const { data: service } = useService({ serviceId })
const methods = useForm<TerraformGeneralData>({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be better to pass the ‎TERRAFORM service as a prop. That would avoid having to use ‎match(service) or ‎if (service?.serviceType === 'TERRAFORM') inside this component because it's only related to terraform a not other services

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done here 5c729ea

@rmnbrd rmnbrd force-pushed the feat/new-nav/terraform-variables-settings branch from 5c729ea to 0061032 Compare March 27, 2026 15:09
@rmnbrd rmnbrd merged commit dae43ac into new-navigation Mar 27, 2026
10 checks passed
@rmnbrd rmnbrd deleted the feat/new-nav/terraform-variables-settings branch March 27, 2026 15:22
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.

4 participants