Skip to content

feat: default to prod, fix cross-platform config writes, support Windows installs - #54

Merged
jpage-godaddy merged 8 commits into
rust-portfrom
fix/windows-and-prod-default
Jun 9, 2026
Merged

jpage-godaddy merged 8 commits into
rust-portfrom
fix/windows-and-prod-default

Conversation

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

Summary

Fixes issues surfaced while testing the gddy alpha on Windows (WSL build verified locally: Windows Credential Manager token storage works, prod default works).

  • Default environment ote → prod everywhere. Adds a DEFAULT_ENV const (rust/src/env/mod.rs), updates the global --env flag default (rust/src/main.rs), and flips the api_url_for fallback so prod is the consistent default. Breaking change from the legacy CLI — intentional.
  • Cross-platform .gdenv: resolved via dirs::home_dir() (%USERPROFILE% on Windows) instead of reading $HOME with a /tmp fallback. Fixes gddy env set failing on Windows with failed to write ~/.gdenv: ... (os error 3).
  • env set <ENV> arg fix: the positional shared arg id "env" with the global --env flag, so env set ote was ignoring its argument and writing the flag default. Renamed the positional to id environment.
  • Windows install support: install.sh now detects Git Bash / MSYS2 / Cygwin and installs the x86_64-pc-windows-msvc gddy.exe from the .zip (via unzip or PowerShell Expand-Archive). Adds install.ps1, a native PowerShell installer, published as a release asset (rust-port-alpha.yaml) and documented in the README.
  • Ignores Claude Code per-machine runtime state under .claude/.

Verification

  • cargo fmt, cargo clippy -- -D warnings, cargo test (114 passing), cargo build — all green on Linux.
  • Fresh gddy env get / env info report prod; env set prod / env set ote write .gdenv correctly.
  • Cross-compiled x86_64-pc-windows-msvc locally (cargo-xwin); the resulting gddy.exe runs on Windows, defaults to prod, writes %USERPROFILE%\.gdenv without error, and stores credentials in Windows Credential Manager.

🤖 Generated with Claude Code

…ows installs

Addresses issues found while testing the gddy alpha on Windows:

- Default environment is now `prod` everywhere (was `ote`). Adds a
  `DEFAULT_ENV` const and flips the `api_url_for` fallback so prod is the
  consistent default.
- `.gdenv` is resolved via `dirs::home_dir()` (`%USERPROFILE%` on Windows)
  instead of `$HOME`-with-`/tmp`-fallback, fixing `gddy env set` failing with
  "os error 3" on Windows.
- `env set <ENV>` positional no longer collides with the global `--env` flag
  (shared arg id `env`), so it correctly honors its argument. Renamed the
  positional to id `environment`.
- install.sh now supports Git Bash / MSYS2 / Cygwin: it fetches the
  x86_64-pc-windows-msvc .zip and extracts gddy.exe (unzip or PowerShell
  Expand-Archive).
- Adds install.ps1, a native PowerShell installer, published as a release
  asset and documented in the README.
- Ignores Claude Code local runtime state under .claude/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Updates the Rust-port gddy CLI to default to prod, fixes cross-platform .gdenv handling and env set argument parsing, and adds Windows installation support (Git Bash/MSYS/Cygwin via install.sh plus native PowerShell via new install.ps1), with corresponding release workflow and docs updates.

Changes:

  • Default environment switched to prod via a shared DEFAULT_ENV constant and updated fallbacks.
  • .gdenv path resolution made cross-platform using dirs::home_dir(), and env set <ENV> positional arg no longer collides with global --env.
  • Windows install support added: install.sh gains Windows ZIP extraction/install logic; new install.ps1 added; workflow and README updated accordingly.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rust/src/main.rs Switches global --env default to use DEFAULT_ENV (now prod).
rust/src/env/mod.rs Adds DEFAULT_ENV, uses dirs::home_dir() for .gdenv, fixes env set arg id collision, updates prod/ote URL fallback behavior.
rust/Cargo.toml Adds dirs dependency for cross-platform home directory resolution.
rust/Cargo.lock Locks new dirs dependency and transitive updates.
README.md Documents Windows install via PowerShell and clarifies installer support.
install.sh Adds Windows (Git Bash/MSYS/Cygwin) support: platform detection, ZIP extraction, installs gddy.exe.
install.ps1 New native PowerShell installer that downloads, checksum-verifies, installs, and updates user PATH.
.gitignore Ignores Claude Code per-machine runtime state files.
.github/workflows/rust-port-alpha.yaml Publishes install.ps1 alongside existing release assets.

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

Comment thread rust/src/main.rs Resolved
Comment thread rust/src/env/mod.rs Resolved
Comment thread install.sh Resolved
Comment thread install.ps1 Resolved
Addresses Copilot review on PR #54:
- get_env() now ignores empty or unrecognized .gdenv values so a corrupted /
  hand-edited file falls back to DEFAULT_ENV instead of propagating an unknown
  environment.
- install.sh checks for `tar` before extracting the unix archive (the preflight
  no longer hard-requires tar, since the Windows path uses unzip/PowerShell).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Comment thread install.sh Resolved
Comment thread install.ps1 Resolved
…exit)

Addresses the second Copilot review pass on PR #54:
- install.sh: escape `'` as `''` before embedding the extraction paths in the
  PowerShell single-quoted Expand-Archive command, so a path containing an
  apostrophe can't break out of the string literal.
- install.ps1: `Die` now uses `throw` instead of `exit 1`. The documented
  install is `irm ... | iex`, which runs in the caller's session, where `exit`
  would close their terminal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread rust/src/env/mod.rs Resolved
Addresses the third Copilot review pass on PR #54: set_env now wraps the
std::fs::write error to prepend the resolved (platform-dependent) path, so a
failure surfaces an actionable message instead of a bare "os error N".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/rust-port-alpha.yaml Resolved
Addresses the fourth Copilot review pass on PR #54: the autogenerated
alpha-notes.md now lists the Windows PowerShell one-liner (irm ... | iex)
alongside the existing curl|bash one-liner, matching the README and the newly
published install.ps1 asset.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread install.sh Resolved
Addresses the fifth Copilot review pass on PR #54: under Git Bash/MSYS2/Cygwin,
/usr/local/bin is usually not user-writable and there's no sudo, so the default
install would fail. When OS=windows and --prefix isn't given, default to
%LOCALAPPDATA%\Programs\gddy (matching install.ps1), falling back to $HOME/bin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.

Comment thread install.ps1 Resolved
Comment thread install.sh Resolved
Addresses the sixth Copilot review pass on PR #54:
- install.ps1: resolve the default prefix in the body (not the param default),
  falling back LOCALAPPDATA -> USERPROFILE and erroring via Die if both are
  unset, instead of throwing inside Join-Path before Die is usable.
- install.sh: guard the $HOME fallback under `set -u` (LOCALAPPDATA -> HOME ->
  actionable error) instead of an unbound-variable crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread install.sh Resolved
Addresses the seventh Copilot review pass on PR #54: the --help text now
contrasts the macOS/Linux default (/usr/local/bin) with the Windows default
(%LOCALAPPDATA%\Programs\gddy).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jpage-godaddy
jpage-godaddy requested a review from Copilot June 6, 2026 02:23

Copilot AI 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

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

@jpage-godaddy

Copy link
Copy Markdown
Collaborator Author

No approvals 😞. Merging anyway. Hopefully get better participation in the future so we can more quickly.

@jpage-godaddy
jpage-godaddy merged commit 43ad0ad into rust-port Jun 9, 2026
2 checks passed
@jpage-godaddy
jpage-godaddy deleted the fix/windows-and-prod-default branch June 9, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants