Skip to content

Seed legacy WeaselBot achievements with auto-award config#10

Open
romanparkhomenko wants to merge 1 commit into
F3-Nation:mainfrom
romanparkhomenko:feat/seed-legacy-weaselbot-achievements
Open

Seed legacy WeaselBot achievements with auto-award config#10
romanparkhomenko wants to merge 1 commit into
F3-Nation:mainfrom
romanparkhomenko:feat/seed-legacy-weaselbot-achievements

Conversation

@romanparkhomenko

Copy link
Copy Markdown

Summary

Hi F3 Nation — Greco from F3 Tornado Alley (org 35003) here. This seeds the canonical set of achievements that the deprecated WeaselBot service used to award (see archive-weaselbot), so the slack bot's auto-award engine can grant them out of the box.

Today the baseline migration (bc8d946e6cf2) seeds only three of these by name (The Priest, The Monk, Leader of Men), and it predates the auto-award columns — so every seeded achievement has auto_award = false and nothing auto-awards.

What changed

A new Alembic data migration (c4f7a1e92b30) that:

  1. Inserts the 11 remaining legacy WeaselBot achievements.

  2. Enables auto-award on the 10 whose criteria map exactly to a metric the engine supports (posts / qs):

    Achievement Metric Threshold Cadence
    Leader of Men qs 4 monthly
    The Boss qs 6 monthly
    Be the Hammer, Not the Nail qs 6 weekly
    El Presidente qs 20 yearly
    El Quatro posts 25 yearly
    Golden Boy posts 50 yearly
    Centurion posts 100 yearly
    Karate Kid posts 150 yearly
    Crazy Person posts 200 yearly
    6 Pack posts 6 weekly
  3. Leaves 4 as manual/named because they can't be expressed with the engine's current metrics (documented in the migration docstring):

    • The Priest / The Monk — QSource-scoped; the award engine ignores event-type/-tag filters (only first/second/third-F category filters apply), so QSource can't be isolated yet.
    • Cadre — "Q at 7 different AOs"; unique_aos counts distinct AOs posted at, not Q'd at.
    • Holding Down the Fort — "50 posts at a single AO"; posts_at_ao needs a specific ao_org_id and has no "max over any one AO" mode.

The legacy code for each is preserved in meta.legacy_code for traceability.

Fidelity note

WeaselBot counted beatdown posts/Qs only (excluding QSource and ruck). Because the engine can't filter those by type, the auto-award rows here count all posts/Qs (auto_filters empty). Regions wanting stricter criteria can create custom achievements. Open to adding category-based filters if you'd prefer closer parity.

Testing

Ran the full Alembic chain up and down against Postgres 16:

  • alembic upgrade head → 14 achievements (10 auto, 4 manual), values as above.
  • alembic downgrade -1 → restores the 3 baseline rows with auto-award cleared.
  • Re-upgrade → idempotent (guards on existing names); all 14 carry meta.legacy_code.
  • ruff check clean.

Pairs with the slack-bot PR that lets regions self-enable achievements — together they make this usable end-to-end.

The baseline seed (bc8d946e6cf2) only inserted three achievements by name
(The Priest, The Monk, Leader of Men) and predates the auto-award columns,
so no achievement auto-awards today.

Seed the eleven remaining canonical WeaselBot achievements (see
archive-weaselbot) and enable auto-award on the ten whose criteria map
exactly to a supported engine metric (posts / qs):

  Leader of Men, The Boss, Be the Hammer Not the Nail, El Presidente,
  El Quatro, Golden Boy, Centurion, Karate Kid, Crazy Person, 6 Pack

Four are seeded as manual-only because they can't be expressed with the
engine's current metrics (documented in the migration docstring):
The Priest & The Monk (QSource-scoped; type/tag filters are ignored by
the engine), Cadre (no 'unique AOs Q'd' metric) and Holding Down the Fort
(no 'max posts at any single AO' metric).

The legacy code for each achievement is preserved in meta.legacy_code.
Idempotent (guards on existing names) with a full downgrade.

Verified by running the full alembic chain up and down against Postgres 16.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant