Skip to content

Remove imports.apm-packages from workflow schema and schema-driven docs#27493

Merged
pelikhan merged 1 commit intomainfrom
copilot/remove-apm-packages-json-schema
Apr 21, 2026
Merged

Remove imports.apm-packages from workflow schema and schema-driven docs#27493
pelikhan merged 1 commit intomainfrom
copilot/remove-apm-packages-json-schema

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

imports.apm-packages is 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

    • Removed imports.apm-packages from pkg/parser/schemas/main_workflow_schema.json.
    • Updated imports object-form descriptions to reflect aw-only object form.
    • Removed apm-packages examples from the imports schema examples.
  • Schema-driven documentation alignment

    • Removed apm-packages autocomplete shape from docs/public/editor/autocomplete-data.json.
    • Removed apm-packages section from full frontmatter reference at docs/src/content/docs/reference/frontmatter-full.md.
  • Parser messaging consistency

    • Updated pkg/parser/import_bfs.go comments and validation error wording to match the aw-only object form.

Example of supported object-form imports after this change:

imports:
  aw:
    - shared/common-tools.md
    - shared/mcp/tavily.md

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>
@pelikhan pelikhan marked this pull request as ready for review April 21, 2026 04:50
Copilot AI review requested due to automatic review settings April 21, 2026 04:50
@pelikhan pelikhan merged commit de53b05 into main Apr 21, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/remove-apm-packages-json-schema branch April 21, 2026 04:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) from main_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-packages shape/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]any branch, if the object-form imports does not contain an aw key (e.g. a typo, or a leftover apm-packages key), the code silently produces len(importSpecs)==0 and returns an empty ImportsResult with no error. After removing imports.apm-packages from 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,
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"additionalProperties": false,
"additionalProperties": false,
"minProperties": 1,
"required": ["aw"],

Copilot uses AI. Check for mistakes.
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