Skip to content

Conversation

@LukasFehring
Copy link
Collaborator

@LukasFehring LukasFehring commented Jul 10, 2025

Description

Motivation and Context

Changes

Type Of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How has This Been Tested?

  • Database provider:
  • Python version:
  • Operating System:

Does this Close/Impact Existing Issues?

  • Issue #X

What is Missing?

Checklist

  • My change is based on the latest stage of the develop branch.
  • My change required a change of the documentation, which has been done.
  • I checked that the documentation can be build, visualizes everything as expected, and does not contain any warnings.
  • I have added/adapted tests to cover my changes.
  • The tests can be executed successfully.
  • The notebooks can be executed successfully.
  • The notebooks can be executed with mysql as provider.
  • I have added a description of the changes to CHANGELOG.rst.

@LukasFehring LukasFehring linked an issue Jul 10, 2025 that may be closed by this pull request
@LukasFehring LukasFehring self-assigned this Jul 10, 2025
@LukasFehring LukasFehring requested review from Copilot and mwever July 10, 2025 12:13
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 adds support for encrypted (m)TLS connections for MySQL by allowing users to specify use_ssl and ssl_params in the database credentials file, updates the connector logic to consume these parameters, adjusts relevant type hints, and refreshes tests and documentation accordingly.

  • Extract SSL parameters (ca, cert, key) when use_ssl is enabled and pass them into the MySQL connector
  • Change table_name and database_name to Optional[str] in PyExperimenter constructor
  • Update docs, example credentials YAML, and disable SSH tunneling in the MySQL integration test

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/test_codecarbon/test_integration_mysql.py Switch use_ssh_tunnel to False in the MySQL integration test
py_experimenter/experimenter.py Tighten type hints for table_name and database_name
py_experimenter/database_connector_mysql.py Add parsing of SSL/mTLS params and optional typing
docs/source/usage/database_credential_file.rst Document use_ssl and ssl_params in credentials file
config/example_database_credentials.yml Provide example use_ssl and ssl_params entries
.cursorignore Ignore credential and certificate directories
Comments suppressed due to low confidence (3)

config/example_database_credentials.yml:6

  • The use_ssl and ssl_params entries are currently siblings of Standard but should be nested under Standard:. Adjust indentation so they live inside Standard:.
    Standard: 

docs/source/usage/database_credential_file.rst:21

  • [nitpick] This sentence uses both "additionally" and "also"—consider removing one for clarity, e.g., "We also support encrypted (m)TLS connections."
We additionally also support utilizing encrypted connections with (m)tls.  To that end, the following parameters can be added to the ``Standard`` section of the database credential file

py_experimenter/database_connector_mysql.py:125

  • There are no existing tests verifying that use_ssl and ssl_params are correctly applied. Consider adding an integration test for SSL/mTLS connections to ensure the connector uses these parameters as intended.
                if "use_ssl" in connection_configuration["Standard"]:

Copy link
Collaborator

@mwever mwever left a comment

Choose a reason for hiding this comment

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

LG2M

@LukasFehring LukasFehring merged commit b0658fa into develop Jul 15, 2025
12 checks passed
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.

Support MTLS

3 participants