Skip to content

fix(cli): resolve three high-severity CLI consistency issues - #48420

Merged
pelikhan merged 4 commits into
mainfrom
copilot/cli-consistency-fixes
Jul 28, 2026
Merged

fix(cli): resolve three high-severity CLI consistency issues#48420
pelikhan merged 4 commits into
mainfrom
copilot/cli-consistency-fixes

Conversation

CopilotAI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Automated CLI consistency inspection flagged three high-severity divergences between command-level help text and the main gh aw --help listing.

Changes

  • --approve flag description unified across run, compile, update, upgrade (cmd/gh-aw/main.go)
    run had a bespoke description scoped to --push-triggered recompile; all four commands now share the canonical description used by compile/update/upgrade. Test updated from Equal to Contains to avoid re-encoding the exact string.

  • add long description now mentions all three input sources (pkg/cli/add_command.go)
    First line changed from "…from repositories…" to "…from repositories, local files, or URLs…", matching the Short field and the main listing.

  • experiments long description aligned with its Short (pkg/cli/experiments_command.go)
    First line changed from "Explore ongoing experiments in the repository." to "List and analyze experiment workflow branches in the repository.", matching the Short field exactly.


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 15.5 AIC · ⌖ 7.12 AIC · ⊞ 7.1K ·
Comment /souschef to run again


run: https://github.com/github/gh-aw/actions/runs/30308333914

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 18.8 AIC · ⌖ 7.74 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30311684823

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10.1 AIC · ⌖ 6.51 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.9 AIC · ⌖ 6.46 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30316592253

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.3 AIC · ⌖ 9.66 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 44.5 AIC · ⌖ 6.75 AIC · ⊞ 7.1K ·
Comment /souschef to run again

…ts command descriptions
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix CLI consistency issues for documentation and help textfix(cli): resolve three high-severity CLI consistency issuesJul 27, 2026
CopilotAI requested a review from pelikhanJuly 27, 2026 18:27
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

FieldValue
Categorychore
Risklow
Score25/100 (impact:8, urgency:8, quality:9)
Actiondefer

Rationale: Draft. Tiny 4-line help-text normalization. No behavior change. Defer until undrafted.

Generated by 🔧 PR Triage Agent · sonnet46 · 54.1 AIC · ⌖ 8.18 AIC · ⊞ 5.7K ·

@pelikhan
pelikhan marked this pull request as ready for review July 27, 2026 20:47
CopilotAI review requested due to automatic review settings July 27, 2026 20:47
@github-actions

github-actionsBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actionsBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

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

@github-actions

github-actionsBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actionsBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

CopilotAI 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

Aligns CLI help text with top-level command listings for issue #48391.

Changes:

  • Unifies --approve help text.
  • Clarifies supported add sources.
  • Aligns the experiments description.
Show a summary per file
FileDescription
cmd/gh-aw/main.goUpdates run --approve help text.
cmd/gh-aw/main_help_text_test.goUpdates help-text coverage.
pkg/cli/add_command.goLists all supported workflow sources.
pkg/cli/experiments_command.goAligns long and short descriptions.

Review details

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment threadcmd/gh-aw/main.go
Comment threadcmd/gh-aw/main_help_text_test.go Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: N/A — No new tests

No new or modified behavioral test functions were detected in this PR. The only test-file change was a refactoring of an existing assertion in cmd/gh-aw/main_help_text_test.go to improve consistency and reduce brittleness (changing from assert.Equal with a long string to assert.Contains with a key phrase).

📊 Analysis Summary
MetricValue
Files changed4 (1 test file, 3 production files)
Behavioral tests added0
Behavioral tests modified0
Assertion changes1 refactoring (existing test)
🚨 Violations0

Verdict: This is a CLI consistency fix focused on production code (main.go, add_command.go, experiments_command.go) with a corresponding test assertion refinement for consistency. No test coverage regressions detected.

Verdict

passed. No new behavioral tests required for CLI consistency fix. Existing test assertion improved for maintainability.

🧪 Test quality analysis by Test Quality Sentinel · haiku45 · 14.8 AIC · ⌖ 13.3 AIC · ⊞ 8.1K ·
Comment /review to run again

@github-actionsgithub-actionsBot 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.

✅ Test Quality Sentinel: No new behavioral tests required. Existing test assertion improved for maintainability. Zero violations.

@github-actionsgithub-actionsBot 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.

One blocking issue; cosmetic note alongside

The test weakening in main_help_text_test.go must be addressed before merge. The other changes (help text copy edits) are fine.

Details

Blocking — test contract weakened
assert.Equalassert.Contains(..., "safe update changes") collapses a precise guard into a trivial substring that matches any --approve description in the codebase. The test no longer verifies the run command's description is distinct or correct.

Non-blocking — missing period
The new run --approve description ends without a period (...skip safe update enforcement), inconsistent with other flag descriptions. Trivial but worth fixing while touching the string.

🔎 Code quality review by PR Code Quality Reviewer · sonnet46 · 22.9 AIC · ⌖ 4.67 AIC · ⊞ 5.7K
Comment /review to run again

Comment threadcmd/gh-aw/main_help_text_test.go Outdated
@@ -21,7 +21,7 @@ func TestRunCommandHelpTextConsistency(t *testing.T) {
require.NotNil(t, runRawField, "run command should define --raw-field")
require.NotNil(t, compileApprove, "compile command should define --approve")
assert.Contains(t, compileApprove.Usage, "safe update changes", "compile --approve should describe compiler safe update approval")

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.

Test precision gutted: assert.Equalassert.Contains removes the precise contract on the flag description. Any string containing "safe update changes" now passes, letting regressions in the full message go silently undetected.

💡 Suggested fix

Either restore the exact string assertion or assert a meaningfully unique substring:

// Option A — restore exact contractassert.Equal(t,
"Approve all safe update changes. When strict mode is active (the default), the compiler emits warnings for new restricted secrets or unapproved action additions/removals not present in the existing gh-aw-manifest. Use this flag to approve and skip safe update enforcement",
runApprove.Usage,
"run --approve canonical description",
)
// Option B — if some flexibility is intentionalassert.Contains(t, runApprove.Usage,
"approve and skip safe update enforcement",
"run --approve must mention approving/skipping enforcement")

The current substring "safe update changes" appears in every command's --approve description, so this test can no longer distinguish the run command's description from a blank or wrong one.

@github-actionsgithub-actionsBot mentioned this pull request Jul 27, 2026

@github-actionsgithub-actionsBot 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.

The changes are clean, low-risk consistency fixes. All four --approve flag descriptions are now aligned across compile, run, update, and upgrade. The add and experiments long descriptions now match their Short fields. The test change from Equal to Contains is appropriate and still validates intent.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 18 AIC · ⌖ 5.13 AIC · ⊞ 5K

@github-actionsgithub-actionsBot 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.

Skills-Based Review 🧠

Applied /grill-with-docs — commenting with two targeted observations; no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Test assertion weakened: EqualContains reduces the test's locking power. If the canonical string is now settled, consider asserting runApprove.Usage == compileApprove.Usage instead.
  • Missing trailing period: The new --approve flag description in main.go breaks punctuation consistency with neighbouring flags.

Positive Highlights

  • ✅ All four --approve descriptions now share consistent semantics — good cross-command alignment.
  • add_command.go long description now accurately reflects all three input sources, eliminating the Short/Long mismatch.
  • experiments_command.go first-line alignment is clean and surgical.
  • ✅ Small, focused diff — easy to review and revert if needed.

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

Comment threadcmd/gh-aw/main_help_text_test.go Outdated
Comment threadcmd/gh-aw/main.go
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

…test assertion
- Add `approve bool` param to RunWorkflowInteractively and thread into RunOptions
- Add `Approve` field to RunWorkflowOptions; thread into RunSpecificWorkflowInteractively
- Add `approve bool` param to buildCommandString so equivalent-command output includes --approve
- Update test to compare runApprove.Usage == compileApprove.Usage directly instead of both Contains
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

CopilotAI commented Jul 27, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot run pr-finisher skill

Done. Both review threads have been addressed in commit 3f7d5c1:

  1. --approve threaded through interactive executionRunWorkflowInteractively now accepts an approve bool parameter and passes it into RunOptions. RunWorkflowOptions and RunSpecificWorkflowInteractively were updated the same way, and buildCommandString now includes --approve in the equivalent-command output when the flag is set.

  2. Test assertion tightened — replaced the two Contains checks with a single assert.Equal(t, compileApprove.Usage, runApprove.Usage, ...) so any future divergence between the two descriptions fails the test directly.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

FieldValue
Categorychore
Risk🟢 low
Score27/100 (impact:12 urgency:7 quality:8)
Action⏸️ defer

Fixes CLI help text consistency (--approve flag description, help listing). Small cosmetic change (35 adds, 11 dels, 6 files). Low-value polish — defer.

Generated by 🔧 PR Triage Agent · sonnet46 · 63.9 AIC · ⌖ 5.94 AIC · ⊞ 5.7K ·

@pelikhan
pelikhan merged commit 7fe26c9 into mainJul 28, 2026
28 checks passed
@pelikhan
pelikhan deleted the copilot/cli-consistency-fixes branch July 28, 2026 01:43
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.5

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cli-consistency] CLI Consistency Issues - 2026-07-27

3 participants

@pelikhan