Skip to content

Add GET /_debug/modules listing all modules with their elections and demographic columns - #758

Merged
fangge518 merged 3 commits into
devfrom
debug-modules-endpoint
Sep 8, 2026
Merged

Add GET /_debug/modules listing all modules with their elections and demographic columns#758
fangge518 merged 3 commits into
devfrom
debug-modules-endpoint

Conversation

@fangge518

@fangge518 fangge518 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

New debug/monitoring endpoint alongside /_debug/cache. It returns every module — invisible ones included — with a curated field set: districtr_map_slug, name, visible, map_type, num_districts, num_districts_modifiable, plus the elections and demographic_columns available on the module's gerrydb table, read live from the database catalog.

Like the rest of /_debug/*, the ALB serves it inside the VPC only (internet requests get a 403). On production and dev, need to use AWS's ECS to open a shell session on backend to print this information.

Tested

  • Module information appears when hitting localhost:8000/_debug/modules

fangge518 and others added 2 commits September 7, 2026 10:07
…aphic columns

Debug/monitoring endpoint next to /_debug/cache: every DistrictrMap row
(visible or not) with a curated field set — name, visible, map_type,
num_districts, num_districts_modifiable — plus the elections and
demographic columns derived live from the module's gerrydb table, using
the same column-name conventions as EvaluationContext.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntext

elections_from_columns and demographic_columns_from_columns now live in
app/evaluation/context.py, used by both EvaluationContext and the
/_debug/modules endpoint, so the column-name convention has one
definition.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

It is the sort key for the listing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fangge518
fangge518 merged commit cdcad48 into dev Sep 8, 2026
2 checks passed
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