WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
392 stars 631 forks source link

[Data rearchitecture] Revisit `ready_for_update` course definition #6006

Closed gabina closed 1 month ago

gabina commented 1 month ago

What this PR does

This PR changes the definition for Course.ready_for_update. Previous to this PR, ready_for_update returned current courses + courses that need a full update (needs_update field is set to true). Now, it also includes courses that need a partial update (courses with at lest one course wiki timeslice with needs_update field set to true).

Additionally, this PR updates the CoursesUsers.ready_for_update scope (that uses the Course.ready_for_update scope), and deletes unused ArticlesCourses.ready_for_update and Article.ready_for_update scopes.

docs/debugging_scripts/prioritize_updates.rb script is also updated because now Course.ready_for_update returns an array (not an ActiveRecord relation).

gabina commented 1 month ago

Failing specs are not related to PR changes.

 1) Assigned Articles view lets users submit feedback about articles
     Failure/Error: find('textarea.feedback-form').fill_in with: 'This is a great article!'

     Capybara::ElementNotFound:
       Unable to find css "textarea.feedback-form"
     # ./spec/features/assigned_articles_spec.rb:26:in `block (3 levels) in <top (required)>'
     # ./spec/features/assigned_articles_spec.rb:22:in `block (2 levels) in <top (required)>'