Gitblick is a tool to tack data about code (such as code coverage, linting scores …) for each commit. The tracked data can then be visualized using svg graphics and included in the git README file.
Example
The repository gitlab.com/manuel2258/gitblick_test is a test repository which uses gitblick in its CI/CD pipeline. It can generate following visualization:
using following gitlab CI/CD configuration:
image: registry.gitlab.com/manuel2258/gitblick/gitblick:staging
stages:
- append
- render
append-test_int-1:
stage: append
script:
# Tracks the value '1' under the name 'test_int' to the current commit
- gitblick --http-password $GITBLICK_GIT_HTTP_PASSWORD append -n test_int -v 1
render-all:
stage: render
script:
# Renders all the graphics
- gitblick --http-password $GITBLICK_GIT_HTTP_PASSWORD render-all
Implementation
Gitblick works by storing configuration and tracked data in a special branch named _gitblick
.
This is an example from the gitblick_test
repository:
There are input files, such as the gitblick.ron
configuration file as well as the templates
folder, which holds
the tera svg templates files.
Additionally stored on the same branch are the output files, which contain the actual records as well as the output graphics.
The records are stored in the folder named after the origin commit hash, and then stored in a file with the point name.
Configuration
The config file is in the ron format, any mainly defines the point name and types, as well as the to render outputs.
Config (
project: ProjectConfig(
name: "gitblick_test",
),
points: {
"test_string": String,
"test_int": Integer,
},
outputs: [
Tera(TeraOutput(
source: "templates/**/*",
destination: "output",
)),
]
)
Run options
|> gitblick )
)
Abandoning Reason
Unfortunately, it is not easily possible to template svg files, as it has no layouting such as html. Meaning when for example iterating through a list of points, you would have to have a variable, which you manually increment to track the y position of those points. Being able to generate output artifacts by embedding a scripting language such a python would be the nice solution, but that is too much work for me right now …