Skip to content

[Enhancement]: Built-in build metadata support (git commit, branch) for self-hosted deployments #12406

Description

@MieszkoMakuch

What features would you like to see added?

Support for passing build metadata (git commit SHA, branch name) into the Docker image at build time, so self-hosted deployments can identify which exact version is running.

Flow

┌─────────────┐      ┌──────────────┐      ┌─────────────┐      ┌──────────┐
│  CI/CD      │      │  Dockerfile  │      │  Vite Build │      │    UI    │
│             │─────▶│              │─────▶│             │─────▶│          │
│ --build-arg │      │ ARG → ENV    │      │ VITE_* vars │      │ footer / │
│ VITE_BUILD_ │      │ during       │      │ baked into  │      │ settings │
│ COMMIT=abc  │      │ npm run      │      │ JS bundle   │      │ /version │
│ BRANCH=main │      │ frontend     │      │ at compile  │      │ endpoint │
└─────────────┘      └──────────────┘      └─────────────┘      └──────────┘

More details

Use case: Self-hosted instances across multiple environments (dev/staging/prod). After deployment, operators need to verify which commit is actually running — for debugging, release verification, etc.

CUSTOM_FOOTER partially covers this, but it's a runtime env var decoupled from the image — if someone swaps the image without updating the var, the info becomes misleading.

Build-time injection solves this: metadata is compiled into the JS bundle, so every image is self-describing.

Prior art: GitLab, Grafana, Mattermost all expose build metadata in self-hosted instances.

Suggested change: Add optional ARGs to the Dockerfile (similar to existing NODE_MAX_OLD_SPACE_SIZE) that Vite picks up via its VITE_ env prefix. When args are not provided — no change in behavior.

Which components are impacted?

General, UI

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions