Skip to content

Releases: L7R7/gitlab-ci-build-statuses

Release v1.2.0

07 Mar 11:56
Compare
Choose a tag to compare

What's Changed

  • new UI for viewing currently running jobs, see here
    • active by default, can be disabled
    • the status page includes a link if the job view is enabled
    • included in the metrics
  • more docs
  • default value for Cache TTL has changed: There are defaults now, 1h for project's list cache, 5min for runner's list. See 7dcc90a
  • API is served with and without /builds prefix
  • Improvements to the docker-compose example (see #50)
  • Logging on info level is drastically reduced
  • The timestamp of the last update is converted to the timezone of the user's browser (only works with JavaScript enabled)
  • A lot of changes under the hood
    • dependency updates, GHC version updates
    • Simpler, more robust, and more elegant thread handling

Release v1.0.0

12 Jun 19:14
Compare
Choose a tag to compare

Overview

This is the first official release. Prevous, untagged versions of the docker image were quite stable already, but there was no chance to pin the version to a certain release.

Features

  • Lightweight UI
    • Plain HTML and CSS, barely any JS involved
    • Refreshes automatically, so you always see the latest statuses
    • The favicon will show an indicator summarizing all statuses, so you can directly see if everything is fine (this is especially helpful if you pin the tab in your browser)
  • Production-ready Docker container including Prometheus metrics, health endpoint, and configurable structured JSON logging
  • Caching for the list of projects of the group to speed up the regular updates as well as reduce the load on the Gitlab API
  • The pipelines will be determined in the following way:
    • Get all the projects for the given group
    • For all projects that have a default branch, try to get the latest pipeline run for the default branch
    • Determine the status of the pipeline and include it in the result

Configuration

The application has to be configured via environment variables.
Some of them are mandatory, others are optional:

  • GCB_GITLAB_BASE_URL: The base URL for the Gitlab instance you want to fetch the data from, e.g. https://www.gitlab.com/
  • GCB_GITLAB_GROUP_ID: The ID of the group in Gitlab for which the build statuses to get.
  • GCB_GITLAB_API_TOKEN: The Access Token for the Gitlab API
  • GCB_DATA_UPDATE_INTERVAL_SECS (optional): Sets the interval in seconds that defines how often the cached data should be updated.
    Default value is 60 seconds.
    The higher the value, the lower the number of requests to the Gitlab API. The lower the value, the less stale will the in-memory data be.
  • GCB_UI_UPDATE_INTERVAL_SECS (optional): Sets the interval in seconds that defines how often the HTML page will refresh itself.
    Default value is 5 seconds.
  • GCB_INCLUDE_SHARED_PROJECTS(optional): Sets whether projects that are shared with the group should be included.
    Possible values are include and exclude.
    Default value is include.
  • GCB_PROJECT_CACHE_TTL_SECS (optional): You can configure caching for the list of projects to reduce the load on the Gitlab API.
    The provided value must be positive and sets the TTL of cached values in seconds.
    By default, caching is disabled.
  • GCB_LOG_LEVEL (optional): Set the minimum log level for log output.
    Defaults to Info if the value is not set or can't be parsed.
    Possible values are DEBUG, INFO, WARN, ERROR.
  • GCB_EXCLUDE_PROJECTS (optional): Set a list of projects that should be excluded from the list.
    Must be a comma-separated list of integers of project IDs.
    Defaults to an empty list if the value is not set or can't be parsed.
    If you specify projects that don't appear in the result from the API, a warning will be logged.

The app won't start if not all mandatory configuration properties are set. There will be a log message with the details before the application exits.

Run it

 docker run -p 8282:8282 \
  -e GCB_GITLAB_API_TOKEN=xyz \
  -e GCB_GITLAB_BASE_URL=https://example.gitlab.com \
  -e GCB_GITLAB_GROUP_ID=1 \
  l7r7/gitlab-ci-build-statuses:v1.0.0

More info about the docker image can be found on DockerHub.

API

The app exposes the following endpoints:

  • /statuses: Responds with an HTML page that shows the current statuses of the pipelines.
    This page will automatically refresh using the configured UI update interval.
    You can use the query flag norefresh to disable that (this is probably only helpful for debugging)
  • /health: Responds with a status indicating if the app is ready to serve requests.
    The status code will be either 200 or 503, the body will always be JSON and will include a status field that's either "HEALTHY" or "UNHEALTHY" alongside a build field that shows which version of the code is running
  • /metrics: Returns Prometheus application metrics