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 2 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
13 changes: 13 additions & 0 deletions entries_skipped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"title": "new_test_entry",
"url": "https://github.com/moj-analytical-services/data-and-analytics-engineering-tech-radar/discussions/148",
"closed": false,
"category": {
"name": "Tools"
},
"labels": {
"edges": []
}
}
]
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
114 changes: 114 additions & 0 deletions manage_discussions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# 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:**
- 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.

- create and activate a virtual environment: `venv`

- 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.
### Install a Live Server to View the Output of index.html Locally in VS Code

To view the output of your index.html file in real-time, you need to install the Live Server extension. While some methods may suggest using tools like Yarn to install the necessary packages, we simplify the process by using the Live Server extension in Visual Studio Code (VS Code). This approach avoids unnecessary complexity and streamlines the workflow.
Follow these steps to install and use Live Server in Visual Studio Code:

- Open Visual Studio Code: Launch VS Code on your computer.
- Access Extensions: Click on the Extensions icon in the Activity Bar on the side of the window.
- Search for Live Server: In the Extensions view, type "Live Server" in the search bar.
- Install Live Server: Click on the Install button for the Live Server extension.
- Open Your Project: Open the folder containing your project files, including index.html.
- Start Live Server: Right-click on your index.html file and select "Open with Live Server" from the context menu.
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