feat: remove MongoDB legacy code - #295
Merged
Merged
Conversation
…ncies Complete removal of MongoDB from backend/app/: - Delete all MongoDB repository classes (base, compliance, enhanced, health, intelligence, plugin_models, plugin, remediation_job, remediation, scan repositories) - Delete MongoDB models (mongo_models.py, enhanced_mongo_models.py) - Delete MongoDB-dependent services (compliance_rules/, content/import_/, content/transformation/transformer.py, mongo_integration_service.py, scan_template_service.py, health_monitoring_tasks.py) - Delete MongoDB-dependent CLI tools (load_compliance_rules.py, migrate_oval_references.py) - Delete MongoDB-dependent routes (scans/config.py) - Clean all MongoDB imports (motor, pymongo, beanie, bson) from remaining service files - Convert Beanie Document models to Pydantic BaseModel in plugin service models - Stub repository-dependent methods with logger warnings and sensible defaults - Replace MongoDB queries with in-memory storage where needed (orchestration jobs, governance audit events) - Update health monitoring to PostgreSQL-only checks - Remove MongoDB config from app config and requirements.txt 80 files changed, 686 insertions(+), 19,475 deletions(-) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove tests/unit/repositories/ directory (test_base_repository.py, test_compliance_repository.py, conftest.py) which imported the deleted base_repository and compliance_repository modules, causing CI collection errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4 tasks
remyluslosius
added a commit
that referenced
this pull request
Mar 7, 2026
complianceAdapter.ts calls /api/compliance/rules which was removed with MongoDB (PR #295). Not imported by any live component — replaced by ruleReferenceAdapter.ts. Also remove barrel export and architecture spec reference.
4 tasks
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
logger.warning()and sensible defaults (empty lists, zero counts, None)80 files changed, 611 insertions(+), 19,488 deletions(-)
Context
MongoDB was deprecated following Aegis integration (see
docs/plans/MONGODB_DEPRECATION_PLAN.md). MongoDB containers were already removed from CI and docker-compose. This PR removes all remaining MongoDB code frombackend/app/, completing the deprecation.Aegis YAML rules replace the MongoDB
compliance_rulescollection. PostgreSQL replaces all other MongoDB collections. Plugin services that depended on MongoDB repositories now log warnings and return safe defaults until they are reimplemented against PostgreSQL.Test plan
py_compilepasses on all modified filesfrom app.repositoriesimports (except empty__init__.py).find(),.to_list(), etc.)🤖 Generated with Claude Code