Skip to content

Comments

Ensure Netty restconf path is well formatted#2497

Merged
ihrasko merged 1 commit intoPANTHEONtech:mainfrom
ihrasko:netty-path
Dec 15, 2025
Merged

Ensure Netty restconf path is well formatted#2497
ihrasko merged 1 commit intoPANTHEONtech:mainfrom
ihrasko:netty-path

Conversation

@ihrasko
Copy link
Collaborator

@ihrasko ihrasko commented Dec 15, 2025

Ensure that Netty restconf path does not starts with '/'.

We would like to:

  • do not touch JSON configuration as we have it
  • make solution compatible with JAXRS logic

Thus remove additional '/' when user asks for it from Netty config.

JIRA: LIGHTY-333

Ensure that Netty restconf path does not starts with '/'.

We would like to:
- do not touch JSON configuration as we have it
- make solution compatible with JAXRS logic

Thus remove additional '/' when user asks for it from Netty config.

JIRA: LIGHTY-333
Signed-off-by: Ivan Hrasko <[email protected]>
@gemini-code-assist
Copy link

Summary of Changes

Hello @ihrasko, 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 refactors how the restconfServletContextPath is handled within the Netty Restconf configuration. The primary change involves shifting the responsibility of removing a leading slash from the path's setter to its getter. This ensures that while the internal configuration can retain the original path value, any component retrieving the path will consistently receive a well-formatted string without a leading slash, thereby improving consistency and compatibility across the system, particularly with JAXRS logic.

Highlights

  • Path Formatting Logic Relocation: The logic responsible for ensuring the restconfServletContextPath does not begin with a '/' has been moved from the setRestconfServletContextPath method to the getRestconfServletContextPath method.
  • Internal Storage Flexibility: The internal restconfServletContextPath field can now store the path as provided, potentially including a leading slash, while the getter guarantees that any consumer retrieving the path will always receive a properly formatted string without a leading slash.
  • Enhanced Compatibility: This adjustment aims to maintain compatibility with existing JSON configurations and align the path handling with JAXRS logic by standardizing the path format upon retrieval for Netty.
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

@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 refactors how the restconfServletContextPath is handled by moving the normalization logic (stripping a leading '/') from the setter to the getter. While this correctly preserves the original value from the configuration, it introduces a significant issue: the equals() and hashCode() methods were not updated. They still operate on the raw field, leading to inconsistent object equality checks. For example, two configurations with paths "/restconf" and "restconf" would be considered unequal, despite being semantically identical after normalization. This breaks the equals contract and can cause subtle bugs. My review includes a detailed comment on this issue.

@ihrasko ihrasko merged commit 7184cf0 into PANTHEONtech:main Dec 15, 2025
5 of 6 checks passed
@ihrasko ihrasko deleted the netty-path branch December 15, 2025 14:37
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.

1 participant