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

[Data rearchitecture] ArticleScopedProgram/VisitingScholarship: Handle changes in categories and assignments #6107

Conversation

gabina
Copy link
Member

@gabina gabina commented Jan 9, 2025

What this PR does

This PR addresses several changes in order to deal with updates in categories and assignments for ArticleScopedProgram and VisitingScholarship course types.

  1. Create article records for every revision
    On one hand, the ConstantUpdate class invokes AssignmentUpdater.update_assignment_article_ids_and_titles with the following description:
  # Update article ids for Assignments that lack them, if an Article with the
  # same title exists in mainspace.
  # This does a case-insensitive match, so it will find cases where no article
  # with the exact title was found when the assignment was first created, but
  # the user edited the actual intended article and so it got imported later.

This means we need article records for every article, not just the scoped ones. As a result, this PR modifies how revisions are filtered (through course.filter_revisions) and ensures that article records are always created, even for non-scoped articles.

  1. Create article course timeslice records for every revision
    Assignments can be added or removed at any point in the course. In addition, categories may change even without any user action, as one article may be added or removed from a category independently. To handle this changes in an easier way, article course timeslices are created for every revision (even for those not associated to a scoped article).

  2. Implement UpdateTimeslicesScopedArticle class
    This new class handles changes in assignments and categories, and put some timeslices to re-process. Only for article scoped program or visiting scholarship courses.

Open questions and concerns

TODO: this PR users the (not used) views Revision field to specify if a given revision is scoped or not. We should change this to something more meaningful when deleting Revision code.

@gabina gabina marked this pull request as ready for review January 10, 2025 16:09
@gabina gabina changed the title [Data rearchitecture] ArticleScopedProgram/VisitingScholarship: Create Article records even for filtered revisions [Data rearchitecture] ArticleScopedProgram/VisitingScholarship: Handle changes in categories and assignments Jan 13, 2025
@gabina gabina merged commit ea667ef into WikiEducationFoundation:data-rearchitecture-for-dashboard Jan 14, 2025
1 check failed
@gabina gabina deleted the data-rearchitecture-ensure-article-records-creation-for-ArticleScopedProgram branch January 14, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant