Skip to content

fix: v2 - proper hydration of loaded spec#2437

Merged
maxy-shpfy merged 1 commit into
masterfrom
06-18-fix_v2_-_proper_hydration_of_loaded_spec
Jun 19, 2026
Merged

fix: v2 - proper hydration of loaded spec#2437
maxy-shpfy merged 1 commit into
masterfrom
06-18-fix_v2_-_proper_hydration_of_loaded_spec

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Closes https://github.com/Shopify/oasis-frontend/issues/659

When a spec is loaded in the Editor, task component references are now hydrated immediately so that the live component spec object model always carries a resolved componentRef.spec. This is handled by the new hydrateLoadedSpecRefs utility, which walks every task in the spec tree, recursing into subgraph specs rather than attempting to hydrate the subgraph reference itself. Tasks whose references fail to hydrate are left untouched and will surface a COMPONENT_HYDRATION_FAILED validation issue.

The deserialization logic in useLoadSpec has also been extracted into a standalone deserializeSpecData function to improve readability and separation of concerns.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Before After
image.png
image.png

Test Instructions

  1. Open the Editor with a pipeline that contains tasks referencing external components (URL-based or text-based refs).
  2. Confirm that each task's component reference is resolved immediately on load without requiring any additional user interaction.
  3. Introduce a task with an invalid or unreachable component reference and confirm that a COMPONENT_HYDRATION_FAILED validation issue is surfaced.
  4. Test a pipeline containing nested subgraph tasks and verify that inner task refs are hydrated while the subgraph ref itself is not re-hydrated.
  5. Run the unit tests in hydrateSpecRefs.test.ts to confirm all three scenarios pass.

Additional Comments

Hydration failures are handled gracefully — the spec continues to load and the affected task is flagged via validation rather than causing a hard error.

Might slow down time-to-operational-editor for massive pipelines

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 06-18-fix_v2_-_proper_hydration_of_loaded_spec/c06f0c5

maxy-shpfy commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

@maxy-shpfy maxy-shpfy force-pushed the 06-18-fix_v2_-_proper_hydration_of_loaded_spec branch from 7ab01b2 to c246e88 Compare June 19, 2026 01:03
@maxy-shpfy maxy-shpfy marked this pull request as ready for review June 19, 2026 01:07
@maxy-shpfy maxy-shpfy requested a review from a team as a code owner June 19, 2026 01:07
Comment thread src/routes/v2/pages/Editor/utils/hydrateSpecRefs.ts
Comment thread src/routes/v2/pages/Editor/hooks/useLoadSpec.ts
@maxy-shpfy maxy-shpfy requested a review from camielvs June 19, 2026 01:33

maxy-shpfy commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

Merge activity

  • Jun 19, 4:40 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 19, 4:41 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 19, 4:44 AM UTC: @maxy-shpfy merged this pull request with Graphite.

@maxy-shpfy maxy-shpfy force-pushed the 06-18-fix_v2_-_proper_hydration_of_loaded_spec branch from c246e88 to c06f0c5 Compare June 19, 2026 04:40
@maxy-shpfy maxy-shpfy merged commit cc2549f into master Jun 19, 2026
15 of 17 checks passed
@maxy-shpfy maxy-shpfy deleted the 06-18-fix_v2_-_proper_hydration_of_loaded_spec branch June 19, 2026 04:44
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.

2 participants