Repository navigation
fix: reconcile pydantic v2 config names and drop unused fields - #195
Conversation
These fields are never read. Leaving them in place hides stale Vault keys that extra=forbid should reject. Co-authored-by: Cursor <cursoragent@cursor.com>
The seed script still looked up the pre-migration ROLE_ prefix, so it skipped every role in the current env files. Co-authored-by: Cursor <cursoragent@cursor.com>
BOT_ENVIRONMENT is one character away from BOT__ENVIRONMENT, and they mean different things. APP_ENV_FILE now selects the deployed env file, while the old name still works. Co-authored-by: Cursor <cursoragent@cursor.com>
Alembic still read the pre-migration MYSQL_* variables and ignored ASYNC. Migrations now use the same URL builder as the app, with the sync driver forced on. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
==========================================
- Coverage 66.60% 65.57% -1.03%
==========================================
Files 54 77 +23
Lines 3177 3788 +611
==========================================
+ Hits 2116 2484 +368
- Misses 1061 1304 +243 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The settings read grouped values as BOT__*, CHANNEL__* and ROLE__* since the Pydantic v2 migration, but the README still listed BOT_TOKEN and CHANNEL_DEVLOG.
dimoschi
left a comment
There was a problem hiding this comment.
Nice cleanup, and it merges cleanly on current main (all tests pass, alembic still builds its URL fine).
One blocker: prod and dev still have some of the removed ROLE__* keys, so with extra="forbid" the bot would not start after this deploys. Details inline. The Vault keys need to go anyway, but the app should not crash on them.
Also, dev has CURRENT_SEASON_ID but no SEASON_ID, so it runs with season 0. Worth adding it there too.
Removed ROLE__ keys are still in Vault, and extra=forbid would stop the bot from starting. The app always uses the async driver and Alembic always uses the sync one. APP_DEPLOYED is the deploy flag, and CURRENT_SEASON_ID still fills SEASON_ID. Co-authored-by: Cursor <cursoragent@cursor.com>
dimoschi
left a comment
There was a problem hiding this comment.
Thanks, all good now. I checked that it boots with the old keys we still have in prod, and that CURRENT_SEASON_ID fills SEASON_ID when it's the only one set. Tests pass on top of current main.
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that apply.Proposed changes
Reconcile the config leftovers from the Pydantic v2 migration.
Fixes #189
Fixes #190
APRIL_ROLE_1,APRIL_ROLE_2,RANK_FIVE,RANK_TWENTY_FIVE,RANK_FIFTY,RANK_HUNDRED,ACADEMY_CBBH,APRIL_FLAG_1,APRIL_FLAG_2,SLACK_WEBHOOK, andJIRA_SPOILER_WEBHOOK.extra="forbid"will reject them if they are still set.ROLE__{suffix}instead of the pre-migrationROLE_prefix.APP_ENV_FILE.BOT_ENVIRONMENTstill works, so current Vault configs keep booting. Either flag loadsENV_PATHwhen it is set.ASYNCselectsasyncmyorpymysql, and Alembic calls that builder with the sync driver instead of readingMYSQL_*.Checklist
Put an
xin the boxes that apply.Additional context
startup.shstill usesMYSQL_*for the readiness ping..docker.envalready defines bothMYSQL_*andDATABASE__*.Before deploy, Vault still needs:
SEASON_IDset to the real season..test.envalready has it. A local.envmay still only haveCURRENT_SEASON_ID.JIRA_SPOILER_WEBHOOKif it is still present.Made with Cursor