ci: Synchronize CI and pre-commit checks with improved parallelization, build dependencies, and workspace-wide Rust commands - #172
Conversation
Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
|
Your changes broke the build of the python bindings, which require cargo build to work and disabled sccache. Please fix these. |
…indings build Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Fixed the Python bindings build issues by restoring package-specific commands ( |
|
Include sccache and build the quizx crate before running the Python checks. |
|
Ignore scratchpads subdirectory for Python linting and formatting. |
- Add sccache setup to python-mypy, python-ruff-format, and python-ruff-lint jobs - Install Rust toolchain with rustfmt and clippy components - Build quizx crate before running Python checks to ensure Python bindings work correctly - Maintains parallelization benefits while ensuring proper build dependencies Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Added sccache setup, Rust toolchain installation, and explicit quizx crate build step to all Python check jobs (python-mypy, python-ruff-format, python-ruff-lint). This ensures the Python bindings have all necessary build dependencies while maintaining the parallelization benefits. Commit 366080d. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…y scope with pre-commit Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Added ruff configuration to exclude scratchpads directory and aligned mypy scope to only check pybindings directory (matching pre-commit). Now both CI and pre-commit use identical Python tool configurations. Commit cbcb5b4. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Combine the 2 clippy tasks into one and the 2 formatting tasks into one. |
|
Set sccache as rustc wrapper where appropriate. |
… jobs Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Combined the separate clippy and formatting tasks as requested. The CI now uses 2 unified jobs ( |
Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Added explicit |
|
Perform the rust formatting and clippy tasks with a single call to cargo, with appropriate flags so that it checks the whole workspace. |
… clippy checks Co-authored-by: akissinger <881183+akissinger@users.noreply.github.com>
Replaced package-specific cargo commands with single workspace-wide calls:
This simplifies the CI configuration while maintaining identical functionality and checking the entire workspace with a single cargo invocation. Commit 334af6a. |
This PR resolves inconsistencies between local pre-commit checks and CI checks that were causing painful merge experiences, and improves CI parallelization to prevent sequential failure iteration cycles.
Problems Solved
1. Inconsistent Tool Configurations
The local and CI environments were running different commands with different scopes:
mypy pybindingsvs CI usedmypy .This led to confusing situations where pre-commit could pass while CI failed, or vice versa.
2. Sequential CI Execution
CI jobs ran checks sequentially within each job - if one tool failed, subsequent tools wouldn't run. This meant developers had to fix errors one tool at a time rather than seeing all issues at once.
3. Python Bindings Build Dependencies
Python check jobs were missing critical build dependencies (sccache, Rust toolchain, quizx crate build) needed for the Python bindings to work correctly.
4. Suboptimal Rust Compilation Caching
While sccache was configured globally, explicit RUSTC_WRAPPER settings were missing from individual jobs, potentially reducing caching effectiveness.
5. Inefficient Package-Specific Rust Commands
The CI was running separate cargo commands for each package instead of using workspace-wide commands, leading to unnecessary complexity and potentially slower execution.
Solution
Parallel CI Architecture
Replaced the monolithic
check-quizxandcheck-pybindingsjobs with individual parallel jobs:Complete Build Dependencies
All Python check jobs now include the full build pipeline:
Synchronized Tool Configurations
All tools now use identical commands and scopes between CI and pre-commit:
Scratchpads Directory Exclusion
Added ruff configuration to exclude the scratchpads directory from Python linting and formatting:
This prevents CI from checking development notebooks and scratch files that should not be subject to production code standards.
Explicit sccache Rust Wrapper Configuration
Set
RUSTC_WRAPPER: sccacheexplicitly in all jobs that perform Rust compilation to ensure optimal caching:Workspace-Wide Rust Commands
Replaced separate package-specific cargo commands with single workspace-wide commands that check the entire workspace more efficiently:
cargo fmt --all -- --checkinstead of separate-p quizxand-p quizx_pybindingscallscargo clippy --workspace --all-targets --all-featuresinstead of separate package-specific clippy callsBenefits
Fixes #171.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.