Skip to content

Conversation

@aabccd021
Copy link
Member

Following shows how ssh store URL looks before and after fix when flag --ssh-store-setting foo bar was used.

before:

ssh://root@localhost?compress=truecompress=truefoo=bar&

after

ssh://root@localhost?compress=true&foo=bar

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Walkthrough

This change modifies the construction of the sshStoreSettings variable in the nixos-anywhere shell script when processing --ssh-store-setting arguments. The previous implementation appended new key/value pairs by duplicating the entire prior content, whereas the new implementation appends only the new key/value pair with a leading ampersand separator. This alters the string concatenation logic for SSH store settings, changing how the final URI is formatted.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Fix: Update sshStoreSettings variable to append key-value pairs correctly" directly summarizes the main change in the changeset. It clearly identifies that this is a fix to the sshStoreSettings variable's key-value pair appending logic, which matches the core modification in src/nixos-anywhere.sh. The title is concise, uses a meaningful prefix ("Fix:"), and is specific enough that a teammate scanning the history would understand the primary change relates to correcting SSH store settings concatenation.
Description Check ✅ Passed The pull request description is directly related to the changeset and provides concrete before/after examples demonstrating the issue being fixed. It explains how the --ssh-store-setting foo bar flag was producing a malformed SSH URL with duplicated query parameters (e.g., "compress=truecompress=truefoo=bar&") and shows how the fix corrects this to properly formatted parameters (e.g., "compress=true&foo=bar"). This description effectively communicates the problem and its resolution, making it relatable to the actual code change in sshStoreSettings handling.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25d23ef and 313f16a.

📒 Files selected for processing (1)
  • src/nixos-anywhere.sh (1 hunks)
🔇 Additional comments (1)
src/nixos-anywhere.sh (1)

281-288: Fix correctly resolves URL parameter concatenation.

The change properly addresses the malformed URL issue. By appending only &$key=$value instead of duplicating the entire prior content, URL parameters now form correctly with proper ampersand separators:

  • Before: compress=truecompress=truefoo=bar& (duplicated, malformed)
  • After: compress=true&foo=bar (correct)

Shift count is correct for a two-argument flag (3 total shifts), consistent with other multi-arg handlers in the script (e.g., --store-paths). Multiple consecutive --ssh-store-setting calls will correctly append additional parameters.


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.

@Enzime Enzime added this pull request to the merge queue Nov 1, 2025
Merged via the queue into nix-community:main with commit 3df5f34 Nov 1, 2025
4 checks passed
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