From 3199fc6c0f7d6db1fae2512b400eed2d0882616a Mon Sep 17 00:00:00 2001 From: Michael Costello Date: Sun, 29 Nov 2026 18:06:17 -0500 Subject: [PATCH 1/2] fix: Describe self-service access in request help The help for requesting Compute access said approval is a manual step by the service provider. The CLI follows the live service's enablement mode, and a self-service service enables access automatically within seconds, so an agent reading the help waited on a person for nothing. The wait itself still prints that a person reviews the request. That text comes from the shared activation package and is tracked in milo-os/service-catalog#269. Key changes: - Describe both self-service and provider-approved access in the help - Say --wait waits for setup to complete - Add a test that the help never calls approval manual Related to #682 --- internal/cmd/compute/access/access.go | 8 +++++--- internal/cmd/compute/access/access_test.go | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 internal/cmd/compute/access/access_test.go diff --git a/internal/cmd/compute/access/access.go b/internal/cmd/compute/access/access.go index 7a492426..c802b1e4 100644 --- a/internal/cmd/compute/access/access.go +++ b/internal/cmd/compute/access/access.go @@ -80,7 +80,9 @@ func requestCommand() *cobra.Command { Use: "request", Short: "Request Compute service access for the current project", Long: "Submit a request to enable the Compute service for the current " + - "project. Approval may be a manual step by the service provider.", + "project. A self-service Compute service enables access automatically, " + + "normally within a few seconds. Otherwise the request waits for the " + + "service provider to approve it.", Args: util.NoPositionalArgs, RunE: func(cmd *cobra.Command, _ []string) error { project := util.ProjectFromCmd(cmd) @@ -111,9 +113,9 @@ func requestCommand() *cobra.Command { } util.MarkGateExempt(cmd) - cmd.Flags().StringVar(&message, "message", "", "Justification sent to the service provider with the request") + cmd.Flags().StringVar(&message, "message", "", "Justification for the service provider, read when it approves requests by hand") cmd.Flags().BoolVar(&renew, "renew", false, "Delete a denied or revoked request and submit a new one") - cmd.Flags().BoolVar(&wait, "wait", false, "Wait until access becomes active (approval is a manual provider step)") + cmd.Flags().BoolVar(&wait, "wait", false, "Wait until Compute setup completes") cmd.Flags().DurationVar(&timeout, "timeout", 30*time.Minute, "Maximum time to wait when --wait is set") return cmd diff --git a/internal/cmd/compute/access/access_test.go b/internal/cmd/compute/access/access_test.go new file mode 100644 index 00000000..336e15bb --- /dev/null +++ b/internal/cmd/compute/access/access_test.go @@ -0,0 +1,22 @@ +package access + +import ( + "strings" + "testing" +) + +func TestRequestHelpDoesNotPromiseManualApproval(t *testing.T) { + cmd := requestCommand() + texts := []string{cmd.Long} + for _, name := range []string{"wait", "message"} { + texts = append(texts, cmd.Flags().Lookup(name).Usage) + } + for _, text := range texts { + if strings.Contains(strings.ToLower(text), "manual") { + t.Errorf("help says approval is manual: %q", text) + } + } + if !strings.Contains(cmd.Long, "self-service") { + t.Errorf("help does not describe self-service access: %q", cmd.Long) + } +} From 9e95cd6805b9f828afb7842e337555fcc99a903f Mon Sep 17 00:00:00 2001 From: Michael Costello Date: Mon, 30 Nov 2026 12:32:27 -0500 Subject: [PATCH 2/2] test: Widen the manual-approval help check The help check built its list with append, which the prealloc linter rejects, and it only banned the word "manual", so other wording that promises a human review would still pass. Key changes: - build the list of help texts as one literal, short text included - also reject "someone reviews", "a person reviews" and "reviews this by hand" Related to #682 --- internal/cmd/compute/access/access_test.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/cmd/compute/access/access_test.go b/internal/cmd/compute/access/access_test.go index 336e15bb..e7bf12d9 100644 --- a/internal/cmd/compute/access/access_test.go +++ b/internal/cmd/compute/access/access_test.go @@ -7,13 +7,18 @@ import ( func TestRequestHelpDoesNotPromiseManualApproval(t *testing.T) { cmd := requestCommand() - texts := []string{cmd.Long} - for _, name := range []string{"wait", "message"} { - texts = append(texts, cmd.Flags().Lookup(name).Usage) + texts := []string{ + cmd.Short, + cmd.Long, + cmd.Flags().Lookup("wait").Usage, + cmd.Flags().Lookup("message").Usage, } for _, text := range texts { - if strings.Contains(strings.ToLower(text), "manual") { - t.Errorf("help says approval is manual: %q", text) + lower := strings.ToLower(text) + for _, claim := range []string{"manual", "someone reviews", "a person reviews", "reviews this by hand"} { + if strings.Contains(lower, claim) { + t.Errorf("help says approval is manual (%q): %q", claim, text) + } } } if !strings.Contains(cmd.Long, "self-service") {