Skip to content

Get backend build version #547

Description

@Kvanzi

As a user of the system I want to see which backend build is currently running so that I can tell whether a fix or a feature has actually been deployed before reporting a problem.

Assumptions & Constraints

  1. The application is deployed as a Docker image that contains only the built jar, so the .git directory is not available at runtime and version data must be generated during the build.
  2. Version data is produced by Maven plugins, so an artifact built outside Maven (for example, compiled by the IDE alone) may contain no version data at all.
  3. The artifact may be built without a git repository, for example from a source archive, and the build must still succeed.
  4. In the CI pipeline the repository is checked out as a shallow clone with a single commit and no tags, so only data about the head commit is available.
  5. The project is open source, therefore publishing commit hashes without authentication is acceptable.

Preconditions

  1. Generation of build metadata is configured in the Maven build.
  2. The application is started from the produced artifact.

Business rules

  1. Version data is public and requires no authentication.
  2. Missing or incomplete version data must never break application startup or the endpoint response.
  3. The commit hash identifies the exact source revision the artifact was built from.
  4. Dates are returned in ISO-8601 format; formatting for display is the responsibility of the client.

Acceptance Criteria

  1. GET /api/v1/version returns 200 for an unauthenticated request.
  2. The response contains the backend commit hash, commit date and branch grouped under a backend object.
  3. The response contains the build date of the artifact at the root level.
  4. All dates are returned in ISO-8601 format.
  5. When the artifact contains no build metadata, the endpoint returns 200 with empty values instead of an error.
  6. The endpoint returns the same data when the application runs from the jar, from the IDE and inside Docker.
  7. The endpoint is documented in Swagger with a description and a response example.

Out of scope

  1. Frontend version data.
  2. Any UI work.
  3. Changes to the actuator endpoints.

Epic link
Epic #546

Labels to be added
"User story", "Versioning", "Application Versioning"

Tasks

  1. Generate build metadata during Maven build #549
  2. Implement version endpoint #550

Activity

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

Metadata

Metadata

Assignees

Projects

  • Status
    Done
  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions