feat(new-nav): add Terraform creation flow#2596
feat(new-nav): add Terraform creation flow#2596rmnbrd wants to merge 10 commits intonew-navigationfrom
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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-settingsand 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.
...ains/service-terraform/feature/src/lib/terraform-creation-flow/step-summary/step-summary.tsx
Outdated
Show resolved
Hide resolved
...omains/service-terraform/feature/src/lib/terraform-creation-flow/terraform-creation-flow.tsx
Outdated
Show resolved
Hide resolved
| </Button> | ||
| <div className="flex gap-3"> | ||
| <Button | ||
| type="submit" |
There was a problem hiding this comment.
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).
| type="submit" | |
| type="button" |
| </Button> | ||
| <div className="flex gap-3"> | ||
| <Button type="submit" size="lg" onClick={onSubmit} disabled={false}> | ||
| Continue |
There was a problem hiding this comment.
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.
| 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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| export const TerraformCreationFlow = ({ children, creationFlowUrl }: TerraformCreationFlowProps) => { | ||
| const { organizationId = '', projectId = '', environmentId = '' } = useParams({ strict: false }) | ||
| const navigate = useNavigate() | ||
| const [currentStep, setCurrentStep] = useState(1) | ||
|
|
There was a problem hiding this comment.
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.
| params: { organizationId, projectId, environmentId }, | ||
| }) | ||
| } | ||
| disabled={false} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Some feedbacks:
Let's putrounded-mdon the Backend configuration and Execution credentials cards
Command should be vertically centered here
- Can't retrieve Qovery variables from here (maybe because of localhost?)
Default execution timeout has also gone from 3600 seconds to 60, not sure if it's intended or not!
Here file path should probably be hidden if we don't have any value (was on the old console also)
There was a problem hiding this comment.
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
- If
File pathsis empty, we need to hide it from the summary
Summary
PR adding the Terraform service creation flow
Screenshots / Recordings
📺 https://www.loom.com/share/d82fe4dc16fb4d83b3d4e84a7678e239