-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add mitxpro-social-auth #376
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the code review. I will functionality test this in the next iteration.
.pre-commit-config.yaml
Outdated
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.10.1 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- types-pytz | ||
- types-requests | ||
- types-pkg_resources | ||
- types-python-dateutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tell me why we have removed it in this PR or any specific reason as to why we are removing it at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were some errors thrown by the pre-commit for mypy therefore, I decided to run the pre-commit without it. I also checked MiTxPRO, MITxOnline and Bootcamp and didn't find the mypy hook.
I'll re-add it in the next commit after resolving the errors
@@ -21,6 +21,7 @@ cd /open-edx-plugins | |||
|
|||
# Installing test dependencies | |||
pip install pytest-mock==3.14.0 | |||
pip install responses==0.25.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it being installed through testing.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think I confused it with https://github.com/openedx/edx-platform/blob/master/scripts/user_retirement/requirements/testing.txt#L231
pyproject.toml
Outdated
@@ -17,6 +17,7 @@ gitpython = "^3.1.37" | |||
python-json-logger = "^2.0.2" | |||
sentry-sdk = "^2.0.0" | |||
XBlock = "*" | |||
social-auth-core = "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should pin this. We don't want to override this package in our open edX instances other than what is being installed by open edx.
src/ol_social_auth/BUILD
Outdated
], | ||
provides=setup_py( | ||
name="ol-social-auth", | ||
version="1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of our apps go with 1.x. They all start with a major version. 0.x.x. If we are starting this off we should go with 0.1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it to 0.1.0
but when we added the openedx-companion-auth
plugin, it was also started from 1.0.0 (reference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 0.1.0 is more suitable based on how we use the versioning of our projects.
src/ol_social_auth/LICENSE
Outdated
@@ -0,0 +1,29 @@ | |||
BSD 3-Clause License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any LICENSE files that include this line? I think you can copy this from one of the existing LICENSE files from other packages in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openedx-companion-auth also has this line. Changing both in the next commit
src/ol_social_auth/BUILD
Outdated
provides=setup_py( | ||
name="ol-social-auth", | ||
version="1.0.0", | ||
description="A package implementing MIT social auth backend", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description="A package implementing MIT social auth backend", | |
description="An Open edX plugin implementing MIT social auth backend", |
poetry.lock
Outdated
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. | ||
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we downgraded the poetry version? The previous file was generated using 1.8.3 but this time its generated with 1.6.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regenerated with the 1.8.3 version in the next commit
src/ol_social_auth/README.rst
Outdated
Version Compatibility | ||
--------------------- | ||
|
||
Compatible with the Nutmeg release of the Open edX and onwards. May work with prior releases as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not correct, Our backend has been working prior to that. Did you copy this from the documentation in the original project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I copied this from openedx-companion-auth
Readme. Since both are used together, I thought they would have a similar support. What should I write here? Compatible with all edx releases
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check the history of the original repo and if there is compatibility mentioned there. If not, you can check the history of that repo to see if it is correct. Otherwise, you can skip this heading altogether.
* Install the plugin in the lms following the installation steps above. | ||
* Verify that you are not logged in on edx-platform. | ||
* Create a new user in your MIT application and verify that a corresponding user is successfully created on the edX platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These steps should include that the provider and other configuration be done before testing this.
src/ol_social_auth/README.rst
Outdated
* **MITxOnline with Tutor:** If you're using MITxOnline with Tutor for development purposes, specific configuration steps are outlined in the `documentation <https://github.com/mitodl/mitxonline/blob/main/docs/source/configuration/tutor.rst>`_ | ||
|
||
|
||
Working |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep things standardized. We are using this heading as How To Use
in other plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good. But the setup.py file the generate bundle doesn't contain the 'install_requires'
section which should have the dependencies for this package.
@@ -0,0 +1,21 @@ | |||
python_sources( | |||
name="ol_social_auth_source", | |||
dependencies=["//:external_dependencies#social-auth-core"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pants was not detecting social-auth-core
automatically, therefore I added it here.
What are the relevant tickets?
https://github.com/mitodl/hq/issues/5404
Description (What does it do?)
Adds social-auth-mitxpro renamed as
ol-social-auth
in open-edx-pluginsHow can this be tested?
pants package ::
. This will create a tar fileol-social-auth-1.0.0.tar.gz
in the dist folder.social_auth_mitxpro.backends.MITxProOAuth2
withol_social_auth.backends.MITxProOAuth2
inTHIRD_PARTY_AUTH_BACKENDS
make lms-shell
command in the devstack folder and thenpip install /edx/src/open-edx-plugins/dist/ol-social-auth-1.0.0.tar.gz
.Additional Context