From dc584b1ae79186a4e1d7d5d77bc4189a29728157 Mon Sep 17 00:00:00 2001 From: Joseph Sawaya Date: Wed, 23 Apr 2025 16:00:20 -0400 Subject: [PATCH] fix(ta): pass right arg to cache rollup task we made the switch from repoid to repo_id previously but i failed to update the calls in CacheRollupCron and the new TA finisher also the call to process flakes in the new TA finisher no longer requires the commit id arg --- services/test_analytics/ta_finish_upload.py | 3 +-- services/test_analytics/tests/test_ta_finish_upload.py | 7 ++----- tasks/cache_rollup_cron_task.py | 2 +- tasks/tests/unit/test_cache_rollup_cron_task.py | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/services/test_analytics/ta_finish_upload.py b/services/test_analytics/ta_finish_upload.py index 78426ccee..5dc53b76d 100644 --- a/services/test_analytics/ta_finish_upload.py +++ b/services/test_analytics/ta_finish_upload.py @@ -110,7 +110,6 @@ def queue_followup_tasks( process_flakes_task_name, kwargs={ "repo_id": repo.repoid, - "commit_id": commit.commitid, "impl_type": impl_type, }, ) @@ -119,7 +118,7 @@ def queue_followup_tasks( celery_app.send_task( cache_test_rollups_task_name, kwargs={ - "repoid": repo.repoid, + "repo_id": repo.repoid, "branch": commit.branch, "impl_type": impl_type, }, diff --git a/services/test_analytics/tests/test_ta_finish_upload.py b/services/test_analytics/tests/test_ta_finish_upload.py index 2bbeb90b6..b056d1600 100644 --- a/services/test_analytics/tests/test_ta_finish_upload.py +++ b/services/test_analytics/tests/test_ta_finish_upload.py @@ -16,10 +16,7 @@ from shared.django_apps.test_analytics.models import Flake from database.enums import ReportType -from database.tests.factories import ( - PullFactory, - UploadFactory, -) +from database.tests.factories import PullFactory, UploadFactory from services.test_analytics.ta_finish_upload import FinisherResult, new_impl from services.yaml import UserYaml from tests.helpers import mock_all_plans_and_tiers @@ -147,7 +144,7 @@ def assert_tasks(tasks: list[Literal["flakes", "cache_rollup"]]): "cache_rollup": call( "app.tasks.cache_rollup.CacheTestRollupsTask", kwargs={ - "repoid": repo.repoid, + "repo_id": repo.repoid, "branch": commit.branch, "impl_type": "new", }, diff --git a/tasks/cache_rollup_cron_task.py b/tasks/cache_rollup_cron_task.py index 507193801..4e4ebbafd 100644 --- a/tasks/cache_rollup_cron_task.py +++ b/tasks/cache_rollup_cron_task.py @@ -25,7 +25,7 @@ def run_cron_task(self, _db_session: Session, *args, **kwargs): repo_branch.delete() else: self.app.tasks[cache_test_rollups_task_name].s( - repoid=repo.repoid, + repo_id=repo.repoid, branch=branch, update_date=False, ).apply_async() diff --git a/tasks/tests/unit/test_cache_rollup_cron_task.py b/tasks/tests/unit/test_cache_rollup_cron_task.py index 888b5595d..729bc8e23 100644 --- a/tasks/tests/unit/test_cache_rollup_cron_task.py +++ b/tasks/tests/unit/test_cache_rollup_cron_task.py @@ -25,7 +25,7 @@ def test_cache_rollup_cron_task(mock_storage, transactional_db, mocker): ) mocked_app.tasks[cache_test_rollups_task_name].s.assert_called_once_with( - repoid=rollup_date.repository_id, + repo_id=rollup_date.repository_id, branch=rollup_date.branch, update_date=False, )