social-core icon indicating copy to clipboard operation
social-core copied to clipboard

Identify Qiita users by permanent_id

Open yktakaha4 opened this issue 3 years ago • 3 comments

Proposed changes

  • Generate UserSocialAuth with permanent_id in Qiita backend.
    • Currently Qiita backend identifies UserSocialAuth by id, but this value can be changed by renaming the account name.
    • According to the official documentation, permanent_id is available as a generated ID for each user.
  • To maintain compatibility, the behavior is modified by the settings variable SOCIAL_AUTH_QIITA_IDENTIFIED_BY_PERMANENT_ID.
    • If unspecified, identified by id.
  • More user information can be referenced in extra_data .
  • Add tests for new behaviors.

Types of changes

  • [ ] Release (new release request)
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] 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

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

Other information

I use this library in my business and always appreciate it! I am not an English speaker, so I would be happy to point out any discrepancies in naming variables, etc.

yktakaha4 avatar Jul 30 '22 09:07 yktakaha4

I verified that the test passed with the make tests command in my local, but it did not run for Python 3.10.

image

yktakaha4 avatar Jul 30 '22 09:07 yktakaha4

Can you please update the documentation at https://github.com/python-social-auth/social-docs as well?

nijel avatar Aug 10 '22 09:08 nijel

Codecov Report

Merging #698 (b5b6395) into master (031e2c7) will increase coverage by 0.09%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #698      +/-   ##
==========================================
+ Coverage   77.20%   77.30%   +0.09%     
==========================================
  Files         323      323              
  Lines        9766     9809      +43     
  Branches     1045     1051       +6     
==========================================
+ Hits         7540     7583      +43     
  Misses       2072     2072              
  Partials      154      154              
Flag Coverage Δ
unittests 77.30% <100.00%> (+0.09%) :arrow_up:

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

Impacted Files Coverage Δ
social_core/backends/qiita.py 94.44% <100.00%> (+1.85%) :arrow_up:
social_core/tests/backends/test_qiita.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 10 '22 09:08 codecov[bot]

Thank you for your review. I have created the following PR. https://github.com/python-social-auth/social-docs/pull/116

yktakaha4 avatar Aug 11 '22 10:08 yktakaha4

@nijel I was going to create another branch to handle this, but I messed up using the forked repository and added the commit to this branch. I am sorry but please point out any problems.

In my local:

$ flake8 social_core/      
$ echo $?       
0

yktakaha4 avatar Aug 16 '22 13:08 yktakaha4

Can you please separate the flake8 changes from the Qiita ones? Keeping it one topic in PR is preferred...

nijel avatar Aug 23 '22 11:08 nijel

My apologies. I have created a flake8 PR based on the current master branch. https://github.com/python-social-auth/social-core/pull/707

Also, the flake8 error related to qiita has been fixed in this PR. https://github.com/python-social-auth/social-core/pull/698/commits/b5b63958053bf7e6f6b1f6952c07308dc291bd16

yktakaha4 avatar Aug 25 '22 13:08 yktakaha4

Merged, thanks for your contribution!

nijel avatar Aug 26 '22 06:08 nijel