Skip to content
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions docs/decisions/0005-migration-path-for-legacy-mechanisms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
5. Migration Path for Legacy User Grouping Mechanisms
#####################################################

Status
******

**Draft** - 2025-06-03

Context
Copy link
Member

Choose a reason for hiding this comment

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

It'd be useful to add the following in this context section as context on how we got here -these are only some ideas that should be refined before including them-:

  • We've proposed a unified model with X, Y, Z structure that differentiates from the legacy in W, ...
  • This model must be able to replace the legacy models... and to do so, then this should happen... (support and behavior)
  • By unifying all these into a single model, we gain... so we propose migrating all legacy mechanisms gradually to this new unified model
  • The main difference in the approaches considered is how they relate to legacy mechanisms, which also affect the deprecation strategy and long-term maintainability...

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for your suggestions! I updated the section to provide a bit more context. What do you think?

*******

Open edX currently uses several user grouping mechanisms (Cohorts, Teams,
Enrollment Track Groups), each with its own logic, storage, and integration
points. This fragmentation results in:

- Complicates maintenance and evolution.
- Makes it difficult to implement new functionality.
- Limits interoperability and extensibility.

Two migration paths were evaluated to transition to a unified grouping system:

- **Cross-System Synchronization**: creates an abstraction layer that
translates the new model to the legacy mechanisms.
- **Behavior Replication**: builds a new and independent system that replicates
Copy link
Member

Choose a reason for hiding this comment

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

In both cases we're building a new system. I think the main difference here is how we intend to use them, through a connecting layer or using the new model directly. I think I'd also prefer to have more details as in the technical docs we produced.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! I included more details about both migration paths. Do you think we should include anything else?

the observable behavior of the legacy mechanisms without integrating with
them.

Decision
********

We select the behavior replication approach, eliminating direct dependencies on
legacy systems. This choice enables a simpler, cleaner architecture with:

- Full independence from legacy mechanisms from day one.
- Elimination of complex synchronization or integration layers.
- Reduced technical debt and maintenance costs during migration.

Existing user-facing functionalities will be replicated in the new model, with
migration executed in clear, isolated phases to minimize risk. Activation will
be controlled via feature flags, configurable per course, organization, or
platform.

See `ADR 6 <docs/decisions/0006-replication-of-legacy-mechanisms-behavior.rst>`_
for detailed rationale.

Consequences
************

- The new system can evolve independently, allowing greater flexibility.
- The responsibility for replicating legacy behavior lies entirely within the
new model, which must be thoroughly validated.
- The transition can be carried out gradually, implementing one functionality
at a time, allowing individual behavior validation and more targeted testing.
- Both new and legacy systems can coexist during rollout, avoiding user
disruption.
- Legacy systems will be fully deprecated and removed post-transition,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should include more information here on what will happen to any running courses that are still using the old systems when the deprecation lands. Will we force migrate them?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've clarified that courses still using legacy grouping systems at the time of deprecation will not be automatically migrated. It will be up to course authors or site operators to transition their configurations manually. If no action is taken, they may lose access to grouping data or functionality related to cohorts, teams, or enrollment track groups.

improving maintainability and extensibility.

Rejected Alternatives
Copy link
Member

Choose a reason for hiding this comment

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

Another rejected decision was maintaining both the new model and legacy, I think.

Copy link
Author

Choose a reason for hiding this comment

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

That alternative wasn’t documented. Do you think we should include it as a rejected option as well? I can add a brief explanation of why it was not chosen.

*********************

Cross-System Synchronization
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

I agree! I included the comparative table.

============================

This proposal involved creating a new unified model while maintaining indirect
Copy link
Member

Choose a reason for hiding this comment

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

Should we specify that both approaches build on top of the new model but the difference is how they relate with legacy systems?

Copy link
Author

Choose a reason for hiding this comment

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

I agree! I updated the description according to your suggestion.

synchronization with the legacy mechanisms through an abstraction layer. This
layer would be responsible for:

- Translating the logic of the new system to Cohorts, Teams, and Enrollment
Copy link
Member

Choose a reason for hiding this comment

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

What does it mean translating the new logic in this context? Can we add more details as in https://openedx.atlassian.net/wiki/spaces/OEPM/pages/4955668482/Cross-System+Synchronization+Proposal?atlOrigin=eyJpIjoiMWE2NTgxNGE0NDEzNGE2YmI2ODgyNTI2ZTBiNTc0NmUiLCJwIjoiYyJ9 so folks understand why we're rejecting it?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for noticing! I added more details about what it means to translate the logic into the new system.

Track Groups.
- Ensuring backward compatibility during the entire transition.
- Enabling a gradual adoption while maintaining functional consistency with the
legacy systems.

Reasons it was rejected:

- Significant increase in technical complexity: maintaining bi-directional
Copy link
Member

Choose a reason for hiding this comment

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

We didn't explain what the approach is about to mention the bi-directional sync, should we? I think we also should mention the synchronization strategy, so folks understand the complexity.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! I included details about what the synchronization strategy is to provide more clarity.

synchronization between two systems introduces risk of errors, logic
duplication, and hard-to-debug issues.
- Higher maintenance cost: any change in the platform or legacy models would
also require updating the synchronization layer.
- Interference with the evolution of the new model: depending on legacy systems
limits the ability of the new system to introduce more flexible criteria or
rules.
- Greater difficulty in isolating and testing the new system: requiring the
presence of legacy systems makes independent validation of the new model more
complex.
- Legacy cleanup becomes harder: as long as active synchronization exists,
legacy code cannot be removed without breaking dependencies.

References
**********

- `Cross-System Synchronization Proposal <https://openedx.atlassian.net/wiki/x/AoBhJwE>`_
- `Behavior Replication Proposal <https://openedx.atlassian.net/wiki/x/AgDiKgE>`_