FAQ | This is a LIVE service | Changelog

Add python-dotenv integration

Description

We currently load variables only from the environment of the launching process for the CLI, e.g.

GITLAB_TOKEN=<gitlab-personal-token> poetry run ucam-gitlab-stats --labels "team::Identity" --print-iterations --week-count=13 14

if we add python-dotenv, we can launch like this instead:

poetry run ucam-gitlab-stats --labels "team::Identity" --print-iterations --week-count=13 14

and provide the environment variable(s) in a .env file.

Further details

Worth doing because:

  • this makes the code more 12factor
  • makes it easier to use locally, as you don't need to provide your token each time
  • safer than binding a token in your .zshrc or similar, as you can use a separate token for each place you use ucam-gitlab-stats, etc.

Task list

Acceptance criteria

  • Code uses python-dotenv to load environment variables in cli.py

Links/references

Edited by Benjamin Woods