Skip to content

Fix trial_confirmation.go sub-step bullets to use console.FormatListItemStderr#43588

Open
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-trial-confirmation-sub-steps
Open

Fix trial_confirmation.go sub-step bullets to use console.FormatListItemStderr#43588
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-trial-confirmation-sub-steps

Conversation

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The two sub-step bullet pairs in trial_confirmation.go (the a./b. lines under "For each of N executions") used raw fmt.Fprintf(os.Stderr, ...) instead of console helpers, making them visually inconsistent with all surrounding steps and stripping TTY-aware color/style in non-interactive contexts.

Changes

  • pkg/cli/trial_confirmation.go — replaced the four raw fmt.Fprintf sub-step calls with console.FormatListItemStderr, covering both the single-workflow and multi-workflow code paths:
// Before
fmt.Fprintf(os.Stderr, "     a. Execute %s\n", workflowName)
fmt.Fprintf(os.Stderr, "     b. Auto-merge any pull requests created during execution\n")

// After
fmt.Fprintln(os.Stderr, console.FormatListItemStderr(fmt.Sprintf("a. Execute %s", workflowName)))
fmt.Fprintln(os.Stderr, console.FormatListItemStderr("b. Auto-merge any pull requests created during execution"))

FormatListItemStderr applies TTY-aware styling (using stderr's TTY state rather than stdout's) and a prefix, consistent with how the rest of the execution steps render.

…ItemStderr in trial_confirmation.go

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix trial_confirmation.go sub-step bullets to use console.FormatListItemStderr Fix trial_confirmation.go sub-step bullets to use console.FormatListItemStderr Jul 5, 2026
Copilot AI requested a review from pelikhan July 5, 2026 16:36
@pelikhan pelikhan marked this pull request as ready for review July 5, 2026 16:41
Copilot AI review requested due to automatic review settings July 5, 2026 16:41
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #43588 does not have the 'implementation' label and has only 4 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the trial execution plan output in gh aw so the lettered sub-steps under “For each of N executions” render using the console list-item helper, making the output consistent with other styled/TTY-aware console formatting in the codebase.

Changes:

  • Replaced raw fmt.Fprintf(os.Stderr, " a./b....") lines with console.FormatListItemStderr(...) for the single-workflow path.
  • Applied the same list-item formatting change to the multi-workflow path.
Show a summary per file
File Description
pkg/cli/trial_confirmation.go Switches the “a./b.” sub-step lines to console.FormatListItemStderr for consistent, stderr-TTY-aware list formatting.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Low

@@ -179,8 +179,8 @@ func showTrialConfirmation(opts trialConfirmationOptions) error {
workflowName := opts.parsedSpecs[0].WorkflowName
if opts.repeatCount > 0 && opts.autoMergePRs {
fmt.Fprintf(os.Stderr, console.FormatInfoMessage(" %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)
@@ -196,8 +196,8 @@ func showTrialConfirmation(opts trialConfirmationOptions) error {

if opts.repeatCount > 0 && opts.autoMergePRs {
fmt.Fprintf(os.Stderr, console.FormatInfoMessage(" %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)
@github-actions github-actions Bot mentioned this pull request Jul 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. The four raw fmt.Fprintf calls are cleanly replaced with console.FormatListItemStderr — the correct stderr-TTY-aware helper — matching how observability_insights.go and other callers render list items. No test regressions detected. The slight indentation change ( a. • a.) is intentional and consistent with all surrounding steps.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 27.7 AIC · ⌖ 5.83 AIC · ⊞ 4.9K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 36.3 AIC · ⌖ 6.79 AIC · ⊞ 6.7K
Comment /matt to run again

@@ -179,8 +179,8 @@ func showTrialConfirmation(opts trialConfirmationOptions) error {
workflowName := opts.parsedSpecs[0].WorkflowName
if opts.repeatCount > 0 && opts.autoMergePRs {
fmt.Fprintf(os.Stderr, console.FormatInfoMessage(" %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/codebase-design] The parent header on this line still uses FormatInfoMessage (stdout TTY detection) while writing to os.Stderr — the same TTY mismatch this PR fixes for the a./b. sub-steps.

💡 Suggestion

Replace FormatInfoMessage with FormatInfoMessageStderr for all fmt.Fprintf(os.Stderr, ...) call sites in this file:

// Before (still inconsistent after this PR)
fmt.Fprintf(os.Stderr, console.FormatInfoMessage("  %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)

// After (fully consistent)
fmt.Fprintf(os.Stderr, console.FormatInfoMessageStderr("  %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)

There are ~15 similar call sites throughout this function. A single sweep would complete the fix the PR started.

@copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

REQUEST_CHANGES — the fix migrates to FormatListItemStderr correctly for TTY-awareness, but introduces two visual regressions that need addressing before merge.

Blocking issues (2)

Indentation regression

FormatListItemStderr renders " • " + item — identical leading depth to the numbered parent step (" N."). The sub-steps are no longer visually subordinate; they appear as siblings. Old code used five leading spaces. See line 182–183.

Redundant bullet + letter label

The item strings "a. Execute ..." and "b. Auto-merge ..." already carry letter labels. After wrapping with FormatListItemStderr, the output is " • a. Execute ..." — both a bullet and an alphabetic label. Every other FormatListItemStderr call in the codebase passes plain unlabelled text. Pick one convention: either drop the a./b. prefixes and rely on the bullet, or use a plain fmt.Fprintf with letter labels and add TTY-aware styling manually. See line 182.

Both issues affect both the single-workflow and multi-workflow code paths identically.

🔎 Code quality review by PR Code Quality Reviewer · 57.3 AIC · ⌖ 5.33 AIC · ⊞ 5.4K
Comment /review to run again

fmt.Fprintf(os.Stderr, " a. Execute %s\n", workflowName)
fmt.Fprintf(os.Stderr, " b. Auto-merge any pull requests created during execution\n")
fmt.Fprintln(os.Stderr, console.FormatListItemStderr(fmt.Sprintf("a. Execute %s", workflowName)))
fmt.Fprintln(os.Stderr, console.FormatListItemStderr("b. Auto-merge any pull requests created during execution"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indentation regression: the sub-steps now appear at the same column as their numbered parent, breaking the visual hierarchy.

💡 Details and suggested fix

FormatListItemStderr renders " • " + item — two leading spaces plus a bullet. The parent step line also uses two leading spaces:

  3. For each of N executions:
  • a. Execute workflow.md         ← same column as parent!
  • b. Auto-merge pull requests

The old code used five leading spaces (" a.") which placed sub-steps clearly inside the parent. The new rendering breaks the subordinate relationship.

To fix, prepend extra spaces inside the item string to push the bullet deeper:

fmt.Fprintln(os.Stderr, console.FormatListItemStderr("    a. Execute "+workflowName))
fmt.Fprintln(os.Stderr, console.FormatListItemStderr("    b. Auto-merge any pull requests created during execution"))

This produces " • a. Execute ..." which indents past the parent " N.". The same fix applies to the multi-workflow branch (lines 199–200).

fmt.Fprintf(os.Stderr, console.FormatInfoMessage(" %d. For each of %d executions:\n"), stepNum, opts.repeatCount+1)
fmt.Fprintf(os.Stderr, " a. Execute %s\n", workflowName)
fmt.Fprintf(os.Stderr, " b. Auto-merge any pull requests created during execution\n")
fmt.Fprintln(os.Stderr, console.FormatListItemStderr(fmt.Sprintf("a. Execute %s", workflowName)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Redundant label + bullet: passing "a. Execute ..." into FormatListItemStderr yields " • a. Execute ..." — both a bullet point and a letter label are visible simultaneously.

💡 Details and suggested fix

FormatListItemStderr unconditionally prepends " • ". The item strings passed in are "a. Execute ..." and "b. Auto-merge ...", so the rendered lines are:

  • a. Execute workflow.md
  • b. Auto-merge any pull requests created during execution

Every other FormatListItemStderr call in the codebase passes plain text without letter prefixes. The original intent of these sub-steps was to use lettered labels (a/b) to indicate ordering within the parent step. A bullet prefix undermines that by adding a second, redundant visual marker.

Either drop the letter prefix and just use the bullet:

fmt.Fprintln(os.Stderr, console.FormatListItemStderr("Execute "+workflowName))
fmt.Fprintln(os.Stderr, console.FormatListItemStderr("Auto-merge any pull requests created during execution"))

Or skip FormatListItemStderr and keep the letter label with appropriate indentation and TTY-aware styling directly.

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.

[plan] Fix trial_confirmation.go sub-step bullets to use console.FormatListItemStderr

3 participants