Add install-nixie shared action - #360
Conversation
Install pinned Nixie and Merman CLI releases through a reusable composite action. Prefer `cargo binstall` for Merman while preserving a locked `cargo install` fallback for runners without cargo-binstall. Document the action contract and cover both installation paths and missing prerequisite failures with focused behavioural tests.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary
Testing
WalkthroughAdds the ChangesInstall Nixie action
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions runner
participant Action as install-nixie action
participant Cargo as cargo
participant UV as uv
Runner->>Action: Invoke action with version inputs
Action->>Cargo: Check prerequisites
Action->>UV: Check prerequisites
Action->>Cargo: Install merman-cli using binstall or locked install
Action->>UV: Install nixie-cli with the selected Python version
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (17 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Keep pytest-cov output from dirtying the working tree when repository gates or stop hooks generate the `.coverage` SQLite database.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/actions/install-nixie/action.yml:
- Line 44: After the uv tool installation command in the action’s install step,
append the directory returned by uv tool dir --bin to GITHUB_PATH so subsequent
workflow steps can locate nixie; update the associated behavioral test to assert
that this directory is exported.
In @.github/actions/install-nixie/README.md:
- Around line 25-44: Add a repository-local usage example to the install-nixie
README alongside the published-action example, using the required uses:
./.github/actions/install-nixie@v1 syntax. Keep the existing published-action
and version-override examples unchanged.
In @.github/actions/install-nixie/tests/test_action.py:
- Around line 85-92: Update the subprocess.run invocation in the test helper to
set check=False explicitly. Preserve the existing non-zero return-code
assertions and all other subprocess options unchanged.
- Around line 77-84: Update the test setup around the environment passed to the
action to parameterize injected Nixie, Merman, and Python versions with
non-default values. Assert end-to-end that each parameterized value is
propagated to both installer commands, while retaining coverage for the defaults
and validating the declared action input/output round trip.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 15359d58-0679-40d6-ae9b-d53d7d0c87d0
📒 Files selected for processing (6)
.github/actions/install-nixie/CHANGELOG.md.github/actions/install-nixie/README.md.github/actions/install-nixie/action.yml.github/actions/install-nixie/tests/test_action.py.gitignoreREADME.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
leynos/polythene(auto-detected)
| cargo install --locked merman-cli --version "=${MERMAN_VERSION}" | ||
| fi | ||
|
|
||
| uv tool install --python "${PYTHON_VERSION}" "nixie-cli==${NIXIE_VERSION}" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Export the Nixie executable directory to subsequent workflow steps.
Append $(uv tool dir --bin) to $GITHUB_PATH after installation, then extend the behavioural test to assert the exported entry. uv tool install uses a configurable tool-bin directory, while $GITHUB_PATH is the GitHub Actions mechanism that exposes directories to later steps; without this, the documented nixie --renderer merman command fails on runners where that directory is absent from PATH. (docs.astral.sh)
uv tool install --python "${PYTHON_VERSION}" "nixie-cli==${NIXIE_VERSION}"
+ printf '%s\n' "$(uv tool dir --bin)" >> "$GITHUB_PATH"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/actions/install-nixie/action.yml at line 44, After the uv tool
installation command in the action’s install step, append the directory returned
by uv tool dir --bin to GITHUB_PATH so subsequent workflow steps can locate
nixie; update the associated behavioral test to assert that this directory is
exported.
Source: Linked repositories
| ```yaml | ||
| - name: Set up Rust | ||
| uses: leynos/shared-actions/.github/actions/setup-rust@v1 | ||
|
|
||
| - name: Install Nixie | ||
| uses: leynos/shared-actions/.github/actions/install-nixie@v1 | ||
|
|
||
| - name: Validate Mermaid diagrams | ||
| run: nixie --renderer merman | ||
| ``` | ||
|
|
||
| To override the pinned versions: | ||
|
|
||
| ```yaml | ||
| - uses: leynos/shared-actions/.github/actions/install-nixie@v1 | ||
| with: | ||
| nixie-version: "1.1.0" | ||
| merman-version: "0.7.0" | ||
| python-version: "3.14" | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the required repository-local usage example.
Add uses: ./.github/actions/install-nixie@v1 alongside the published-action example.
Triage: [type:docstyle]
As per coding guidelines, “Each action README must include … a usage example using uses: ./.github/actions/<name>@<major>.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/actions/install-nixie/README.md around lines 25 - 44, Add a
repository-local usage example to the install-nixie README alongside the
published-action example, using the required uses:
./.github/actions/install-nixie@v1 syntax. Keep the existing published-action
and version-override examples unchanged.
Sources: Coding guidelines, Path instructions
| env = { | ||
| **os.environ, | ||
| "CALLS_PATH": calls_path.as_posix(), | ||
| "MERMAN_VERSION": "0.7.0", | ||
| "NIXIE_VERSION": "1.1.0", | ||
| "PATH": stubs_dir.as_posix(), | ||
| "PYTHON_VERSION": "3.14", | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Test overridden input pins end-to-end.
Parameterize the injected Nixie, Merman, and Python versions, then assert that non-default values reach both installer commands. Current tests only exercise defaults, so configurable input propagation is unprotected.
As per coding guidelines, “Contract tests must validate that declared action inputs and outputs round-trip correctly.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/actions/install-nixie/tests/test_action.py around lines 77 - 84,
Update the test setup around the environment passed to the action to
parameterize injected Nixie, Merman, and Python versions with non-default
values. Assert end-to-end that each parameterized value is propagated to both
installer commands, while retaining coverage for the defaults and validating the
declared action input/output round trip.
Source: Coding guidelines
| return subprocess.run( # noqa: S603,TID251 - exercise the bash fragment. | ||
| [bash, "-c", _install_script()], | ||
| cwd=tmp_path, | ||
| env=env, | ||
| capture_output=True, | ||
| text=True, | ||
| timeout=30, | ||
| ) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Set check=False explicitly.
Preserve the intentional non-zero return-code assertions while satisfying Ruff’s PLW1510 finding.
🧰 Tools
🪛 Ruff (0.15.21)
[warning] 85-85: subprocess.run without explicit check argument
Add explicit check=False
(PLW1510)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/actions/install-nixie/tests/test_action.py around lines 85 - 92,
Update the subprocess.run invocation in the test helper to set check=False
explicitly. Preserve the existing non-zero return-code assertions and all other
subprocess options unchanged.
Source: Linters/SAST tools
Summary
install-nixiecomposite action with configurable pins for Nixie CLI, Merman CLI, and Pythoncargo binstallpackages for Merman and fall back to an exact lockedcargo installsource build when cargo-binstall is unavailable.coveragedatabase so validation and stop hooks do not dirty the working treeReview walkthrough
.github/actions/install-nixie/action.ymlfor the public inputs and installation contract..github/actions/install-nixie/tests/test_action.pyfor both Cargo paths and prerequisite failure coverage.Validation
make check-fmt: passed.make typecheck: passed.make lint: passed.make markdownlint: passed.make nixie: passed.git diff --check: passed.install-nixietests passed, including after the coverage ignore fix.make testrun reported 950 passed, 14 skipped, and 46 setup errors confined to untouchedrelease-to-pypi-uvtests resolving action scripts under the repository-rootscripts/directory instead of their action directory.References