Skip to content

fix: add missing fleet_key.py to worker Docker image#20

Merged
GeiserX merged 2 commits intomainfrom
fix/worker-missing-fleet-key
Apr 15, 2026
Merged

fix: add missing fleet_key.py to worker Docker image#20
GeiserX merged 2 commits intomainfrom
fix/worker-missing-fleet-key

Conversation

@GeiserX
Copy link
Copy Markdown
Owner

@GeiserX GeiserX commented Apr 15, 2026

Summary

  • Worker container fails to start with ImportError: cannot import name 'fleet_key' from 'app'
  • app/fleet_key.py was not included in Dockerfile.worker COPY instructions
  • Added the missing COPY line

Fixes #19

Files changed

  • Dockerfile.worker — added COPY --chown=cashpilot:root app/fleet_key.py ./app/
  • AGENTS.md — added CI/CD deployment workflow notes

Test plan

  • Verified fleet_key.py exists and is imported by worker_api.py
  • CI builds worker image successfully
  • Worker container starts without ImportError

Summary by CodeRabbit

  • Documentation
    • Enhanced CI/CD deployment workflow guidance with step-by-step instructions for post-PR deployment process
    • Added critical warning against manual Git tag creation to prevent build conflicts

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Warning

Rate limit exceeded

@GeiserX has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 12 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1dccfaa0-c834-4935-842a-1987e8e5025c

📥 Commits

Reviewing files that changed from the base of the PR and between c9906f9 and da80f1d.

📒 Files selected for processing (5)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • app/main.py
  • app/worker_api.py
  • docker-compose.fleet.yml
  • requirements-worker.txt
📝 Walkthrough

Walkthrough

The PR adds deployment workflow documentation to AGENTS.md and includes a missing application source file (fleet_key.py) in the Dockerfile.worker runtime stage to resolve a module import error.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md
Adds critical note against manually creating Git tags/releases to prevent workflow conflicts, and documents sequential deployment workflow after PR merge (wait for Auto Release, then Build and Push Docker Images, then server-side docker pull and container recreation).
Docker Configuration
Dockerfile.worker
Copies app/fleet_key.py into container /app directory to resolve missing module import error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Dockerfile.worker change is directly scoped to fixing the issue. However, the AGENTS.md documentation update appears unrelated to the worker initialization bug fix. Remove or separate the AGENTS.md CI/CD documentation changes into a distinct PR, as they are outside the scope of fixing issue #19.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the missing fleet_key.py file to the worker Docker image to fix the ImportError.
Linked Issues check ✅ Passed The PR directly addresses issue #19 by adding the missing fleet_key.py import to Dockerfile.worker, which resolves the ImportError preventing worker initialization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/worker-missing-fleet-key

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Use 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-alpine

Also 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

📥 Commits

Reviewing files that changed from the base of the PR and between bd6b94b and c9906f9.

📒 Files selected for processing (2)
  • AGENTS.md
  • Dockerfile.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"
@GeiserX GeiserX merged commit 77a3437 into main Apr 15, 2026
6 checks passed
@GeiserX GeiserX deleted the fix/worker-missing-fleet-key branch April 15, 2026 16:41
@GeiserX GeiserX mentioned this pull request Apr 15, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Worker is not listed in UI

1 participant