fix: add missing fleet_key.py to worker Docker image#20
Conversation
The worker imports `from app import fleet_key` but Dockerfile.worker did not COPY fleet_key.py into the image, causing ImportError on startup. Fixes #19.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 12 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR adds deployment workflow documentation to AGENTS.md and includes a missing application source file ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile.worker (1)
2-2:⚠️ Potential issue | 🟠 MajorUse Python 3.12 as required by coding guidelines.
Dockerfile.worker lines 2 and 20 reference
python:3.14-alpine, but coding guidelines mandate Python 3.12 for Docker images.Fix
-FROM python:3.14-alpine AS builder +FROM python:3.12-alpine AS builder-FROM python:3.14-alpine +FROM python:3.12-alpineAlso applies to: 20-20
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Dockerfile.worker` at line 2, The Dockerfile uses the Python 3.14 Alpine base image in its FROM directives; update both occurrences of the image tag to python:3.12-alpine (replace "python:3.14-alpine" with "python:3.12-alpine") so the builder and final stages use Python 3.12 per the coding guidelines and ensure any other "python:3.14-alpine" references in the same file are changed consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@Dockerfile.worker`:
- Line 2: The Dockerfile uses the Python 3.14 Alpine base image in its FROM
directives; update both occurrences of the image tag to python:3.12-alpine
(replace "python:3.14-alpine" with "python:3.12-alpine") so the builder and
final stages use Python 3.12 per the coding guidelines and ensure any other
"python:3.14-alpine" references in the same file are changed consistently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fc75e2c0-0f15-46b5-bfaa-d92e7c793b62
📒 Files selected for processing (2)
AGENTS.mdDockerfile.worker
- Add constant-time API key comparison (hmac.compare_digest) in both worker and UI to prevent timing side-channel attacks - Add missing /fleet shared volume to docker-compose.fleet.yml so auto-generated fleet keys work in fleet mode - Remove unused aiosqlite from worker requirements - Fix socket leak in _get_local_ip() with try/finally - Show real timestamp in worker heartbeat status instead of "just now" - Suppress stack traces in deploy error responses - Bug report template: require exact version tag, not "latest"
Summary
ImportError: cannot import name 'fleet_key' from 'app'app/fleet_key.pywas not included inDockerfile.workerCOPY instructionsFixes #19
Files changed
Dockerfile.worker— addedCOPY --chown=cashpilot:root app/fleet_key.py ./app/AGENTS.md— added CI/CD deployment workflow notesTest plan
fleet_key.pyexists and is imported byworker_api.pySummary by CodeRabbit