Remove imports.apm-packages from workflow schema and schema-driven docs#27493
Remove imports.apm-packages from workflow schema and schema-driven docs#27493
imports.apm-packages from workflow schema and schema-driven docs#27493Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e0d2c819-28e7-4d36-b099-48e4808988f7 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes the deprecated imports.apm-packages frontmatter field from the workflow schema and aligns schema-driven docs/editor metadata with the aw-only object-form import model.
Changes:
- Removed
imports.apm-packages(schema definition + examples) frommain_workflow_schema.json. - Updated parser comment/error messaging to describe the
aw-only object form. - Updated schema-driven docs and editor autocomplete metadata to drop the
apm-packagesshape/section.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/schemas/main_workflow_schema.json | Removes imports.apm-packages from the schema contract and examples; updates imports descriptions. |
| pkg/parser/import_bfs.go | Updates imports parsing comments and the validation error message to reflect aw-only object form. |
| docs/src/content/docs/reference/frontmatter-full.md | Removes the apm-packages section from the generated full frontmatter reference. |
| docs/public/editor/autocomplete-data.json | Removes apm-packages autocomplete metadata under imports. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
pkg/parser/import_bfs.go:67
- In the
map[string]anybranch, if the object-formimportsdoes not contain anawkey (e.g. a typo, or a leftoverapm-packageskey), the code silently produceslen(importSpecs)==0and returns an emptyImportsResultwith no error. After removingimports.apm-packagesfrom the schema/docs, this behavior can hide invalid configuration and lead to workflows compiling without intended imports.
Consider validating object-form imports more strictly here (e.g., if the map is non-empty and does not contain aw, return a clear error listing allowed keys; optionally special-case apm-packages with a targeted migration message).
case map[string]any:
// Object form: {aw: [...]}
// Extract 'aw' subfield for agentic workflow imports.
if awAny, hasAW := v["aw"]; hasAW {
switch awVal := awAny.(type) {
case []any:
specs, err := parseImportSpecsFromArray(awVal)
if err != nil {
return nil, fmt.Errorf("imports.aw: %w", err)
}
importSpecs = specs
case []string:
for _, s := range awVal {
importSpecs = append(importSpecs, ImportSpec{Path: s})
}
default:
return nil, errors.New("imports.aw must be an array of strings or objects")
}
}
default:
return nil, errors.New("imports field must be an array or an object with an 'aw' subfield")
}
if len(importSpecs) == 0 {
return &ImportsResult{}, nil
- Files reviewed: 4/4 changed files
- Comments generated: 1
| "type": "object", | ||
| "description": "Object form of imports with 'aw' subfield for shared agentic workflow paths and 'apm-packages' subfield for APM packages.", | ||
| "description": "Object form of imports with 'aw' subfield for shared agentic workflow paths.", | ||
| "additionalProperties": false, |
There was a problem hiding this comment.
The object-form imports schema allows an empty object (imports: {}) because aw is not required. Now that the only supported object-form key is aw, consider requiring it (and/or setting minProperties: 1) to prevent no-op configurations and better catch typos in CI/schema validation.
| "additionalProperties": false, | |
| "additionalProperties": false, | |
| "minProperties": 1, | |
| "required": ["aw"], |
imports.apm-packagesis no longer supported in frontmatter and should be configured through imported workflows instead. This PR removes that field from the schema contract and aligns generated reference metadata/docs with the new import model.Schema contract update
imports.apm-packagesfrompkg/parser/schemas/main_workflow_schema.json.importsobject-form descriptions to reflectaw-only object form.apm-packagesexamples from theimportsschema examples.Schema-driven documentation alignment
apm-packagesautocomplete shape fromdocs/public/editor/autocomplete-data.json.apm-packagessection from full frontmatter reference atdocs/src/content/docs/reference/frontmatter-full.md.Parser messaging consistency
pkg/parser/import_bfs.gocomments and validation error wording to match theaw-only object form.Example of supported object-form imports after this change: