Skip to content

fix: escape database URL for Alembic config - #39

Merged
afaryy merged 1 commit into
mainfrom
fix/alembic-database-url-percent-escape
Aug 3, 2026
Merged

fix: escape database URL for Alembic config#39
afaryy merged 1 commit into
mainfrom
fix/alembic-database-url-percent-escape

Conversation

@afaryy

@afaryy afaryy commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • escape percent signs before passing DATABASE_URL into Alembic configparser-backed configuration
  • keep runtime application DATABASE_URL handling unchanged
  • add a backend regression test using a synthetic percent-encoded password value

Root cause

Alembic's config.set_main_option uses Python configparser interpolation. Percent-encoded characters in DATABASE_URL, such as %2B or %25, must be escaped as %% before being stored in the Alembic config object.

Validation

  • backend pytest
  • backend ruff
  • Alembic history check
  • git diff --check

Not included

  • no Terraform changes
  • no CloudFormation changes
  • no GitHub workflow changes
  • no frontend changes
  • no AWS resources, deployments, or migrations run

Follow-up after merge

  • publish a new backend image from main
  • rerun the database migration workflow with the new backend digest/source_commit
  • deploy the backend after migration succeeds

@afaryy
afaryy marked this pull request as ready for review August 3, 2026 03:00
@afaryy
afaryy merged commit cdcb16d into main Aug 3, 2026
7 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

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.

1 participant