Skip to content

refactor: remove dead code and rename misleading group method - #24

Merged
SrStamm merged 1 commit into
mainfrom
chore/dead-code-cleanup
Oct 20, 2026
Merged

SrStamm merged 1 commit into
mainfrom
chore/dead-code-cleanup

Conversation

@SrStamm

@SrStamm SrStamm commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Context

B8 of the portfolio fixes. Cleanup only — no behavior change: remove what nothing references and fix a name that lies. For a portfolio repo, dead code and misleading names cost reviewers time.

Changes

  • core/utils.py deleted — its found_user_in_project_or_404 had no callers (chat now goes through ProjectService), and it carried a dead bound-method statement (user = session.get) whose result was returned instead of the looked-up row.
  • test/test_utils.py deleted — the whole body was inside a """...""" block (no runnable tests), yet the file-level import core.utils still executed. Removing core/utils.py without this file would break pytest collection with ModuleNotFoundError. It was dead code on both sides.
  • Unused schemas removed — Access_Token and Message (0 references; Message was superseded by GroupMessagePayload).
  • backup.sql deleted — stray file at the repo root, unreferenced.
  • GroupService.get_groups_with_cache renamed to get_groups — it is a plain pass-through to group_repo.get_all_groups with no caching; the name claimed behavior that does not exist. Updated definition, router caller and test.
  • .gitignore — dropped the invalid ./env pattern (git does not interpret ./; env and /env already cover it).

Verification

  • Each deleted symbol re-checked with grep for references: core.utils, Access_Token, schemas.Message, backup.sql, get_groups_with_cache — all report zero.
  • git check-ignore .venv/ confirms .venv/ is still ignored.
  • pytest -q -> 177 passed (unchanged; no behavior touched).

- Delete core/utils.py (no callers) and its unused test module test_utils.py,
  whose entire body was commented out but still imported the deleted module
- Remove unused schemas Access_Token and Message
- Delete stray backup.sql
- Rename GroupService.get_groups_with_cache to get_groups: it is a plain
  pass-through to the repository with no caching, the name lied
- Drop the invalid ./.env gitignore pattern (keep /env and .venv/)
@SrStamm
SrStamm merged commit fa0ac66 into main Oct 20, 2026
1 check passed
@SrStamm
SrStamm deleted the chore/dead-code-cleanup branch October 20, 2026 13:35
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