Skip to content

Conversation

@lemanczykp
Copy link
Contributor

@lemanczykp lemanczykp commented Dec 12, 2025

mp tool: Optional disabling ssl verification for dev-env push

Description

Disables ssl when pushing the integration to a development env. This is usefull for localhost deployments.
Example usage:

mp dev-env login --no-ssl
mp dev-env push tools --no-ssl

When using this param the tools throws new warnings

Checklist:

Please ensure you have completed the following items before submitting your PR.
This helps us review your contribution faster and more efficiently.

General Checks:

  • I have read and followed the project's contributing.md guide.
  • My code follows the project's coding style guidelines.
  • I have performed a self-review of my own code.
  • My changes do not introduce any new warnings.
  • My changes pass all existing tests.
  • I have added new tests where appropriate to cover my changes. (If applicable)
  • I have updated the documentation where necessary (e.g., README, API docs). (If applicable)

Open-Source Specific Checks:

  • My changes do not introduce any Personally Identifiable Information (PII) or sensitive customer data.
  • My changes do not expose any internal-only code examples, configurations, or URLs.
  • All code examples, comments, and messages are generic and suitable for a public repository.
  • I understand that any internal context or sensitive details related to this work are handled separately in internal systems (Buganizer for Google team members).

For Google Team Members and Reviewers Only:

  • I have included the Buganizer ID in the PR title or description (e.g., "Internal Buganizer ID: 123456789" or "Related Buganizer: go/buganizer/123456789").
  • I have ensured that all internal discussions and PII related to this work remain in Buganizer.
  • I have tagged the PR with one or more labels that reflect the pull request purpose.

@lemanczykp lemanczykp self-assigned this Dec 12, 2025
@lemanczykp lemanczykp requested a review from a team as a code owner December 12, 2025 13:54
@lemanczykp lemanczykp added the mp mp related change label Dec 12, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lemanczykp, 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 new --no-ssl flag for the mp dev-env login and mp dev-env push commands. This enhancement provides developers with the flexibility to disable SSL certificate verification when interacting with development environments, which is especially beneficial for local deployments and testing where standard SSL certificates may not be configured or are self-signed. The underlying BackendAPI has been updated to support this new verification control.

Highlights

  • New --no-ssl option for mp dev-env login: Introduced a new --no-ssl option for the mp dev-env login command, allowing users to bypass SSL certificate verification when authenticating to a development environment. This is particularly useful for localhost setups where self-signed or no SSL certificates might be in use.
  • New --no-ssl option for mp dev-env push: Added a --no-ssl option to the mp dev-env push command, enabling the optional disabling of SSL verification during the deployment of integrations to a development environment. This streamlines the deployment process for local development and testing.
  • BackendAPI class modification: The BackendAPI class constructor now accepts a verify_ssl boolean parameter. This parameter is used to configure the requests.Session object's verify attribute, allowing programmatic control over SSL certificate verification for all subsequent HTTP requests made by the API client.
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 --no-ssl flag to the dev-env login and dev-env push commands, allowing users to disable SSL certificate verification. This is a useful feature for local development environments. The implementation correctly passes the flag down to the BackendAPI to control the requests session's verification behavior.

My review includes a few suggestions to improve the code:

  • Refactoring the BackendAPI instantiation in both login and push commands to reduce code duplication.
  • Suppressing the InsecureRequestWarning that requests issues when SSL verification is disabled, which will improve the user experience as mentioned in the PR description.

Overall, the changes are well-implemented and address the intended goal.

Comment on lines 148 to 154
if api_key is not None:
backend_api = api.BackendAPI(api_root=params.api_root, api_key=params.api_key)
backend_api = api.BackendAPI(api_root=params.api_root, api_key=params.api_key, verify_ssl=not no_ssl)
else:
backend_api = api.BackendAPI(
api_root=params.api_root, username=params.username, password=params.password
api_root=params.api_root, username=params.username, password=params.password, verify_ssl=not no_ssl
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and reduce code duplication, you can refactor the instantiation of BackendAPI. By building a dictionary of keyword arguments, you can avoid repeating the common parameters.

Suggested change
if api_key is not None:
backend_api = api.BackendAPI(api_root=params.api_root, api_key=params.api_key)
backend_api = api.BackendAPI(api_root=params.api_root, api_key=params.api_key, verify_ssl=not no_ssl)
else:
backend_api = api.BackendAPI(
api_root=params.api_root, username=params.username, password=params.password
api_root=params.api_root, username=params.username, password=params.password, verify_ssl=not no_ssl
)
kwargs = {
"api_root": params.api_root,
"verify_ssl": not no_ssl,
}
if api_key is not None:
kwargs["api_key"] = params.api_key
else:
kwargs["username"] = params.username
kwargs["password"] = params.password
backend_api = api.BackendAPI(**kwargs)

Comment on lines 219 to 232
if config.get("api_key"):
backend_api = api.BackendAPI(api_root=config["api_root"], api_key=config["api_key"])
backend_api = api.BackendAPI(
api_root=config["api_root"], api_key=config["api_key"], verify_ssl=not no_ssl
)
else:
backend_api = api.BackendAPI(
api_root=config["api_root"],
username=config["username"],
password=config["password"],
verify_ssl=not no_ssl,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to the login function, you can refactor this section to reduce code duplication and improve readability by preparing the arguments for BackendAPI in a dictionary.

        kwargs = {
            "api_root": config["api_root"],
            "verify_ssl": not no_ssl,
        }
        if config.get("api_key"):
            kwargs["api_key"] = config["api_key"]
        else:
            kwargs["username"] = config["username"]
            kwargs["password"] = config["password"]
        backend_api = api.BackendAPI(**kwargs)

self.password = password
self.api_key = api_key
self.session = requests.Session()
self.session.verify = verify_ssl
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The pull request description mentions that new warnings are thrown when using --no-ssl. These are likely InsecureRequestWarning from the requests library. To improve the user experience for local development, you can suppress these warnings when SSL verification is disabled. This avoids cluttering the output for users who are intentionally disabling verification.

        self.session.verify = verify_ssl
        if not verify_ssl:
            import urllib3

            urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

@doriaviram
Copy link
Contributor

Hey, do you want to fix the lint issues ?

@lemanczykp
Copy link
Contributor Author

@doriaviram Hi, this feature is mostly for ease of local development and was not requested. The lint issues require a bit of rework and retest for which I recently did not have "spare" time. Will try to wrap it during this or next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mp mp related change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants