Story #2607 :: Task: Wire the Library Versioning achievement to per-release authorship - #2611
Open
herzog0 wants to merge 2 commits into
Open
Story #2607 :: Task: Wire the Library Versioning achievement to per-release authorship#2611herzog0 wants to merge 2 commits into
herzog0 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 |
5 tasks
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
from
August 13, 2026 14:44
8f5212c to
0f058b0
Compare
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
from
August 14, 2026 15:26
0f058b0 to
fb42915
Compare
herzog0
changed the base branch from
teo/2541-source-library-maintenance
to
teo/2486-badge-profile-display
August 14, 2026 18:39
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
from
August 14, 2026 19:57
fb42915 to
8eb0e9c
Compare
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
2 times, most recently
from
August 17, 2026 16:32
2a3d511 to
96b2f65
Compare
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
from
August 17, 2026 17:22
96b2f65 to
1bec46f
Compare
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
3 times, most recently
from
August 18, 2026 14:28
d77f611 to
c53dd7a
Compare
herzog0
force-pushed
the
teo/2541-source-library-versioning
branch
from
August 21, 2026 14:48
c53dd7a to
e5190a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #2607
teo/2486-badge-profile-displaySummary & Context
Wires the Library Maintenance achievement. The one thing worth reviewing here is the grain:
maintainers are recorded per
LibraryVersion, but the badge counts libraries maintained(1 / 2 / 5 / 10 / 20), so the iterator deduplicates across versions and yields the
Libraryasthe achievement source.
Without that, a maintainer of one library with 40 releases would hold diamond.
Changes
_iter_library_maintenancewalksLibraryVersionwith its maintainers prefetched and yields(user, library)once per(user, library)pair, tracking what it has already seen.BACKFILL_ITERATORS.test_iter_library_maintenance_dedupes_versions- three versions of one library yield exactlyone pair.
test_backfill_library_maintenance- two versions, one grant, one badge.(user, library)pair,bounded by the number of maintainer relationships, not by the number of versions - a few
thousand entries at Boost's scale.
Library, not theLibraryVersion. This iswhat makes the grant idempotent under
unique_automatic_user_achievement_sourceand what letsreconciliation match it. An earlier iteration of this feature recorded versions and had to be
cleaned up with a data migration;
reconcile, the two-way command, not on a backfill. That is by design.
Screenshots
n/a - no UI.
Peer-review testing steps
The dedup is the whole PR, and it is visible on a changelist. Setup:
just load_production_data,just migrate,docker compose up.The source is wired.
/admin/badges/badge/- the Maintainer row's Automatic column is atick and its ladder reads
1 / 2 / 5 / 10 / 20.Make yourself a maintainer of one library, several times over.
/admin/libraries/libraryversion/, filter by a single library, then open three of its versionsand add your own user to Maintainers on each.
Backfill.
/admin/badges/userachievement/-> Backfill achievements with Source set toLibrary Maintenance.
Three versions, one grant. Filter that changelist by Achievement: Library Maintenance: you
have exactly one row, and its Source column links to the library, not to any of the
three versions. Without the dedup this step is where you would see three.
/admin/badges/userbadge/shows Maintainer / Bronze; the per-member page (your name, linked from either badge changelist)
reads one valid grant and 1 to go to Silver.
A second library does move the count. Add yourself to Maintainers on one version of a
different library and press Backfill again: two grants, and Maintainer / Silver is
awarded. This is what proves the dedup is per (member, library) and not just "one grant per member".
Removal is a reconcile, and it demotes. Drop yourself from all three versions of the first
library. Backfill changes nothing. Then Reconcile achievements with Source on Library
Maintenance: the preview reports one removal, Apply, and the Silver row is revoked with
Count at revocation 1 while Bronze stays held.
/admin/badges/achievementsyncrun/shows the runwith Removed 1, and the revoked badge's notes name it.
Sanity-check against real data. Backfill All sources on a production copy, then filter
/admin/badges/userbadge/to Badge: Maintainer and Rank: Diamond. Every name there must genuinelymaintain 20 or more libraries - filter
/admin/badges/userachievement/by Achievement: LibraryMaintenance, search their email, and count the rows, whose Source links must all be distinct
libraries. Without the dedup, anyone maintaining a single long-lived library would be sitting in that
Diamond list, which is the failure this PR exists to prevent.