Update CI workflow for Rust and Python builds#69
Conversation
Reviewer's GuideCI workflow is refactored to run all jobs on a self-hosted (rpi) runner, gate the main Python matrix for only non-draft PRs, and add a dedicated draft PR build job that combines Rust and Python smoke tests using pyenv-based Python setup and caching. Flow diagram for updated CI job structure and gatingflowchart TD
trigger[GitHub pull_request]
mainpush[GitHub push to main/develop]
subgraph Conditions
draft{"pull_request is draft"}
nonDraft{"pull_request is non-draft"}
end
trigger --> draft
trigger --> nonDraft
mainpush --> install_deps
install_deps[install-deps job\nself-hosted rpi]
rust[rust-build-and-test\nneeds install-deps]
pyMatrix[python-build-and-test\nnon-draft PR only\nneeds install-deps]
draftBuild[build-draft\ndraft PR only\nneeds install-deps]
lintJob[lint job\nneeds install-deps]
draft -->|true| draftBuild
draft -->|false| nonDraft
nonDraft --> install_deps
install_deps --> rust
install_deps --> pyMatrix
install_deps --> draftBuild
install_deps --> lintJob
classDef selfHosted fill:#e3f2fd,stroke:#1e88e5
class install_deps,rust,pyMatrix,draftBuild,lintJob selfHosted
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Python | Jun 30, 2026 4:05p.m. | Review ↗ | |
| Rust | Jun 30, 2026 4:05p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The job
ifconditions referencegithub.event.pull_request.manual_workflow, which is not a standard field on the pull_request event; if you need to distinguish manual vs normal runs, consider usingworkflow_dispatchinputs orgithub.event_nameinstead. - Since
draftalready indicates draft PRs on pull_request events, you may not need a separatebuild-draftjob; instead, consider simplifying by using a single Python job with anif: !github.event.pull_request.draft(or similar) condition or by sharing steps between the two jobs to avoid duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The job `if` conditions reference `github.event.pull_request.manual_workflow`, which is not a standard field on the pull_request event; if you need to distinguish manual vs normal runs, consider using `workflow_dispatch` inputs or `github.event_name` instead.
- Since `draft` already indicates draft PRs on pull_request events, you may not need a separate `build-draft` job; instead, consider simplifying by using a single Python job with an `if: !github.event.pull_request.draft` (or similar) condition or by sharing steps between the two jobs to avoid duplication.
## Individual Comments
### Comment 1
<location> `.github/workflows/ci.yml:51` </location>
<code_context>
run: cargo test --release
python-build-and-test:
+ if: github.event.pull_request.manual_workflow == false && github.event.pull_request.draft == false
name: Python Build and Test
runs-on: ${{ matrix.os }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Accessing `github.event.pull_request.manual_workflow` is likely invalid and may break non-PR triggers.
`pull_request` events don’t expose a `manual_workflow` field, so this condition will always be false on PRs and may throw `Cannot index into a null value` on non-PR events where `github.event.pull_request` is null (e.g. `push`, `workflow_dispatch`). If you need a manual flag, use `workflow_dispatch` inputs or labels, and guard PR-only fields with something like:
```yaml
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
```
</issue_to_address>
### Comment 2
<location> `.github/workflows/ci.yml:112-113` </location>
<code_context>
fi
shell: bash
continue-on-error: true
+ build-draft:
+ if: github.event.pull_request.manual_workflow == true || github.event.pull_request.draft == true
+ runs-on: ${{ matrix.os }}
+ strategy:
</code_context>
<issue_to_address>
**issue (bug_risk):** The `build-draft` condition has the same `manual_workflow` / null pull_request access problem as the main Python job.
This reuses the unguarded access to `github.event.pull_request.manual_workflow` / `.draft`. On non-PR events, `github.event.pull_request` is `null`, so this condition can fail evaluation, and `manual_workflow` is not part of the standard PR payload. Consider restricting this to PR events, e.g.
```yaml
if: github.event_name == 'pull_request' && github.event.pull_request.draft == true
```
and handle any "manual workflow" behavior via a separate mechanism (such as `workflow_dispatch` inputs or labels).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Updated CI workflow to run on Raspberry Pi and simplified Python setup.
Specify pip version for Python setup
Summary by Sourcery
Migrate CI workflows to self-hosted runners with a shared dependency setup job, add a draft pull request build job for Rust/Python wheels, and gate the Python build job to only run on non-draft pull requests.
CI: