Skip to content

Commit

Permalink
separate tech radar directory (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoumayaMauthoorMOJ authored Jul 26, 2024
1 parent f147548 commit d1f4507
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gh_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy static content to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'tech_radar/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 5 additions & 2 deletions manage_discussions/create_discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

load_dotenv()
GH_TOKEN = os.environ['GH_TOKEN']
blips_path = './tech_radar/blips.json'
radar_config_path = './tech_radar/radar_config.json'

transport = AIOHTTPTransport(url='https://api.github.com/graphql',
headers={'Authorization':f'token {GH_TOKEN}'}
)
Expand Down Expand Up @@ -123,10 +126,10 @@
"""
)

with open('blips.json') as f:
with open(blips_path) as f:
entries = json.load(f)

with open('radar_config.json') as f:
with open(radar_config_path) as f:
radar = json.load(f)

for entry in entries["entries"]:
Expand Down
15 changes: 10 additions & 5 deletions manage_discussions/get_discussions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@

load_dotenv()
GH_TOKEN = os.environ['GH_TOKEN']
COMPARE = True
blips_path = './tech_radar/blips.json'
radar_config_path = './tech_radar/radar_config.json'
entries_skipped_path = './tech_radar/entries_skipped.json'

transport = AIOHTTPTransport(url='https://api.github.com/graphql',
headers={'Authorization':f'token {GH_TOKEN}'}
)
client = Client(transport=transport, fetch_schema_from_transport=True)
COMPARE=True

query = gql(
"""
Expand Down Expand Up @@ -47,13 +51,14 @@

blips_old = {}
if COMPARE:
with open('blips.json') as f:
with open(blips_path) as f:
config = json.load(f)
for entry in config['entries']:
blips_old[entry['label']] = entry['ring']

with open('radar_config.json') as f:
with open(radar_config_path) as f:
radar = json.load(f)

ring_index = {}
for i,ring in enumerate(radar['rings']):
ring_index[f"{i+1}: {ring['name']} {ring['emoji']}"] = i
Expand Down Expand Up @@ -115,8 +120,8 @@
entries_new = sorted(entries_new, key=lambda k: k['label'].lower())
blips_new = {"date":str(datetime.date.today()),"entries":entries_new}

with open(f'blips.json', 'w') as f:
with open(blips_path, 'w') as f:
json.dump(blips_new, f, indent=2)
if len(entries_skipped)>0:
with open('entries_skipped.json', 'w') as f:
with open(entries_skipped_path, 'w') as f:
json.dump(entries_skipped, f, indent=2)
2 changes: 1 addition & 1 deletion blips.json → tech_radar/blips.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"date": "2021-11",
"date": "DRAFT",
"entries": [
{
"label": "Acceptance Criteria",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d1f4507

Please sign in to comment.