Skip to content

Commit dda472d

Browse files
committed
feat: tag the release pipeline backfill in the sync log
1 parent d1901b0 commit dda472d

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

libraries/management/commands/release_tasks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def set_tasks(self):
6262
Action("Updating website statistics", self.update_website_statistics),
6363
Action("Importing mailing list counts", self.import_ml_counts),
6464
# Last, so every source it reads has already been refreshed above.
65-
Action("Backfilling achievements", ["backfill_achievements"]),
65+
Action(
66+
"Backfilling achievements",
67+
["backfill_achievements", "--trigger", "pipeline"],
68+
),
6669
# Action("Generating report", self.generate_report),
6770
]
6871

libraries/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def update_authors_and_maintainers():
281281
call_command("update_library_version_authors", "--clean")
282282
app.signature("users.tasks.recompute_displayed_profile_roles").apply_async()
283283
# Only the sources whose upstream data just changed. A blanket backfill would
284-
# also sweep the commit, review and news tables this task never touches.
284+
# also sweep the commit and review tables this task never touches.
285285
call_command(
286286
"backfill_achievements",
287287
"--source",

libraries/tests/test_tasks.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_update_library_version_website_adoc_no_stable_release():
168168

169169
@patch("libraries.tasks.call_command")
170170
def test_update_authors_and_maintainers_backfills_only_library_sources(mock_call):
171-
"""A blanket backfill here would sweep the commit, review and news tables."""
171+
"""A blanket backfill here would sweep the commit and review tables too."""
172172
from libraries.tasks import update_authors_and_maintainers
173173

174174
update_authors_and_maintainers()
@@ -208,8 +208,12 @@ def test_release_tasks_delegates_the_backfill_to_the_command(mock_call):
208208

209209
assert [c.args[0] for c in mock_call.call_args_list] == ["release_tasks"]
210210
manager = ReleaseTasksManager(base_uri="https://example.com", user_id=None)
211-
assert [
212-
task.description
211+
sweeps = [
212+
task
213213
for task in manager.tasks
214-
if task.handler == ["backfill_achievements"]
215-
] == ["Backfilling achievements"]
214+
if isinstance(task.handler, list) and task.handler[0] == "backfill_achievements"
215+
]
216+
assert [task.description for task in sweeps] == ["Backfilling achievements"]
217+
# Tagged, so the sync log can tell the weekly job from a person pressing a
218+
# button when support asks what moved a member's count.
219+
assert sweeps[0].handler == ["backfill_achievements", "--trigger", "pipeline"]

0 commit comments

Comments
 (0)