Repository navigation
ci: use uv for woodpecker smoke - #667
Conversation
Switch lint-and-smoke-tests to install uv, sync locked project dependencies from uv.lock with the existing redis/dev extras, and run ruff/pytest through uv while reusing the Woodpecker runner cache PVC. Use --frozen because CI points UV_DEFAULT_INDEX at the Aliyun mirror while uv.lock records PyPI sources; --locked would require a lock source update. Keep --no-group dev so lint/smoke does not pull dependency-group dev packages like mypy/pandas. Verification: woodpecker-cli lint .woodpecker/ci.yml; local uv sync/run ruff/pytest on Python 3.12; Docker python:3.12-slim cold and warm cache runs; local subagent review found no P1/P2.
📝 WalkthroughWalkthroughThe Woodpecker CI configuration's ChangesCI uv migration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.woodpecker/ci.yml (2)
24-24: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winPin the
ruffversion used via--with ruff.The rest of the sync (line 23) is deterministic via
--frozenagainstuv.lock, butruffhere is an unpinned transient dependency.uv run --withinstalls the extra package into a temporary overlay environment without touching the locked project env, so its resolved version can silently change between CI runs as newruffreleases land, causing unrelated lint failures.♻️ Proposed fix: pin ruff version
- - uv run --frozen --extra redis --extra dev --no-group dev --with ruff ruff check src/coding_agent/observability/ src/coding_agent/ui/http_server.py src/coding_agent/ui/session_manager.py tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py + - uv run --frozen --extra redis --extra dev --no-group dev --with "ruff==<pinned-version>" ruff check src/coding_agent/observability/ src/coding_agent/ui/http_server.py src/coding_agent/ui/session_manager.py tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py🤖 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 @.woodpecker/ci.yml at line 24, The CI step using uv run with --with ruff is pulling an unpinned transient ruff version, which can vary between runs; update the workflow command to use a fixed ruff version in the same place so linting stays deterministic. Keep the change in the ci.yml job that runs ruff check, and ensure the pinned version is explicit wherever --with ruff is currently used.
23-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDuplicated sync flags across three commands; consider
--no-syncon theuv runlines.The full
--frozen --extra redis --extra dev --no-group devflag set is repeated on all three lines.uv syncalready puts the environment in the desired state on line 23;uv runre-triggers an inexact sync check on lines 24-25, which is redundant overhead and a maintenance risk if the flag set needs to change later (three places to update in sync).♻️ Proposed simplification using `--no-sync`
- uv sync --frozen --extra redis --extra dev --no-group dev - - uv run --frozen --extra redis --extra dev --no-group dev --with ruff ruff check src/coding_agent/observability/ src/coding_agent/ui/http_server.py src/coding_agent/ui/session_manager.py tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py - - uv run --frozen --extra redis --extra dev --no-group dev pytest tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py -q + - uv run --no-sync --with ruff ruff check src/coding_agent/observability/ src/coding_agent/ui/http_server.py src/coding_agent/ui/session_manager.py tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py + - uv run --no-sync pytest tests/ui/test_server_compat_imports.py tests/coding_agent/test_agent_observability.py tests/coding_agent/test_bee_template_pack_smoke.py -q🤖 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 @.woodpecker/ci.yml around lines 23 - 25, The CI steps in the workflow repeat the same uv sync flags across the `uv run` commands, which is redundant after the prior `uv sync` step. Update the `uv run` invocations in the workflow to reuse the already-prepared environment by adding `--no-sync`, while keeping the existing `uv sync` step and the same test/ruff commands, so the setup remains consistent and easier to maintain.
🤖 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.
Nitpick comments:
In @.woodpecker/ci.yml:
- Line 24: The CI step using uv run with --with ruff is pulling an unpinned
transient ruff version, which can vary between runs; update the workflow command
to use a fixed ruff version in the same place so linting stays deterministic.
Keep the change in the ci.yml job that runs ruff check, and ensure the pinned
version is explicit wherever --with ruff is currently used.
- Around line 23-25: The CI steps in the workflow repeat the same uv sync flags
across the `uv run` commands, which is redundant after the prior `uv sync` step.
Update the `uv run` invocations in the workflow to reuse the already-prepared
environment by adding `--no-sync`, while keeping the existing `uv sync` step and
the same test/ruff commands, so the setup remains consistent and easier to
maintain.
Summary
lint-and-smoke-testsfrompip install -e '.[dev,redis]' rufftouv syncplusuv runUV_CACHE_DIR=/cache/uv/coding-agent-loopon the existingwoodpecker-runner-cache:/cachePVC--extra redis --extra dev --no-group dev, and keepruffas a transientuv run --with rufftool dependencyNotes
--frozeninstead of--lockedbecause CI setsUV_DEFAULT_INDEXto the Aliyun mirror whileuv.lockrecords PyPI sources;--lockedfails by treating that source change as a lock updatebuild-imageandbuild-deploy-toolsunchangedVerification
git diff --check -- .woodpecker-cli lint .woodpecker/ci.ymluv sync+uv run ruff+uv run pytestcompleted with22 passedpython:3.12-slimcold run completed with22 passedpython:3.12-slimwarm-cache run using the same mounted cache completed withPrepared 64 packages in 6msand22 passedSummary by CodeRabbit