Skip to content

refactor: infrastructure - #113

Merged
paulkczw merged 8 commits into
devfrom
refactor/infrastructure-cleanup
Jun 4, 2026
Merged

refactor: infrastructure#113
paulkczw merged 8 commits into
devfrom
refactor/infrastructure-cleanup

Conversation

@paulkczw

@paulkczw paulkczw commented Jun 4, 2026

Copy link
Copy Markdown
Member

Consolidates infrastructure modules into a single core module, extracts api interfaces for tasks and console, fixes architecture violations in the data layer, and cleans up publishing.

Changes

Module Consolidation: core

Merged database, packets, events, and cache into a new core module. These four modules form the infrastructure layer (Redis DB, pub/sub communication, event dispatch, cluster cache) and had a strict dependency chain (events -> packets -> database, cache -> database + tasks). None were published as Maven artifacts.

API Interface Extraction

Task interfaces in apis:base-api (dev.redicloud.api.tasks):

  • ICloudTask -- schedulable task with lifecycle management
  • ICloudTaskManager -- task registration and builder access
  • ICloudTaskExecutorBuilder -- fluent builder for instant/delayed/periodic/event/packet triggers
  • CloudTask, CloudTaskManager, CloudTaskExecutorBuilder now implement their respective interfaces
  • Guice binding for ICloudTaskManager added in BaseService

Console interface in apis:base-api (dev.redicloud.api.console):

  • ICloudConsole -- simplified console access (writeLine, clearScreen, commands)
  • IConsole extends ICloudConsole with bridge methods for the full console API
  • Guice binding for ICloudConsole added in NodeService

Architecture Fix: Decouple Data Layer from Console

The repositories and papermc-updater modules had a direct dependency on the console module (presentation layer).

Publishing Cleanup

Only modules containing interfaces/abstract classes are published:

  • apis:base-api
  • apis:node-api
  • apis:connector-api
  • utils
  • logging
  • test-framework

Bugfixes

  • getTextFromGitHub() now falls back to branch-based URL when commit-pinned URL returns 404 (fixes startup crash on local dev builds with unpushed commits)
  • Default file URLs in server-version-types.json migrated from api.redicloud.dev to raw.githubusercontent.com (API is deprecated for file serving)

Documentation

KDoc docstrings added to all new and refactored files including all core module classes and new api interfaces.

Breaking Changes

  • External consumers using dev.redicloud.cache.IClusterCacheObject must update imports to dev.redicloud.api.cache.IClusterCacheObject
  • Modules depending on :database, :packets, :events, or :cache must switch to :core
  • toConsoleValue import changed from dev.redicloud.console.utils to dev.redicloud.utils
  • URLServerVersionHandler and PaperMcServerVersionHandler constructor signature changed (Console replaced by IVersionHandlerListener?)

@paulkczw
paulkczw merged commit 45d5ed8 into dev Jun 4, 2026
1 check passed
@paulkczw
paulkczw deleted the refactor/infrastructure-cleanup branch June 4, 2026 11:34
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