ref(repositories): Remove feature flag branching for SeerProjectRepository reads#115606
ref(repositories): Remove feature flag branching for SeerProjectRepository reads#115606wedamija wants to merge 3 commits into
Conversation
…itory reads Remove the `organizations:project-repository-fk-reads` flag checks from all SeerProjectRepository read/write paths and related code mapping accesses in Seer code. Always use `project_repository` FK for queries and attribute access. The flag registration is left in place — it will be removed in a follow-up PR that also drops the old model columns.
e11636f to
1de21d9
Compare
| ordered_mappings: list[tuple[str, RepositoryProjectPathConfig]] = [] | ||
| for cm in code_mappings: | ||
| repo = cm.project_repository.repository if use_project_repository_fk else cm.repository | ||
| repo = cm.project_repository.repository |
There was a problem hiding this comment.
N+1 queries from unprefetched project_repository FK access
Medium Severity
These callers now unconditionally access code_mapping.project_repository.repository, but get_sorted_code_mapping_configs still branches on the organizations:project-repository-fk-reads flag. When that flag is off, it only calls select_related("repository") — not project_repository or project_repository__repository. Each code mapping access then triggers two extra DB queries, creating an N+1 problem on the autofix hot path.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 2dcb64e. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dc296f7. Configure here.


Remove the
organizations:project-repository-fk-readsflag checks from all SeerProjectRepository read/write paths and related code mapping accesses in Seer code. Always useproject_repositoryFK for queries and attribute access.For now we'll keep
organizations:project-repository-fk-readsaround, since we'll have a separate pr to remove reads/writes for code mappings.