Skip to content

meili#1457

Merged
MiniDigger merged 31 commits intostagingfrom
meili
Apr 19, 2025
Merged

meili#1457
MiniDigger merged 31 commits intostagingfrom
meili

Conversation

@MiniDigger
Copy link
Member

@MiniDigger MiniDigger commented Mar 23, 2025

smol todo list for myself

@MiniDigger MiniDigger changed the title meli meili Apr 18, 2025
@MiniDigger MiniDigger requested a review from Copilot April 19, 2025 07:49
Copy link

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 implements new indexing and webhook functionality for MeiliSearch while updating several configuration accessors and dependency versions. Key changes include:

  • Addition of new webhook components (converter, message, and controller) for handling MeiliSearch webhook events.
  • Enhancements to the MeiliService, IndexService, and IndexDAO to support index creation, document management, and search operations.
  • Updates to configuration accessors and dependency versions across authentication, image processing, and CI/CD workflows.

Reviewed Changes

Copilot reviewed 199 out of 200 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
backend/src/main/java/io/papermc/hangar/components/index/webhook/* Added webhook converter, record definitions, and controller to process webhook messages.
backend/src/main/java/io/papermc/hangar/components/index/MeiliService.java Introduced a new service with methods for index management, document send/remove, and search.
backend/src/main/java/io/papermc/hangar/components/index/IndexService.java Created a new service to orchestrate full updates and incremental updates for projects/versions.
backend/src/main/java/io/papermc/hangar/components/index/IndexDAO.java Added complex SQL queries for retrieving project and version data for indexing.
backend/src/main/java/io/papermc/hangar/components/images/service/ImageService.java Updated configuration accessor calls for image scaling and quality properties.
Multiple auth and config service files Replaced legacy configuration getters with method-based accessors and updated JWT setups.
README.md and GitHub Workflows files Updated documentation and CI configuration to reflect new dependencies and node version.
Files not reviewed (1)
  • backend/pom.xml: Language not supported
Comments suppressed due to low confidence (1)

backend/src/main/java/io/papermc/hangar/components/auth/service/AuthService.java:176

  • Using getFirst() on a List may lead to a runtime error because the List interface does not guarantee this method. Consider reverting to get(0) or ensuring that the collection type supports getFirst().
final OffsetDateTime nextChange = userNameHistory.getFirst().date().plusDays(this.config.users().nameChangeInterval());

try {
return objectMapper.readValue(line, Webhook.class);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
Copy link

Copilot AI Apr 19, 2025

Choose a reason for hiding this comment

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

Rethrowing a JsonProcessingException as a generic RuntimeException may obscure the underlying error and conflict with the method signature. Consider wrapping the exception in an HttpMessageNotReadableException to provide clearer context for message conversion failures.

Suggested change
throw new RuntimeException(e);
throw new HttpMessageNotReadableException("Failed to parse JSON line into Webhook object", e);

Copilot uses AI. Check for mistakes.
@MiniDigger MiniDigger marked this pull request as ready for review April 19, 2025 07:58
@MiniDigger MiniDigger merged commit 0bf0f8c into staging Apr 19, 2025
2 checks passed
@MiniDigger MiniDigger deleted the meili branch April 19, 2025 08:50
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.

2 participants