From 360567a489fb0aa0f1a43ac84d742692ef5a3c46 Mon Sep 17 00:00:00 2001 From: Si Hammill Date: Tue, 7 Jul 2026 14:47:33 +0100 Subject: [PATCH 1/2] Compare script added in logic to turn off filter branches --- tf_compare.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tf_compare.py b/tf_compare.py index 138bd61..4846b8c 100644 --- a/tf_compare.py +++ b/tf_compare.py @@ -30,6 +30,9 @@ workflow = args.workflow RTVersion = args.rt +# Set to True to bypass the workflow/branch allow-list (for testing) +FILTER_RUNS = False + saveLocation = ['new_data', 'prev_data'] repos = ['YoYoGames/GameMaker-Bugs', 'YoYoGames/GM-TestFramework', 'YoYoGames/TF_Bug_Report_Holding'] @@ -89,10 +92,13 @@ def get_workflow_runs(): allowed_branches = {'develop', '2026.0.0-main'} # only the runs we care about, newest first (GitHub returns them newest first) - valid_runs = [ - run for run in workflow_runs - if run['head_branch'] in allowed_branches and run['name'] in allowed_workflows - ] + if FILTER_RUNS: + valid_runs = [ + run for run in workflow_runs + if run['head_branch'] in allowed_branches and run['name'] in allowed_workflows + ] + else: + valid_runs = workflow_runs if not valid_runs: LOGGER.error("Valid workflow not used, only Beta, Monthly, Red or LTS2026 on the develop / 2026.0.0-main branch is accepted for the TF Compare script") From b6586849c7a52d4c91a04f86332c132acf15a6c6 Mon Sep 17 00:00:00 2001 From: Si Hammill Date: Wed, 8 Jul 2026 09:47:16 +0100 Subject: [PATCH 2/2] compare script: refactored logic for retrieving the summary_file name --- .github/workflows/LTS2026.yml | 2 ++ .github/workflows/Monthly.yml | 2 ++ .github/workflows/Red.yml | 2 ++ tf_compare.py | 27 ++++++++++++++++++++------- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/LTS2026.yml b/.github/workflows/LTS2026.yml index ac0a01a..9aa6ad8 100644 --- a/.github/workflows/LTS2026.yml +++ b/.github/workflows/LTS2026.yml @@ -41,6 +41,8 @@ jobs: with: name: summary_file-${{ github.event.inputs.RUNTIME_VERSION }} path: ${{ github.workspace }}\GM-TF\results + - name: Wait 10 seconds + run: sleep 10 - name: Running TF Compare Script run: python .\tf_compare.py --github-token ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} --workflow ${{ github.workflow }}.yml --rt ${{ github.event.inputs.RUNTIME_VERSION }} working-directory: GM-TF diff --git a/.github/workflows/Monthly.yml b/.github/workflows/Monthly.yml index b1abe57..4caead4 100644 --- a/.github/workflows/Monthly.yml +++ b/.github/workflows/Monthly.yml @@ -41,6 +41,8 @@ jobs: with: name: summary_file-${{ github.event.inputs.RUNTIME_VERSION }} path: ${{ github.workspace }}\GM-TF\results + - name: Wait 10 seconds + run: sleep 10 - name: Running TF Compare Script run: python .\tf_compare.py --github-token ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} --workflow ${{ github.workflow }}.yml --rt ${{ github.event.inputs.RUNTIME_VERSION }} working-directory: GM-TF diff --git a/.github/workflows/Red.yml b/.github/workflows/Red.yml index fa08d6b..cbba3fe 100644 --- a/.github/workflows/Red.yml +++ b/.github/workflows/Red.yml @@ -46,6 +46,8 @@ jobs: with: name: summary_file-${{ github.event.inputs.RUNTIME_VERSION }} path: ${{ github.workspace }}\GM-TF\results + - name: Wait 10 seconds + run: sleep 10 - name: Running TF Compare Script run: python .\tf_compare.py --github-token ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} --workflow ${{ github.workflow }}.yml --rt ${{ github.event.inputs.RUNTIME_VERSION }} working-directory: GM-TF diff --git a/tf_compare.py b/tf_compare.py index 4846b8c..b308de5 100644 --- a/tf_compare.py +++ b/tf_compare.py @@ -113,7 +113,10 @@ def get_workflow_runs(): None ) if target_index is None: - LOGGER.error(f"No workflow run found with a summary_file artifact for runtime version {RTVersion}") + LOGGER.error(f"No workflow run found with a summary_file artifact for runtime version '{RTVersion}'") + # log what the newest run actually has so the mismatch is visible in the workflow log + newest_names = get_artifact_names(valid_runs[0]['id'], headers) + LOGGER.error(f"Artifacts on newest run {valid_runs[0]['id']}: {newest_names}") return else: # no runtime version supplied -> behave as before (latest run) @@ -134,14 +137,24 @@ def get_workflow_runs(): get_artifact_URL() -# True if the given run uploaded a summary_file artifact for this runtime version -def run_has_summary_for_rt(run_id, rt_version, headers): - response = requests.get(f"https://api.github.com/repos/{repos[1]}/actions/runs/{run_id}/artifacts", headers=headers) +# Return the list of artifact names for a run (empty list on error) +def get_artifact_names(run_id, headers): + response = requests.get(f"https://api.github.com/repos/{repos[1]}/actions/runs/{run_id}/artifacts?per_page=100", headers=headers) if response.status_code != 200: LOGGER.warning(f"Could not read artifacts for run {run_id}. HTTP Status: {response.status_code}") - return False - artifacts = response.json().get("artifacts", []) - return any(a.get("name") == f"summary_file-{rt_version}" for a in artifacts) + return [] + return [a.get("name", "") for a in response.json().get("artifacts", [])] + + +# True if the given run uploaded a summary_file artifact for this runtime version. +# Match tolerantly: the artifact is named "summary_file-" but we don't +# rely on an exact string equality (which breaks on any stray whitespace or format drift). +def run_has_summary_for_rt(run_id, rt_version, headers): + rt = str(rt_version).strip() + for name in get_artifact_names(run_id, headers): + if "summary_file" in name and rt in name: + return True + return False