Skip to content

fix: Set call handling to not use base url as path#292

Merged
itachi1706 merged 2 commits intomasterfrom
path-as-base-url-fix
Oct 2, 2025
Merged

fix: Set call handling to not use base url as path#292
itachi1706 merged 2 commits intomasterfrom
path-as-base-url-fix

Conversation

@itachi1706
Copy link
Owner

The current implementation makes it such that the base url is also the path. As a result when using the builder pattern it will attempt to call $baseUrl/$baseUrl which is incorrect

This change converts the call to a new path variable so that it calls $baseUrl/$path correctly. And this path is optional and defaults to an empty string so that you can choose not to use it.

@itachi1706 itachi1706 requested a review from Copilot October 2, 2025 02:57
@itachi1706 itachi1706 self-assigned this Oct 2, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @itachi1706, 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 addresses a bug in the ApiCallsHelper where the base URL was incorrectly being used as the path component, leading to malformed API calls (e.g., $baseUrl/$baseUrl). The fix introduces a distinct path variable and a corresponding setPath method in the builder pattern, ensuring that API calls are correctly formed as $baseUrl/$path, with the path being optional and defaulting to an empty string.

Highlights

  • New Path Variable: Introduced a dedicated path variable within the ApiCallsHelper.Builder class to correctly manage API endpoint paths, defaulting to an empty string.
  • Path Configuration Method: Added a setPath method to the ApiCallsHelper.Builder to allow explicit configuration of the API call path.
  • Corrected URL Construction: Modified the internal call handling logic to utilize the new path variable instead of mistakenly using the baseUrl when constructing the final API request URL.
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

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 fixes an API call URL construction bug where the base URL was being used as both the base and path, resulting in incorrect $baseUrl/$baseUrl calls. The fix introduces a separate optional path parameter that defaults to an empty string, enabling proper $baseUrl/$path URL construction.

Key changes:

  • Added a new path property to the Builder class to separate path from base URL
  • Added a setPath() method to allow setting the path
  • Modified the call handling to use the path instead of base URL for the endpoint

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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 correctly fixes an issue where the base URL was being used as the path in API calls made through the Builder pattern, which caused incorrect URLs like $baseUrl/$baseUrl. The introduction of a path variable in the Builder and using it in the internalCallHandling call effectively resolves this. My only suggestion is to add KDoc to the new setPath method for consistency and better documentation.

@itachi1706 itachi1706 enabled auto-merge October 2, 2025 02:59
@itachi1706 itachi1706 added the hacktoberfest-accepted For Hacktoberfest related activities label Oct 2, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2025

@itachi1706 itachi1706 merged commit 518d8fa into master Oct 2, 2025
8 checks passed
@itachi1706 itachi1706 deleted the path-as-base-url-fix branch October 2, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted For Hacktoberfest related activities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants