Skip to content

fix: resolve CodeQL false positives in retrieval changes - #360

Merged
suguanYang merged 2 commits into
mainfrom
fix/wangbinqi/pr358-codeql-comments
Aug 31, 2026
Merged

suguanYang merged 2 commits into
mainfrom
fix/wangbinqi/pr358-codeql-comments

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • Mark Alembic migration metadata as explicit module exports so CodeQL does not report required revision, down_revision, branch_labels, and depends_on globals as unused.
  • Replace the mixed module import in the large-snapshot contract test.
  • Remove redundant route-local initialization.
  • Narrow namespace/manifest snapshot lookup fallback handling to SQLAlchemyError and log the fallback context.
  • Add the missing rollback() implementation to the counting session test double.

Why

Alembic consumes migration metadata by convention, so deleting those globals would break migration discovery. Exporting them via __all__ is a narrow, repository-local way to communicate that contract to CodeQL while preserving the check elsewhere.

Verification

  • uv run ruff check ...
  • uv run pyright ...
  • pytest apps/api/tests/contract/test_retrieval_serving_manifest_contract.py apps/api/tests/contract/test_retrieval_manifest_cache_contract.py
  • Python compilation and git diff --check

The separate classic-route scoring and serving-index projection findings require behavior-level design/contract changes and are intentionally not mixed into this tooling/fallback cleanup PR.

@suguanYang
suguanYang merged commit 7f05cba into main Aug 31, 2026
6 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