Skip to content

fix(ci): install chezmoi in bash tests workflow job#129

Merged
kurone-kito merged 2 commits into
masterfrom
fix/idd-109-chezmoi-ci
May 18, 2026
Merged

fix(ci): install chezmoi in bash tests workflow job#129
kurone-kito merged 2 commits into
masterfrom
fix/idd-109-chezmoi-ci

Conversation

@kurone-kito
Copy link
Copy Markdown
Owner

Summary

  • Adds two CI steps to .github/workflows/test.yml's bash-tests job: install chezmoi into $HOME/.local/bin via the official one-shot installer, then append that directory to $GITHUB_PATH so Run bats tests resolves the binary on PATH.
  • The bats suite invokes chezmoi execute-template indirectly via per-test _render() helpers (tests/bash/signing-resolve.bats:20-26, tests/bash/secret-deploy-manifest.bats:20-26). The ubuntu-latest runner did not preinstall chezmoi, so each _render call exited 127 and the failures were environmental, not behavioral. After this fix the suite should run end to end.
  • Post-merge follow-up (not in this commit): once master's Bash tests (bats) check is green, append Bash tests (bats) to required_status_checks.contexts via gh api PUT branches/master/protection. This is a settings-only update and can be done by the same session that watches the post-merge run.

Closes #109
Refs #107

Test plan

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/test.yml'))" parses cleanly.
  • tests/bash/helpers/bats-core/bin/bats tests/bash/ → 212 / 212 pass locally (where chezmoi is already on PATH via Homebrew).
  • PR CI: Bash tests (bats) should now complete green. This is the empirical verification the issue acceptance criteria require.
  • Post-merge: branch-protection update to add Bash tests (bats) to required checks. Will be applied by the same agent session that watches the post-merge master run.

Signing trail

Commit signed via git commit-ssh alias (SSH fallback path; GPG remained in category-P pinentry timeout state).

🤖 Generated with Claude Code

The bash-tests job in .github/workflows/test.yml has been failing
on every push since the bats suite started invoking `chezmoi
execute-template` indirectly through per-test _render() helpers
(see tests/bash/signing-resolve.bats:20-26 and
tests/bash/secret-deploy-manifest.bats:20-26). The ubuntu-latest
runner does not preinstall chezmoi, so each _render call exits
127 and the suite reports environmental rather than behavioral
failures.

Add two steps after the checkout that install chezmoi into
$HOME/.local/bin via the official one-shot installer and append
that directory to $GITHUB_PATH so `Run bats tests` can resolve
chezmoi on PATH. This matches the smallest-change recommendation
in #109 and keeps the workflow free of any tool-version pin
(tracked separately if a reviewer wants mise to pin chezmoi).

After this PR lands and master CI confirms a green Bash tests
(bats) run, the matching check should be promoted to a required
status check on the master branch protection by appending it to
`required_status_checks.contexts`.

Closes #109
Refs #107

fix(ci): install chezmoi in bash tests workflow job

The bash-tests job in .github/workflows/test.yml has been failing
on every push since the bats suite started invoking `chezmoi
execute-template` indirectly through per-test _render() helpers
(see tests/bash/signing-resolve.bats:20-26 and
tests/bash/secret-deploy-manifest.bats:20-26). The ubuntu-latest
runner does not preinstall chezmoi, so each _render call exits
127 and the suite reports environmental rather than behavioral
failures.

Add two steps after the checkout that install chezmoi into
$HOME/.local/bin via the official one-shot installer and append
that directory to $GITHUB_PATH so `Run bats tests` can resolve
chezmoi on PATH. This matches the smallest-change recommendation
in #109 and keeps the workflow free of any tool-version pin
(tracked separately if a reviewer wants mise to pin chezmoi).

After this PR lands and master CI confirms a green Bash tests
(bats) run, the matching check should be promoted to a required
status check on the master branch protection by appending it to
`required_status_checks.contexts`.

Closes #109
Refs #107
Copilot AI review requested due to automatic review settings May 18, 2026 15:24
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@kurone-kito has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 54 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 434d5501-b016-4bc9-8b59-236d7d1b0113

📥 Commits

Reviewing files that changed from the base of the PR and between 9dcb609 and 39933ba.

📒 Files selected for processing (2)
  • .cspell.config.yml
  • .github/workflows/test.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/idd-109-chezmoi-ci

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the Bash CI test environment by installing chezmoi before running the bats suite, aligning the workflow with tests that render chezmoi templates.

Changes:

  • Installs chezmoi in the bash-tests job.
  • Adds $HOME/.local/bin to PATH for subsequent CI steps.

Two follow-up fixes on the bash CI job after the first chezmoi
install attempt:

- tests/bash/75-worktrunk.bats:149,158,167 invoke `zsh -fc` to
  exercise the WorkTrunk shell-init renderer. The ubuntu-latest
  runner does not preinstall zsh, so each invocation exited 127
  even after the chezmoi step landed. Install zsh alongside
  chezmoi in the same step.

- cspell flagged `luac` (the Lua bytecode compiler used by the
  lua-syntax job at line 55 of the same workflow file). cspell-action
  scans changed files in full, so the pre-existing word came into
  scope once test.yml was touched. Add `luac` to
  .cspell.config.yml#words.

After these land, the PR's Bash tests (bats) and lint checks both
go green, which is the precondition for promoting Bash tests (bats)
to a required status check on master.

Refs #109

fix(ci): also install zsh; extend cspell dictionary for luac

Two follow-up fixes on the bash CI job after the first chezmoi
install attempt:

- tests/bash/75-worktrunk.bats:149,158,167 invoke `zsh -fc` to
  exercise the WorkTrunk shell-init renderer. The ubuntu-latest
  runner does not preinstall zsh, so each invocation exited 127
  even after the chezmoi step landed. Install zsh alongside
  chezmoi in the same step.

- cspell flagged `luac` (the Lua bytecode compiler used by the
  lua-syntax job at line 55 of the same workflow file). cspell-action
  scans changed files in full, so the pre-existing word came into
  scope once test.yml was touched. Add `luac` to
  .cspell.config.yml#words.

After these land, the PR's Bash tests (bats) and lint checks both
go green, which is the precondition for promoting Bash tests (bats)
to a required status check on master.

Refs #109
@kurone-kito kurone-kito merged commit e4b8ca9 into master May 18, 2026
7 of 9 checks passed
@kurone-kito kurone-kito deleted the fix/idd-109-chezmoi-ci branch May 18, 2026 15:29
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.

fix(ci): install chezmoi in Bash tests CI job and promote to required

2 participants