From 20d27727ba46fd4b920e7519f03f0d44ce015f3f Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 28 Aug 2024 14:34:55 +0100 Subject: [PATCH] Filter out old actions runs from dashboard --- .../metrics/sync/github/github_runs_prefetcher/code/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py b/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py index e8fe60b4a7dc..fd4a5e713fe0 100644 --- a/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py +++ b/.test-infra/metrics/sync/github/github_runs_prefetcher/code/main.py @@ -307,6 +307,8 @@ def append_workflow_runs(workflow, runs): number_of_entries_per_page = 100 # The number of results per page (max 100) params = {"branch": "master", "page": page, "per_page": number_of_entries_per_page} concurrent_requests = 30 # Number of requests to send simultaneously + start = datetime.now() - timedelta(days=90) + earliest_run_creation_date = start.strftime('%Y-%m-%d') semaphore = asyncio.Semaphore(concurrent_requests) print("Start fetching recent workflow runs") @@ -338,6 +340,7 @@ def append_workflow_runs(workflow, runs): "page": page, "per_page": number_of_entries_per_page, "exclude_pull_requests": "true", + "created": f'>={earliest_run_creation_date}', } workflow_run_tasks.append(fetch(runs_url, semaphore, params, headers)) page += 1