Skip to content

fix: register NormalizationRun model in package exports and Alembic#14

Merged
damienriehl merged 1 commit intoCatholicOS:mainfrom
alea-institute:fix/register-normalization-run-model
Apr 1, 2026
Merged

fix: register NormalizationRun model in package exports and Alembic#14
damienriehl merged 1 commit intoCatholicOS:mainfrom
alea-institute:fix/register-normalization-run-model

Conversation

@damienriehl
Copy link
Copy Markdown
Contributor

@damienriehl damienriehl commented Apr 1, 2026

Summary

  • Add NormalizationRun to ontokit/models/__init__.py import and __all__
  • Add NormalizationRun to alembic/env.py model imports for autogenerate

Fixes #12 — the model was referenced by Project.normalization_runs but never registered, causing lazy-load name resolution failures in standalone scripts and invisible migration drift in Alembic autogenerate.

Test plan

  • Run a standalone script that imports Project (e.g., benchmark) — should no longer fail with expression 'NormalizationRun' failed to locate a name
  • Run alembic revision --autogenerate — should detect normalization_runs table

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a new NormalizationRun model to the public API, making it available for use throughout the application.
    • Integrated NormalizationRun with the database schema generation so it will be considered during migration autogeneration and schema alignment.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0bccdcaf-3d51-47c2-bc02-505b8dfffb53

📥 Commits

Reviewing files that changed from the base of the PR and between eb69f3c and ceeb607.

📒 Files selected for processing (2)
  • alembic/env.py
  • ontokit/models/__init__.py
✅ Files skipped from review due to trivial changes (1)
  • alembic/env.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • ontokit/models/init.py

📝 Walkthrough

Walkthrough

NormalizationRun was imported into alembic/env.py and added to ontokit.models.__init__ exports so the model is included in Alembic's Base.metadata and is publicly importable from ontokit.models.

Changes

Cohort / File(s) Summary
Alembic Migration Registration
alembic/env.py
Added import of NormalizationRun so the model is part of Base.metadata for Alembic autogenerate/schema alignment.
Models Package Exports
ontokit/models/__init__.py
Imported NormalizationRun from ontokit.models.normalization and added it to the module's __all__ to make the model publicly available from ontokit.models.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through imports, found a missing friend,
NormalizationRun brought back to the end.
Alembic nods and exports cheer,
Tables and code now draw more near.
Pip-pip—schema tidy, all clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: registering the NormalizationRun model in package exports and Alembic migrations.
Linked Issues check ✅ Passed The pull request fully addresses both objectives from issue #12: importing and exporting NormalizationRun from ontokit/models/init.py and importing it in alembic/env.py.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue requirements; only NormalizationRun registration changes are present with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JohnRDOrazio JohnRDOrazio force-pushed the fix/register-normalization-run-model branch from 5ca54e9 to eb69f3c Compare April 1, 2026 12:58
Fixes CatholicOS#12 — NormalizationRun was not exported from the models package
or imported in alembic/env.py, causing lazy-load resolution failures
in standalone scripts and silent migration drift.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@damienriehl damienriehl force-pushed the fix/register-normalization-run-model branch from eb69f3c to ceeb607 Compare April 1, 2026 13:11
@damienriehl damienriehl merged commit ece2ed0 into CatholicOS:main Apr 1, 2026
7 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.

NormalizationRun model not registered in models/__init__.py or alembic/env.py

2 participants