Skip to content

fix(installer): nix-PATH hint, completions error surfacing, dotnet-sdk/landing banners#19

Merged
WomB0ComB0 merged 3 commits intomainfrom
fix/install-ux-nix-path-completions
Apr 19, 2026
Merged

fix(installer): nix-PATH hint, completions error surfacing, dotnet-sdk/landing banners#19
WomB0ComB0 merged 3 commits intomainfrom
fix/install-ux-nix-path-completions

Conversation

@WomB0ComB0
Copy link
Copy Markdown
Member

@WomB0ComB0 WomB0ComB0 commented Apr 19, 2026

Context

Live install feedback exposed three friction points the installer should soften:

  1. `nix: command not found` in new terminals after install. Determinate wires the system profile, but the `curl | sh` pipeline can't mutate the caller's env. Users who followed our "Get started" footer (`cd … && nix develop`) in the SAME terminal that launched the installer hit an immediate `bash: command not found: nix`.
  2. Bash completions failed silently. The warning was `Failed to generate bash completions — skip` with no reason; `2>/dev/null` was swallowing the real error. Actual cause: the currently-released `resq-cli-v0.2.6` predates the `completions` subcommand (shipped in the PR#74 Stage 1 merge); v0.2.7 will have it.
  3. `print_repo_info` / `Show-RepoInfo` had no `dotnet-sdk` or `landing` case. Two of the eight repos produced no "What's included" banner after a successful install.

Changes

  • install.sh + install.ps1: track `NIX_JUST_INSTALLED` / `$script:NixJustInstalled` inside `install_nix` / `Install-Nix`. When true, `Main` emits a yellow note before "Get started" telling the user to open a new terminal or source the daemon profile, with a fish-specific hint.
  • install.sh: `install_resq_completions` now redirects stderr to a tempfile and surfaces the first line in the warning on failure. Empty-output case explicitly calls out that the installed binary may predate the subcommand. PowerShell counterpart already captured `$_` in `catch`.
  • install.sh + install.ps1: `print_repo_info` / `Show-RepoInfo` gains branches for `dotnet-sdk` (.NET 9 + Protobuf) and `landing` (Bun + Next.js 15 + Tailwind).

Test plan

  • `sh -n`, `bash -n`, `shellcheck install.sh` clean
  • Fresh host with no Nix: curl|sh → `Note: Nix was just installed…` appears before "Get started"
  • Host that already had Nix: note is suppressed
  • `REPO=dotnet-sdk` / `REPO=landing` → proper banner
  • Completions failure prints a reason instead of `— skip`

Follow-up

Cut `resq-cli-v0.2.7` (merges Stage 1 + 3 into a release) so fresh installs get the `completions` subcommand and tab-completion lights up end-to-end.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added guidance after Nix installation explaining how to refresh PATH in new shells
    • Expanded repository information with "What's included" details for additional repositories, including tooling lists and build/dev commands
  • Bug Fixes

    • Improved error handling and reporting for completion generation with better diagnostic messages

…k/landing banners

User feedback from a live install surfaced three friction points:

1. **\`nix: command not found\` in new terminals after install.** Determinate
   wires the system profile, but the curl|sh parent process can't mutate
   the caller's env. When the "Get started" footer told the user to
   \`cd ... && nix develop\` in the SAME terminal that launched curl|sh,
   they hit the missing-PATH error because only our script's subshell had
   nix sourced.

   Track whether we installed Nix this run (\$NIX_JUST_INSTALLED / in PS
   \$script:NixJustInstalled) and emit a prominent note before "Get started"
   telling the user to either open a new terminal or source the daemon
   profile script explicitly. Includes a fish-specific hint.

2. **Bash completions failed silently** with \`Failed to generate bash
   completions — skip\` and no reason. The redirect was \`2>/dev/null\`.
   Now we capture stderr to a tempfile and echo the first line into the
   warning when generation fails; also special-case empty-output to tell
   the user the binary likely predates the \`completions\` subcommand
   (resq-cli-v0.2.7+ has it). PowerShell variant already captured \$_.

3. **\`print_repo_info\` had no \`dotnet-sdk\` or \`landing\` case.**
   Users of those repos got no "What's included" banner. Added both
   (dotnet-sdk: .NET 9 SDK + Protobuf; landing: Bun + Next.js 15 +
   Tailwind). PowerShell Show-RepoInfo mirrored.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 19, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Installation scripts for both PowerShell and shell environments have been enhanced with improved Nix installation tracking, user-facing PATH notifications, robust error handling for completion generation, and expanded repository information display.

Changes

Cohort / File(s) Summary
Nix Installation UX & PATH Notifications
install.ps1, install.sh
Both scripts now track Nix installation state via a flag ($script:NixJustInstalled / NIX_JUST_INSTALLED). After setup completes, a prominent note informs users that nix may not be on PATH in new terminals, with shell-specific instructions for resolving this (including fish-specific syntax).
Completion Generation Robustness
install.sh
install_resq_completions() now captures stderr to a temporary file and reports failures using the first stderr line when available. Distinguishes between empty output (likely pre-v0.2.7 versions) and actual error output, with cleanup of temporary files on failure.
Repo Information Expansion
install.ps1, install.sh
Show-RepoInfo and print_repo_info() now include "What's included" sections for dotnet-sdk and landing repositories, listing tooling and example build/dev commands.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A flag hops through the script, tracking Nix with care,
PATH notes now bloom for users everywhere,
Stderr whispers caught in temp files tight,
dotnet-sdk and landing shine in light,
Shell scripts dance, both swift and bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes all three main changes: Nix PATH handling improvement, completions error surfacing, and new repo info banners for dotnet-sdk and landing.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/install-ux-nix-path-completions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the installation scripts for both PowerShell and Shell to track whether Nix was installed during the current session, providing a notification to the user if a shell restart or manual profile sourcing is needed. Additionally, it adds project-specific information for .NET SDK and landing repositories. In install.sh, the resq completion generation now captures stderr to provide more descriptive error messages. Review feedback suggests replacing hardcoded temporary file paths in install.sh with mktemp to improve reliability and security.

Comment thread install.sh Outdated
Comment thread install.sh
Applies gemini's review comments on PR #19 (lines 472 and 479).

Swap /tmp/resq-compl-err.$$ for mktemp so TMPDIR is honoured and we
can't collide with a stale file from a different user on a shared
host. Same variable threads through both the success and failure
branches for cleanup and stderr-read.
@WomB0ComB0
Copy link
Copy Markdown
Member Author

Resolved gemini's two review points (both about the same fix):

  • Swapped the hardcoded /tmp/resq-compl-err.$$ for a $(mktemp) tempfile — $TMPDIR is honoured and we can't collide with a stale file from a different user on a shared host.
  • The same variable ($_err_tmp) threads through both the success and failure branches, so cleanup and the head -n 1 read reference the same path consistently.

Rebased onto the main-merge commit before pushing so the PR stays a clean fast-forward.

@WomB0ComB0 WomB0ComB0 merged commit b1be9be into main Apr 19, 2026
15 of 16 checks passed
@WomB0ComB0 WomB0ComB0 deleted the fix/install-ux-nix-path-completions branch April 19, 2026 07:23
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.

1 participant