Skip to content

feat(new-nav): add Terraform creation flow#2596

Open
rmnbrd wants to merge 10 commits intonew-navigationfrom
feat/new-nav/terraform-creation-flow
Open

feat(new-nav): add Terraform creation flow#2596
rmnbrd wants to merge 10 commits intonew-navigationfrom
feat/new-nav/terraform-creation-flow

Conversation

@rmnbrd
Copy link
Copy Markdown
Contributor

@rmnbrd rmnbrd commented Apr 13, 2026

Summary

PR adding the Terraform service creation flow

Screenshots / Recordings

📺 https://www.loom.com/share/d82fe4dc16fb4d83b3d4e84a7678e239

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

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

Files with missing lines Patch % Lines
...raform-creation-flow/step-summary/step-summary.tsx 0.00% 56 Missing ⚠️
...raform-creation-flow/step-general/step-general.tsx 0.00% 23 Missing ⚠️
...erraform-creation-flow/terraform-creation-flow.tsx 0.00% 13 Missing ⚠️
...ion-flow/step-configuration/step-configuration.tsx 0.00% 10 Missing ⚠️
...rm-creation-flow/step-variables/step-variables.tsx 0.00% 9 Missing ⚠️
...rm-create-context/use-terraform-create-context.tsx 0.00% 5 Missing ⚠️
...w/terraform-create-utils/terraform-create-utils.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             new-navigation    #2596   +/-   ##
=================================================
  Coverage                  ?   44.94%           
=================================================
  Files                     ?     1070           
  Lines                     ?    22115           
  Branches                  ?     6486           
=================================================
  Hits                      ?     9939           
  Misses                    ?    10390           
  Partials                  ?     1786           
Flag Coverage Δ
unittests 44.94% <0.82%> (?)

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 self-assigned this Apr 14, 2026
@rmnbrd rmnbrd added the V5 label Apr 14, 2026
@rmnbrd rmnbrd marked this pull request as ready for review April 14, 2026 13:16
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 service creation funnel to the “new-nav” (TanStack Router) console so users can create Terraform services via a multi-step flow.

Changes:

  • Introduces a Terraform creation flow (general → configuration → variables → summary) under /service/create/terraform.
  • Wires the Terraform card in the “Service New” page to the new creation-flow route.
  • Exposes Terraform configuration/variables settings components from service-settings and adds console-v5 routes + route tree updates.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
libs/pages/application/src/lib/feature/page-settings-terraform-variables/page-settings-terraform-variables.tsx Removes an unused React import in the Terraform variables settings page.
libs/domains/services/feature/src/lib/service-new/service-new.tsx Updates the Terraform service card link to use the new creation-flow path builder.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/terraform-creation-flow.tsx Adds the Terraform funnel wrapper with shared RHF state + step metadata.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/step-general/step-general.tsx Adds step 1 (general/source) for Terraform creation.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/step-configuration/step-configuration.tsx Adds step 2 (Terraform configuration) and navigation controls.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/step-variables/step-variables.tsx Adds step 3 (Terraform variables) and navigation controls.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/step-summary/step-summary.tsx Adds step 4 (summary) including create + create-and-plan submission.
libs/domains/service-terraform/feature/src/lib/terraform-creation-flow/index.ts Barrel export for the Terraform creation-flow components.
libs/domains/service-terraform/feature/src/lib/hooks/use-terraform-create-context/use-terraform-create-context.tsx Adds a dedicated context/hook for Terraform creation state.
libs/domains/service-terraform/feature/src/index.ts Exports the Terraform creation-flow from the package entrypoint.
libs/domains/service-settings/feature/src/lib/terraform-variables-settings/terraform-variables-settings.tsx Minor text color token update.
libs/domains/service-settings/feature/src/index.ts Exports Terraform settings components (configuration + variables).
apps/console-v5/src/routes/_authenticated/organization/route.tsx Adds Terraform creation route to the bypass-layout allowlist.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/route.tsx Adds the Terraform creation-flow parent route (Outlet + provider).
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/index.tsx Adds index redirect to the Terraform “general” step.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/general.tsx Adds route for step 1.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/terraform-configuration.tsx Adds route for step 2.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/input-variables.tsx Adds route for step 3.
apps/console-v5/src/routes/_authenticated/organization/$organizationId/project/$projectId/environment/$environmentId/service/create/terraform/summary.tsx Adds route for step 4.
apps/console-v5/src/routeTree.gen.ts Regenerates route tree to include the new Terraform routes.

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

</Button>
<div className="flex gap-3">
<Button
type="submit"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This “Continue” CTA is declared as type="submit", but this step does not render a <form> to submit. Consider switching it to type="button" to avoid unintended form-submit semantics (especially if this component later becomes nested inside a form).

Suggested change
type="submit"
type="button"

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +44
</Button>
<div className="flex gap-3">
<Button type="submit" size="lg" onClick={onSubmit} disabled={false}>
Continue
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This step uses a submit button (type="submit") without a surrounding <form>, and the Continue CTA is hardcoded as enabled (disabled={false}), so users can advance even when generalForm is invalid. Consider switching to type="button" and disabling (or await generalForm.trigger() before navigating) based on generalForm.formState.isValid to ensure invalid configuration can’t be skipped.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +5
import { useNavigate, useParams } from '@tanstack/react-router'
import { useEffect } from 'react'
import { TerraformConfigurationSettings } from '@qovery/domains/service-settings/feature'
import { Button, FunnelFlowBody } from '@qovery/shared/ui'
import { useTerraformCreateContext } from '../../hooks/use-terraform-create-context/use-terraform-create-context'
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

Importing TerraformConfigurationSettings from @qovery/domains/service-settings/feature introduces a circular dependency: service-settings’s terraform-configuration-settings imports runtime symbols from @qovery/domains/service-terraform/feature (e.g. useTerraformAvailableVersions), and this creation flow (in service-terraform) now imports back from service-settings. This kind of cross-domain cycle can cause bundling/init-order issues and may violate Nx module boundaries. Consider extracting shared Terraform settings UI into a lower-level shared lib (or keeping it within service-terraform) to keep dependencies one-directional.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@RemiBonnet RemiBonnet Apr 14, 2026

Choose a reason for hiding this comment

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

I think this one is important to fix, I think I found a solution to avoid it in the service-helm domain, probably adding all the logic inside this specific domain

Comment on lines +21 to +25
export const TerraformCreationFlow = ({ children, creationFlowUrl }: TerraformCreationFlowProps) => {
const { organizationId = '', projectId = '', environmentId = '' } = useParams({ strict: false })
const navigate = useNavigate()
const [currentStep, setCurrentStep] = useState(1)

Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

New Terraform creation-flow components were added, but there are no accompanying tests in this package. Similar creation flows (e.g. libs/domains/service-helm/feature/src/lib/helm-creation-flow/*) have step-level tests validating navigation, CTA enabled/disabled states, and submit payloads; adding equivalent tests here would help prevent regressions.

Copilot uses AI. Check for mistakes.
params: { organizationId, projectId, environmentId },
})
}
disabled={false}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The “Continue” CTA is always enabled (disabled={false}), so users can proceed even when useTerraformVariablesContext().errors.size > 0. The legacy Terraform variables step disables Continue when there are validation errors; consider restoring that gating to prevent advancing with invalid variables.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@TheoGrandin74 TheoGrandin74 left a comment

Choose a reason for hiding this comment

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

Some feedbacks:

  • Let's put rounded-md on the Backend configuration and Execution credentials cards
Image
  • Command should be vertically centered here
Image - Can't retrieve Qovery variables from here (maybe because of localhost?) Image
  • Default execution timeout has also gone from 3600 seconds to 60, not sure if it's intended or not!
Image
  • Here file path should probably be hidden if we don't have any value (was on the old console also)
Image

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 @rmnbrd !

  • I think the GitHub Copilot comment is relevant for circular dependencies !
  • The link is missing from these cards (this screen is just an example, there will probably be more) and needs to be updated
Image
  • If ‎File paths is empty, we need to hide it from the summary
Image

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