Skip to content

feat: add public API module - #242

Open
Jakubk15 wants to merge 39 commits into
masterfrom
codex/issue-176-api-module
Open

Jakubk15 wants to merge 39 commits into
masterfrom
codex/issue-176-api-module

Conversation

@Jakubk15

Copy link
Copy Markdown
Member

Summary

  • split the project into parcellockers-api and parcellockers-plugin modules
  • expose stable parcel and locker contracts, domain models, events, and the ParcelLockersProvider entry point
  • publish the API as com.eternalcode:parcellockers-api:0.5.0-BETA with sources and Javadocs
  • keep plugin-only administrative and lifecycle operations outside the published API artifact
  • harden parcel dispatch, collection, rollback, item-storage reservation, compensation, and per-parcel operation serialization required by the new public facade
  • use JSpecify for nullness metadata

Why

External plugins currently cannot depend on a small, supported ParcelLockers contract without coupling to the complete plugin implementation. The new module provides a consumer-facing artifact for listening to events and managing parcels and lockers through service interfaces.

Impact

Existing plugin wiring now registers the public API provider during startup and clears it during shutdown. Consumers can compile against the API artifact while implementation details remain in the plugin module and deployable shadow JAR.

Verification

  • ./gradlew :parcellockers-api:test --rerun-tasks
  • explicit non-integration :parcellockers-plugin:test matrix covering all 17 unit-test classes
  • git diff --check

Both Gradle test runs completed with BUILD SUCCESSFUL on the final commit.

Docker/Testcontainers integration tests were intentionally skipped. H2/PostgreSQL schema-upgrade and cross-table transaction scenarios will be verified manually.

Closes #176

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@Jakubk15 Jakubk15 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  • Ensure you're using imports, not fully qualified class names
  • Keep it simple and stupid, do not use overly complicated enterprise-grade callbacks and atomicity for a simple Minecraft plugin
  • Ensure the tests are actually worth it rather than blind-writing tests for every feature
  • Answer why PublicParcelService and PluginParcelService cannot be merged

Comment thread parcellockers-api/build.gradle.kts Outdated
Comment thread parcellockers-plugin/build.gradle.kts Outdated
Comment thread parcellockers-plugin/build.gradle.kts Outdated
Comment thread build.gradle.kts Outdated
Jakubk15 and others added 3 commits August 15, 2026 17:44
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate Bot and others added 11 commits August 24, 2026 15:15
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…246)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jakub Kędziora <77227023+Jakubk15@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop in-memory parcel operation serialization, ThreadLocal event guards
  and item storage reservations; rely on atomic DB updates
  (saveIfAbsent, updateIfStatus, commitCollection) instead
- Simplify ParcelServiceImpl, ParcelDispatchService, AdminParcelService,
  ParcelSendTask and PublicParcelService, remove duplicated compensation
- Remove unused markCollected/rollbackCollection repository methods and
  redundant null checks
- Inject logger into ParcelDispatchService, document PluginParcelService
- Replace subprojects {} with a buildSrc convention plugin, publish
  snapshots to the snapshots repository, drop AOT runServer flags

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MySQL rejects a UNIQUE index on a TEXT column without a key length, so the
lockers table could never be created on MySQL. Existing tables on other
databases are left untouched by CREATE TABLE IF NOT EXISTS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unwrap the CompletionException so ParcelOperationException carries the real
failure. Fix ParcelServiceImplTest mocks: deep stubs could not follow the
self-typed notice builder and the scheduler answer returned a Boolean
instead of a Task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Await repository saves before reading them back, and replace real ItemStacks
(which need a running server) with marker mocks shared via TestItemStacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Check the sender's balance before inserting the parcel, so an
  unaffordable send never leaves a row behind; report a failed
  compensating delete with the parcel UUID
- Keep the parcel and its content when the sender's items cannot be
  restored after a delivery-creation failure, instead of rolling back
  the only remaining copy of the items
- Refuse dispatch to a destination locker that does not exist
- Reject more items than the parcel size can hold in the public API;
  move the capacity to ParcelSize#capacity()
- Validate non-null fields in the Parcel record constructor
- Remove unused imports and fix the test location in AGENTS.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Add API module

1 participant