Skip to content

Commit

Permalink
filter out outdated workflow runs (#31071)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreydevyatkin authored Apr 22, 2024
1 parent 8dcbf96 commit 2472695
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from psycopg2 import extras
from ruamel.yaml import YAML
from github import GithubIntegration
from datetime import datetime
from datetime import datetime, timedelta

DB_HOST = os.environ["DB_HOST"]
DB_PORT = os.environ["DB_PORT"]
Expand Down Expand Up @@ -158,10 +158,12 @@ def filter_workflow_runs(run, issue):
if not len(workflow.runs):
return False

three_months_ago_datetime = datetime.now() - timedelta(days=90)
workflow_runs = [run for run in workflow.runs if run.started_at > three_months_ago_datetime]

url = f"https://api.github.com/repos/{GIT_ORG}/beam/issues"
headers = {"Authorization": get_token()}
semaphore = asyncio.Semaphore(5)
workflow_runs = workflow.runs
params = {
"state": "closed",
"labels": f"flaky_test,workflow_id: {workflow.id}",
Expand Down

0 comments on commit 2472695

Please sign in to comment.