Skip to content

internal: run active_record_doctor in pre-commit and CI - #8259

Open
YheChen wants to merge 2 commits into
MarkUsProject:masterfrom
YheChen:feat/active-record-doctor-hooks
Open

YheChen wants to merge 2 commits into
MarkUsProject:masterfrom
YheChen:feat/active-record-doctor-hooks

Conversation

@YheChen

@YheChen YheChen commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

  • Run active_record_doctor in pre-commit when models, migrations, the database structure, or its configuration change.
  • Run the same check in CI after the test databases are set up.
  • Disable the nine detectors with existing findings so the six currently clean detectors prevent regressions. Each disabled detector can be enabled when its findings are fixed.
  • Document that the local hook requires a running, migrated PostgreSQL development database.

This adds automated coverage for model/schema consistency without requiring the unrelated existing findings to be fixed in this PR.

Validation performed:

  • Ran active_record_doctor successfully in both development and test environments.
  • Ran the repository's pre-commit hooks on all five changed files.
  • Confirmed the hook skips unrelated files.
Screenshots of your changes (if applicable)

Type of Change

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
✨ New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
📖 Documentation update (change that updates documentation) X
🔧 Internal (change that only affects developers or continuous integration) X

Checklist

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

@YheChen YheChen changed the title Run active_record_doctor in pre-commit and CI run active_record_doctor in pre-commit and CI Nov 1, 2026
@coveralls

coveralls commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 41364469262

Coverage remained the same at 91.462%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 54174
Covered Lines: 50606
Line Coverage: 93.41%
Relevant Branches: 2569
Covered Branches: 1292
Branch Coverage: 50.29%
Branches in Coverage %: Yes
Coverage Strength: 129.43 hits per line

💛 - Coveralls

@YheChen YheChen changed the title run active_record_doctor in pre-commit and CI internal: run active_record_doctor in pre-commit and CI Nov 1, 2026
@YheChen
YheChen requested a review from david-yz-liu November 1, 2026 23:57
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.

2 participants