Overview
It all started when my line manager at the time came to me with an ask to help and automate our sprint numbers so that it wouldn’t be a tedious clicking task on a fortnight. So it started…
Source code here:
Technologies / Services Stack
Here’s the technologies / services stack I’ve chosen, based on what we already had in place and what was common way of working:
- Python – for the single source code of truth – as pretty much everybody in the team knows at least a bit of it
- Docker – latest python:3 docker image, customized to our teams needs – so it has minimal dependencies on where it’s being run
- Gitlab – code repository
- Gitlab CI – run the pipeline on a schedule, which includes:
- Change log – docker container running conventional changelog
- KICS IaC SAST check – Gitlab’s Infrastructure as Code (IaC) scanning
- Gitlab’s Static Application Security Testing (SAST)
- Gitlab’s Secret Detection
- Gitlab’s Dependency Scanning
- Gitlab Runner – to run the jobs from Gitlab CI
- Gitlab Pages / MkDocs – for the documentation
- And of course, the App itself for the reports, multiple instances of it
App
Python requirements
This lists only additional python packages were not available from python:3 latest docker image:
- deepmerge – to recursively merge 2 dictionaries
- pandas – to build Markdown code from lists and dictionaries
- requests – to perform Web requests
Config
Configuration is stored in a JSON file in /app/config.json
, which contains configuration of Jira and Confluence, including projects, components, issue types, team names and custom field names for the Jira Queries. It also contains default URLs for Jira and Confluence.
To make app work, there is an example config override file /app/tokens.json.example
that needs to be copies to /app/tokens.json
and filled with Jira and Confluence Personal Access Tokens of a user that had administrative privileges to the required projects. Tokens JSON file can override and/or extend config file as much as needed. This is where Python’s Deepmerge is used to merge them together.
Tokens JSON file, when run from Gitlab CI, is provided via Gitlab CI variables section, where secret text is present as a file to the job argument.
Run
App accepts a few different arguments:
- archive – run Jira issue archival based on configured criteria
- service_desk – run Jira Service Management (ex. Service Desk) reports for:
- Yearly statistics
- Monthly: closed
- Monthly: continued service by issue type: Bug, Technical Dept, Upgrade/Patch
- Sprint timings: service desk
- Sprint timings: teams
- Yearly: support Live vs Non-Live
- Yearly-monthly: support by component
- Yearly-monthly: teams by component
- user_report – run a report against Jira and Confluence for not active users
Results
Every run of an app with different arguments create a specific set of artifacts, that when run from Gitlab CI pipeline are brought forward to Gitlab Pages / MkDocs builder which collates them into one and provides a nicely formatted HTML file and graphs displayed using Chart.js.
Source code here: