Skip to content

Polish JSON-import UX for add/add-wizard output#33424

Merged
pelikhan merged 3 commits into
mainfrom
copilot/improve-add-wizard-experience
May 20, 2026
Merged

Polish JSON-import UX for add/add-wizard output#33424
pelikhan merged 3 commits into
mainfrom
copilot/improve-add-wizard-experience

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

When gh aw add ingests JSON-converted workflows, output currently repeats the destination path and surfaces frontmatter description text as a standalone info line (e.g. “Format and linter”), which is noisy and ambiguous. This update tightens default output and adds an explicit agentic follow-up hint for best-effort JSON imports.

  • Output de-duplication

    • Added workflow: now prints the filename (<name>.md) instead of the full destination path to avoid repeating location context already shown in subsequent output.
  • Description verbosity behavior

    • Workflow description info lines are now shown only in verbose mode.
    • Applied to both non-interactive add and interactive add-wizard flow (showWorkflowDescriptions).
  • JSON-import follow-up guidance

    • JSON-converted payloads now carry conversion metadata through resolution.
    • Resolver emits a targeted warning suggesting an agentic prompt pass to refine generated workflow content after best-effort JSON conversion.
  • Implementation notes

    • Extended fetched workflow metadata to track JSON conversion state and warnings.
    • Added resolver coverage for the JSON refinement suggestion path.
// before: noisy default output
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Added workflow: "+destFile))
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(description))

// after: concise default, description only when verbose
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Added workflow: "+filepath.Base(destFile)))
if opts.Verbose && description != "" {
    fmt.Fprintln(os.Stderr, console.FormatInfoMessage(description))
}

Copilot AI and others added 2 commits May 20, 2026 01:27
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 Polish JSON import UX for add/add-wizard Polish JSON-import UX for add/add-wizard output May 20, 2026
Copilot AI requested a review from pelikhan May 20, 2026 01:34
@pelikhan pelikhan marked this pull request as ready for review May 20, 2026 01:56
Copilot AI review requested due to automatic review settings May 20, 2026 01:56
@pelikhan pelikhan merged commit 495d5fa into main May 20, 2026
26 of 27 checks passed
@pelikhan pelikhan deleted the copilot/improve-add-wizard-experience branch May 20, 2026 01:57
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

Tightens gh aw add / add-wizard console output when ingesting workflows (especially JSON-converted imports) by reducing default verbosity and adding a follow-up guidance warning for best-effort JSON conversions.

Changes:

  • Extend fetched-workflow metadata to track whether content was converted from JSON and to retain conversion warnings.
  • Make workflow description info lines display only in verbose mode (both non-interactive add and interactive description display).
  • Emit a resolver warning suggesting a follow-up “agentic prompt” refinement for JSON-imported workflows; add a unit test for that path.
Show a summary per file
File Description
pkg/cli/fetch.go Adds JSON-conversion metadata fields to FetchedWorkflow and populates them for JSON URL imports.
pkg/cli/add_workflow_resolution.go Adds a resolver warning when a fetched workflow was converted from JSON.
pkg/cli/add_workflow_resolution_redirect_test.go Adds coverage to assert the JSON-import refinement suggestion is surfaced as a warning.
pkg/cli/add_interactive_orchestrator.go Gates interactive workflow description printing behind verbose mode.
pkg/cli/add_command.go Prints only the installed filename (not full path) and prints description only in verbose mode.
.github/workflows/smoke-otel-backends.lock.yml Updates Datadog MCP header env-var reference in the generated lock content.

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/cli/add_workflow_resolution.go:178

  • This warning hard-codes the destination as .github/workflows/.md, but the actual install location/name can differ (e.g., --dir or -n/--name during add). Consider wording this in terms of the generated workflow filename only (or defer path rendering until the add step where the final destination is known) to avoid pointing users at the wrong file.
		if fetched.ConvertedFromJSON {
			resolutionWarnings = append(resolutionWarnings,
				fmt.Sprintf("JSON workflow import for %q was best-effort; run an agentic prompt to refine .github/workflows/%s.md", resolvedSpec.WorkflowName, resolvedSpec.WorkflowName))
		}
  • Files reviewed: 6/6 changed files
  • Comments generated: 2

Comment on lines +175 to +178
if fetched.ConvertedFromJSON {
resolutionWarnings = append(resolutionWarnings,
fmt.Sprintf("JSON workflow import for %q was best-effort; run an agentic prompt to refine .github/workflows/%s.md", resolvedSpec.WorkflowName, resolvedSpec.WorkflowName))
}
Comment thread pkg/cli/fetch.go
Comment on lines 35 to 42
type FetchedWorkflow struct {
Content []byte // The raw content of the workflow file
CommitSHA string // The resolved commit SHA at the time of fetch (empty for local)
IsLocal bool // true if this is a local workflow (from filesystem)
SourcePath string // The original source path (local path or remote path)
Content []byte // The raw content of the workflow file
CommitSHA string // The resolved commit SHA at the time of fetch (empty for local)
IsLocal bool // true if this is a local workflow (from filesystem)
SourcePath string // The original source path (local path or remote path)
ConvertedFromJSON bool // true when the fetched source was JSON converted to markdown
JSONConversionWarnings []string // best-effort conversion warnings produced during JSON import
}
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