unmapped backers: a plain donation is not a member finding
ci/woodpecker/push/woodpecker Pipeline was canceled

A no-tier BACKER is only a member when it predates the tier system
(LEGACY_NO_TIER_BEFORE). Treating every no-tier BACKER as memberish made
the $75 Workers.VC donation mail info@ as a paid contributor with no
account. Mirror fetch_members() exactly; donations stay silent, and only
unattached credit packs keep the hold-and-notify path.
This commit is contained in:
inference-bot committed 2026-11-21 19:42:36 +00:00
1 parent ac39740acb
commit b761136dd9
2 files changed
+35 -7

No files matched your search

+17 -5
View File
@@ -107,6 +107,14 @@ async def main():
node("ADMIN", "Membership", "adminco", "admin@x.org", name="Co-op"),
# NOT a member: a credit-pack-only BACKER takes the held-credits path
node("BACKER", "Credit pack", "packbuyer", "pack@x.org", name="Pack Buyer"),
# NOT a member: a plain DONATION (no tier, joined after the legacy cutoff).
# OC grants BACKER role for any one-time contribution; a donation must stay
# silent instead of mailing info@ about a "missing account".
node("BACKER", None, "donor", "donor@x.org", name="Donor",
created="2026-11-21T15:10:00Z"),
# FINDING: a LEGACY no-tier BACKER (before the tier system) IS a member
node("BACKER", None, "legacy", "legacy@x.org", name="Legacy",
created="2026-01-01T00:00:00Z"),
# not a member role
node("MEMBER", "Membership", "roleonly", "role@x.org", name="Role Only"),
# FINDING: visible email -> the sweep should have provisioned this
@@ -137,15 +145,19 @@ async def main():
res = await m.reconcile_unmapped_backers()
check(f"the check runs (got {res.get('status')})", res.get("status") == "ok")
classes = sorted(res.get("classes") or [])
check(f"four findings in three classes (got {res.get('findings')} {classes})",
res.get("findings") == 4 and classes == ["hidden", "null-account", "org", "visible"])
check(f"five findings in four classes (got {res.get('findings')} {classes})",
res.get("findings") == 5 and classes == ["hidden", "null-account", "org", "visible"])
check("a node with no createdAt is NOT reported (nothing to attribute it against)",
sum(1 for f in res["detail"] if f["class"] == "null-account") == 1)
slugs = sorted(f["slug"] or "(null-account)" for f in res["detail"])
check(f"exactly the unmapped member-ish nodes are findings (got {slugs})",
slugs == ["(null-account)", "gammaorg", "han", "vic"])
slugs == ["(null-account)", "gammaorg", "han", "legacy", "vic"])
check("a Credit-pack-only BACKER is not a member finding",
not any(f["slug"] == "packbuyer" for f in res["detail"]))
check("a post-cutoff no-tier BACKER (a plain donation) is not a finding",
not any(f["slug"] == "donor" for f in res["detail"]))
check("a LEGACY no-tier BACKER is still a member finding",
any(f["slug"] == "legacy" for f in res["detail"]))
check("a MEMBER-role node is not a member finding",
not any(f["slug"] == "roleonly" for f in res["detail"]))
vis = {f["slug"]: f["email_visibility"] for f in res["detail"]}
@@ -170,7 +182,7 @@ async def main():
# Same set again: a report, but NO second email.
res2 = await m.reconcile_unmapped_backers()
check(f"the same finding set is not re-emailed (got {len(SENT)} emails)",
res2.get("findings") == 4 and res2.get("reported") is False and len(SENT) == 1)
res2.get("findings") == 5 and res2.get("reported") is False and len(SENT) == 1)
# The set CHANGES (one finding resolved): mail again.
NODES[:] = [n for n in NODES
@@ -181,7 +193,7 @@ async def main():
# got shorter. Only genuinely NEW keys speak.
check(f"a smaller set re-mails nobody (got {res3.get('findings')} findings, "
f"{res3.get('new')} new, {len(SENT)} emails)",
res3.get("findings") == 3 and res3.get("new") == 0 and len(SENT) == 1)
res3.get("findings") == 4 and res3.get("new") == 0 and len(SENT) == 1)
# Fully clear: silent, and the marker is cleared so a recurrence speaks up.
NODES[:] = [node("BACKER", "Membership", "alice", "alice@x.org", name="Alice")]