chore: bake build version into container images#1145
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughVersion information is now configurable at Docker build time across all application images. A new Go version package is introduced, Dockerfiles accept a ChangesVersion Build-Time Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Pull request overview
This PR aims to bake a build/version identifier into the generated container images so running services (and the web bundle) can report which build they’re from.
Changes:
- Add a Go
versionpackage intended to hold a build-time-injectedVersionstring forworkspace-engine. - Pass a
VERSIONbuild-arg into Docker builds, wiring it into:workspace-enginevia Go linker-ldflags -XwebviaVITE_CTRLPLANE_VERSIONapiviaCTRLPLANE_VERSION
- Update the reusable GitHub Actions workflow to pass
VERSIONfromdocker/metadata-action.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/workspace-engine/pkg/version/version.go | Adds a Version variable intended for build-time injection. |
| apps/workspace-engine/Dockerfile | Injects VERSION into the Go binary via -ldflags -X. |
| apps/web/Dockerfile | Sets VITE_CTRLPLANE_VERSION at build time from VERSION. |
| apps/api/Dockerfile | Sets CTRLPLANE_VERSION in the runtime image from VERSION. |
| .github/workflows/build-image.yaml | Passes VERSION build-arg from Docker metadata output during builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Build the binary with CGO enabled (required for confluent-kafka-go) | ||
| # The vendored librdkafka will be statically linked | ||
| RUN CGO_ENABLED=1 GOOS=linux go build -o engine . | ||
| RUN CGO_ENABLED=1 GOOS=linux go build -ldflags "-X workspace-engine/pkg/version.Version=$VERSION" -o engine . |
Summary by CodeRabbit
New Features
Chores