get_discussions.py
extracts technology radar entries from the tech radar GitHub Discussions and outputs them in a structured JSON
format used by the visualization framework. It can also compare the extracted data with a previous snapshot to identify changes. The create_discussions.py
script generates new discussions in the GitHub repository based on the entries defined in blips.json
, assigns appropriate labels, and posts initial comments to each discussion. Lastly, the delete_discussion.py
script deletes discussions from the GitHub repository, ensuring that any unnecessary or outdated discussions are removed.
git clone git@github.com:moj-analytical-services/data-and-analytics-engineering-tech-radar.git
cd data-and-analytics-engineering-tech-radar
Create a file named .env
in the script's directory and add your GitHub personal access token in the following format:
GH_TOKEN=<your_github_token>
Replace <your_github_token>
with your actual GitHub personal access token (PAT) that has the necessary permissions for GraphQL API access.
For GitHub Personal Access Token:
- Go to your [GitHub account settings](https://github.com/settings/profile).
- Navigate to Developer settings -> Personal access tokens.
- Click Generate new token and select the repo scope.
- Copy the generated token into the .env file.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
-
Setup: Ensure
radar_config.json
andblips.json
(if comparing) are properly configured. -
Fetch and Update Discussions: Run
get_discussions.py
to fetch and update local data. -
Create Discussions: Use
create_discussions.py
to add new discussions to the GitHub repository based onblips.json
. -
Delete Discussions: Run
delete_discussion.py
to remove discussions from the GitHub repository.
python manage_discussions/get_discussions.py
The script will generate two JSON files:
-
blips.json
: Contains the extracted radar entries with the current date, which also updates the visualization. -
entries_skipped.json
: (If any) Lists discussions that didn't match the criteria for radar entries.