mitodl / mitodl/release-script

Reduce number of required environment variables for bot_local.py

Open
#289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
16
Forks
8
Avg merge
11h 47m
Merged PRs (30d)
2

Description

Currently we assert the presence of these variables:

    'SLACK_ACCESS_TOKEN',
    'BOT_ACCESS_TOKEN',
    'GITHUB_ACCESS_TOKEN',
    'NPM_TOKEN',
    'SLACK_SECRET',
    'TIMEZONE',
    'PORT',
    'PYPI_USERNAME',
    'PYPI_PASSWORD',
    'PYPITEST_USERNAME',
    'PYPITEST_PASSWORD',

Some environment variables like SLACK_ACCESS_TOKEN are not useful for bot_local.py, so we should only assert them when the Slack bot is starting.

Also, we should consider finer grained verification of environment variables at the command level. For example release does not require PYPI_USERNAME at all, and publish may or may not require PYPI_USERNAME depending on whether it's a python or npm release. I think it's fine to validate all of these variables on boot for Doof but it makes simple commands difficult for bot_local.py

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bot_local.py by tracing the boot-time environment-variable assertions and how commands such as release and publish are dispatched. Determine which variables each command and bot startup actually needs. Done means simple bot_local.py commands no longer require unrelated variables while Doof still validates its full set at boot.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.