diff --git a/.test-infra/metrics/sync/github/sync_workflows.py b/.test-infra/metrics/sync/github/sync_workflows.py index a2c062b175ea..d2400dab4080 100644 --- a/.test-infra/metrics/sync/github/sync_workflows.py +++ b/.test-infra/metrics/sync/github/sync_workflows.py @@ -328,7 +328,6 @@ 'Beam Metrics Report', 'Build and Version Runner Docker Image', 'PreCommit GHA', - 'pr-bot-prs-needing-attention', 'PreCommit RAT', 'Assign or close an issue', 'PostCommit Website Test', @@ -339,8 +338,10 @@ 'PreCommit Whitespace', 'Publish Beam SDK Snapshots', 'Cancel Stale Dataflow Jobs', + 'pr-bot-new-prs', 'pr-bot-pr-updates', - 'pr-bot-new-prs' + 'pr-bot-prs-needing-attention', + 'pr-bot-update-reviewers' ] MISC_TESTS = [ @@ -355,7 +356,6 @@ 'Cancel', 'PostCommit PortableJar Spark', 'PreCommit Integration and Load Test Framework', - 'pr-bot-update-reviewers', 'PostCommit TransformService Direct', 'Cut Release Branch', 'Generate issue report', @@ -404,7 +404,7 @@ def get_dashboard_category(workflow_name): return 'go' if workflow_name in MISC_TESTS: return 'misc' - + print(f'No category found for workflow: {workflow_name}') print('Falling back to rules based assignment') @@ -471,7 +471,7 @@ def get_token(): git_integration = GithubIntegration(GH_APP_ID, GH_PEM_KEY) token = git_integration.get_access_token(GH_APP_INSTALLATION_ID).token return f'Bearer {token}' - + @backoff.on_exception(backoff.constant, aiohttp.ClientResponseError, max_tries=5) async def fetch(url, semaphore, params=None, headers=None, request_id=None): async with semaphore: @@ -574,7 +574,7 @@ def append_workflow_runs(workflow, runs): else: workflow_ids_to_fetch_extra_runs.pop(workflow_id, None) print(f"Successfully fetched details for: {workflow.filename}") - + page = math.ceil( int(GH_NUMBER_OF_WORKFLOW_RUNS_TO_FETCH) / number_of_entries_per_page ) + 1 diff --git a/scripts/ci/pr-bot/updateReviewers.ts b/scripts/ci/pr-bot/updateReviewers.ts index c49f8feba24f..96eaa6e22f63 100644 --- a/scripts/ci/pr-bot/updateReviewers.ts +++ b/scripts/ci/pr-bot/updateReviewers.ts @@ -104,6 +104,7 @@ async function getReviewersForPull(pull: any): Promise { for (const comment of comments) { if ( + comment.user && comment.user.login && comment.user.login !== pull.user.login && comment.user.login !== BOT_NAME