feat: Implement filter schema by definition in the editor - #361
Conversation
✅ Deploy Preview for openworkflow-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates the editor to SDK Alpha-8 and adds a schema-filtering utility that can extract a single $defs definition as a self-contained schema (flattening allOf and bundling transitive $ref dependencies). It also adds Storybook + tests to validate and explore the filtered schema output.
Changes:
- Bumped
@openworkflowspec/sdkto^1.0.3-alpha8and updated workflow serialization to use the SDK serializer withvalidate: false. - Added
getSchemaForDefinition/getReferencedDefinitionsschema filtering utilities with caching, transitive$defsbundling, and a Storybook “Schema Filter” story. - Added/updated Vitest tests covering schema filtering and updated graph-building expectations for empty workflows.
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 |
|---|---|
| pnpm-workspace.yaml | Updates catalog versions (SDK alpha-8, changesets/storybook bumps) and adds allof-merge. |
| pnpm-lock.yaml | Lockfile updates reflecting the dependency bumps/additions. |
| packages/open-workflow-diagram-editor/tests/core/workflowSdk.integration.test.ts | Updates integration test expectations for SDK behavior on empty-task workflows. |
| packages/open-workflow-diagram-editor/tests/core/filterSchema.test.ts | Adds unit tests for schema filtering, flattening, and $defs bundling behavior. |
| packages/open-workflow-diagram-editor/stories/features/SchemaFilter.stories.tsx | Adds a Storybook UI to interactively resolve and inspect filtered schemas. |
| packages/open-workflow-diagram-editor/src/core/workflowSdk.ts | Switches serialization to SDK serializer with validation disabled. |
| packages/open-workflow-diagram-editor/src/core/schemaFilter.ts | Implements schema merge/filter utilities, caching, and $defs bundling logic. |
| packages/open-workflow-diagram-editor/package.json | Adds allof-merge dependency required by schema filtering. |
| .github/workflows/publish-release.yaml | Updates pinned changesets/action to v2.1.0. |
| .github/workflows/prepare-release.yaml | Updates pinned changesets/action to v2.1.0. |
| .github/workflows/ci_codeql.yml | Updates pinned CodeQL action to v4.37.7. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fantonangeli
left a comment
There was a problem hiding this comment.
Thanks @handreyrc 2 small comments
Signed-off-by: handreyrc <handrey.cunha@gmail.com> # Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
4ef63f7 to
1c83b62
Compare
|
PR rebased from feature branch. Thanks! |
Signed-off-by: handreyrc <handrey.cunha@gmail.com>
1c2f8f1
into
open-workflow-specification:feature/node-editing
Closes: #357
Summary
Add schema filter capabilities to cherry-pick a definition and merge any external dependencies into a fully formed scoped schema.
Changes
filterSchemafunction to filter definitions and sub-definitionsTesting
The output of the function
getSchemaForDefinitioncan be tested and validated from the story "Schema Filter".