Skip to content

Adds staff and instructor users of the master course to CCX - #11787

Merged
macdiesel merged 1 commit into
openedx:masterfrom
mitocw:enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue
Mar 28, 2016
Merged

Adds staff and instructor users of the master course to CCX#11787
macdiesel merged 1 commit into
openedx:masterfrom
mitocw:enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue

Conversation

@amir-qayyum-khan

Copy link
Copy Markdown
Contributor

Background

fixes mitocw#126, fixes mitocw#155, fixes mitocw#115 and fixes mitocw#205

This is an updated version of https://github.com/edx/edx-platform/pull/10877 which had to be reverted.

What is done in this PR

Studio Updates:

  • Remove ccx from staff dashboard inside studio. Because a master course can have unlimited ccx, staff's dashboard can be populated with a huge list of ccx along with master course

LMS Updates:

  • This is for course staff to see what ccx coaches are doing with course.
  • Now when a coach creates a new ccx, I am assigning staff role on this ccx course to all staff of master course.
  • Added instructors of master course as instructor(s) in ccx.
  • Also adds the master course staff users to new CCX created via the CCX REST APIs
  • Note: This code will add/enrol staff and instructors in ccx and now max student limit for ccx depends on number of staff and admins.
  • Fixed view as student issue on ccx, now staff can view as student and see how ccx view will appear to student
  • Fixed display name on ccx coach dashboard. Previously it was show display name of master course on coach dashboard.
To run migration manually on devstack
  • python manage.py lms migrate ccx 0003 --settings=devstack
    To reverse migration manually on devstack
  • python manage.py lms migrate ccx 0002 --settings=devstack

@pdpinch @giocalitri

  • Staff on Master course
    screen shot 2015-11-30 at 5 12 54 pm
  • Staff on CCX
    screen shot 2015-11-30 at 5 13 04 pm
  • Admin/instructors on master course
    screen shot 2015-12-10 at 5 10 18 pm
  • Admin/instructors on ccx
    screen shot 2015-12-10 at 5 10 22 pm

Fixed view as student

screen shot 2015-12-17 at 7 21 37 pm 2
screen shot 2015-12-17 at 7 21 53 pm 2
screen shot 2015-12-17 at 7 22 05 pm 2

Fixed display name of ccx on coach dashboard.

screen shot 2015-12-18 at 3 29 34 pm
screen shot 2015-12-18 at 3 29 44 pm
screen shot 2015-12-18 at 3 29 55 pm

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @amir-qayyum-khan! I've created OSPR-1184 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

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

  • supporting documentation
  • edx-code email 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 still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

@macdiesel

Copy link
Copy Markdown
Contributor

@aamir-khan can you tell me why this was reverted the first time and anything else we should be aware of for this go round?

@pdpinch

pdpinch commented Mar 21, 2016

Copy link
Copy Markdown
Contributor

Thanks for asking @macdiesel. Migrations failed due to legacy data on stage and edge. The updated PR now skips CCX with deprecated course keys. We have also been working with @edx/devops to remove those legacy CCX.

Also, we added more tests. Unfortunately it looks like the coverage results have gone stale.

@pdpinch

pdpinch commented Mar 21, 2016

Copy link
Copy Markdown
Contributor

jenkins run python

@macdiesel

Copy link
Copy Markdown
Contributor

Thanks @pdpinch. Since we had issues with the migration last time I would like to get a thumb from @edx/devops as well on this one.

for staff in list_staff:
if staff in list_staff_ccx:
# allow 'staff' access on ccx to staff of master course
revoke_access(course_ccx, staff, 'staff')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm confused that the comment says to allow staff access but then the function called is revoke_access. Are these 2 lines congruous?

@amir-qayyum-khan
amir-qayyum-khan force-pushed the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch from eecb6d4 to 98421e3 Compare March 22, 2016 11:00

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documentation is not aligned correctly here.

Also please add documentation for the Argument:
https://sphinxcontrib-napoleon.readthedocs.org/en/latest/example_google.html

@macdiesel

Copy link
Copy Markdown
Contributor

@amir-qayyum-khan Thank you for the submission. I have finished my first pass on this PR.

@amir-qayyum-khan
amir-qayyum-khan force-pushed the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch 4 times, most recently from 3f3a660 to 41f6796 Compare March 24, 2016 11:37
@jibsheet

Copy link
Copy Markdown
Contributor

From talking to Max, neither of us can remember code in util vs the migration causing us issues on a rollback. I thought this migration died so hard that it never finished / needed rollback.

Perhaps you folks remember. I will review the migration itself tomorrow.

@pdpinch

pdpinch commented Mar 24, 2016

Copy link
Copy Markdown
Contributor

Sorry if I confused you all. The concern about the rollback code came from our developers.

My recollection is the same as yours -- the migration on stage.edx.org failed early enough that no rollback was needed.

In any case, @amir-qayyum-khan has already DRYed everything out, so the migration imports the util code.

Do you think the guard against deprecated course keys is sufficient to merge?

@pdpinch

pdpinch commented Mar 25, 2016

Copy link
Copy Markdown
Contributor

@macdiesel @jibsheet can we merge this?

I'd very much like to get this PR into the release getting cut this morning.

@jibsheet

Copy link
Copy Markdown
Contributor

@pdpinch this doesn't look DRY to me? migrations/0003 contains a complete copy of add_master_course_staff_to_ccx from utils.py except the send_email is set to false by default.

Maybe I've misunderstood the conversation you had with @macdiesel but it seems weird to me to copy when nobody can remember why it would be necessary.

@pdpinch

pdpinch commented Mar 25, 2016

Copy link
Copy Markdown
Contributor

You're right. I was looking at the wrong thing.

@amir-qayyum-khan please remove the duplicate code.

We're not going to make the release, are we?

@jibsheet

Copy link
Copy Markdown
Contributor

@pdpinch given test runs, probably not. You can reach out to @sanfordstudent if you think you can make the changes this morning. I have meetings until 11:30 unfortunately, so won't be able to look again after 10 (and my team is in those meetings with me). Sorry I didn't have time to look yesterday, was buried in other work but had carved out this morning for it.

@pdpinch

pdpinch commented Mar 25, 2016

Copy link
Copy Markdown
Contributor

FWIW, the reason to do the copy was discussed in https://github.com/edx/edx-platform/pull/11787/files/98421e3f1dfb5a4de62ed3b7619c8bb80529cca0#r57002351 https://github.com/edx/edx-platform/pull/11787/files/98421e3f1dfb5a4de62ed3b7619c8bb80529cca0#r57002351

We had two PRs in progress that made changes to ccx/utils.py. When this migration had a dependency on it, you couldn't successfully roll it back.

Maybe I've misunderstood the conversation you had with @macdiesel https://github.com/macdiesel but it seems weird to me to copy when nobody can remember why it would be necessary.

@amir-qayyum-khan
amir-qayyum-khan force-pushed the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch from c77ffe9 to e01fc5a Compare March 25, 2016 16:33
@amir-qayyum-khan

Copy link
Copy Markdown
Contributor Author

@macdiesel @jibsheet should we or you merge this PR? I think it is ready.

@jibsheet

Copy link
Copy Markdown
Contributor

@pdpinch unfortunately, github tells me those files/comments were force pushed away
@amir-qayyum-khan I'll try to review now, but I have a meeting starting in 20 minutes.

@pdpinch

pdpinch commented Mar 25, 2016

Copy link
Copy Markdown
Contributor

Thanks. We missed the cut anyway, so whenever you have time.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like ccx_course is also a lift from utils.py, back from when the with ccx_course(ccx_key) as course_ccx existed in the migration, so that should also go away. You can also clean up the unused import.

@jibsheet

Copy link
Copy Markdown
Contributor

@amir-qayyum-khan see my one note about other code I believe can go away, after that does, 👍
I believe Peter can merge once you check on that.

@amir-qayyum-khan
amir-qayyum-khan force-pushed the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch from e01fc5a to b594a77 Compare March 25, 2016 19:33
@amir-qayyum-khan
amir-qayyum-khan force-pushed the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch from b594a77 to 795ead8 Compare March 25, 2016 22:19
@amir-qayyum-khan

Copy link
Copy Markdown
Contributor Author

@pdpinch Done with changes, just rebased now.

@macdiesel

Copy link
Copy Markdown
Contributor

LGTM. 👍

@macdiesel
macdiesel merged commit 1dff9d4 into openedx:master Mar 28, 2016
@pdpinch
pdpinch deleted the enhancement/aq/add_master_course_staff_in_ccx_fix_migration_issue branch March 29, 2016 13:53
@amir-qayyum-khan

Copy link
Copy Markdown
Contributor Author

@macdiesel done with verification of this PR on stage. Every thing working as expected.
Thanks

cc @pdpinch

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

Labels

engineering review open-source-contribution PR author is not from Axim or 2U

Projects

None yet

6 participants