Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I’m Not on the DEV Team. I Still Debugged Their Missing Badges From Public Code. (And My First Test Was Wrong.)

Описание и применение

Проблема с выдачей многократных бейджей на DEV была решена путем исправления несоответствия slug, добавления контекстного сообщения и обеспечения идемпотентности. Теперь пользователи с четырьмя и более слияниями получают бейдж 4x‑commit‑club с благодарностью.

Задача

Missing multi‑commit contributor badges on DEV due to slug mismatch, missing context messages, and idempotency issues in the badge awarding service.

Результат

The PR fixed slug resolution, added thank‑you context, and ensured idempotent badge creation, restoring badge awards for multi‑commit contributors and preventing duplicate emails.

Рабочий процесс

  • 1. Observe missing badge after 4 merged PRs. 2. Inspect BadgeAwardWorker schedule and GitHub API. 3. Read award_contributor_from_github.rb to identify bugs. 4. Identify slug mismatch, missing context, and idempotency problems. 5. File Issue #24114 and submit PR #24113 with fixes. 6. Review and adjust logging and regression tests. 7. Merge PR and verify badge awarded with context message.

Доказательства

Each key in BADGE_SLUGS is resolved via Badge.id_for_slug(slug). If a slug in the production badges table doesn’t match the hardcoded constant, id_for_slug returns nil.

Источник

BadgeAchievement.create(user_id: user_id, badge_id: slug_id)

Источник

I ran a read-only lookup on the badges table for the five BADGE_SLUGS keys. Only one of the five slugs resolves.

Источник

The test passed on main without the fix because the badge factory defaults to allow_multiple_awards: false.

Источник

  • Дата записи: 2026-11-01T16:43:56.620Z