Skip to content

Extract shared SQL user access with existing backend adapters - #321

Merged
BenCodez merged 2 commits into
masterfrom
codex/shared-sql-user-storage
Sep 12, 2026
Merged

BenCodez merged 2 commits into
masterfrom
codex/shared-sql-user-storage

Conversation

@BenCodez

@BenCodez BenCodez commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Dependency and merge order

Depends on #320. Merge FLAT removal first. This branch contains #320's commit followed by one SQL-access commit. It targets master so the existing Maven PR workflow validates the combined candidate without adding or modifying a workflow. The incremental SQL-only diff is e0f56679b12b0f0d7e67c655383e0f33b628d938..b789d7b1b95252f05083f717a039fc9ff0841975 (10 files).

Summary

  • Add platform-neutral core.user.storage.SqlUserStorage and SqlUserDataAccess for live SQL row interpretation, typed reads/writes, keys/values, existence, deletion, and bulk writes.
  • Add BukkitSqlUserStorage adapting the existing SQLite/MySQL user-table providers through lazy plugin/UUID suppliers. No new connection pool, JDBC implementation, cache, identity resolver, executor, or write queue.
  • Make the existing UserData SQL paths use the shared access layer immediately. Keep its public method signatures and private temporary-cache field/accessors.
  • Preserve all six fetch modes, cache precedence, notifications, queue short-circuiting, execution-time UUID lookup, list encoding, and existing write scheduling.
  • Preserve virtual getMySqlRow, getSQLiteRow, and convert hooks for existing subclasses. Readers do not capture a stale row/provider during construction.
  • Add 14 JUnit tests plus a headless behavioral fixture: typed/default/case behavior, duplicate handling, mutable exports, lazy ownership, SQL delegation, bulk call ordering, facade overrides, all fetch modes, queued/async writes, failure handling, and isolated loading without Bukkit/plugin classes.

Compatibility and scope

This is the SQL access boundary, not a claim that the entire native storage/user runtime is finished. Bukkit-facing provider construction, SQLite bootstrap, schema registration, UserManager enumeration, user-cache lifecycle, and final native packaging remain follow-ups. Native code can supply a storage port without an AdvancedCorePlugin; the current Bukkit adapter retains the existing providers.

The provider's existing behavior is retained, including the MySQL unavailable-provider bulk no-op and SQLite cumulative per-entry bulk updates. No new durable-completion, atomic-batch, or retry guarantee is invented. #317's async reward checkpoints/completion semantics remain separate and must be preserved when reconciling overlapping work.

One Maven project. No POM, dependencies, workflows, schema, persistence encoding, migration, or reward-execution changes beyond the prerequisite FLAT removal. SimpleAPI stays 1.0.2-SNAPSHOT; #314 stays closed and the unwanted pinning test stays removed.

Verified GitHub Actions build

Java CI with Maven — run 603 passed. Inspected completed build job 103632505558 and its Maven log:

  • mvn -B -f AdvancedCore/pom.xml package on Temurin Java 21.0.12.
  • 351 tests run, 0 failures, 0 errors, 0 skipped.
  • All 14 new tests passed: BukkitSqlUserStorageTest (3), SqlUserDataAccessTest (5), SqlUserDataFacadeTest (5), and SqlAccessHeadlessTest (1).
  • The headless fixture executed shared SQL-access behavior with Bukkit/plugin classes denied. Its in-memory storage port is not a real database integration test.
  • The prerequisite's SQL-only tests and existing user/cache/fetch-mode/reward/lifecycle/platform regressions passed.
  • Maven refreshed snapshot metadata and downloaded SimpleAPI 1.0.2-20260912.212854-22. This records tested inputs; the POM remains 1.0.2-SNAPSHOT.
  • AdvancedCore/target/AdvancedCore.jar generated; shading/minimization completed; BUILD SUCCESS.
  • Tested integration merge 248544428ea8d3b9d4d120390cc3f8bdf635c155 for candidate b789d7b1b95252f05083f717a039fc9ff0841975 and base b03cb7f8a26c22e1e35b0c1a44ac1df7d5d8098d.

These are GitHub Actions results, not full local Maven validation. Shade emitted overlap/minimization warnings; successful packaging does not establish packaged runtime compatibility.

Local checks

  • Syntax-parsed the 15 Java files present in the combined local partial worktree with JDK 21; nine are changed/added by this SQL commit. This is not dependency/type checking.
  • Mechanically compared the existing UserData public method signatures: unchanged. Both scalar cache-selection prefixes match the prerequisite exactly; the original tempCache field is retained.
  • git diff --cached --check passed for the complete 10-file incremental diff in an exact-baseline partial Git fixture. The uploaded UserData blob matches the locally checked bytes.
  • GitHub comparison confirms one incremental commit, 10 files, 771 additions and 180 deletions beyond Remove deprecated FLAT user storage #320.

Draft validation limits

Maven is absent and external dependency/repository DNS is unavailable in the editing container. Full local/downstream builds, real database round trips, packaged linkage, live server testing, and a fresh independent reviewer have not run. Same-context source inspection is not an independent clean verdict.

Prerequisite: e0f56679b12b0f0d7e67c655383e0f33b628d938 (#320).
Candidate: b789d7b1b95252f05083f717a039fc9ff0841975.

No merge, release, deployment, or manual external review request was performed.

@BenCodez
BenCodez marked this pull request as ready for review September 12, 2026 22:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T22:58:47.678301Z b789d7b Draft marked ready
🔒 Security Review ✅ Completed 2026-09-12T23:01:21.013476Z b789d7b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@BenCodez
BenCodez merged commit 130844c into master Sep 12, 2026
4 checks passed
@BenCodez
BenCodez deleted the codex/shared-sql-user-storage branch September 12, 2026 23:30
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