Skip to content

fix: reconcile pydantic v2 config names and drop unused fields - #195

Open
ToxicBiohazard wants to merge 4 commits into
mainfrom
fix/config-env-consistency
Open

ToxicBiohazard wants to merge 4 commits into
mainfrom
fix/config-env-consistency

Conversation

@ToxicBiohazard

Copy link
Copy Markdown
Member

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply.

  • Bugfix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality not to work as expected).
  • Documentation Update (if none of the other choices applies).

Proposed changes

Reconcile the config leftovers from the Pydantic v2 migration.

Fixes #189
Fixes #190

  • Remove settings that nothing reads: 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, and JIRA_SPOILER_WEBHOOK. extra="forbid" will reject them if they are still set.
  • Seed dynamic roles from ROLE__{suffix} instead of the pre-migration ROLE_ prefix.
  • Choose the settings file with APP_ENV_FILE. BOT_ENVIRONMENT still works, so current Vault configs keep booting. Either flag loads ENV_PATH when it is set.
  • Build the database URL in one place. ASYNC selects asyncmy or pymysql, and Alembic calls that builder with the sync driver instead of reading MYSQL_*.

Checklist

Put an x in the boxes that apply.

  • I have read and followed the CONTRIBUTING.md doc.
  • Lint and unit tests pass locally with my changes.
  • I have added the necessary documentation (if appropriate).

Additional context

startup.sh still uses MYSQL_* for the readiness ping. .docker.env already defines both MYSQL_* and DATABASE__*.

Before deploy, Vault still needs:

  • SEASON_ID set to the real season. .test.env already has it. A local .env may still only have CURRENT_SEASON_ID.
  • The removed keys deleted, or startup fails. That includes JIRA_SPOILER_WEBHOOK if it is still present.

Made with Cursor

ToxicBiohazard and others added 4 commits September 29, 2026 07:22
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

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.05%. Comparing base (76b2f25) to head (243f57a).

Files with missing lines Patch % Lines
scripts/seed_dynamic_roles.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #195      +/-   ##
==========================================
- Coverage   66.60%   66.05%   -0.55%     
==========================================
  Files          54       55       +1     
  Lines        3177     3226      +49     
==========================================
+ Hits         2116     2131      +15     
- Misses       1061     1095      +34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

fix: reconcile config naming inconsistencies from Pydantic v2 migration chore: remove unused config fields from v1.13.0 pydantic migration

1 participant