Skip to content

feat(blueprints): add support for multiple versions#2791

Open
rmnbrd wants to merge 2 commits into
stagingfrom
feat/blueprints/support-multi-versions
Open

feat(blueprints): add support for multiple versions#2791
rmnbrd wants to merge 2 commits into
stagingfrom
feat/blueprints/support-multi-versions

Conversation

@rmnbrd

@rmnbrd rmnbrd commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Blueprints: add support for multiple versions

This PR introduces 2 blueprint-related improvements:

  • The addition of the version selector in the blueprint-based service creation flow
  • A new "Up-to-date" or "Update available" badge is now present in the service details header.

Changes can be tested here and there.

Screenshots / Recordings

image image

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

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 (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.64706% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.09%. Comparing base (640bcb7) to head (3d737f2).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
...hooks/use-blueprint-update/use-blueprint-update.ts 0.00% 4 Missing ⚠️
...reation-flow/blueprint/blueprint-creation-flow.tsx 75.00% 0 Missing and 4 partials ⚠️
...service-overview/service-header/service-header.tsx 71.42% 1 Missing and 1 partial ⚠️
...onfiguration-view/blueprint-configuration-view.tsx 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2791      +/-   ##
===========================================
- Coverage    47.44%   47.09%   -0.35%     
===========================================
  Files         1267     1177      -90     
  Lines        26812    25462    -1350     
  Branches      7913     7618     -295     
===========================================
- Hits         12721    11992     -729     
+ Misses       11892    11388     -504     
+ Partials      2199     2082     -117     
Flag Coverage Δ
unittests 47.09% <67.64%> (-0.35%) ⬇️

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.

@rmnbrd rmnbrd marked this pull request as ready for review July 1, 2026 15:12
Copilot AI review requested due to automatic review settings July 1, 2026 15:12

Copilot AI 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.

Pull request overview

This PR extends the blueprint-based service experience to support multiple blueprint versions by letting users select a version during creation and by surfacing blueprint update status in the service header.

Changes:

  • Added a “Blueprint version” selector that sorts available major versions and sends the selected version tag in the create payload.
  • Added an “Up to date” / “Update available” badge to the service overview header for blueprint-based services (with Suspense + skeleton loading state).
  • Introduced a new useBlueprintUpdate React Query hook and corresponding query key in the services data-access layer.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libs/domains/services/feature/src/lib/service-overview/service-header/service-header.tsx Adds blueprint update status badge (Suspense + skeleton) when blueprint_id is present.
libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx Adds unit tests for up-to-date/outdated/loading states and non-blueprint behavior.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-step-summary/blueprint-step-summary.tsx Sends versionTag from form state as the blueprint tag in the create payload.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-creation-utils/blueprint-creation-utils.ts Adds sortBlueprintMajorVersions helper to order versions newest → oldest.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-creation-utils/blueprint-creation-utils.spec.ts Adds test coverage for sortBlueprintMajorVersions.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-creation-flow.tsx Tracks selected version tag, derives selected major version, and resets form fields when version changes.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-creation-flow.spec.tsx Adds test verifying sorting + selecting a version results in the expected create payload tag.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-create-context/blueprint-create-context.ts Extends form data with versionTag.
libs/domains/services/feature/src/lib/service-creation-flow/blueprint/blueprint-configuration-view/blueprint-configuration-view.tsx Renders version selector (InputSelect) when multiple versions exist; falls back to read-only when only one.
libs/domains/services/feature/src/lib/hooks/use-blueprint-update/use-blueprint-update.ts Adds useBlueprintUpdate hook wrapping queries.services.blueprintUpdate.
libs/domains/services/feature/src/index.ts Exports the new useBlueprintUpdate hook.
libs/domains/services/data-access/src/lib/domains-services-data-access.ts Adds services.blueprintUpdate query definition calling checkBlueprintUpdate.

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

import { queries } from '@qovery/state/util-queries'

export interface UseBlueprintUpdateProps {
blueprintId?: string | null

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.

Suggested change
blueprintId?: string | null
blueprintId: string

From what I understand in the code, blueprintId should be always necessary?

export function useBlueprintUpdate({ blueprintId, enabled = true, suspense = false }: UseBlueprintUpdateProps) {
return useQuery({
...queries.services.blueprintUpdate({ blueprintId: blueprintId ?? '' }),
enabled: enabled && Boolean(blueprintId),

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.

Suggested change
enabled: enabled && Boolean(blueprintId),
enabled,

setSelectedVersionTag(watchedVersionTag)
}, [watchedVersionTag])

useEffect(() => {

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.

Can we avoid this sync effect?

It can reset the form with the previous version's fields before the new version's fields have loaded, then skip the reset once they arrive. I think resetting only after the selected version's fields are available would fix the stale-field issue

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

Successfully merging this pull request may close these issues.

3 participants