Add engine.extensions to workflow schema and generated frontmatter docs#42317
Add engine.extensions to workflow schema and generated frontmatter docs#42317Copilot wants to merge 5 commits into
engine.extensions to workflow schema and generated frontmatter docs#42317Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
engine.extensions to workflow schema and generated frontmatter docs
There was a problem hiding this comment.
Pull request overview
This PR aims to add support for engine.extensions to the main workflow JSON schema and ensure the generated frontmatter reference includes it, with regression coverage in both Go schema validation tests and the schema-doc generator tests.
Changes:
- Adds
engine.extensionstopkg/parser/schemas/main_workflow_schema.json. - Adds schema validation coverage for
engine.extensionsinpkg/parser/schema_test.go. - Extends schema-doc generator tests and updates the generated frontmatter reference output.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate-schema-docs.test.js | Adds assertions that engine.extensions appears in generated docs (but currently asserts incorrect semantics). |
| pkg/parser/schemas/main_workflow_schema.json | Introduces engine.extensions schema property (but description/examples conflict with existing Pi extension/plugin behavior). |
| pkg/parser/schema_test.go | Adds schema validation test for engine.extensions (but uses values that don’t match how Pi extensions are implemented). |
| docs/src/content/docs/reference/frontmatter-full.md | Updates generated frontmatter reference to include engine.extensions (but wording reflects incorrect semantics). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 5
- Review effort level: Low
| "extensions": { | ||
| "type": "array", | ||
| "description": "Optional allowlist of file extensions that the Pi engine may modify. Entries should be strings such as '.go' or '.md'. When omitted or empty, the Pi engine uses its default extension behavior.", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "examples": [ | ||
| [".go", ".md"], | ||
| [".js", ".ts", ".json"] | ||
| ] | ||
| }, |
| # Optional allowlist of file extensions that the Pi engine may modify. Entries | ||
| # should be strings such as '.go' or '.md'. When omitted or empty, the Pi engine | ||
| # uses its default extension behavior. |
| "engine": map[string]any{ | ||
| "id": "pi", | ||
| "extensions": []any{".go", ".md"}, | ||
| }, |
| "engine": map[string]any{ | ||
| "id": "pi", | ||
| "extensions": []any{".go", 1}, | ||
| }, |
| // Test 8: Verify engine.extensions appears in generated docs | ||
| allPassed &= assertContains(output, "extensions:", "Engine extensions field should be present in generated docs"); | ||
| allPassed &= assertContains(output, "Pi engine may modify", "Engine extensions description should be present in generated docs"); |
🔍 PR Triage — §28395315609
Score breakdown: impact 22 + urgency 14 + quality 15
|
|
@copilot All CI checks are passing and the branch is clean. Please address the open inline feedback from the automated Copilot code review before this PR can merge. Unresolved feedback from
Once those are addressed, please invoke the
|
Pi workflows already support
engine.extensionsat parse/runtime, but the field was missing from the main workflow schema. That caused valid workflows to fail schema validation and left the generated frontmatter reference incomplete.Schema
engine.extensionsto$defs.engine_config.propertiesinpkg/parser/schemas/main_workflow_schema.jsonarray<string>with Pi-specific semantics and examplesRegression coverage
engine.extensionsmust appear in generated outputGenerated reference
docs/src/content/docs/reference/frontmatter-full.mdto include the missingengine.extensionssection in the engine config reference