diff --git a/jobs.py b/jobs.py index 80ad4b3..2600f00 100644 --- a/jobs.py +++ b/jobs.py @@ -833,7 +833,7 @@ def configure_scheduled_jobs() -> None: schedule.every().friday.at("13:00").do(post_inactive_engineers) schedule.every().day.at("12:00").do(post_priority_bugs) - schedule.every().friday.at("20:00").do(post_leaderboard) + schedule.every().friday.at("16:00", "America/New_York").do(post_leaderboard) # schedule.every().thursday.at("19:00").do(post_weekly_changelog) schedule.every().day.at("10:00", "America/New_York").do(post_stale) schedule.every().day.at("14:00", "America/New_York").do(post_project_updates) diff --git a/linear/projects.py b/linear/projects.py index df2b107..96f6d29 100644 --- a/linear/projects.py +++ b/linear/projects.py @@ -9,7 +9,7 @@ def get_completed_project_issue_assignees(project_id: str) -> list[str]: """Return sorted unique assignee display names for a project's completed issues.""" query = gql( """ - query CompletedProjectIssueAssignees($project_id: String!, $after: String) { + query CompletedProjectIssueAssignees($project_id: ID!, $after: String) { issues( first: 50 after: $after diff --git a/tests/test_jobs.py b/tests/test_jobs.py index eb8e291..4d58c80 100644 --- a/tests/test_jobs.py +++ b/tests/test_jobs.py @@ -173,8 +173,8 @@ def fake_every(interval=None): { "interval": None, "unit": "friday", - "at_time": "20:00", - "timezone": None, + "at_time": "16:00", + "timezone": "America/New_York", "func": jobs_module.post_leaderboard, }, recorded_jobs, @@ -204,11 +204,14 @@ def fake_every(interval=None): class RunDebugJobsTest(unittest.TestCase): def test_runs_leaderboard_stale_and_project_updates(self): with patch.object(jobs_module, "should_use_redis_cache", return_value=False): - with patch.object(jobs_module, "post_priority_bugs"): - with patch.object(jobs_module, "post_leaderboard") as leaderboard: - with patch.object(jobs_module, "post_stale") as stale: - with patch.object(jobs_module, "post_project_updates") as project_updates: - jobs_module.run_debug_jobs() + with patch.object(jobs_module, "post_inactive_engineers"): + with patch.object(jobs_module, "post_priority_bugs"): + with patch.object(jobs_module, "post_leaderboard") as leaderboard: + with patch.object(jobs_module, "post_stale") as stale: + with patch.object( + jobs_module, "post_project_updates" + ) as project_updates: + jobs_module.run_debug_jobs() leaderboard.assert_called_once_with() stale.assert_called_once_with() diff --git a/tests/test_linear_projects.py b/tests/test_linear_projects.py index 45d922e..0d93487 100644 --- a/tests/test_linear_projects.py +++ b/tests/test_linear_projects.py @@ -106,8 +106,10 @@ def test_paginates_and_returns_sorted_unique_assignees(self): }, ] calls = [] + queries = [] def fake_execute(_query, variable_values=None): + queries.append(str(_query)) calls.append(variable_values) return responses[len(calls) - 1] @@ -121,6 +123,7 @@ def fake_execute(_query, variable_values=None): {"project_id": "project-2", "after": "issue-cursor-1"}, ], ) + self.assertIn("$project_id: ID!", queries[0]) self.assertEqual(assignees, ["Austin Witherow", "Later Page Contributor"])