Rename Commons to Game throughout the codebase (closes #276) - #277
Merged
Conversation
The user-facing terminology was already renamed from "Commons" to "Game" in #271; this does the same for the code itself: database table/column names, class/file names, method names, parameter names, API routes, and test names, respecting each artifact's case convention (Commons->Game, commons->game, COMMONS->GAME, e.g. commonsId->gameId, CommonsPlus->GamePlus). - Renamed 80 source files (entities, controllers, repositories, services, jobs, errors, DTOs, and their frontend/test/story counterparts), including moving the frontend's Commons/ component directory to Game/. Also fixed a pre-existing filename typo (AdminListCommonPageV2.jsx, singular) to match its already-plural component name, now AdminListGamePageV2.jsx. - Added a new idempotent migration (008... actually 007, following the same precondition-guarded pattern as the prior two rename migrations) that renames the commons table to game, and the commons_id column (plus its two FK constraints) across every table that references it: farmer, profits, announcement, chat_message, commonstats, cowdeath, and reports. - The case-aware substitution deliberately protects two collisions: "CommonStats" (a distinct, unrelated entity/table - "Common" is singular, not "Commons") via a negative-lookahead regex guarding the literal lowercase "commonstats" substring used in its API routes, and "Tragedy of the Commons" (the real-world economics term the app is named after) by excluding prose documentation from the bulk substitution entirely. - Caught and reverted a second-order corruption from the same collision risk: pom.xml's actual Apache Commons Maven dependency (org.apache.commons:commons-csv) and its imports across 6 files got mangled to "org.apache.game" by an earlier, less careful pass and had to be restored - a reminder that "Commons" the app concept and Apache Commons the library share nothing but a name. Verified: backend `mvn verify` (379/379 tests, 100% JaCoCo); frontend (742/742 tests, 100% coverage, lint/format clean); Pitest on all ~58 changed backend classes (411/411 mutants killed, 100%); Stryker on all ~44 changed frontend files (100% mutation score, 0 survivors); and the Playwright integration suite run locally end-to-end (GameWebIT, FarmerWebIT, and GameIT all pass; DashboardWebIT hits the same unrelated pre-existing flake already documented in the #271/#274 PRs). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Closes #276. The user-facing terminology was already renamed from "Commons" to "Game" in #271; this does the same for the code itself: database table/column names, class/file names, method names, parameter names, API routes, and test names, respecting each artifact's case convention (
Commons->Game,commons->game,COMMONS->GAME, e.g.commonsId->gameId,CommonsPlus->GamePlus).Details:
Commons/component directory toGame/. Also fixed a pre-existing filename typo (AdminListCommonPageV2.jsx, singular) to match its already-plural component name, nowAdminListGamePageV2.jsx.007_rename_commons_to_game.json, following the same precondition-guarded pattern as the prior two rename migrations from Change UserCommons name to Farmer throughout the app #274/Hotfix: make lib-jobs migration's FK drop idempotent #272) that renames thecommonstable togame, and thecommons_idcolumn (plus its two FK constraints) across every table that references it:farmer,profits,announcement,chat_message,commonstats,cowdeath, andreports.CommonStats— a distinct, unrelated entity/table (Commonis singular, notCommons) — via a negative-lookahead regex guarding the literal lowercasecommonstatssubstring used in its API routes (/api/commonstats/*).pom.xml's actual Apache Commons Maven dependency (org.apache.commons:commons-csv) and its imports across 6 files got mangled toorg.apache.gameby an earlier, less careful substitution pass and had to be restored — a good reminder that "Commons" the app concept and Apache Commons the library share nothing but a name.Test plan
mvn verify— 379/379 tests, 100% JaCoCo coverageGameWebIT,FarmerWebIT, andGameITall pass.DashboardWebIThits an unrelated pre-existing Playwright flake (element detached from DOM) that reproduces identically on unmodifiedmain— already documented in the Change "Commons" in user facing terminology to something else #271/Change UserCommons name to Farmer throughout the app #274 PRs, not introduced by this change.Commons/commons/COMMONSoutside: the historical migration files (which must stay byte-identical), the new migration file (which necessarily references the old names as its rename targets), and the legitimateCommonStats/org.apache.commons/"Tragedy of the Commons" exclusions above.🤖 Generated with Claude Code