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

ci: add TiDB v7.1 & Django v4.2 #42

Merged
merged 12 commits into from
Aug 8, 2023
Merged

ci: add TiDB v7.1 & Django v4.2 #42

merged 12 commits into from
Aug 8, 2023

Conversation

wd0517
Copy link
Collaborator

@wd0517 wd0517 commented Aug 6, 2023

  • Refactor CI workflow with matrix
  • Add TiDB v7.1 & Django v4.2
  • JSON related tests are expected to fail because of Does not fully support JSON because Django has some hard code for mysql in JSONField #38, I will fix it in next pr
  • Skip tests when TiDB v4 & v5 and Django v4.2, because django introduced the debug_transaction feature in version 4.2.x, but it does not consider databases that do not support savepoints(TiDB < 6.2.0), this results in all assertNumQueries test cases failing, for example:
    • "basic.tests.ModelInstanceCreationTests.test_save_parent_primary_with_default"
    • "bulk_create.tests.BulkCreateTests.test_efficiency"
    • "bulk_create.tests.BulkCreateTests.test_explicit_batch_size_efficiency"
    • "bulk_create.tests.BulkCreateTests.test_explicit_batch_size_respects_max_batch_size"
    • "bulk_create.tests.BulkCreateTests.test_non_auto_increment_pk_efficiency"
    • ....

@zhangyangyu
Copy link
Member

Nice job! But I think we should add Python 3.11, it's the current bugfix Python version.

@wd0517
Copy link
Collaborator Author

wd0517 commented Aug 8, 2023

there is a bug or a improvement in python 3.11.4, not releated to django-tidb, I will switch to using python 3.11.3 for running the tests

Python 3.11.4 (main, Jul 25 2023, 17:36:13) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib.parse import urlsplit
>>> urlsplit('http://[::1:2::3]/')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/parse.py", line 500, in urlsplit
    _check_bracketed_host(bracketed_host)
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/parse.py", line 446, in _check_bracketed_host
    ip = ipaddress.ip_address(hostname) # Throws Value Error if not IPv6 or IPv4
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: '::1:2::3' does not appear to be an IPv4 or IPv6 address

python 3.9

Python 3.9.17 (main, Jun 20 2023, 18:00:22)
[Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> from urllib.parse import urlsplit
>>> urlsplit('http://[::1:2::3]/')
SplitResult(scheme='http', netloc='[::1:2::3]', path='/', query='', fragment='')
>>>

@wd0517
Copy link
Collaborator Author

wd0517 commented Aug 8, 2023

It's an security improvement: https://docs.python.org/release/3.11.4/whatsnew/changelog.html#python-3-11-4

Django has already fixed this issue in versions 4.2.x and 4.1.x, but not in version 3.2.x, even though 3.2 is a TLS version and support ends in April 2024. Django Supported Versions, I will report this problem to Django.

@wd0517 wd0517 merged commit eabcac1 into pingcap:main Aug 8, 2023
27 checks passed
@wd0517 wd0517 deleted the update-ci branch August 8, 2023 13:40
@zhangyangyu
Copy link
Member

zhangyangyu commented Aug 8, 2023

@wd0517 I don't look into the Django test, but for the code snippet failed:

>>> from urllib.parse import urlsplit
>>> urlsplit('http://[::1:2::3]/')

I think it's not due to the security fix in 3.11.4, but this fix python/cpython@b2171a2.

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.

3 participants