From 89497c7c7d0a3a4ab68a1d89edefe2e1781953ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 21:54:38 +0000 Subject: [PATCH 1/4] Initial plan From ba563fc31c7de5b51cf2bab00e968a89e503f86d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:07:35 +0000 Subject: [PATCH 2/4] Add detailed help text for env get and update Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/env_command.go | 24 ++++++++++++++++++++++-- pkg/cli/env_command_test.go | 11 ++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/pkg/cli/env_command.go b/pkg/cli/env_command.go index 3cc7ffe69e6..4d6f870fbef 100644 --- a/pkg/cli/env_command.go +++ b/pkg/cli/env_command.go @@ -133,7 +133,16 @@ func newDefaultsGetCommand() *cobra.Command { cmd := &cobra.Command{ Use: "get [file]", Short: "Download defaults into a YAML file", - Args: cobra.MaximumNArgs(1), + Long: `Download compiler defaults into a YAML file. + +When [file] is omitted, the command writes to ./file.yml. + +Scope resolution: +- --scope defaults to repo. +- repo scope uses --repo owner/repo, or the current repository when --repo is omitted. +- org scope uses --org when provided; otherwise it infers the organization from --repo (or the current repository). +- ent scope requires --enterprise .`, + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { outputFile := "file.yml" if len(args) == 1 { @@ -161,7 +170,18 @@ func newDefaultsUpdateCommand() *cobra.Command { cmd := &cobra.Command{ Use: "update [file]", Short: "Upload defaults from a YAML file", - Args: cobra.MaximumNArgs(1), + Long: `Upload compiler defaults from a YAML file. + +When [file] is omitted, the command reads from ./file.yml. + +Scope and flag behavior: +- --scope is required (repo|org|ent). +- repo scope uses --repo owner/repo, or the current repository when --repo is omitted. +- org scope uses --org when provided; otherwise it infers the organization from --repo (or the current repository). +- ent scope requires --enterprise . +- --dry-run previews planned changes and exits without applying updates. +- --yes skips the confirmation prompt for real updates; it has no effect with --dry-run.`, + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { inputFile := "file.yml" if len(args) == 1 { diff --git a/pkg/cli/env_command_test.go b/pkg/cli/env_command_test.go index a14d42ebd7e..32d12b139c8 100644 --- a/pkg/cli/env_command_test.go +++ b/pkg/cli/env_command_test.go @@ -16,11 +16,12 @@ func TestNewEnvCommand(t *testing.T) { require.NotNil(t, cmd) assert.Equal(t, "env", cmd.Use) - var updateCmd *cobra.Command + var getCmd, updateCmd *cobra.Command var hasGet, hasUpdate bool for _, sub := range cmd.Commands() { if sub.Name() == "get" { hasGet = true + getCmd = sub } if sub.Name() == "update" { hasUpdate = true @@ -29,7 +30,15 @@ func TestNewEnvCommand(t *testing.T) { } assert.True(t, hasGet, "env command should include get subcommand") assert.True(t, hasUpdate, "env command should include update subcommand") + require.NotNil(t, getCmd) require.NotNil(t, updateCmd) + assert.Contains(t, getCmd.Long, "./file.yml") + assert.Contains(t, getCmd.Long, "--scope defaults to repo") + assert.Contains(t, getCmd.Long, "--enterprise ") + assert.Contains(t, updateCmd.Long, "./file.yml") + assert.Contains(t, updateCmd.Long, "--scope is required") + assert.Contains(t, updateCmd.Long, "--dry-run previews planned changes") + assert.Contains(t, updateCmd.Long, "--yes skips the confirmation prompt") assert.NotNil(t, updateCmd.Flags().Lookup("yes")) assert.NotNil(t, updateCmd.Flags().Lookup("dry-run")) } From 099907e2ae27dfe3fdd017c772f844ca93efe4a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:10:42 +0000 Subject: [PATCH 3/4] Stabilize env help text assertions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/env_command_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/cli/env_command_test.go b/pkg/cli/env_command_test.go index 32d12b139c8..76377d108db 100644 --- a/pkg/cli/env_command_test.go +++ b/pkg/cli/env_command_test.go @@ -32,13 +32,15 @@ func TestNewEnvCommand(t *testing.T) { assert.True(t, hasUpdate, "env command should include update subcommand") require.NotNil(t, getCmd) require.NotNil(t, updateCmd) - assert.Contains(t, getCmd.Long, "./file.yml") - assert.Contains(t, getCmd.Long, "--scope defaults to repo") - assert.Contains(t, getCmd.Long, "--enterprise ") - assert.Contains(t, updateCmd.Long, "./file.yml") - assert.Contains(t, updateCmd.Long, "--scope is required") - assert.Contains(t, updateCmd.Long, "--dry-run previews planned changes") - assert.Contains(t, updateCmd.Long, "--yes skips the confirmation prompt") + assert.NotEmpty(t, getCmd.Long) + assert.Contains(t, getCmd.Long, "file") + assert.Contains(t, getCmd.Long, "scope") + assert.Contains(t, getCmd.Long, "--enterprise") + assert.NotEmpty(t, updateCmd.Long) + assert.Contains(t, updateCmd.Long, "file") + assert.Contains(t, updateCmd.Long, "scope") + assert.Contains(t, updateCmd.Long, "--dry-run") + assert.Contains(t, updateCmd.Long, "--yes") assert.NotNil(t, updateCmd.Flags().Lookup("yes")) assert.NotNil(t, updateCmd.Flags().Lookup("dry-run")) } From e8d42a2b2b839ce08cfa3b237fc1ae24cf530f92 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 22:14:00 +0000 Subject: [PATCH 4/4] Align env help default filename wording Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/env_command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cli/env_command.go b/pkg/cli/env_command.go index 4d6f870fbef..c3aeac44c38 100644 --- a/pkg/cli/env_command.go +++ b/pkg/cli/env_command.go @@ -135,7 +135,7 @@ func newDefaultsGetCommand() *cobra.Command { Short: "Download defaults into a YAML file", Long: `Download compiler defaults into a YAML file. -When [file] is omitted, the command writes to ./file.yml. +When [file] is omitted, the command writes to file.yml. Scope resolution: - --scope defaults to repo. @@ -172,7 +172,7 @@ func newDefaultsUpdateCommand() *cobra.Command { Short: "Upload defaults from a YAML file", Long: `Upload compiler defaults from a YAML file. -When [file] is omitted, the command reads from ./file.yml. +When [file] is omitted, the command reads from file.yml. Scope and flag behavior: - --scope is required (repo|org|ent).