Skip to content

chore: bake build version into container images#1145

Merged
adityachoudhari26 merged 1 commit into
mainfrom
pass-version-info-to-builds
May 19, 2026
Merged

chore: bake build version into container images#1145
adityachoudhari26 merged 1 commit into
mainfrom
pass-version-info-to-builds

Conversation

@adityachoudhari26
Copy link
Copy Markdown
Member

@adityachoudhari26 adityachoudhari26 commented May 19, 2026

Summary by CodeRabbit

  • New Features

    • Applications now expose version information across all services, providing visibility into deployed component versions.
    • Version numbers are configurable at build time, enabling flexible deployment strategies and environment-specific release configurations.
  • Chores

    • Updated CI/CD workflows and Docker build infrastructure to support consistent version propagation throughout the entire application stack.

Review Change Stack

Copilot AI review requested due to automatic review settings May 19, 2026 17:30
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dcb400df-dcef-408e-937f-92be8084fac3

📥 Commits

Reviewing files that changed from the base of the PR and between ea27815 and 5d406a3.

📒 Files selected for processing (5)
  • .github/workflows/build-image.yaml
  • apps/api/Dockerfile
  • apps/web/Dockerfile
  • apps/workspace-engine/Dockerfile
  • apps/workspace-engine/pkg/version/version.go

📝 Walkthrough

Walkthrough

Version information is now configurable at Docker build time across all application images. A new Go version package is introduced, Dockerfiles accept a VERSION build argument and expose it as environment variables or inject it into binaries, and the build workflow wires version metadata through Docker builds.

Changes

Version Build-Time Configuration

Layer / File(s) Summary
Go version package contract
apps/workspace-engine/pkg/version/version.go
A new version package exports a Version variable initialized to dev, providing the contract for injecting version information into the workspace-engine binary via linker flags.
Dockerfile version configuration
apps/api/Dockerfile, apps/web/Dockerfile, apps/workspace-engine/Dockerfile
All three Dockerfiles now accept a VERSION build argument (default dev). The API image exports it as CTRLPLANE_VERSION env var, the web image as VITE_CTRLPLANE_VERSION env var, and workspace-engine injects it into the Go binary via -ldflags -X during build.
Workflow version propagation
.github/workflows/build-image.yaml
The build workflow now passes VERSION=${{ steps.meta.outputs.version }} as build arguments in both the non-main and main Docker build/push steps, wiring version metadata from container image metadata into all application Docker images.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A version flows through build and time,
From metadata to every Docker line,
Each app now knows its number true,
Dev by default, but shaped anew!
whiskers twitch with deployment glee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: bake build version into container images' accurately and concisely summarizes the main change: adding version information to Docker builds across multiple Dockerfiles and the build workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pass-version-info-to-builds

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.

❤️ Share

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 version package intended to hold a build-time-injected Version string for workspace-engine.
  • Pass a VERSION build-arg into Docker builds, wiring it into:
    • workspace-engine via Go linker -ldflags -X
    • web via VITE_CTRLPLANE_VERSION
    • api via CTRLPLANE_VERSION
  • Update the reusable GitHub Actions workflow to pass VERSION from docker/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 .
@adityachoudhari26 adityachoudhari26 merged commit e308cef into main May 19, 2026
17 checks passed
@adityachoudhari26 adityachoudhari26 deleted the pass-version-info-to-builds branch May 19, 2026 17:59
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.

2 participants