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: avoid using the email enrollment endpoint to fix a bug in versions without email support #59

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

MaferMazu
Copy link
Contributor

@MaferMazu MaferMazu commented Nov 7, 2023

Description

When we add the new endpoint support in #44, we insert a bug. We tried to make an email enrollment, and in the previous version (Palm and Olive), this didn't fail, but we created an enrollment with the JWT token user, which is not the correct behavior.

To fix this, I only changed the second argument in get_enrollment_process_body to use the old form to request (with users). More info here.

Testing instructions

Install this plugin and perform enrollment requests in different versions of Open edX.

Check if you can enroll users and if you can perform course enrollments allowed.

Additional information

Without this change (The bug)

Screenshot of performing an enrollment with a user (Olmo version) - we perform this action with a user, and the plugin uses another user (the JWT token user).
Screenshot from 2023-11-07 18-47-27

With this change

Screenshot of performing an enrollment with a user (Olmo version)
image

Screenshot of performing an enrollment with a user (Quince version)
image

Screenshot of trying to enroll someone without an Open edX account without and with the enrollment allowed check, respectively (Quince version)
image

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 7, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 7, 2023

Thanks for the pull request, @MaferMazu! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@MaferMazu MaferMazu marked this pull request as ready for review November 8, 2023 00:05
@MaferMazu
Copy link
Contributor Author

MaferMazu commented Nov 8, 2023

Hello @julianramirez2, can you help me review this, please?

@MaferMazu
Copy link
Contributor Author

Hello @felipemontoya, can you help me review this, please?

@felipemontoya
Copy link
Member

This PR works by changing the value passed to $use_old_endpoint from false to true. As such it will definitely work to fix the regression.

What I'm wondering is what would be the long term plan? Do we wait a few releases and turn it back on? Since the API is exactly the same version after openedx/edx-platform#33006 the only way to know for sure that the email worked would be to call the API and then look at the answer, but by then the incorrect enrollment would already have been created.

I'm good with merging this changes as is, but I still wanted to know the plans for the future.

Copy link
Member

@felipemontoya felipemontoya left a comment

Choose a reason for hiding this comment

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

As I said, were good to merge this to fix the bug

@MaferMazu
Copy link
Contributor Author

What I'm wondering is what would be the long term plan? Do we wait a few releases and turn it back on?

Yes, we could use email directly when Quince is the oldest Open edX support.
But I think maybe we want to maintain the old enrollment endpoints to not break the backward compatibility at some point.

I don't have a strong position regarding this, but we can discuss it and decide the best in terms of maintenance and usability.

@MaferMazu MaferMazu merged commit 563e295 into openedx:main Nov 8, 2023
4 checks passed
@openedx-webhooks
Copy link

@MaferMazu 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants