Skip to content

Add rerandomize_lottery_numbers option to SignupRound#11226

Merged
nbudin merged 2 commits intomainfrom
11224-rerandomize-signup-round
Mar 16, 2026
Merged

Add rerandomize_lottery_numbers option to SignupRound#11226
nbudin merged 2 commits intomainfrom
11224-rerandomize-signup-round

Conversation

@nbudin
Copy link
Contributor

@nbudin nbudin commented Mar 15, 2026

Summary

  • Adds a rerandomize_lottery_numbers boolean field to SignupRound (default false)
  • When true, the automation reassigns new random lottery numbers (sampled from 1–10,000 without replacement) to all UserConProfiles in the convention before executing the round's signups, using a single UPDATE … FROM (VALUES …) SQL statement to avoid unique constraint issues
  • New numbers are assigned atomically within the same transaction as the signup execution, ensuring they apply to the round that's about to run

Test plan

  • Added test verifying rerandomized lottery numbers are in the 1–10,000 range and are used for signup ordering
  • Added test verifying lottery numbers are unchanged when rerandomize_lottery_numbers is false
  • All existing ExecuteRankedChoiceSignupRoundService tests continue to pass

Fixes #11224

🤖 Generated with Claude Code

When rerandomize_lottery_numbers is true on a signup round, the automation
reassigns random lottery numbers (sampled from 1..10000 without replacement)
to all UserConProfiles in the convention using a single SQL UPDATE before
executing the round's signups.

Fixes #11224
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbudin nbudin added enhancement minor Bumps the minor version number on release labels Mar 15, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
app/graphql/types/signup_round_type.rb 🟢 95% 🟢 95.45% 🟢 0.45%
app/services/execute_ranked_choice_signup_round_service.rb 🟢 80.39% 🟢 81.65% 🟢 1.26%
test/services/execute_ranked_choice_signup_round_service_test.rb 🟢 94.58% 🟢 95.09% 🟢 0.51%
Overall Coverage 🟢 52.69% 🟢 52.75% 🟢 0.06%

Minimum allowed coverage is 0%, this run produced 52.75%

@nbudin nbudin merged commit 4015589 into main Mar 16, 2026
19 checks passed
@nbudin nbudin deleted the 11224-rerandomize-signup-round branch March 16, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement minor Bumps the minor version number on release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-randomize option on signup rounds

1 participant