Pass --build to every docker compose run in AGENTS.md - #1196
ThisIsMissEm wants to merge 1 commit into
Conversation
`docker compose run` only builds when no image exists yet, so the documented commands reuse a stale image and report on code that isn't in the container. That falsifies the CI section's claim that each command's exit code matches the corresponding CI step's. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018cXCCCiaQvNuPbnYkRQeVu
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthrough
ChangesCompose build guidance
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to This documentation-only update reduces stale-image test results without introducing an actionable merge risk. 🚥 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 |
| docker compose run --rm backend npm run lint | ||
| docker compose run --rm backend npm run build | ||
| docker compose run --rm client npm run lint | ||
| docker compose run --rm client npm run build | ||
| docker compose run --rm test | ||
| docker compose run --rm --build backend npm run lint | ||
| docker compose run --rm --build backend npm run build | ||
| docker compose run --rm --build client npm run lint | ||
| docker compose run --rm --build client npm run build | ||
| docker compose run --rm --build test |
There was a problem hiding this comment.
Arguably this should be kept the same, though it is weird to build development tools into a baked docker image..
There was a problem hiding this comment.
I was thinking about this as I was looking at the pr. And the --build is only needed because the compose services use COPY instead of volume mounts.
For local dev, mounting the source directories would keep the container in sync without rebuilding. That avoids the --build tax entirely and makes the feedback loop faster. I think we can update docker-compose.yaml to mount ./server and ./client into the respective services instead?
There was a problem hiding this comment.
I'm not sure if that'd actually help here, due to how volume mounts end up working with the node_modules directories and with .dockerignore — really I don't think we should be running lint, build, or test within the container typically in developer workflows: we already have those tools all existing locally via npm install — with a volume mount we'd end up with macos deps running inside a linux container which would obviously break.
The chances of drift here between the CI and local copy is next to none, bar maybe platform specific issues, since the only additional software in the container is dumb-init. Platform specific issues would be things we'd need to get fixed anyway in order to make the project contributor friendly.
There was a problem hiding this comment.
I think I understand the concern now. Mounting ./server over /app would overlay the image’s existing /app, including its Linux-installed node_modules. We could preserve those with a separate /app/node_modules volume or narrower source mounts, but that requires additional Compose design.
I don’t think .dockerignore affects runtime bind mounts. It only controls the Docker build context. Either way, with the current setup the source is baked into the images, so adding --build makes sense.
Context & Requests for Reviewers
Whilst working on #1193, I encountered an issue with claude running the test suite, unbeknownst to me, it was actually reusing the existing container from a previous run, this meant that when I thought I'd run all the tests following changes, I'd actually run the previous containers code & tests, not the latest changes.
Tests
n/a, changes agents.md
(Optional) Rollout Plan
n/a
Checklist
Only check items that apply to this PR; leave the rest unchecked.
If you changed anything user-facing (i.e. user interface or APIs):
Did you update related docs?
If the change is notable (refer to Keep a Changelog conventions):
Did you update CHANGELOG.md?
If you changed
server/models/**/{ContentTypeModel,ActionModel,RuleModel,PolicyModel}.ts:Did you update the corresponding history tables and their triggers?
If you changed
db/src/scripts/**and usedCREATE TABLE,ADD COLUMN, orALTER COLUMN:Are as many columns marked
NOT NULLas possible? If some columns can sometimes be null depending on other columns, are thereCHECKconstraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?If you added a new signal in
server/services/signalsService/signals/**:Did you classify every error case as a permanent error (
SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be aSignalPermanentError.Summary by CodeRabbit
--buildflag.