Skip to content

Commit 472994b

Browse files
authored
Align audit/trial help text and update docs for update --cool-down (#31597)
1 parent 8f27541 commit 472994b

5 files changed

Lines changed: 66 additions & 31 deletions

File tree

docs/src/content/docs/setup/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ gh aw update --disable-release-bump # Update workflows; only force-update
601601
gh aw update --create-pull-request # Update and open a pull request
602602
```
603603

604-
**Options:** `--dir`, `--no-merge`, `--major`, `--force`, `--engine`, `--no-stop-after`, `--stop-after`, `--disable-release-bump`, `--create-pull-request`, `--no-compile`, `--no-redirect`
604+
**Options:** `--dir`, `--no-merge`, `--major`, `--force`, `--engine`, `--no-stop-after`, `--stop-after`, `--disable-release-bump`, `--create-pull-request`, `--no-compile`, `--no-redirect`, `--cool-down`
605605

606606
The `--no-redirect` flag causes `update` to fail when the source workflow has a [`redirect`](/gh-aw/reference/frontmatter/) field, rather than following the redirect to its new location. Use this when you want explicit control over redirect handling.
607607

pkg/cli/audit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var auditLog = logger.New("cli:audit")
2828
func NewAuditCommand() *cobra.Command {
2929
cmd := &cobra.Command{
3030
Use: "audit <run-id-or-url> [run-id-or-url]...",
31-
Short: "Audit a workflow run and generate a detailed report",
31+
Short: "Audit workflow runs and generate detailed reports",
3232
Long: `Audit one or more workflow runs by downloading artifacts and logs, detecting errors,
3333
analyzing MCP tool usage, and generating a concise report suitable for AI agents.
3434
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//go:build !integration
2+
3+
package cli
4+
5+
import (
6+
"os"
7+
"path/filepath"
8+
"runtime"
9+
"strings"
10+
"testing"
11+
12+
"github.com/stretchr/testify/assert"
13+
"github.com/stretchr/testify/require"
14+
)
15+
16+
func TestAuditCommandDescriptionsAreConsistent(t *testing.T) {
17+
cmd := NewAuditCommand()
18+
19+
assert.Contains(t, cmd.Short, "workflow runs", "audit short description should describe multiple run inputs")
20+
assert.Contains(t, cmd.Long, "Audit one or more workflow runs", "audit long description should describe multiple run inputs")
21+
}
22+
23+
func TestTrialCommandUsesStandardExamplesHeading(t *testing.T) {
24+
cmd := NewTrialCommand(func(string) error { return nil })
25+
26+
assert.Contains(t, cmd.Long, "Examples:", "trial long help should use the standard examples heading")
27+
assert.NotContains(t, cmd.Long, "Single workflow:", "trial long help should avoid custom example section headings")
28+
assert.NotContains(t, cmd.Long, "Multiple workflows (for comparison):", "trial long help should avoid custom example section headings")
29+
assert.NotContains(t, cmd.Long, "Workflows from different repositories:", "trial long help should avoid custom example section headings")
30+
assert.NotContains(t, cmd.Long, "Repository mode examples:", "trial long help should avoid custom example section headings")
31+
assert.NotContains(t, cmd.Long, "Repeat and cleanup examples:", "trial long help should avoid custom example section headings")
32+
assert.NotContains(t, cmd.Long, "Auto-merge examples:", "trial long help should avoid custom example section headings")
33+
assert.NotContains(t, cmd.Long, "Advanced examples:", "trial long help should avoid custom example section headings")
34+
}
35+
36+
func TestUpdateDocsIncludeCoolDownOption(t *testing.T) {
37+
_, currentFile, _, ok := runtime.Caller(0)
38+
require.True(t, ok, "should resolve current test file path")
39+
40+
docsPath := filepath.Join(filepath.Dir(currentFile), "..", "..", "docs", "src", "content", "docs", "setup", "cli.md")
41+
content, err := os.ReadFile(docsPath)
42+
require.NoError(t, err, "should read CLI setup docs")
43+
44+
text := string(content)
45+
updateIndex := strings.Index(text, "#### `update`")
46+
require.NotEqual(t, -1, updateIndex, "CLI setup docs should contain the update section")
47+
48+
updateSection := text[updateIndex:]
49+
assert.Contains(t, updateSection, "`--cool-down`", "update docs options should include --cool-down")
50+
}

pkg/cli/trial_command.go

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,19 @@ This command creates a temporary private repository in your GitHub account, inst
1818
workflow(s) from their source repositories, and runs them in "trial mode" to capture safe outputs without
1919
making actual changes to the "simulated" host repository.
2020
21-
Single workflow:
22-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/weekly-research
23-
Outputs: stdout + local trials/weekly-research.DATETIME-ID.json + trial repo trials/
24-
25-
Multiple workflows (for comparison):
26-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/daily-plan githubnext/agentics/weekly-research
27-
Outputs: stdout + local trials/ + trial repo trials/ (individual + combined results)
28-
29-
Workflows from different repositories:
30-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/daily-plan myorg/myrepo/custom-workflow
31-
32-
Repository mode examples:
33-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo myorg/myrepo # Use myorg/myrepo as host for trial execution
34-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --logical-repo myorg/myrepo # Simulate running against myorg/myrepo
35-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --clone-repo myorg/myrepo # Clone myorg/myrepo contents into host
36-
37-
Repeat and cleanup examples:
38-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --repeat 3 # Run 4 times total (1 initial + 3 repeats)
39-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --delete-host-repo-after # Delete repo after completion
40-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo my-trial # Custom host repo
41-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --dry-run # Show what would be done without changes
42-
43-
Auto-merge examples:
44-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --auto-merge-prs # Auto-merge any PRs created during trial
45-
46-
Advanced examples:
47-
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo . # Use current repo as host
48-
` + string(constants.CLIExtensionPrefix) + ` trial ./local-workflow.md --clone-repo upstream/repo --repeat 2
21+
Examples:
22+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/weekly-research # Run a single workflow in a temporary trial repository
23+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/daily-plan githubnext/agentics/weekly-research # Compare multiple workflows
24+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/daily-plan myorg/myrepo/custom-workflow # Run workflows from different repositories
25+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo myorg/myrepo # Use an existing host repository
26+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --logical-repo myorg/myrepo # Simulate a different github.repository value
27+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --clone-repo myorg/myrepo # Clone repository contents into the trial host
28+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --repeat 3 # Run 4 times total (1 initial + 3 repeats)
29+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --delete-host-repo-after # Delete the trial host repository when done
30+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --dry-run # Preview changes without executing
31+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --auto-merge-prs # Auto-merge PRs created during the trial
32+
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo . # Use the current repository as the host
33+
` + string(constants.CLIExtensionPrefix) + ` trial ./local-workflow.md --clone-repo upstream/repo --repeat 2 # Run a local workflow against cloned contents
4934
` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --trigger-context https://github.com/owner/repo/issues/123 # Provide issue context for issue-triggered workflows
5035
5136
Repository modes:

pkg/parser/frontmatter_extraction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This is a test workflow with empty frontmatter.`,
6565
wantMarkdown: "# Content",
6666
},
6767
{
68-
name: "frontmatter delimiters with surrounding whitespace",
68+
name: "frontmatter delimiters with surrounding whitespace",
6969
content: " \t--- \t\r\non: push\r\n \t--- \t\r\n\r\n# Test Workflow\r\n",
7070
wantYAML: map[string]any{
7171
"on": "push",

0 commit comments

Comments
 (0)