Skip to content

Drop non-config JSON metadata during add/add-wizard import#33420

Merged
pelikhan merged 3 commits into
mainfrom
copilot/add-ignored-fields-json-import
May 20, 2026
Merged

Drop non-config JSON metadata during add/add-wizard import#33420
pelikhan merged 3 commits into
mainfrom
copilot/add-ignored-fields-json-import

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

JSON workflow imports were surfacing API metadata (created_by, disabled, disabled_state, updated_at) as unsupported-field comments/warnings, adding noise to generated markdown. This change makes those fields explicitly ignored so imports keep only actionable workflow config.

  • Import behavior change

    • Treat created_by, disabled, disabled_state, and updated_at as known-but-ignored during JSON unmarshal/conversion.
    • Prevent these fields from being copied into Extra, emitted as # Unsupported fields..., or added to conversion warnings.
  • Scope

    • Applies to the shared JSON import conversion path used by both gh aw add and gh aw add-wizard.
  • Regression coverage

    • Updated JSON conversion tests to assert ignored-field silence.
    • Preserved existing behavior for truly unsupported fields (for example, created_at still appears in warnings/comments).
knownKeys := map[string]bool{
  "id": true, "name": true, "description": true,
  "instructions": true, "prompt": true, "engine": true,
  "on": true, "triggers": true, "tools": true, "permissions": true, "tags": true,
  "created_by": true, "disabled": true, "disabled_state": true, "updated_at": true, // ignored
}

Copilot AI and others added 2 commits May 20, 2026 01:09
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Silently drop selected JSON metadata fields during import Drop non-config JSON metadata during add/add-wizard import May 20, 2026
Copilot AI requested a review from pelikhan May 20, 2026 01:11
@pelikhan pelikhan marked this pull request as ready for review May 20, 2026 01:12
Copilot AI review requested due to automatic review settings May 20, 2026 01:12
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

Reduces noise during JSON workflow imports by treating API-returned metadata fields as known-but-ignored so they don’t get preserved into Extra or emitted as unsupported-field comments/warnings.

Changes:

  • Updated JSONWorkflow.UnmarshalJSON to ignore created_by, disabled, disabled_state, and updated_at rather than capturing them in Extra.
  • Added a focused unmarshal test ensuring those metadata keys are dropped while truly unknown keys are still captured.
  • Updated JSON→markdown conversion tests to assert warnings/comments are emitted only for genuinely unsupported fields (e.g., created_at), not ignored metadata.
Show a summary per file
File Description
pkg/cli/jsonworkflow_to_markdown.go Adds specific API metadata keys to the known-key set so they are ignored during import.
pkg/cli/jsonworkflow_to_markdown_test.go Adds/updates tests to ensure ignored metadata fields do not appear in Extra or conversion warnings.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@pelikhan pelikhan merged commit 1096eb4 into main May 20, 2026
29 of 31 checks passed
@pelikhan pelikhan deleted the copilot/add-ignored-fields-json-import branch May 20, 2026 01:21
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