openedx / openedx/openedx-platform

CONTENT_GROUPS_FOR_TEAMS breaks across re-runs and import/export

Open
#37,192 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

The Problem

The id that TeamPartitionScheme passes into the Group is the primary key of the corresponding CourseTeam object: https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/teams/team_partition_scheme.py#L102

These primary keys will be written into published learning content via the group_access XBlock attribute from InheritanceMixin, and the keys will be written into XML when exporting. Primary keys are not appropriate for this, because they will have different meanings across different course runs and across different instances.

Steps to reproduce

(This is just based on reading the code. I haven't tried these steps yet)

  • Enable CONTENT_GROUPS_FOR_TEAMS waffle
  • Create a course and configure a team-set
  • Publish it
  • In LMS, create a couple teams
  • In Studio, restrict some content to those teams
  • Re-run the course
  • In the re-run, create the same two teams
  • Expected: In the re-ran course, team access restrictions will still be in place.
  • Actual: In the re-ran course, team access restrictions will point to CourseTeams object from the original run, and thus won't work and/or will raise an error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lms/djangoapps/teams/team_partition_scheme.py around line 102 and trace how InheritanceMixin stores group_access through course export/import and re-runs. Reproduce the CONTENT_GROUPS_FOR_TEAMS scenario if possible; done means restrictions in a re-run resolve to that run's teams rather than the original CourseTeam records.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.