Skip to content

Use SyntaxCore ConfigManager for PlotsX startup and reload - #29

Merged
WieszczY85 merged 2 commits into
mainfrom
fix/config-manager-integration
Oct 14, 2026
Merged

WieszczY85 merged 2 commits into
mainfrom
fix/config-manager-integration

Conversation

@WieszczY85

@WieszczY85 WieszczY85 commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

PlotsX previously filled missing configuration fields manually and kept a stale Bukkit view after writing the file. Startup now uses SyntaxCore.init(this), assigns SyntaxCore.logger, and loads the main YAML through ConfigManager before plot/database services initialize. Successful loading refreshes Bukkit's config and pluginConfig; /ptx reload follows the same path while retaining the claim-mode restart guard.

The bundled schema advances to 103 with steps 100 → 101 → 102 → 103. Migration preserves raw user values, including unknown nested maps/lists, while adding missing defaults. Database selections and credentials are retained. Language completion remains separate and now uses strict parsing: malformed YAML cannot become an empty configuration which is then overwritten with defaults. Reload prevalidation also uses strict parsing. Runtime/compile coordinates use SyntaxCore 2.0.0-R0.1-SNAPSHOT; teardown explicitly closes core.

Validation: full test/build passed, 217 tests with zero failures and zero skips. Twelve configuration tests include parameterized loops covering:

  • Every customized leaf of the actual bundled template, plus false/zero/empty strings/lists and unknown nested settings.
  • Missing nested default fields without overwriting custom values.
  • Historical/unversioned schemas, fresh installation, unchanged current/future schemas, stable repeated load, and Bukkit readback.
  • Exact backup present before callbacks; failed migration preserves original bytes; retries preserve each old backup; existing backup paths use unique siblings; denied backup writes prevent migration callbacks.
  • Malformed YAML across unversioned/old/current/future schemas with no default replacement or staging residue.
  • Language completion preserving user values, malformed language/reload YAML, invalid templates and incompatible sections leaving original bytes unchanged.

Consumer tests invoke the resolved SyntaxCore file engine reflectively to exercise the actual loader without a live JavaPlugin or new mocking dependency. Verified packaged schema 103 and runtime core coordinates. Live server smoke tests were not run.

Backup is once per migration attempt/chain, not per individual version step. Parsing precedes backup/mutation; parse failure leaves the original intact. Current/future schemas are read without rewriting, adding missing fields on disk, or creating migration backups. Documentation explains these boundaries and startup-only settings.

@WieszczY85
WieszczY85 merged commit f32ef79 into main Oct 14, 2026
1 check passed
@WieszczY85
WieszczY85 deleted the fix/config-manager-integration branch October 14, 2026 19:23
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