Skip to content

Conversation

@dev-marek
Copy link
Contributor

@dev-marek dev-marek commented Oct 31, 2025

Issue

https://gravitee.atlassian.net/browse/APIM-11694

Description

Get Homepage Navigation Items

GET {{baseUrl}}management/v2/environments/DEFAULT/portal-navigation-items?area=HOMEPAGE&loadChildren=true
Authorization: {{token}}

Additional context

@dev-marek dev-marek requested a review from a team as a code owner October 31, 2025 16:20
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dev-marek, 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 significantly refactors the management and retrieval of portal navigation items. It introduces a more robust and flexible architecture by centralizing navigation item queries into a dedicated service and use case, while also enhancing the domain models for better type safety and hierarchical representation. The changes aim to improve the maintainability and extensibility of the portal's navigation system.

Highlights

  • Repository API Refinement: The PortalNavigationItemRepository interface has been updated to remove the organizationId parameter from the findAllByAreaAndEnvironmentId method, streamlining queries to be environment-specific for a given area.
  • Repository Implementations Alignment: Both JDBC and MongoDB implementations of PortalNavigationItemRepository have been adjusted to match the updated API signature, ensuring consistency across persistence layers.
  • Domain Model Enhancements: The PortalNavigationItem class is now sealed, restricting its direct subclasses to PortalNavigationPage, PortalNavigationLink, and PortalNavigationFolder, which are now final. A parentId field has also been added to PortalNavigationItem for hierarchical structuring.
  • New Query Service for Portal Navigation Items: A new PortalNavigationItemsQueryService interface and its PortalNavigationItemsQueryServiceImpl implementation have been introduced to provide dedicated methods for retrieving portal navigation items, including finding by ID, parent ID, and top-level items by area.
  • New Use Case for Listing Navigation Items: A ListPortalNavigationItemsUseCase has been added, leveraging the new query service to fetch portal navigation items. This use case supports listing top-level items or children of a specific parent, with an option to recursively load all descendants.
  • Repository-to-Domain Model Adapter: A new PortalNavigationItemAdapter has been created to facilitate the conversion between repository-level PortalNavigationItem entities and the core domain models, handling specific configurations for page and link types.
  • Removal of PageExistsSpecification: The PageExistsSpecification.java file has been removed, indicating a refactoring or simplification of page existence validation logic.
  • Comprehensive Testing Infrastructure: New in-memory repository and query service implementations, along with dedicated test fixtures and unit tests, have been added to thoroughly validate the new portal navigation item listing functionality.
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.

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 introduces a use case for listing portal navigation items, along with significant refactoring of the PortalNavigationItem model and its corresponding repository. The changes are generally positive, making good use of modern Java features like sealed classes. However, there are several areas for improvement. The new query service implementation has performance issues due to in-memory filtering instead of leveraging database queries, which could be problematic at scale. Additionally, the adapter for converting between repository and domain models could be made more robust and efficient. My review includes specific suggestions to address these points.

@dev-marek dev-marek marked this pull request as draft November 3, 2025 10:00
@dev-marek dev-marek marked this pull request as ready for review November 3, 2025 13:30
@dev-marek dev-marek force-pushed the apim-11690-refactor-structures-for-portal-pages branch from b84abed to 4e8cc18 Compare November 3, 2025 16:16
@dev-marek dev-marek force-pushed the apim-11694-list-navigation-items-use-case branch 2 times, most recently from 7e007de to ce2b64f Compare November 4, 2025 12:15
@dev-marek dev-marek force-pushed the apim-11690-refactor-structures-for-portal-pages branch 2 times, most recently from ff50840 to 722364f Compare November 5, 2025 13:02
Base automatically changed from apim-11690-refactor-structures-for-portal-pages to master November 5, 2025 13:28
@dev-marek dev-marek force-pushed the apim-11694-list-navigation-items-use-case branch 2 times, most recently from ddbecfe to 883209d Compare November 5, 2025 13:35
@dev-marek dev-marek force-pushed the apim-11694-list-navigation-items-use-case branch 2 times, most recently from 645e29d to 8fb1838 Compare November 6, 2025 16:04
Copy link
Member

@phiz71 phiz71 left a comment

Choose a reason for hiding this comment

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

Last few comments

@dev-marek dev-marek force-pushed the apim-11694-list-navigation-items-use-case branch 2 times, most recently from e947352 to 90087ee Compare November 7, 2025 10:36
@dev-marek dev-marek force-pushed the apim-11694-list-navigation-items-use-case branch from 90087ee to 6100887 Compare November 7, 2025 11:42
@dev-marek dev-marek merged commit d29631b into master Nov 7, 2025
25 checks passed
@dev-marek dev-marek deleted the apim-11694-list-navigation-items-use-case branch November 7, 2025 13:35
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.

3 participants