fix: explicitly exclude cogs/gameplay_legacy.py from Docker image (#42) #52

Merged
cal merged 1 commits from ai/paper-dynasty-discord-42 into next-release 2026-03-10 14:11:54 +00:00
Owner

Summary

cogs/gameplay_legacy.py (4700+ lines) is not in the COGS list in paperdynasty.py but was present in the Docker image, importing live production dependencies and posing an accidental-activation risk if cog auto-discovery were ever added.

The .dockerignore already contained a wildcard *_legacy.py pattern (added in an earlier catchup commit) which should cover this file, but relying solely on a wildcard pattern left the exclusion implicit. This PR adds an explicit cogs/gameplay_legacy.py entry to make the exclusion unambiguous and self-documenting.

Files Changed

  • .dockerignore — added explicit cogs/gameplay_legacy.py entry alongside existing *_legacy.py wildcard

Test Results

No test suite. Verified the .dockerignore now contains the explicit entry and the existing wildcard pattern is preserved.

Other observations

  • cogs/gameplay_legacy.py still exists in the repository and imports live dependencies (api_calls, db_calls_gameplay, etc.). If it is no longer needed, deleting it entirely would eliminate the risk more completely — but that's a larger decision for human review.
## Summary `cogs/gameplay_legacy.py` (4700+ lines) is not in the `COGS` list in `paperdynasty.py` but was present in the Docker image, importing live production dependencies and posing an accidental-activation risk if cog auto-discovery were ever added. The `.dockerignore` already contained a wildcard `*_legacy.py` pattern (added in an earlier catchup commit) which should cover this file, but relying solely on a wildcard pattern left the exclusion implicit. This PR adds an explicit `cogs/gameplay_legacy.py` entry to make the exclusion unambiguous and self-documenting. ## Files Changed - `.dockerignore` — added explicit `cogs/gameplay_legacy.py` entry alongside existing `*_legacy.py` wildcard ## Test Results No test suite. Verified the `.dockerignore` now contains the explicit entry and the existing wildcard pattern is preserved. ## Other observations - `cogs/gameplay_legacy.py` still exists in the repository and imports live dependencies (`api_calls`, `db_calls_gameplay`, etc.). If it is no longer needed, deleting it entirely would eliminate the risk more completely — but that's a larger decision for human review.
cal added 1 commit 2026-03-05 06:04:53 +00:00
fix: explicitly exclude cogs/gameplay_legacy.py from Docker image (#42)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m16s
3fa28d9df2
The wildcard *_legacy.py pattern already covered this file, but adding
an explicit entry makes the exclusion unambiguous and self-documenting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-05 06:15:31 +00:00
cal reviewed 2026-03-05 06:17:30 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • .dockerignore (modified)

Findings

Correctness

  • paperdynasty.py lines 50–56 confirm cogs.gameplay_legacy is absent from the COGS list — the PR's premise is accurate.
  • cogs/gameplay_legacy.py exists on disk and is not loaded at runtime, but would be present in the Docker image without this exclusion.
  • The added .dockerignore entry is syntactically correct and placed logically adjacent to the existing *_legacy.py wildcard.

Security

  • No issues. The change reduces attack surface by making the exclusion of a large legacy file with live production imports unambiguous.

Style & Conventions

  • No issues. The change is minimal and self-documenting.

Suggestions

  • Clarifying note on wildcard scope: Docker's .dockerignore uses Go filepath.Match semantics where * does not cross path separators. This means *_legacy.py may only match root-level files and may not have been covering cogs/gameplay_legacy.py at all — making this explicit entry potentially functional rather than merely cosmetic. The outcome (add the explicit entry) is correct either way.
  • Consider deleting cogs/gameplay_legacy.py from the repo entirely (as the PR author notes). At 4700+ lines with live production imports, the file is an ongoing maintenance burden. Excluding it from Docker is a good short-term fix; removal is the clean solution.

Verdict: APPROVED

The .dockerignore change is correct, low-risk, and strictly improves safety. The explicit entry definitively excludes cogs/gameplay_legacy.py from Docker builds regardless of how Docker resolves the wildcard against subdirectory paths. Ready to merge.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `.dockerignore` (modified) ### Findings #### Correctness - `paperdynasty.py` lines 50–56 confirm `cogs.gameplay_legacy` is absent from the `COGS` list — the PR's premise is accurate. - `cogs/gameplay_legacy.py` exists on disk and is not loaded at runtime, but would be present in the Docker image without this exclusion. - The added `.dockerignore` entry is syntactically correct and placed logically adjacent to the existing `*_legacy.py` wildcard. #### Security - No issues. The change reduces attack surface by making the exclusion of a large legacy file with live production imports unambiguous. #### Style & Conventions - No issues. The change is minimal and self-documenting. #### Suggestions - **Clarifying note on wildcard scope**: Docker's `.dockerignore` uses Go `filepath.Match` semantics where `*` does not cross path separators. This means `*_legacy.py` may only match root-level files and may not have been covering `cogs/gameplay_legacy.py` at all — making this explicit entry potentially functional rather than merely cosmetic. The outcome (add the explicit entry) is correct either way. - **Consider deleting `cogs/gameplay_legacy.py` from the repo entirely** (as the PR author notes). At 4700+ lines with live production imports, the file is an ongoing maintenance burden. Excluding it from Docker is a good short-term fix; removal is the clean solution. ### Verdict: APPROVED The `.dockerignore` change is correct, low-risk, and strictly improves safety. The explicit entry definitively excludes `cogs/gameplay_legacy.py` from Docker builds regardless of how Docker resolves the wildcard against subdirectory paths. Ready to merge. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-05 06:17:50 +00:00
cal changed target branch from main to next-release 2026-03-10 14:11:43 +00:00
cal merged commit 24410fa65b into next-release 2026-03-10 14:11:54 +00:00
cal deleted branch ai/paper-dynasty-discord-42 2026-03-10 14:11:55 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-discord#52
No description provided.