Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the referenced js file version #151

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 138 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,143 @@
# Data and Analytics Engineering Tech Radar

In the MoJ [Data and Analytics Engineering community](https://ministryofjustice.github.io/data-and-analytics-engineering/),
we maintain a [public Tech Radar](http://zalando.github.io/tech-radar/) to help our teams
align on technology choices. It is based on the [pioneering work
The MoJ [Data and Analytics Engineering community](https://ministryofjustice.github.io/data-and-analytics-engineering/),
maintains a [public Tech Radar](http://zalando.github.io/tech-radar/) to help
align technology choices within our teams. This Tech Radar is based on [pioneering work
by ThoughtWorks](https://www.thoughtworks.com/radar) and uses a modified version of Zalando's
[`radar.js`](https://github.com/zalando/tech-radar/blob/master/docs/radar.js) [d3.js v4](https://d3js.org) tech radar visualisation.
[`radar.js`](https://github.com/zalando/tech-radar/blob/master/docs/radar.js) with [d3.js v4](https://d3js.org) for visualisation.

Tech radar blips are configured in `blips.json` against tech radar rings
and quadrants configured in `radar_config.json`.
Tech radar blips are configured in `blips.json`, while tech radar rings and quadrants are set up in `radar_config.json`. Additional context for the blips is provided by GitHub discussions, which are queried using the GitHub GraphQL API to populate `blips.json`

GitHub discussions provide additional context to the blips,
which are queried using the GitHub graphql API to populate `blips.json`.

# Tech Radar Discussion Management

This script extracts technology radar entries from [the tech radar GitHub Discussions](https://github.com/moj-analytical-services/data-and-analytics-engineering-tech-radar/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.



## Setup

### Clone the Repository:

```bash
git clone [email protected]:moj-analytical-services/data-and-analytics-engineering-tech-radar.git
```
```bash
cd data-and-analytics-engineering-tech-radar
```
### Create `.env` File:

Create a file named `.env` in the script's directory and add your GitHub personal access token in the following format:
```bash
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:**
<ol>
<li> Go to your [GitHub account settings](https://github.com/settings/profile). </li>
<li> Navigate to Developer settings -> Personal access tokens. </li>
<li> Click Generate new token and select the repo scope. </li>
<li> Copy the generated token into the .env file. </li>

</ol>

### Create and activate a virtual environment:

```
python -m venv venv
source venv/bin/activate
```
### Install the python packages required


```pythpn
pip install -r requirements.txt
```

## Configure `radar_config.json`:
Create a file named `radar_config.json` to define your radar's structure:

```json
{
"quadrants": [
{"name": "Quadrant 1 Name",
"_location": "Top"},
{"name": "Quadrant 2 Name",
"_location": "Bottom"},
...
],
"rings": [
{"name": "Ring 1 Name", "emoji": "✅"},
{"name": "Ring 2 Name", "emoji": "🧪"},
...
]
}
```

**Example:**
```json
{
"quadrants": [
{"name": "Techniques"},
{"name": "Platforms"},
{"name": "Languages & Frameworks"},
{"name": "Data Tools"}
],
"rings": [
{"name": "Adopt", "emoji": "✅"},
{"name": "Trial", "emoji": "🧪"},
{"name": "Assess", "emoji": "🔎"},
{"name": "Hold", "emoji": "🛑"}
]
}
```

#### (Optional) Prepare `blips.json` for Comparison:

If you want to compare with previous data, create a `blips.json` file with the following structure:

```json
{
"date": "YYYY-MM-DD",
"entries": [
{
"label": "Entry 1 Label",
"quadrant": 0,
"ring": 2
},
...
]
}
```

### Usage

#### Run the Script
```bash
python manage_discussions/get_discussions.py
```
### Output

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.
</ol>

### Viewing the Output Locally in VS Code
#### Install Live Server Extension
<ol>
<li>Open Visual Studio Code: Launch VS Code on your computer.</li>
<li>Access Extensions: Click on the Extensions icon in the Activity Bar on the side of the window.</li>
<li>Search for Live Server: In the Extensions view, type "Live Server" in the search bar.</li>
<li>Install Live Server: Click on the Install button for the Live Server extension.</li>
</ol>

#### Start Live Server

<ol>
<li> Open Your Project: Open the folder containing your project files, including index.html</li>
<li>Start Live Server: Right-click on your index.html file and select "Open with Live Server" from the context menu.</li>
</ol>
Empty file added entries_skipped.json
Empty file.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<link rel="shortcut icon" href="favicon.ico">

<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/SoumayaMauthoorMOJ/tech-radar@0.0.4/docs/radar.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/SoumayaMauthoorMOJ/tech-radar@0.0.1/docs/radar.css">
<script src="https://cdn.jsdelivr.net/gh/zalando/tech-radar@master/docs/radar.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zalando/tech-radar@master/docs/radar.css">
</head>

<body>
Expand Down
3 changes: 3 additions & 0 deletions manage_discussions/get_discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
ring_old = blips_old.get(details['title'])
if ring_old is not None:
ring_change = ring_old - ring
else:
# Set ring_change to 2 if it's a new entry
ring_change = 2
entries_new.append({"label":details['title'],
"quadrant":quadrant,
"ring":ring,
Expand Down