Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ add MySQL 8.4 and MariaDB 11.4 support #122

Merged
merged 26 commits into from
Jul 23, 2024
Merged

Conversation

techouse
Copy link
Owner

@techouse techouse commented Jul 21, 2024

Pull Request Template

Description

Add MariaDB 11.4 and MySQL 8.4 support

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Additional MariaDB 11.4 and MySQL 8.4 specific CI tests have been added.

NOTE: Because of a MySQL 8.4 bug all MySQL 8.4 tests have been marked as experimental which effectively sets continue-on-error: true for these tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@techouse techouse added the ci label Jul 21, 2024
@techouse techouse self-assigned this Jul 21, 2024
Copy link

coderabbitai bot commented Jul 21, 2024

Walkthrough

This update enhances the testing framework and documentation for a project by adding support for multiple Python versions (3.8 to 3.12) in the CI configuration, ensuring broader compatibility and testing coverage. Additionally, the README is updated to reflect support for MariaDB version 11.4 and MySQL version 8.4, improving clarity for users regarding database compatibility.

Changes

Files Change Summary
.github/workflows/test.yml Added testing configurations for Python versions 3.8 to 3.12 with MariaDB 11.4 and MySQL 8.4.
README.md Updated MariaDB support badge to include version 11.4 and MySQL badge to include version 8.4.
pyproject.toml / requirements_dev.txt Upgraded mysql-connector-python dependency from 8.2.0 to 9.0.0.
src/sqlite3_to_mysql/transporter.py Changed default MySQL collation from utf8mb4_general_ci to utf8mb4_unicode_ci for better character handling.
tests/conftest.py Enhanced mysql_instance function to accept charset and collation parameters for MySQL connections.
tests/func/sqlite3_to_mysql_test.py Updated tests to include charset and collation parameters in MySQL connection test cases.
tests/func/test_cli.py Added command-line arguments -h and -P to various CLI tests for better configuration.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI System
    participant Python as Python Environment
    participant MariaDB as MariaDB
    participant MySQL as MySQL

    CI->>Python: Trigger tests for Python 3.8 with MariaDB
    Python->>MariaDB: Connect to MariaDB 11.4
    MariaDB-->>Python: Return connection success
    Python-->>CI: Return test results

    CI->>Python: Trigger tests for Python 3.8 with MySQL
    Python->>MySQL: Connect to MySQL 8.4
    MySQL-->>Python: Return connection success
    Python-->>CI: Return test results

    %% This continues for Python 3.9, 3.10, 3.11, and 3.12
Loading

🐰 In the garden, changes sprout,
Testing versions, without a doubt.
MariaDB and MySQL shine bright,
Compatibility is a delightful sight!
With every hop, our code's refined,
A happy project, so well aligned! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@techouse techouse changed the title ✅ add MariaDB 11.4 tests ✅ add MariaDB 11.4 CI tests Jul 21, 2024
@techouse techouse marked this pull request as draft July 21, 2024 10:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f742ac9 and 509f642.

Files selected for processing (2)
  • .github/workflows/test.yml (1 hunks)
  • README.md (1 hunks)
Additional context used
LanguageTool
README.md

[locale-violation] ~5-~5: license must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...+10.3+|+10.4+|+10.5|+11.4&color=C0765A) [![GitHub license](https://img.shields.io/github/license/...

(LICENCE_LICENSE_NOUN_SINGULAR)

Additional comments not posted (6)
README.md (1)

5-5: Ensure the badge URL is correct and consistent.

The badge URL for MariaDB support has been updated to include version 11.4. Verify that the URL is correct and consistent with the format used for other badges.

Tools
LanguageTool

[locale-violation] ~5-~5: license must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...+10.3+|+10.4+|+10.5|+11.4&color=C0765A) [![GitHub license](https://img.shields.io/github/license/...

(LICENCE_LICENSE_NOUN_SINGULAR)

.github/workflows/test.yml (5)

309-314: LGTM!

The configuration for testing with Python 3.8 and MariaDB 11.4 looks good.


315-320: LGTM!

The configuration for testing with Python 3.9 and MariaDB 11.4 looks good.


321-326: LGTM!

The configuration for testing with Python 3.10 and MariaDB 11.4 looks good.


327-332: LGTM!

The configuration for testing with Python 3.11 and MariaDB 11.4 looks good.


333-338: LGTM!

The configuration for testing with Python 3.12 and MariaDB 11.4 looks good.

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.50%. Comparing base (21d0306) to head (4c92bd1).

Files Patch % Lines
src/sqlite3_to_mysql/transporter.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #122   +/-   ##
=======================================
  Coverage   88.50%   88.50%           
=======================================
  Files           8        8           
  Lines         661      661           
=======================================
  Hits          585      585           
  Misses         76       76           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@techouse techouse changed the title ✅ add MariaDB 11.4 CI tests ✅ add MySQL 8.4 and MariaDB 11.4 CI tests Jul 21, 2024
@techouse techouse changed the title ✅ add MySQL 8.4 and MariaDB 11.4 CI tests ✨ add MySQL 8.4 and MariaDB 11.4 support Jul 22, 2024
@techouse techouse marked this pull request as ready for review July 23, 2024 08:01
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 509f642 and 4c92bd1.

Files selected for processing (8)
  • .github/workflows/test.yml (3 hunks)
  • README.md (1 hunks)
  • pyproject.toml (1 hunks)
  • requirements_dev.txt (1 hunks)
  • src/sqlite3_to_mysql/transporter.py (2 hunks)
  • tests/conftest.py (1 hunks)
  • tests/func/sqlite3_to_mysql_test.py (1 hunks)
  • tests/func/test_cli.py (9 hunks)
Additional context used
LanguageTool
README.md

[locale-violation] ~5-~5: license must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...+10.3+|+10.4+|+10.5|+11.4&color=C0765A) [![GitHub license](https://img.shields.io/github/license/...

(LICENCE_LICENSE_NOUN_SINGULAR)

Additional comments not posted (18)
requirements_dev.txt (1)

5-5: Verify compatibility with mysql-connector-python version 9.0.0.

Upgrading to a new major version may introduce breaking changes or new features that could affect the application. Ensure that the codebase is compatible with mysql-connector-python 9.0.0 and that all relevant tests pass.

pyproject.toml (1)

42-42: Verify compatibility with mysql-connector-python version 9.0.0.

Upgrading to a new major version may introduce breaking changes or new features that could affect the application. Ensure that the codebase is compatible with mysql-connector-python 9.0.0 and that all relevant tests pass.

README.md (2)

4-4: Update MySQL support badge.

The MySQL support badge has been updated to include version 8.4, which improves the clarity of the project's documentation regarding supported MySQL versions.


5-5: Update MariaDB support badge.

The MariaDB support badge has been updated to include version 11.4, which improves the clarity of the project's documentation regarding supported MariaDB versions.

Tools
LanguageTool

[locale-violation] ~5-~5: license must be spelled with a “c” when used as a noun in British English. Use “licence”.
Context: ...+10.3+|+10.4+|+10.5|+11.4&color=C0765A) [![GitHub license](https://img.shields.io/github/license/...

(LICENCE_LICENSE_NOUN_SINGULAR)

tests/conftest.py (1)

296-297: LGTM! But verify the usage of new parameters in the codebase.

The code changes are approved.

However, ensure that all calls to mysql_instance provide the new parameters if necessary.

.github/workflows/test.yml (2)

309-337: New configurations for MariaDB 11.4 look good.

The new configurations for MariaDB 11.4 are correctly integrated and follow the existing structure.


459-487: New configurations for MySQL 8.4 look good.

The new configurations for MySQL 8.4 are correctly integrated and follow the existing structure.

tests/func/test_cli.py (8)

80-83: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


106-109: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


134-137: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


160-163: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


187-190: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


253-256: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.


281-284: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.

Also applies to: 301-304


329-332: Integration of -h and -P arguments looks good.

The new arguments are correctly integrated and the test logic remains valid.

tests/func/sqlite3_to_mysql_test.py (1)

351-352: LGTM! But verify the function usage in the codebase.

The addition of charset and collation parameters enhances Unicode character support. Ensure that all function calls to test_transfer_transfers_all_tables_in_sqlite_file match the new signature.

Verification successful

No calls to the function test_transfer_transfers_all_tables_in_sqlite_file were found.

Since there are no calls to this function in the codebase, there are no instances to verify against the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `test_transfer_transfers_all_tables_in_sqlite_file` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type python -A 5 $'test_transfer_transfers_all_tables_in_sqlite_file'

Length of output: 104


Script:

#!/bin/bash
# Description: Verify all function calls to `test_transfer_transfers_all_tables_in_sqlite_file` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg -A 5 $'test_transfer_transfers_all_tables_in_sqlite_file'

Length of output: 481


Script:

#!/bin/bash
# Description: Verify all function calls to `test_transfer_transfers_all_tables_in_sqlite_file` match the new signature.

# Test: Search for all calls to the function. Expect: Only occurrences of the new signature.
rg 'test_transfer_transfers_all_tables_in_sqlite_file\('

Length of output: 153

src/sqlite3_to_mysql/transporter.py (2)

110-110: LGTM! But verify the constructor usage in the codebase.

The change to set the default collation to utf8mb4_unicode_ci enhances Unicode character support. Ensure that all constructor calls to SQLite3toMySQL match the new logic.

Verification successful

LGTM! But verify the constructor usage in the codebase.

The change to set the default collation to utf8mb4_unicode_ci enhances Unicode character support. Ensure that all constructor calls to SQLite3toMySQL match the new logic.

  • Verified multiple instances of SQLite3toMySQL constructor usage across test files and the CLI module.
  • The tests cover various scenarios, ensuring comprehensive coverage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all constructor calls to `SQLite3toMySQL` match the new logic.

# Test: Search for the constructor usage. Expect: Only occurrences of the new logic.
rg --type python -A 5 $'SQLite3toMySQL'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify all constructor calls to `SQLite3toMySQL` match the new logic.

# Test: Search for the constructor usage. Expect: Only occurrences of the new logic.
rg --type py -A 5 $'SQLite3toMySQL'

Length of output: 16989


147-148: LGTM! But verify the method usage in the codebase.

The addition of charset and collation parameters in the MySQL connection enhances Unicode character support. Ensure that all calls to _create_database match the new logic.

@techouse techouse added the enhancement New feature or request label Jul 23, 2024
@techouse techouse merged commit 042dec9 into master Jul 23, 2024
77 of 83 checks passed
@techouse techouse deleted the feat/update-mariadb-tests branch July 23, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant