diff --git a/.github/actions/collect_data/src/utils.py b/.github/actions/collect_data/src/utils.py index 0dc506e..908e8dd 100644 --- a/.github/actions/collect_data/src/utils.py +++ b/.github/actions/collect_data/src/utils.py @@ -82,13 +82,6 @@ def get_pipeline_row_from_github_info(github_runner_environment, github_pipeline } -def return_first_string_starts_with(starting_string, strings): - for string in strings: - if string.startswith(starting_string): - return string - raise Exception(f"{strings} do not have any that match {starting_string}") - - def get_job_failure_signature_(github_job) -> Optional[Union[InfraErrorV1]]: if github_job["conclusion"] == "success": return None @@ -122,23 +115,17 @@ def get_job_row_from_github_job(github_job): else: location = "tt_cloud" + os = None if location == "github": - try: - ubuntu_version = return_first_string_starts_with("ubuntu-", labels) - except Exception as e: - logger.error(e) - logger.error(f"{labels} for a GitHub runner seem to not specify an ubuntu version") - raise e - if ubuntu_version == "ubuntu-latest": + os_variants = ["ubuntu", "windows", "macos"] + os = [label for label in labels if any(variant in label for variant in os_variants)][0] + if os == "ubuntu-latest": logger.warning("Found ubuntu-latest, replacing with ubuntu-24.04 but may not be case for long") - ubuntu_version = "ubuntu-24.04" - elif location == "tt_cloud": - logger.warning("Assuming ubuntu-20.04 for tt cloud, but may not be the case soon") - ubuntu_version = "ubuntu-20.04" - else: - ubuntu_version = None + os = "ubuntu-24.04" - os = ubuntu_version + if location == "tt_cloud": + logger.warning("Assuming ubuntu-20.04 for tt cloud, but may not be the case soon") + os = "ubuntu-20.04" name = github_job["name"] diff --git a/.github/actions/collect_data/test/data/12007373278/workflow_jobs.json b/.github/actions/collect_data/test/data/12007373278/workflow_jobs.json index 12b45cc..acc883c 100644 --- a/.github/actions/collect_data/test/data/12007373278/workflow_jobs.json +++ b/.github/actions/collect_data/test/data/12007373278/workflow_jobs.json @@ -233,6 +233,42 @@ "runner_group_id": 2, "runner_group_name": "GitHub Actions" }, + { + "id": 33467841415, + "run_id": 12007373278, + "workflow_name": "Run all tests", + "head_branch": "main", + "run_url": "https://api.github.com/repos/tenstorrent/tt-lens/actions/runs/12007373278", + "run_attempt": 1, + "node_id": "CR_kwDOMDRX4M8AAAAHyta7hw", + "head_sha": "2030b2421d8c444a8c1fe4b8f823e2bc094f5dd9", + "url": "https://api.github.com/repos/tenstorrent/tt-lens/actions/jobs/33467841415", + "html_url": "https://github.com/tenstorrent/tt-lens/actions/runs/12007373278/job/33467841415", + "status": "completed", + "conclusion": "success", + "created_at": "2024-11-25T09:48:50Z", + "started_at": "2024-11-25T09:48:55Z", + "completed_at": "2024-11-25T09:50:18Z", + "name": "build / Build TT-LENS.", + "steps": [ + { + "name": "Set up job", + "status": "completed", + "conclusion": "success", + "number": 1, + "started_at": "2024-11-25T09:48:55Z", + "completed_at": "2024-11-25T09:48:56Z" + } + ], + "check_run_url": "https://api.github.com/repos/tenstorrent/tt-lens/check-runs/33467841415", + "labels": [ + "macos-latest" + ], + "runner_id": 18, + "runner_name": "GitHub Actions 18", + "runner_group_id": 2, + "runner_group_name": "GitHub Actions" + }, { "id": 33467915506, "run_id": 12007373278,