Skip to content

Conversation

@Jakubk15
Copy link
Member

@Jakubk15 Jakubk15 commented Nov 8, 2025

No description provided.

@Jakubk15 Jakubk15 requested a review from Copilot November 8, 2025 13:39
@Jakubk15 Jakubk15 added the 🆕 feature New feature or request label Nov 8, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Jakubk15, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial feature for managing parcel locker capacity by allowing a configurable maximum number of parcels per locker. It integrates a pre-send check to ensure that parcels are not sent to full lockers, enhancing system stability and user experience. Players attempting to send parcels to an overloaded locker will receive an immediate notification, preventing failed deliveries and improving clarity.

Highlights

  • New Configuration Option: A new configuration setting, maxParcelsPerLocker, has been introduced in PluginConfig.java to allow administrators to define the maximum number of parcels a single locker can hold. The default value is set to 30.
  • Locker Capacity Check: The system now performs a check to determine if a destination locker is full before a parcel can be sent. This check is integrated into the sendParcel method within GuiManager.java.
  • User Notification for Full Lockers: A new notice message, lockerFull, has been added to MessageConfig.java. If a player attempts to send a parcel to a full locker, this message will be displayed to inform them that the destination locker is at capacity.
  • LockerManager Enhancements: The LockerManager has been updated to include a new method, isLockerFull, which queries the ParcelRepository to count existing parcels for a given locker and compares it against the configured maximum.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Jakubk15 Jakubk15 changed the title Add 'max parcels per locker' option GH-143 Add 'max parcels per locker' option Nov 8, 2025
@Jakubk15
Copy link
Member Author

Jakubk15 commented Nov 8, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully adds a configurable limit for the maximum number of parcels a locker can hold. The implementation is solid, introducing a check before a parcel is sent. I've identified a critical issue in GuiManager involving a race condition and a redundant database call, and I've provided a suggestion to fix it. Additionally, I've suggested a small improvement in the repository layer to handle potential integer overflows, making the implementation more robust. With these changes, the feature will be a great addition.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a feature to limit the maximum number of parcels per locker. The implementation looks good overall, introducing a new configuration option, a message for when the locker is full, and the logic to check the locker capacity before sending a parcel. I've found a critical bug in a database query that would prevent the feature from working correctly, and I've also suggested an improvement for handling potential errors in an asynchronous call to provide better feedback to the user. Please see my detailed comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a locker capacity limit feature to prevent parcels from being sent to full lockers. The implementation includes a configurable maximum parcels per locker setting and validates capacity before allowing parcel submissions.

  • Added countByDestinationLocker method to count parcels in a specific locker
  • Implemented capacity check in GuiManager.sendParcel with user notification when locker is full
  • Added configuration option maxParcelsPerLocker with default value of 30

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/com/eternalcode/parcellockers/parcel/repository/ParcelRepositoryOrmLite.java Implements database query to count parcels by destination locker
src/main/java/com/eternalcode/parcellockers/parcel/repository/ParcelRepository.java Adds interface method for counting parcels by destination locker
src/main/java/com/eternalcode/parcellockers/locker/LockerManager.java Adds isLockerFull method using the new count functionality and configuration
src/main/java/com/eternalcode/parcellockers/gui/GuiManager.java Wraps parcel sending logic with capacity check and user notification
src/main/java/com/eternalcode/parcellockers/configuration/implementation/PluginConfig.java Adds maxParcelsPerLocker configuration setting
src/main/java/com/eternalcode/parcellockers/configuration/implementation/MessageConfig.java Adds lockerFull notification message
src/main/java/com/eternalcode/parcellockers/ParcelLockers.java Updates dependency injection to pass required services to LockerManager and GuiManager
src/main/java/com/eternalcode/parcellockers/parcel/ParcelServiceImpl.java Adds blank line (formatting only)
src/main/java/com/eternalcode/parcellockers/parcel/ParcelService.java Adds blank line (formatting only)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Jakubk15 and others added 3 commits November 8, 2025 14:45
…ParcelRepositoryOrmLite.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
CitralFlo
CitralFlo previously approved these changes Nov 10, 2025

public CompletableFuture<Boolean> isLockerFull(UUID lockerUuid) {
return this.parcelRepository.countByDestinationLocker(lockerUuid)
.thenApply(count -> count >= this.config.settings.maxParcelsPerLocker);
Copy link
Member

Choose a reason for hiding this comment

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

maybe You can add option to set infinite number of parcels in the locer with value like -1 ? So this would be an option not a must.

Copy link
Member Author

Choose a reason for hiding this comment

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

will add

long count = dao.queryBuilder()
.where()
.eq(DESTINATION_LOCKER_COLUMN, destinationLocker)
.eq("status", ParcelStatus.DELIVERED)
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity why only in this status and not on IN_PROGRESS ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we need to count parcels that have already arrived in the parcel locker.

@igoyek igoyek removed their request for review November 12, 2025 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants