Story #2609 :: Task: Run the achievement backfill from the weekly release pipeline - #2613
Story #2609 :: Task: Run the achievement backfill from the weekly release pipeline#2613herzog0 wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c078f65 to
7a33de9
Compare
7a33de9 to
6b42a49
Compare
6b42a49 to
a4ecd9c
Compare
eed9dd2 to
efc6942
Compare
efc6942 to
19bcbea
Compare
b5c189f to
bce0901
Compare
bce0901 to
ed9c3ec
Compare
ed9c3ec to
aa13c18
Compare
aa13c18 to
28227fe
Compare
28227fe to
62b99ee
Compare
jlchilders11
left a comment
There was a problem hiding this comment.
One major concern with the release tasks, which I have been bitten by before. Happy to discuss solutions!
| Action("Updating slack activity buckets", ["fetch_slack_activity"]), | ||
| Action("Updating website statistics", self.update_website_statistics), | ||
| Action("Importing mailing list counts", self.import_ml_counts), | ||
| # Last, so every source it reads has already been refreshed above. |
There was a problem hiding this comment.
For actions which call management commands, the Action returns and the Manager moves on once the managment command is called. For commands that then call tasks, this is instantaneous. This means that we have no real guarantee that the previous actions have finished resolving before this is called (and in fact likely are not, since the celery worker is weaker than the main thread).
62b99ee to
dda472d
Compare
dda472d to
8d87f22
Compare
Issue: #2609
teo/2541-source-library-reviewSummary & Context
Lets the achievement backfill run unattended. This is deliberately the last step of the ingestion
half: by now every source is wired and reviewed, and the previous eight PRs can all be exercised
by hand first.
Changes
release_tasks: aBackfilling achievementsaction, last in the list, so every source itreads has already been refreshed by the steps above it.
update_authors_and_maintainers: backfills only the three sources whose upstream data thattask just changed (
library-authoring,library-maintenance,library-versioning). A blanketbackfill would also sweep the commit and review tables it never touches.
update_commits: a comment recording why there is deliberately no backfill call there - itruns as a step of
release_tasks, which sweeps everything once at the end, so calling it heretoo would walk the whole
Committable twice per release.libraries/tests/test_tasks.py: three tests asserting the wiring, which was previously threeuntested
call_commandlines.Everything it runs is additive -
backfill_achievementsissync_sourcewithremove=Falseand cannot delete a grant or revoke a badge - so the failure mode is over-granting, not
data loss.
set. It must be settled before this runs for real, because backfill
awards badges against whatever thresholds are live at that moment, and lowering a threshold
afterwards is easy while raising one is not (retiring and replacing a tier keeps the members who
already met the old number). Tracked by the threshold-confirmation ticket.
a few seconds against a full copy of the Boost data.
going rather than failing the release job. Only an explicitly named missing source is fatal.
Screenshots
n/a - no UI.
Peer-review testing steps
This PR adds no UI of its own; what it changes is what three existing admin buttons do afterwards, and
the sync run log is where you see it. Setup:
just load_production_data,just migrate,docker compose up, and note the current last row id on/admin/badges/achievementsyncrun/so you cantell new rows from old ones.
/admin/libraries/library/-> Update Authors & Maintainers. When theworker finishes,
/admin/badges/achievementsyncrun/has exactly three new rows -library-authoring,library-maintenance,library-versioning- and nocode-commitsorlibrary-reviewrow. That absence is the review: this task only touches library authorship, so ablanket backfill would walk the commit and review tables for nothing.
commandwith no actor, because the libraries changelist buttons are the eightlegacy GET views that were deliberately left unconverted. Worth knowing when reading the log; not
something this PR changes.
/admin/libraries/commit/-> Update Commits. No new sync run rowappears. That is intentional and commented in the code: this task also runs as a step of
release_tasks, which sweeps everything once at the end, so backfilling here too would walk thewhole
Committable twice per release./admin/libraries/releasereport/-> Get Release Report Data, which is therelease_tasksentry point. Only against a scratch database with GitHub credentials configured: itimports versions, libraries, commits, issues, Slack and mailing-list data first, and its own tooltip
warns it can take hours. When it lands, the log has one row per source with trigger pipeline, all
timestamped after the import steps. Ordering matters - a backfill that ran before the imports would
grant against yesterday's data, which is why it is the last action in the list.
changed only ever counts additions. Then filter
/admin/badges/userbadge/to Revoked andconfirm nothing was revoked while the pipeline ran.
backfill_achievementsissync_sourcewithremove=False, so the failure mode here is over-granting, never data loss./admin/badges/badge/- the ladder column then reads No tiers - awards nothing - and runUpdate Authors & Maintainers again. Grants are still recorded, no badge is awarded, and the
other sources complete normally. (The stronger case, a source whose
Achievementrow is missingentirely, is not reachable from the admin on purpose: achievement deletion is refused. It is covered
in tests, and the behaviour is stderr-and-continue so a taxonomy mistake cannot kill the release job.)
/admin/badges/badge/andconfirm each one is the number the client intends. The sweep awards against whatever is live at that
moment, and lowering a threshold later is easy while raising one is not.