From d1f45074cbfda204c13043916b797d5e2618dde6 Mon Sep 17 00:00:00 2001 From: Soumaya Mauthoor <95432492+SoumayaMauthoorMOJ@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:03:12 +0100 Subject: [PATCH] separate tech radar directory (#306) --- .github/workflows/gh_deploy.yml | 31 ++++++++++++++++++ manage_discussions/create_discussions.py | 7 ++-- manage_discussions/get_discussions.py | 15 ++++++--- blips.json => tech_radar/blips.json | 2 +- favicon.ico => tech_radar/favicon.ico | Bin index.html => tech_radar/index.html | 0 .../radar_config.json | 0 7 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/gh_deploy.yml rename blips.json => tech_radar/blips.json (99%) rename favicon.ico => tech_radar/favicon.ico (100%) rename index.html => tech_radar/index.html (100%) rename radar_config.json => tech_radar/radar_config.json (100%) diff --git a/.github/workflows/gh_deploy.yml b/.github/workflows/gh_deploy.yml new file mode 100644 index 0000000..55df35d --- /dev/null +++ b/.github/workflows/gh_deploy.yml @@ -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 \ No newline at end of file diff --git a/manage_discussions/create_discussions.py b/manage_discussions/create_discussions.py index b37b919..3de20ad 100644 --- a/manage_discussions/create_discussions.py +++ b/manage_discussions/create_discussions.py @@ -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}'} ) @@ -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"]: diff --git a/manage_discussions/get_discussions.py b/manage_discussions/get_discussions.py index c6e12f2..9d6db3c 100644 --- a/manage_discussions/get_discussions.py +++ b/manage_discussions/get_discussions.py @@ -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( """ @@ -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 @@ -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) \ No newline at end of file diff --git a/blips.json b/tech_radar/blips.json similarity index 99% rename from blips.json rename to tech_radar/blips.json index 152b5fd..22843f5 100644 --- a/blips.json +++ b/tech_radar/blips.json @@ -1,5 +1,5 @@ { - "date": "2021-11", + "date": "DRAFT", "entries": [ { "label": "Acceptance Criteria", diff --git a/favicon.ico b/tech_radar/favicon.ico similarity index 100% rename from favicon.ico rename to tech_radar/favicon.ico diff --git a/index.html b/tech_radar/index.html similarity index 100% rename from index.html rename to tech_radar/index.html diff --git a/radar_config.json b/tech_radar/radar_config.json similarity index 100% rename from radar_config.json rename to tech_radar/radar_config.json