Skip to content

Add game recreation flow and local-dev test game management#4698

Draft
Copilot wants to merge 64 commits into
masterfrom
copilot/add-local-map-file-and-channels
Draft

Add game recreation flow and local-dev test game management#4698
Copilot wants to merge 64 commits into
masterfrom
copilot/add-local-map-file-and-channels

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

  • Inspect the current recreate/show-game/local-dev flow and Fog of War channel setup helpers
  • Run focused pre-change tests for the touched recreate/local-dev area
  • Add recreate support for Fog of War games instead of rejecting them as incompatible
  • Recreate the Fog of War-specific Discord resources needed by the game (GM role/channel and player private channels) while preserving runner access
  • Add Fog of War map-post support for the recreated channels using the closest existing /show_game behavior that fits FoW rendering rules
  • Update focused tests to cover the new Fog of War recreate behavior
  • Run formatting, focused tests, and final validation
  • Expand Fog of War helper coverage for roles and private-channel recreation
  • Clarify Fog of War recreate intent and messaging
  • Add clearer Fog of War role/private-channel failure notes

Copilot AI and others added 12 commits April 15, 2026 10:27
@wholton
Copy link
Copy Markdown
Collaborator

wholton commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 4dea2b7. The branch now merges cleanly with master, and I validated the resolution with mvn --batch-mode --no-transfer-progress -DskipTests test-compile.

Copilot AI requested a review from wholton April 15, 2026 17:44
@wholton
Copy link
Copy Markdown
Collaborator

wholton commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request

…ap-file-and-channels

Co-authored-by: wholton <3317595+wholton@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 15, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 08c76a0. I re-checked against the latest master, finalized the clean merge commit, and verified it with mvn --batch-mode --no-transfer-progress -DskipTests test-compile.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a game “recreation” utility for restoring Discord channels/roles from saved game state, plus a local-development workflow to clone a sample game into a disposable test game and manage cleanup via a developer command and optional startup hook.

Changes:

  • Introduces RecreateGameService (and /admin recreate_game) to recreate/move channels and roles for an existing game.
  • Adds LocalDevelopmentSampleGameService (and /developer local_dev) to create/cleanup local-dev “test games” cloned from a source save.
  • Extends persistence loading with GameManager.loadFromPath(...) / GameLoadService.load(Path) and adds focused unit tests for the new helpers.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/ti4/service/game/RecreateGameService.java Core logic to recreate roles/channels/threads and produce a summary result.
src/main/java/ti4/service/game/LocalDevelopmentSampleGameService.java Local-dev clone + cleanup flow for test games (including Discord resource deletion).
src/main/java/ti4/discord/interactions/commands/admin/RecreateGame.java New admin subcommand to trigger recreation for a named game.
src/main/java/ti4/discord/interactions/commands/admin/AdminCommand.java Registers the new recreate_game admin subcommand.
src/main/java/ti4/discord/interactions/commands/developer/LocalDevelopment.java New developer subcommand to create/clean local-dev test games.
src/main/java/ti4/discord/interactions/commands/developer/DeveloperCommand.java Registers the new local_dev developer subcommand.
src/main/java/ti4/discord/JdaService.java Adds optional startup hook to auto-create a local-dev test game after games load.
src/main/java/ti4/game/persistence/GameManager.java Adds loadFromPath(Path) wrapper for loading a game from an arbitrary path.
src/main/java/ti4/game/persistence/GameLoadService.java Adds load(Path) overload to read a game file directly from a Path.
src/main/java/ti4/helpers/Constants.java Adds new command/option constants used by the new slash commands.
src/test/java/ti4/service/game/RecreateGameServiceTest.java Unit tests for test-game marker parsing and channel-name sanitization.
src/test/java/ti4/service/game/LocalDevelopmentSampleGameServiceTest.java Unit tests for clone preparation and local-dev startup arg handling.

Comment thread src/main/java/ti4/game/persistence/GameManager.java Outdated
Comment thread src/main/java/ti4/discord/interactions/commands/developer/LocalDevelopment.java Outdated
Comment thread src/main/java/ti4/discord/JdaService.java Outdated
Comment thread src/main/java/ti4/service/game/LocalDevelopmentSampleGameService.java Outdated
Copilot AI and others added 2 commits April 18, 2026 22:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

🔬 Test Results

✅ JSON Validation

No JSON files changed.


✅ Formatting Checks Passed

All files pass Spotless formatting.


✅ JUnit Tests Passed

All tests passed successfully.

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.

3 participants