WikiEduDashboard icon indicating copy to clipboard operation
WikiEduDashboard copied to clipboard

Create an alert when an edited article is moved out of mainspace

Open ragesoss opened this issue 2 years ago • 11 comments

Current Behavior:

During the course update process, ArticleStatusManager is responsible for updating the status of Article records associated with the course, handling cases where the article got deleted, moved to a different namespace, or was modified such that it has a new MediaWiki ID.

Desired Behavior:

When the namespace of an article has changed from mainspace to a different namespace (typically, User or Draft), ArticleStatusManager should trigger creation of an alert (an Alert record of a new type) that notifies the Wiki Expert for the the course associated with that article.

This way, we can more quickly look into cases where student work got moved out of mainspace, as this may indicate problems that Wiki Education staff need to help with.

Additional context:

This probably requires some refactoring of ArticleStatusManager so that the course record can easily be passed on along as needed, along with a new alert type (see app/models/alert.rb and app/models/alert_types) and an alert manager responsible for generating the alert.

ragesoss avatar Mar 21 '23 00:03 ragesoss

Hi, I'll be attempting on this issue.

sharon-odhiambo avatar Mar 21 '23 22:03 sharon-odhiambo

@sharon-odhiambo you're welcome to give it a shot, but note that this isn't marked as a newcomer issue. I'd like to ship this within the next week or two, so let me know how progress on it goes; if you get stuck, I'll likely implement it myself for the sake of getting it shipped.

ragesoss avatar Mar 22 '23 17:03 ragesoss

Hi @ragesoss , sure let me attempt and let you know by end of this week. Thank you.

sharon-odhiambo avatar Mar 22 '23 19:03 sharon-odhiambo

Hi @ragesoss , I had promised to share my progress on this by end of this week but am just starting to understand this issue now. Kindly allow me to do an update beginning next week and you can guide on whether to proceed or pick another issue. Thank you.

sharon-odhiambo avatar Mar 24 '23 20:03 sharon-odhiambo

Hi @ragesoss , I tried to work on this issue. However, I've been stuck on testing how the alerts work. I tried to see how the articles-for-deletion work to help understand this. This is my PR-draft Kindly let me know whether this is leading somewhere or not. I'm able to create the articles and edit them but the editing record doesn't show on my local environment dashboard.

sharon-odhiambo avatar Mar 28 '23 15:03 sharon-odhiambo

In order to pull in data from Wikipedia (for example, about a page that got moved), you need to run the UpdateCourseStats process for the course you're using. If you haven't already, check out docs/user_roles.md. It has some details on how to pull in different sorts of data, including commands for using UpdateCourseStats via console.

ragesoss avatar Mar 28 '23 16:03 ragesoss

Thank you for this. Could you kindly let me know if what I've done is on the right track?

sharon-odhiambo avatar Mar 28 '23 17:03 sharon-odhiambo

You've started in the right place in the data flow, and it looks like you've thought through the use case of creating a (new type of) alert. I haven't looked in more detail than that, but it seems like you have a clear understanding of what you're trying to do.

ragesoss avatar Mar 28 '23 17:03 ragesoss

Okay, thank you. Let me see if I'll be able to get the stats and find out how to proceed.

sharon-odhiambo avatar Mar 28 '23 17:03 sharon-odhiambo

@ragesoss , can I work on this issue ?

himadeepthi1 avatar Dec 19 '23 10:12 himadeepthi1

@himadeepthi1 This is not a good first issue, as it's fairly complex.

ragesoss avatar Dec 19 '23 15:12 ragesoss