-
Notifications
You must be signed in to change notification settings - Fork 0
chore: migrate to Nix-based development and CI workflows [ENG-11657] #43
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
Conversation
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.
Pull request overview
This PR migrates the repository from traditional Python tooling to a Nix-based development environment and CI workflow setup, providing reproducible builds and unified tooling across development and continuous integration.
Key Changes:
- Replaces separate
test.ymlandlint.ymlworkflows with a unifiedci.ymlworkflow using Nix - Introduces
flake.nixfor development environment configuration with automatic dependency installation and git hooks - Removes Python-based pre-commit configuration in favor of Nix-native git-hooks.nix with treefmt
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| flake.nix | Adds Nix flake configuration defining the development environment, treefmt settings, and git hooks |
| .github/workflows/ci.yml | New unified CI workflow using Nix for lint, type-check, and test jobs |
| .github/workflows/nix-flake.yml | Adds workflow to validate Nix flake syntax and structure |
| .github/actions/setup-nix/action.yaml | Reusable composite action for setting up Nix with Cachix caching |
| .github/workflows/release.yml | Updates release workflow to use Nix for building and publishing |
| .github/workflows/docs.yml | Updates documentation workflow to use Nix for building docs |
| .github/workflows/test.yml | Removed in favor of unified ci.yml workflow |
| .github/workflows/lint.yml | Removed in favor of unified ci.yml workflow |
| .pre-commit-config.yaml | Removed Python pre-commit configuration (replaced by git-hooks.nix) |
| pyproject.toml | Removes pre-commit dependency from dev dependencies |
| Makefile | Removes pre-commit install step from install target |
| README.md | Adds Nix installation instructions as recommended development setup |
| .envrc | Adds direnv configuration for automatic Nix environment loading |
| stackone_ai/meta_tools.py | Code formatting change (line length) |
| stackone_ai/feedback/tool.py | Code formatting changes (line length and trailing commas) |
| examples/test_examples.py | Code formatting changes (trailing commas) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f5ebcfd to
36fc480
Compare
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.
1 issue found across 19 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="flake.nix">
<violation number="1" location="flake.nix:22">
P2: Missing `x86_64-darwin` in systems list. Intel Mac users won't be able to use this flake. Consider adding `"x86_64-darwin"` to maintain cross-platform support as described in the PR.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
Migrate all CI workflows to use Nix for consistent, reproducible builds following the pattern from stackone-ai-node repository. Changes: - Add .github/actions/setup-nix for reusable Nix setup - Create unified ci.yml workflow (replaces test.yml and lint.yml) - Add nix-flake.yml for flake validation - Update docs.yml and release.yml to use Nix - Enhance flake.nix shellHook to auto-install dependencies - Remove separate test.yml and lint.yml workflows Benefits: - Consistent environment between local dev and CI - Faster builds with Cachix caching - Single unified CI workflow - Automatic dependency installation via shellHook
Replace pre-commit with Nix-native git-hooks.nix and treefmt for better integration with the Nix development environment. Changes: - Add git-hooks.nix and treefmt-nix flake inputs - Configure treefmt with ruff (check + format) and nixfmt - Set up git-hooks with treefmt and mypy pre-commit hooks - Remove .pre-commit-config.yaml - Remove pre-commit from dev dependencies - Update Makefile to remove pre-commit install step - Format code with treefmt (ruff) Benefits: - Consistent formatting via `nix fmt` - Automatic git hook installation in nix develop - No Python-based pre-commit dependency - Faster hook execution - Better Nix ecosystem integration
Add Nix as the recommended development setup with instructions for entering the dev environment, formatting, and running checks. Benefits of using Nix: - Automatic dependency installation - Git hooks auto-configured - Consistent environment across platforms
This file is auto-generated by git-hooks.nix and should not be tracked.
Configure git-hooks to skip the check during 'nix flake check' because mypy requires the Python environment which isn't available in the Nix sandbox. The mypy hook still works locally in 'nix develop' where the Python environment is available. Mypy is also run in CI via ci.yml. Changes: - Set pre-commit.check.enable = false to skip flake check - Keep mypy hook enabled for local development - Treefmt check still runs in flake check
Replace Makefile with justfile for better command runner experience. Add just to Nix devShell for development environment.
Apply consistent formatting across the repository using nix fmt: - YAML files: standardise string quoting to double quotes - Markdown files: add blank lines before lists for proper rendering - Remove trailing whitespace in CLAUDE.md
StuBehan
left a comment
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.
LGTM
Summary
Migrate the repository to use Nix for development environment and CI workflows, following the patterns from stackone-ai-node repository.
Changes
CI/CD
.github/actions/setup-nixfor reusable Nix setup actionci.ymlworkflow (replacestest.ymlandlint.yml)nix-flake.ymlfor flake validationdocs.ymlandrelease.ymlto use NixDevelopment Environment
flake.nixwith development shell configurationnix develop).gitignoreto exclude Nix-managed.pre-commit-config.yamlDocumentation
Benefits
nix developauto-installs dependencies and git hooksnix fmt) for all formattingTest Plan
nix flake checkpassesnix developenters shell and installs git hooksnix fmtformats code correctlyBreaking Changes
None. The repository still works with traditional
pip/uvinstallation. Nix is optional but recommended for development.Summary by cubic
Migrates development and CI to Nix for reproducible environments and faster builds, unifying lint, type-check, and tests under a single workflow. Pre-commit is replaced with Nix-native git hooks and treefmt for simpler setup.
Refactors
Migration
Written for commit 56e9314. Summary will update automatically on new commits.