• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

astronomer / astro-cli / c574f593-fb69-4153-aba1-d44ea591c656

05 May 2026 02:52PM UTC coverage: 39.717% (-0.03%) from 39.746%
c574f593-fb69-4153-aba1-d44ea591c656

Pull #2123

circleci

jlaneve
review pass: trim narrative comments, share versionURL, gate Windows hint

- Extract versionURL constant and reuse it from LatestVersion() so the
  /latest/version path has one source of truth.
- HEAD instead of GET for the probe — we never read the body.
- Show the 32-bit-CLI-on-64-bit-Windows hint only when GOOS is windows;
  it's confusing for a Linux user on an unsupported arch.
- Trim doc comments back to load-bearing WHY (sibling private helpers
  use 1-3 lines; the originals were 6).
- Drop test comments that narrated the customer ticket and design rationale —
  the test names + assertions carry the meaning.
Pull Request #2123: fix(otto): translate 404 into actionable platform error

17 of 23 new or added lines in 1 file covered. (73.91%)

84 existing lines in 3 files now uncovered.

26132 of 65795 relevant lines covered (39.72%)

9.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.0
/cmd/cloud/env_input.go
1
package cloud
2

3
import (
4
        "fmt"
5
        "io"
6
        "os"
7
        "strings"
8

9
        "golang.org/x/term"
10

11
        "github.com/astronomer/astro-cli/pkg/input"
12
)
13

14
// readSecretValue resolves a secret value from one of three sources, in order:
15
//
16
//  1. The flag value (if explicitly provided).
17
//  2. Stdin, if it's piped (single line, trailing newline stripped).
18
//  3. An interactive prompt with echo disabled, if stdin is a TTY.
19
//
20
// Passing the value via flag is supported but discouraged for secret values,
21
// since it puts the value in shell history.
22
func readSecretValue(flagValue, prompt string) (string, error) {
1✔
23
        if flagValue != "" {
1✔
UNCOV
24
                return flagValue, nil
×
UNCOV
25
        }
×
26
        if hasPipedStdin() {
2✔
27
                b, err := io.ReadAll(os.Stdin)
1✔
28
                if err != nil {
1✔
29
                        return "", fmt.Errorf("reading stdin: %w", err)
×
UNCOV
30
                }
×
31
                return strings.TrimRight(string(b), "\r\n"), nil
1✔
32
        }
33
        return input.Password(prompt + ": ")
×
34
}
35

36
// confirmTTY returns true if the user confirms y/Y at an interactive prompt.
37
// On a non-TTY it returns false without reading anything; callers must require
38
// an explicit --yes flag for non-interactive use.
39
func confirmTTY(prompt string) bool {
1✔
40
        if !term.IsTerminal(int(os.Stdin.Fd())) {
2✔
41
                return false
1✔
42
        }
1✔
UNCOV
43
        ok, _ := input.Confirm(prompt)
×
UNCOV
44
        return ok
×
45
}
46

47
// hasPipedStdin reports whether stdin appears to be a pipe rather than a TTY.
48
// Used by opt-in secret prompts to distinguish "user piped a value" from
49
// "user is at an interactive shell with no flag set".
50
func hasPipedStdin() bool {
1✔
51
        return !term.IsTerminal(int(os.Stdin.Fd()))
1✔
52
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc