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‑ов, отсутствия контекстных сообщений и отсутствия идемпотентности. Исправление кода привело к появлению многократных вкладов и корректной отправке писем.

Задача

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 badge awarding logic, restored missing badges, added thank‑you messages, and prevented duplicate badge emails.

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

  • 1. Identified missing badges after merging four PRs. 2. Reviewed BadgeAwardWorker schedule and GitHub API. 3. Opened award_contributor_from_github.rb to inspect logic. 4. Discovered three bugs: silent slug drops, missing context, missing idempotency. 5. Filed Issue #24114 and PR #24113 with fixes. 6. Reviewed PR with OpenHands; adjusted logging and test. 7. Merged PR and received badge email 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.

Источник

  • Дата записи: 2026-10-24T20:26:48.339Z