Repository navigation
fix(ci): unbreak shell-inline-check on main #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
260de21
fix(ci): make shell-inline-check iterate lines in order and drop dolt…
claude 0c50928
test(dolt): add spec and coverage entry for dolt/start.sh
claude f5d833f
fix(dolt): stringify startScript derivation for launchd ProgramArguments
claude dc7a8c0
fix(fish-test): drop stray 'test' prefix in tmux bootstrap assertions
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
| # @beadsDir@ and @dolt@ are substituted by pkgs.replaceVars. | ||
| set -euo pipefail | ||
|
|
||
| mkdir -p "@beadsDir@" | ||
|
|
||
| if [ -d "@beadsDir@/dolt" ] && [ ! -L "@beadsDir@/dolt" ]; then | ||
| if [ -e "@beadsDir@/df" ]; then | ||
| echo "Refusing to migrate @beadsDir@/dolt because @beadsDir@/df already exists" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| mv -f "@beadsDir@/dolt" "@beadsDir@/df" | ||
| fi | ||
|
|
||
| if [ -d "@beadsDir@/df" ]; then | ||
| ln -sfn df "@beadsDir@/dolt" | ||
| fi | ||
|
|
||
| exec "@dolt@/bin/dolt" sql-server \ | ||
| -H 127.0.0.1 \ | ||
| -P 3307 \ | ||
| --data-dir "@beadsDir@" \ | ||
| --loglevel info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #!/usr/bin/env bash | ||
| # shellcheck disable=SC2329 | ||
|
|
||
| Describe 'home-manager/services/dolt/start.sh' | ||
| SCRIPT="$PWD/home-manager/services/dolt/start.sh" | ||
|
|
||
| Describe 'script properties' | ||
| It 'uses bash shebang' | ||
| When run bash -c "head -1 '$SCRIPT'" | ||
| The output should include '#!/usr/bin/env bash' | ||
| End | ||
|
|
||
| It 'uses strict mode' | ||
| When run bash -c "grep 'set -euo pipefail' '$SCRIPT'" | ||
| The output should include 'set -euo pipefail' | ||
| End | ||
|
|
||
| It 'passes bash syntax check after stripping placeholders' | ||
| When run bash -c "sed 's|@[a-z_]*@|/usr|g' '$SCRIPT' | bash -n" | ||
|
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
|
||
| The status should be success | ||
| End | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| End | ||
|
|
||
| Describe 'placeholder substitutions' | ||
| It 'references @beadsDir@' | ||
| When run bash -c "grep '@beadsDir@' '$SCRIPT'" | ||
| The output should include '@beadsDir@' | ||
| End | ||
|
|
||
| It 'references @dolt@' | ||
| When run bash -c "grep '@dolt@' '$SCRIPT'" | ||
| The output should include '@dolt@' | ||
| End | ||
| End | ||
|
|
||
| Describe 'dolt migration behavior' | ||
| It 'migrates legacy dolt directory to df' | ||
| When run bash -c "grep 'mv -f' '$SCRIPT'" | ||
| The output should include 'mv -f' | ||
| End | ||
|
|
||
| It 'symlinks dolt to df for backwards compatibility' | ||
| When run bash -c "grep 'ln -sfn df' '$SCRIPT'" | ||
| The output should include 'ln -sfn df' | ||
| End | ||
|
|
||
| It 'refuses to overwrite an existing df directory' | ||
| When run bash -c "grep 'Refusing to migrate' '$SCRIPT'" | ||
| The output should include 'Refusing to migrate' | ||
| End | ||
| End | ||
|
|
||
| Describe 'sql-server invocation' | ||
| It 'binds to localhost' | ||
| When run bash -c "grep -- '-H 127.0.0.1' '$SCRIPT'" | ||
| The output should include '-H 127.0.0.1' | ||
| End | ||
|
|
||
| It 'listens on port 3307' | ||
| When run bash -c "grep -- '-P 3307' '$SCRIPT'" | ||
| The output should include '-P 3307' | ||
| End | ||
|
|
||
| It 'points --data-dir at the beads directory' | ||
| When run bash -c "grep -- '--data-dir' '$SCRIPT'" | ||
| The output should include '--data-dir' | ||
| End | ||
| End | ||
|
|
||
| End | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation uses
builtins.readFileon a derivation produced bypkgs.replaceVars, which is an Import From Derivation (IFD). IFD can cause performance issues during Nix evaluation because it forces a build to happen before evaluation can continue.Since this follows an existing pattern in the repository, it may be acceptable, but a more efficient alternative would be to use
pkgs.substituteAllto create the script derivation directly, avoiding the need to read the file back into Nix memory.