{{ message }}
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds SSL certificate verification configuration to the GitLab HVCS client by passing the ssl_verify parameter to the gitlab.Gitlab constructor.
- Adds
ssl_verify=not allow_insecureparameter when initializing the GitLab client to properly handle SSL/TLS certificate verification
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
This PR has not received a response in 14 days. If no response is received in 7 days, it will be closed. We look forward to hearing from you. |
|
This PR was closed because no response was received. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Purpose
This pull request fixes a bug where
python-semantic-releasefails to create releases on self-hosted GitLab instances that use self-signed or internally-issued SSL certificates.When the
insecure = trueflag is set inpyproject.toml, the release process currently fails with anSSLCertVerificationError, preventing users from publishing releases in their private GitLab environments. This PR ensures that theinsecureflag is correctly honored.Solves:
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failedwhen runningsemantic-release publishagainst a self-hosted GitLab instance.Rationale
The root cause of the issue is that the
allow_insecureparameter in thesemantic_release.hvcs.gitlab.Gitlabclass was not being passed down to the underlyingpython-gitlabclient.The
gitlab.Gitlabconstructor accepts anssl_verifyparameter, which defaults toTrue. Thepython-semantic-releasewrapper did not utilize theallow_insecureflag to modify this behavior. As a result, thepython-gitlabclient always attempted to verify SSL certificates, regardless of the user's configuration inpyproject.toml.The solution is to explicitly pass
ssl_verify=not allow_insecureduring the initialization of thegitlab.Gitlabclient withinsemantic_release/hvcs/gitlab.py. This directly connects the configuration option to the client's behavior, making theinsecureflag work as intended.Workarounds like setting
REQUESTS_CA_BUNDLEorGITLAB_SSL_VERIFYenvironment variables were considered but are less ideal as they require extra configuration in the user's CI/CD environment rather than fixing the bug at its source.How did you test?
This change was validated through manual end-to-end testing in a CI/CD environment that replicates the original issue.
Methodology:
python-semantic-releaseand applied the code change on a new branch.pyproject.tomlfile was configured with the following remote settings:python-semantic-releasedirectly from the forked Git repository and branch.- uv pip install "git+https://github.com/your-username/python-semantic-release.git@fix/gitlab-ssl-verify"semantic-release publishcommand.SSLCertVerificationError.publishstep, creating a new release in the self-hosted GitLab project.No edge cases were identified, as this change simply wires a boolean flag to its intended destination. Existing unit tests continue to pass.
How to Verify
A reviewer can verify this fix by following these steps:
pyproject.tomlas follows:python-semantic-release.semantic-release publish.mainbranch, which should fail with theSSLCertVerificationError.PR Completion Checklist