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

Add recurring migration job #7092

Merged
merged 16 commits into from
Aug 28, 2023
Merged

Add recurring migration job #7092

merged 16 commits into from
Aug 28, 2023

Conversation

merkushin
Copy link
Member

@merkushin merkushin commented Aug 13, 2023

Resolves #5437

Proposed Changes

  • Add WooCommerce Action Scheduler as a composer package and use it for the background jobs.
  • Implement the migration job and the scheduler for it.

Testing Instructions

  1. Enable tables_based_progress feature.
  2. Go to Sensei LMS -> Tools.
  3. Run action for "Migrate comment-based student progress".
  4. Refresh the page a few times until you see "Status: Completed." in the description of the tool.

Might be needed to do some cleanup if you tested migration before:

truncate table `wp_sensei_lms_progress`;
delete from `wp_options` where `option_name` = "sensei_migrated_progress_last_comment_id";

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@merkushin merkushin added the HPPS label Aug 13, 2023
@merkushin merkushin added this to the 4.16.2 milestone Aug 13, 2023
@merkushin merkushin requested a review from m1r0 August 13, 2023 23:04
@fjorgemota
Copy link
Member

Just to close the loop, I raised one important thing about this PR on Slack: p1692030035740929-slack-C04A6MB40QN

@m1r0 m1r0 removed their request for review August 16, 2023 10:52
@m1r0 m1r0 self-assigned this Aug 16, 2023
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #7092 (c3b56a7) into trunk (ca5f34d) will increase coverage by 0.10%.
Report is 52 commits behind head on trunk.
The diff coverage is 91.95%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7092      +/-   ##
============================================
+ Coverage     49.37%   49.47%   +0.10%     
- Complexity    10543    10569      +26     
============================================
  Files           575      578       +3     
  Lines         44527    44602      +75     
  Branches        402      402              
============================================
+ Hits          21985    22069      +84     
+ Misses        22215    22206       -9     
  Partials        327      327              
Files Changed Coverage Δ
...d-jobs/class-sensei-scheduler-action-scheduler.php 83.33% <0.00%> (ø)
includes/class-sensei.php 23.14% <0.00%> (-0.28%) ⬇️
...ternal/action-scheduler/class-action-scheduler.php 100.00% <100.00%> (ø)
...er/migrations/class-student-progress-migration.php 81.63% <100.00%> (+0.73%) ⬆️
...nt-progress/jobs/class-migration-job-scheduler.php 100.00% <100.00%> (ø)
...rnal/student-progress/jobs/class-migration-job.php 100.00% <100.00%> (ø)
...al/student-progress/tools/class-migration-tool.php 100.00% <100.00%> (+68.96%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b4a964...c3b56a7. Read the comment docs.

@m1r0 m1r0 marked this pull request as ready for review August 21, 2023 20:12
@m1r0 m1r0 requested a review from a team August 21, 2023 20:18
@m1r0
Copy link
Member

m1r0 commented Aug 21, 2023

@merkushin I wasn't able to figure out how to make Psalm happy. I would appreciate your help. 🙏

@@ -13,4 +13,8 @@
<directory name="widgets" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@merkushin
Copy link
Member Author

Thanks, Miro! Looks good!
Unfortunately, can't approve it as I'm an author of the PR :)

Copy link
Member

@m1r0 m1r0 left a comment

Choose a reason for hiding this comment

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

Unfortunately, can't approve it as I'm an author of the PR :)

😆

@m1r0 m1r0 merged commit 5aab8bb into trunk Aug 28, 2023
24 checks passed
@m1r0 m1r0 deleted the add/recurring-job branch August 28, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a migration that copies the progress data to the new tables
3 participants