Polish JSON-import UX for add/add-wizard output#33424
Merged
Merged
Conversation
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 May 20, 2026
add/add-wizard output
Copilot created this pull request from a session on behalf of
pelikhan
May 20, 2026 01:34
View session
Contributor
There was a problem hiding this comment.
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
addand 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 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
gh aw addingests 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
descriptioninfo lines are now shown only in verbose mode.addand interactiveadd-wizardflow (showWorkflowDescriptions).JSON-import follow-up guidance
Implementation notes