Fixes GitHub Actions workflows for package automation#213
Conversation
Fixes ModuleNotFoundError by using nix-shell to provide Python with the requests package. The update scripts require requests to make GitHub API calls, but the system Python on GitHub Actions runners doesn't have this module installed. Changes: - Updated all package update workflows to use nix-shell - Ensures Python scripts have access to the requests module - Applies to: update-vimr, update-kots, update-replicated, update-sbctl, check-package-status 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
VimR is a macOS application bundle (.app) that installs to Applications/, not a command-line binary. The test script was failing because it tried to find a 'vimr' binary in PATH. Changes: - Added VimR case mapping with empty BINARY_NAME - Skip binary availability check when BINARY_NAME is empty - Existing app bundle verification in platform-specific checks now runs as the primary test for VimR This allows the VimR update workflow to proceed past the test step. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The home-manager rebuild test was failing due to flake.nix using builtins.currentSystem in pure evaluation mode. This test is not necessary for validating the VimR package update - the package-specific test is sufficient. Changes: - Removed "Test home-manager rebuild" step - Updated PR body template to reflect simplified validation - Package builds and installation tests are sufficient validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The Python update script checks GitHub API for new releases but wasn't receiving the GITHUB_TOKEN, causing it to hit rate limits quickly (60 requests/hour for unauthenticated requests). Changes: - Added GITHUB_TOKEN env var to "Check for VimR updates" step - Uses secrets.GITHUB_TOKEN which is automatically available in workflows - Increases rate limit from 60/hour to 5000/hour 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Per user feedback that "we don't need to test the home manager configuration, it's sufficient to test the package", this removes the home-manager rebuild test step from the remaining update workflows (KOTS, Replicated, and sbctl) for consistency with the VimR workflow. This test was causing failures due to builtins.currentSystem not being available in pure evaluation mode, and testing the package directly is sufficient validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
## 🔄 Automated Package Update: VimR This is an automated update of the VimR package. ### Changes - **Previous version**: v0.58.0-20251013.211150 - **New version**: v0.59.0-20251103.194245 - **Release notes**: https://github.com/qvacua/vimr/releases/tag/v0.59.0-20251103.194245 ### Validation ✅ Package builds successfully ✅ Installation test passed on macOS ### Next Steps - Review the changes and ensure they look correct - Test the updated package in your environment - Merge when ready --- 🤖 *This PR was created automatically by the VimR update workflow* Co-authored-by: crdant <50028+crdant@users.noreply.github.com>
WalkthroughAdds app-bundle handling to the package test script, replaces direct Python calls in several GitHub workflows with nix-shell invocations (python3 + requests), removes home-manager rebuild test steps from update workflows, and bumps VimR to v0.59.0 with updated build and sha256. Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Workflow
participant nix as nix-shell
participant Script as test-package.sh
participant Package as Package (vimr or other)
Workflow->>nix: run python checks via nix-shell (python3 + requests)
Note right of nix `#d6f5d6`: ensures dependencies available
nix->>Workflow: exit / output
Workflow->>Script: invoke package tests
Script->>Script: decide package type
alt app bundle (vimr)
Script->>Package: skip CLI binary checks
Script->>Package: verify .app presence (macOS)
else CLI binary
Script->>Package: check BINARY_NAME exists
Script->>Package: try --version / version / --help
end
Script->>Workflow: report pass/fail
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (5)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.github/scripts/test-package.sh(2 hunks).github/workflows/check-package-status.yml(1 hunks).github/workflows/update-kots.yml(5 hunks).github/workflows/update-replicated.yml(5 hunks).github/workflows/update-sbctl.yml(3 hunks).github/workflows/update-vimr.yml(2 hunks)pkgs/vimr/default.nix(1 hunks)
🔇 Additional comments (17)
.github/workflows/update-vimr.yml (3)
26-27: LGTM! Authentication added to prevent rate limiting.The GITHUB_TOKEN environment variable properly provides authentication for GitHub API calls in the update script.
29-29: LGTM! Python dependencies properly provisioned.Using nix-shell to provide Python and the requests package ensures dependencies are available in the CI environment.
54-55: LGTM! Validation text updated correctly.The PR validation section now accurately reflects the removed home-manager test step.
.github/workflows/update-replicated.yml (2)
28-28: LGTM! Python dependencies consistently provisioned.All Python script invocations properly use nix-shell to provide python3 and python3Packages.requests.
Also applies to: 55-55, 86-86
153-154: LGTM! PR validation messages updated.Validation text correctly reflects the current test coverage without home-manager tests.
.github/workflows/update-sbctl.yml (3)
30-33: Same GITHUB_TOKEN concern as in update-replicated.yml.Similar to the comment on update-replicated.yml lines 25-28, verify if GITHUB_TOKEN should be added here to avoid rate limits when checking for updates.
33-33: LGTM! Python dependencies properly provisioned.Using nix-shell to provide Python and the requests package ensures dependencies are available.
101-103: LGTM! Validation text updated correctly.The PR body now accurately reflects the test coverage without home-manager tests.
.github/workflows/update-kots.yml (3)
25-28: Same GITHUB_TOKEN concern as in update-replicated.yml.Similar to the comment on update-replicated.yml lines 25-28, verify if GITHUB_TOKEN should be added here to avoid rate limits.
28-28: LGTM! Python dependencies consistently provisioned.All Python script invocations properly use nix-shell with python3 and python3Packages.requests.
Also applies to: 55-55, 86-86
153-154: LGTM! PR validation messages updated.Validation text correctly reflects current test coverage.
.github/scripts/test-package.sh (3)
28-31: LGTM! VimR properly identified as app bundle.Setting BINARY_NAME to empty for VimR correctly distinguishes it as a macOS app bundle rather than a CLI tool.
51-77: LGTM! Binary checks appropriately conditionalized.The logic now properly skips binary availability checks for app bundles while maintaining comprehensive testing for CLI tools. The enhanced version/help checking with multiple fallback commands is thorough.
80-95: LGTM! VimR app bundle validation implemented.The platform-specific checks for VimR properly verify:
- macOS-only constraint
- App bundle structure at the expected path
.github/workflows/check-package-status.yml (2)
26-26: LGTM! Python dependencies properly provisioned.Using nix-shell to provide Python and requests package ensures dependencies are available for the package status check script.
92-93: Note: GH_TOKEN vs GITHUB_TOKEN naming.This workflow uses
GH_TOKENwhile the update workflows useGITHUB_TOKEN. This is typically intentional—GH_TOKENis the expected environment variable for the GitHub CLI (ghcommand), while Python scripts using the GitHub API typically useGITHUB_TOKEN. Verify this aligns with the tools being used in each context.pkgs/vimr/default.nix (1)
5-6: LGTM! VimR updated to v0.59.0.The version, build timestamp, and sha256 hash are all updated consistently for the VimR v0.59.0 release, as indicated in the PR objectives.
Also applies to: 10-10
Adds GITHUB_TOKEN environment variable to the update check steps in update-kots.yml, update-replicated.yml, and update-sbctl.yml to ensure authenticated GitHub API requests (5000/hour limit) instead of unauthenticated requests (60/hour limit). This prevents rate limiting issues during package update checks, matching the fix previously applied to update-vimr.yml. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
TL;DR ----- Resolves multiple cascading failures in automated package update workflows by ensuring Python dependencies are available, properly handling VimR's app bundle architecture, authenticating GitHub API requests, and removing unnecessary validation steps. Details -------- The automated package update workflows were experiencing systematic failures that prevented successful execution of VimR and other package updates. These issues emerged after recent workflow enhancements and manifested as four distinct but interconnected problems that needed coordinated resolution. The Python update scripts require the `requests` library to interact with GitHub's API for checking release information, but GitHub Actions runners provide only a minimal Python installation without this module. This caused immediate `ModuleNotFoundError` failures in all package update workflows. The solution wraps Python invocations with `nix-shell -p python3 python3Packages.requests`, ensuring the required dependency is available through Nix rather than relying on system Python packages. VimR presents unique challenges as a macOS application bundle that installs to `Applications/VimR.app` rather than providing command-line binaries in PATH. The test script was attempting to verify a `vimr` binary existence and failed consistently. The fix adds VimR-specific handling with an empty `BINARY_NAME`, causing the script to skip binary availability checks while still validating the app bundle structure through platform-specific verification. GitHub API authentication was missing from the update check steps, causing workflows to hit the unauthenticated rate limit of 60 requests per hour almost immediately. By exposing `secrets.GITHUB_TOKEN` to the Python scripts through environment variables, workflows now operate under the authenticated limit of 5000 requests per hour, essentially eliminating rate limit concerns for normal operation. The home-manager rebuild tests were causing failures due to `builtins.currentSystem` being unavailable in pure evaluation mode, and represented unnecessary validation since package build tests already verify correctness. Per feedback that "we don't need to test the home manager configuration, it's sufficient to test the package", these steps were removed from all workflows, simplifying the validation pipeline and eliminating a fragile test dependency. All changes maintain consistency across the five affected workflows (VimR, KOTS, Replicated, sbctl, and package status checks), ensuring uniform behavior and maintainability. The VimR workflow successfully executed end-to-end after these fixes, automatically creating PR #211 to update VimR from v0.58.0 to v0.59.0, demonstrating that the automation pipeline now functions reliably. These fixes enable the automated package update system to operate without manual intervention, supporting the project's goal of keeping dependencies current through GitHub Actions automation rather than manual updates. Related: PR #211 (VimR v0.59.0 update created by fixed workflow) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * VimR upgraded to v0.59.0 * **Chores** * Enhanced package testing framework to support app bundle configurations * Improved post-build validation error handling and messaging * Streamlined CI/CD workflows for more reliable dependency provisioning * Simplified automated testing pipeline by removing redundant verification steps <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: crdant <50028+crdant@users.noreply.github.com>
TL;DR ----- Resolves multiple cascading failures in automated package update workflows by ensuring Python dependencies are available, properly handling VimR's app bundle architecture, authenticating GitHub API requests, and removing unnecessary validation steps. Details -------- The automated package update workflows were experiencing systematic failures that prevented successful execution of VimR and other package updates. These issues emerged after recent workflow enhancements and manifested as four distinct but interconnected problems that needed coordinated resolution. The Python update scripts require the `requests` library to interact with GitHub's API for checking release information, but GitHub Actions runners provide only a minimal Python installation without this module. This caused immediate `ModuleNotFoundError` failures in all package update workflows. The solution wraps Python invocations with `nix-shell -p python3 python3Packages.requests`, ensuring the required dependency is available through Nix rather than relying on system Python packages. VimR presents unique challenges as a macOS application bundle that installs to `Applications/VimR.app` rather than providing command-line binaries in PATH. The test script was attempting to verify a `vimr` binary existence and failed consistently. The fix adds VimR-specific handling with an empty `BINARY_NAME`, causing the script to skip binary availability checks while still validating the app bundle structure through platform-specific verification. GitHub API authentication was missing from the update check steps, causing workflows to hit the unauthenticated rate limit of 60 requests per hour almost immediately. By exposing `secrets.GITHUB_TOKEN` to the Python scripts through environment variables, workflows now operate under the authenticated limit of 5000 requests per hour, essentially eliminating rate limit concerns for normal operation. The home-manager rebuild tests were causing failures due to `builtins.currentSystem` being unavailable in pure evaluation mode, and represented unnecessary validation since package build tests already verify correctness. Per feedback that "we don't need to test the home manager configuration, it's sufficient to test the package", these steps were removed from all workflows, simplifying the validation pipeline and eliminating a fragile test dependency. All changes maintain consistency across the five affected workflows (VimR, KOTS, Replicated, sbctl, and package status checks), ensuring uniform behavior and maintainability. The VimR workflow successfully executed end-to-end after these fixes, automatically creating PR #211 to update VimR from v0.58.0 to v0.59.0, demonstrating that the automation pipeline now functions reliably. These fixes enable the automated package update system to operate without manual intervention, supporting the project's goal of keeping dependencies current through GitHub Actions automation rather than manual updates. Related: PR #211 (VimR v0.59.0 update created by fixed workflow) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * VimR upgraded to v0.59.0 * **Chores** * Enhanced package testing framework to support app bundle configurations * Improved post-build validation error handling and messaging * Streamlined CI/CD workflows for more reliable dependency provisioning * Simplified automated testing pipeline by removing redundant verification steps <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: crdant <50028+crdant@users.noreply.github.com>
TL;DR
Resolves multiple cascading failures in automated package update workflows by ensuring Python dependencies are available, properly handling VimR's app bundle architecture, authenticating GitHub API requests, and removing unnecessary validation steps.
Details
The automated package update workflows were experiencing systematic failures that prevented successful execution of VimR and other package updates. These issues emerged after recent workflow enhancements and manifested as four distinct but interconnected problems that needed coordinated resolution.
The Python update scripts require the
requestslibrary to interact with GitHub's API for checking release information, but GitHub Actions runners provide only a minimal Python installation without this module. This caused immediateModuleNotFoundErrorfailures in all package update workflows. The solution wraps Python invocations withnix-shell -p python3 python3Packages.requests, ensuring the required dependency is available through Nix rather than relying on system Python packages.VimR presents unique challenges as a macOS application bundle that installs to
Applications/VimR.apprather than providing command-line binaries in PATH. The test script was attempting to verify avimrbinary existence and failed consistently. The fix adds VimR-specific handling with an emptyBINARY_NAME, causing the script to skip binary availability checks while still validating the app bundle structure through platform-specific verification.GitHub API authentication was missing from the update check steps, causing workflows to hit the unauthenticated rate limit of 60 requests per hour almost immediately. By exposing
secrets.GITHUB_TOKENto the Python scripts through environment variables, workflows now operate under the authenticated limit of 5000 requests per hour, essentially eliminating rate limit concerns for normal operation.The home-manager rebuild tests were causing failures due to
builtins.currentSystembeing unavailable in pure evaluation mode, and represented unnecessary validation since package build tests already verify correctness. Per feedback that "we don't need to test the home manager configuration, it's sufficient to test the package", these steps were removed from all workflows, simplifying the validation pipeline and eliminating a fragile test dependency.All changes maintain consistency across the five affected workflows (VimR, KOTS, Replicated, sbctl, and package status checks), ensuring uniform behavior and maintainability. The VimR workflow successfully executed end-to-end after these fixes, automatically creating PR #211 to update VimR from v0.58.0 to v0.59.0, demonstrating that the automation pipeline now functions reliably.
These fixes enable the automated package update system to operate without manual intervention, supporting the project's goal of keeping dependencies current through GitHub Actions automation rather than manual updates.
Related: PR #211 (VimR v0.59.0 update created by fixed workflow)
🤖 Generated with Claude Code
Summary by CodeRabbit
Updates
Chores