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

fix auto field warning for django 3.2 #354

Merged

Conversation

umarmughal824
Copy link
Contributor

@umarmughal824 umarmughal824 commented Sep 23, 2021

Proposed changes

I am fixing some waring while upgrading to django 3.2 that have mentioned below in the Other Information section

Types of changes

Please check the type of change your PR introduces:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here to
help! This is simply a reminder of what we are going to look for before merging
your code.

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

Other information

I am facing the following warning while upgrading the django to 3.2 which take the default variable for DEFAULT_AUTO_FIELD ref

web_1     | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the PythonSocialAuthConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
web_1     | social_django.Code: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
web_1     | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the PythonSocialAuthConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
web_1     | social_django.Nonce: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
web_1     | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the PythonSocialAuthConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
web_1     | social_django.Partial: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
web_1     | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the PythonSocialAuthConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.
web_1     | social_django.UserSocialAuth: (models.W042) Auto-created primary key used when not defining a primary key type, by default 'django.db.models.AutoField'.
web_1     | 	HINT: Configure the DEFAULT_AUTO_FIELD setting or the PythonSocialAuthConfig.default_auto_field attribute to point to a subclass of AutoField, e.g. 'django.db.models.BigAutoField'.

So in lieu of that I am facing the error in my CI/CD that is

Migrations for 'social_django': /opt/hostedtoolcache/Python/3.7.5/x64/lib/python3.7/site-packages/social_django/migrations/0011_auto_20210923_1203.py - Alter field id on association - Alter field id on code - Alter field id on nonce - Alter field id on partial - Alter field id on usersocialauth

@atodorov
Copy link
Contributor

Migrations for 'social_django': /opt/hostedtoolcache/Python/3.7.5/x64/lib/python3.7/site-packages/social_django/migrations/0011_auto_20210923_1203.py - Alter field id on association - Alter field id on code - Alter field id on nonce - Alter field id on partial - Alter field id on usersocialauth

LGTM but I didn't understand this last bit. Can you explain?

@umarmughal824
Copy link
Contributor Author

Migrations for 'social_django': /opt/hostedtoolcache/Python/3.7.5/x64/lib/python3.7/site-packages/social_django/migrations/0011_auto_20210923_1203.py - Alter field id on association - Alter field id on code - Alter field id on nonce - Alter field id on partial - Alter field id on usersocialauth

LGTM but I didn't understand this last bit. Can you explain?

that's not really to that repository that the logs from our CI/CD flow because of missing migrations

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #354 (0dd1e2d) into master (fa5c926) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #354      +/-   ##
==========================================
+ Coverage   93.76%   93.78%   +0.02%     
==========================================
  Files          33       34       +1     
  Lines        1106     1110       +4     
  Branches       63       63              
==========================================
+ Hits         1037     1041       +4     
  Misses         44       44              
  Partials       25       25              
Flag Coverage Δ
unittests 93.78% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
social_django/migrations/0011_alter_id_fields.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa5c926...0dd1e2d. Read the comment docs.

@atodorov atodorov merged commit 0fde29f into python-social-auth:master Sep 23, 2021
@umarmughal824 umarmughal824 deleted the umar/support-django32 branch September 23, 2021 13:03
@umarmughal824
Copy link
Contributor Author

@atodorov when are you planning to make a new release tag that it could be a part of so that it could be used.

@atodorov
Copy link
Contributor

@atodorov when are you planning to make a new release tag that it could be a part of so that it could be used.

I can't push new releases to PyPI so that's for @omab to decide.

In any case you can still use the application as-is. If the Django warning is bothering you then you can provide the DEFAULT_AUTO_FIELD setting inside your own code base.

@umarmughal824
Copy link
Contributor Author

umarmughal824 commented Sep 24, 2021

DEFAULT_AUTO_FIELD

@atodorov @omab I am already using it but still it's bringing that missing migration error. See that logs below that could only be addressed by only new release tag.

[TEST SUITE] ./scripts/test/detect_missing_migrations.sh
Error: one or more migrations are missing
Migrations for 'social_django': /opt/hostedtoolcache/Python/3.7.5/x64/lib/python3.7/site-packages/social_django/migrations/0011_auto_20210923_1203.py - Alter field id on association - Alter field id on code - Alter field id on nonce - Alter field id on partial - Alter field id on usersocialauth

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

Successfully merging this pull request may close these issues.

2 participants