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

feat: handle enrollments for "Invite Only" courses #1748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tecoholic
Copy link

@tecoholic tecoholic commented May 7, 2023

Description

This PR introduces some improvements to the 'Manage Learners' page of Enterprise Customer admin that will allow enrolling learners into "Invite Only" courses.

Refer #1745 for full details about the issue.

Testing instructions

  • Follow the testing instructions in Admins cannot enroll enterprise learners to "Invite Only" courses #1745 and reproduce the issue
  • Switch to the PR branch
  • Try enrolling learners into the course marked as "Invite Only", with the Force Enrollment checkbox checked, this time it should work without throwing an error.
  • Test with both a learner who already has a registered account and an email which is not registered in the system to ensure, "enrollment on registration" also works for "Invite Only" courses.

image

Merge checklist:

  • Any new requirements are in the right place (do not manually modify the requirements/*.txt files) - No new requirements added
    • base.in if needed in production but edx-platform doesn't install it
    • test-master.in if edx-platform pins it, with a matching version
    • make upgrade && make requirements have been run to regenerate requirements
  • make static has been run to update webpack bundling if any static content was updated - Running make static didn't introduce any changes
  • ./manage.py makemigrations has been run - No DB migrations introduced
    • Checkout the Database Migration Confluence page for helpful tips on creating migrations.
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.
    • This should be run from either a venv with all the lms/edx-enterprise requirements installed or if you checked out edx-enterprise into the src directory used by lms, you can run this command through an lms shell.
      • It would be ./manage.py lms makemigrations in the shell.
  • Version bumped
  • Changelog record added
  • Translations updated (see docs/internationalization.rst but also this isn't blocking for merge atm)

Post merge:

  • Tag pushed and a new version released
    • Note: Assets will be added automatically. You just need to provide a tag (should match your version number) and title and description.
  • After versioned build finishes in GitHub Actions, verify version has been pushed to PyPI
    • Each step in the release build has a condition flag that checks if the rest of the steps are done and if so will deploy to PyPi.
      (so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
  • PR created in edx-platform to upgrade dependencies (including edx-enterprise)
    • This must be done after the version is visible in PyPi as make upgrade in edx-platform will look for the latest version in PyPi.
    • Note: the edx-enterprise constraint in edx-platform must also be bumped to the latest version in PyPi.

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

openedx-webhooks commented May 7, 2023

Thanks for the pull request, @tecoholic!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently unmaintained.

To get help with finding a technical reviewer, tag the community contributions project manager for this PR in a comment and let them know that your changes are ready for review:

  1. On the right-hand side of the PR, find the Contributions project, click the caret in the top right corner to expand it, and check the "Primary PM" field for the name of your PM.
  2. Find their GitHub handle here.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@tecoholic tecoholic marked this pull request as draft May 7, 2023 02:19
@tecoholic tecoholic marked this pull request as ready for review May 9, 2023 15:10
@e0d
Copy link

e0d commented May 9, 2023

@tecoholic it looks like the branch has conflicts, can you have a look?

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from 49ea86a to 534af99 Compare May 10, 2023 06:13
@tecoholic
Copy link
Author

@e0d I have rebased the PR branch and bumped the version in enterprise/__init__.py. Conflicts are now resolved.

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label May 10, 2023
Copy link
Member

@Agrendalath Agrendalath left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: verified that the forced enrollment works correctly for invitation-only courses
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: n/a
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

enterprise/admin/views.py Outdated Show resolved Hide resolved
enterprise/static/enterprise/js/manage_learners.js Outdated Show resolved Hide resolved
enterprise/__init__.py Outdated Show resolved Hide resolved
@e0d
Copy link

e0d commented May 11, 2023

@tecoholic Looks like there are some conflicts that need to be resolved, can you have a look?

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from 534af99 to d8b24f4 Compare May 12, 2023 09:17
@tecoholic
Copy link
Author

@e0d I have rebased it on master and fixed the conflicts. Can you kindly approve the tests to run?

@e0d
Copy link

e0d commented May 12, 2023

@tecoholic Tests approved.

@tecoholic
Copy link
Author

@e0d Looks like all checks have passed. Can you kindly see if this can be reviewed and merged?

@mphilbrick211 mphilbrick211 removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label May 12, 2023
@mphilbrick211 mphilbrick211 requested review from macdiesel and a team May 12, 2023 17:16
@mphilbrick211
Copy link

Hi @macdiesel and @openedx/enterprise-titans! Could someone please review and merge this if all looks good? Thanks!

@tecoholic
Copy link
Author

@mphilbrick211 Hi, can you kindly get someone to take a look at this?

@mphilbrick211
Copy link

Hi @macdiesel and @openedx/enterprise-titans! Friendly ping on this :)

In the meantime, @tecoholic, would you mind resolving the branch conflicts? Thanks!

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from 84dca10 to 110bdb0 Compare May 31, 2023 06:47
@tecoholic
Copy link
Author

tecoholic commented May 31, 2023

@mphilbrick211 Done. All good w.r.t conflicts. The CI tests require approval to run.

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label May 31, 2023
@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label May 31, 2023
@mphilbrick211
Copy link

Hi @tecoholic - tests are running again, but there are some more branch conflicts that have popped up.

@tecoholic
Copy link
Author

@mphilbrick211 I think the conflicts will continue to happen on the changelog and the version number as long as things are changing on the master and it would be a daily task to keep resolving them. So, I am think we could do either of the 2 things:

  1. Kindly ping me when someone picks this up for review and I can resolve the conflicts
  2. Or the reviewer can resolve it as long as it is just the change-log entry and the version number and it doesn't touch any code.

What do you think?

@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jun 1, 2023
@tecoholic tecoholic changed the title Handle enrollments for "Invite Only" courses feat: handle enrollments for "Invite Only" courses Jun 6, 2023
@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jun 26, 2023
@tecoholic
Copy link
Author

@e0d Hi, I have resolved the conflict. If it runs into conflict again, I guess it wouldn't be possible for you to make changes as Demid pointed out. Would like me to squash the changed into a single commit, that would allow you to cherry-pick and resolve conflicts locally and merge?

@e0d
Copy link

e0d commented Jul 6, 2023

@tecoholic I don't think I'm going to be able to take over conflict management.

I did notice that a number of the OpenCraft PRs are broken because of a doc formatting issue. See my commit here.

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from d4b2e1b to a83e1fc Compare July 14, 2023 05:51
@tecoholic
Copy link
Author

@e0d Hi, since the conflicts have been occurring on the version bump and the changelog, I have removed them from the PR and rebased it to the latest master. Kindly see if this helps.

@Agrendalath
Copy link
Member

@tecoholic, since the upstream review for this didn't start yet, you can squash the commits. It will be easier to cherry-pick this to our Palm branch.

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from a83e1fc to 0e06d74 Compare July 21, 2023 12:58
@mphilbrick211 mphilbrick211 added the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jul 24, 2023
@e0d
Copy link

e0d commented Jul 28, 2023

@mphilbrick211 this branch will need a rebase when the reviewers are ready to look at it, but the tests are all green. Removing the label.

@e0d e0d removed the needs test run Author's first PR to this repository, awaiting test authorization from Axim label Jul 28, 2023
@mphilbrick211
Copy link

Hi @openedx/enterprise-titans! Following up to see if we could please get this reviewed/merged. Thanks!

@mphilbrick211
Copy link

Hi @tecoholic! Some branch conflicts have popped up - would you mind taking a looK?

@Agrendalath
Copy link
Member

@mphilbrick211, I believe it would make sense to move forward with this document first. Without a timeline for these reviews, the branch conflicts will appear regularly.

cc: @tecoholic

@mphilbrick211
Copy link

@mphilbrick211, I believe it would make sense to move forward with this document first. Without a timeline for these reviews, the branch conflicts will appear regularly.

cc: @tecoholic

Sounds good - thanks, @Agrendalath!

@mphilbrick211
Copy link

Hi @openedx/enterprise-titans! Is there an ETA on when someone could please review this? Thanks!

@mphilbrick211
Copy link

Hi @openedx/enterprise-titans! Is there an ETA on when someone could please review this? Thanks!

Hi @openedx/enterprise-titans - following up on this!

@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from 0e06d74 to 074b4b2 Compare November 9, 2023 07:32
@mphilbrick211 mphilbrick211 added needs test run Author's first PR to this repository, awaiting test authorization from Axim waiting for eng review PR is ready for review. Review and merge it, or suggest changes. and removed needs test run Author's first PR to this repository, awaiting test authorization from Axim labels Nov 9, 2023
When creating pending enrollments for non-existant users, we also check
to see if the course is "invite_only". If the course is invite only,
then we create corresponding CourseEnrollmentAllowed objects. This fixes
the issue when the enterprise creates pending enrollment, but the user
cannot enroll to the course as platform rejects the enrollment request
due to missing CEA for the user.
@tecoholic tecoholic force-pushed the tecoholic/handle-enrollment-for-invite-only-courses branch from 074b4b2 to 2d8c2d4 Compare December 8, 2023 10:15
@tecoholic
Copy link
Author

@openedx/enterprise-titans The PR has been rebased on master and all the checks are passing. Kindly review.

cc: @e0d

@mphilbrick211
Copy link

Hi @openedx/2u-titans! Are you still reviewing pull requests? If so, could you please review / merge this for us? Thanks!

@mphilbrick211 mphilbrick211 removed request for a team and macdiesel July 30, 2024 21:36
@mphilbrick211 mphilbrick211 added needs reviewer assigned PR needs to be (re-)assigned a new reviewer and removed waiting for eng review PR is ready for review. Review and merge it, or suggest changes. labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reviewer assigned PR needs to be (re-)assigned a new reviewer open-source-contribution PR author is not from Axim or 2U
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

5 participants