Repository navigation
feat(settings): add versioned player settings api with adventure keys - #181
Merged
Merged
Conversation
Baseline V1 reproduces the Hibernate schema of otis_player, V2 adds player_setting additively. Existing databases are baselined at version 1. Claude-Session: https://claude.ai/code/session_012BmpdMdQ5wwagagQvfcq8S
TheMeinerLP
force-pushed
the
feat/player-settings
branch
from
October 7, 2026 10:55
23ad6df to
4cfe5e2
Compare
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
Per-player settings in Otis, keyed by Adventure
Key. Stacked on #180 (Problem Details). Merge #180 first; this PR then retargets tomain.playerUuidplus an Adventure keynamespace:value. The value is arbitrary JSON (max 64 KiB) that Otis stores without interpreting it.olf:is the conventional namespace for generic settings, and games use their own (lobby:, ...). Keys without a namespace, inminecraft:or with an empty value are rejected./v1, new, versioned by URI):GET /v1/players/{playerUuid}/settings[?namespace=...], andGET/PUT/DELETE /v1/players/{playerUuid}/settings/{key}.versionandupdatedAtin every response.PUT(semantically equal JSON) is a no-op: status 200, no version bump.PUTanswers 201 when it creates the setting.DELETEalways answers 204.missing-namespace,reserved-namespace,invalid-setting-key,invalid-setting-value,setting-value-too-large(413),player-not-foundandsetting-not-found.settings.get|list|put|delete) with player uuid, namespace, key and outcome. The value never appears in a span or log.net.kyori.adventure.key.Keyin its public API.adventure-key5.2.0 (aligned with velocity-api 4.2.0) iscompileOnly.OtisClients.newApiClient()registers the JacksonAdventureKeyModule.Migration (no data loss)
Flyway (micronaut-flyway) is introduced with
baseline-on-migrate, baseline version 1. There are vendor-specific scripts for PostgreSQL, MariaDB and H2.CREATE TABLE player_setting(FK tootis_player(uuid)ON DELETE CASCADE). No existing table is altered or written.otis_playerexactly as Hibernate generates it (verified per dialect), then V2 runs.ExistingDatabaseMigrationTest: 3 pre-existing rows are byte-identical after the migration, and V1 is BASELINE.FreshDatabaseMigrationTest: Hibernatevalidatepasses on the migrated schema.hbm2ddl=noneas in prod: migration plus a settings smoke test, including cascade delete.flyway_schema_historyandplayer_setting).FLYWAY_ENABLED=falsedisables Flyway as an escape hatch.DROP TABLE player_setting. Player data is untouched in every step.otis_playerwith auuidPK column, which is what Micronaut's naming strategy produces. Please check this before deploying.binary(16)UUID columns would not match the V2 FK. UseFLYWAY_ENABLED=falseor recreate the local DB.Compatibility (old plugins)
/otis/**and/search/**are unchanged.ExistingEndpointsCompatibilityTeststays green. The only new effect: deleting a player also deletes their settings (cascade), with the same response as before.javap -publicof the generated client: 0 removed or changed lines, 91 lines added.velocity-pluginbuilds without source changes, and its shadow JAR contains nonet/kyoriclasses.Deviations
Recorded in
openspec/changes/add-player-settings/design.mdunder "Implementation Notes":{vendor}placeholder, so a small locations customizer replaces it.TypeConverterfor keys in the path, because it would lose the specific problem types.@Primarytransaction managers). Concurrent updates are last-write-wins and may skip a version increment.JsonNode.Test plan
./gradlew clean build(stacked branch): 173 tests, 0 failures, 1 skipped (pre-existing disabledOtisTest)OpenTelemetryExtension(name, kind, parent, attributes, value never present)javapdiff contains additions only; shadow JAR free of Adventure classeshttps://claude.ai/code/session_012BmpdMdQ5wwagagQvfcq8S