-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Add commands to schedule and deactivate scheduled tasks #11670
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
Conversation
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #11670 +/- ##
==========================================
- Coverage 54.99% 54.95% -0.05%
==========================================
Files 4785 4787 +2
Lines 162763 162842 +79
Branches 8919 8923 +4
==========================================
- Hits 89511 89483 -28
- Misses 70633 70732 +99
- Partials 2619 2627 +8
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. π New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @M-arcus ,
thanks for your contribution, we think this would be a great addition! π
I've left some smaller comments and looks like your tests are also failing because symfony adds some line breaks to the command output, maybe we can just remove them before comparing against the expected output?
Additionally please provide another PR to the docs repo to mention the new commands there as well: https://developer.shopware.com/docs/guides/hosting/infrastructure/scheduled-task.html#scheduled-task
src/Core/Framework/MessageQueue/Command/DeactivateScheduledTaskCommand.php
Outdated
Show resolved
Hide resolved
src/Core/Framework/MessageQueue/Command/ScheduleScheduledTaskCommand.php
Outdated
Show resolved
Hide resolved
src/Core/Framework/MessageQueue/Command/ScheduleScheduledTaskCommand.php
Outdated
Show resolved
Hide resolved
The tests work locally, but for some reason the GitHub Action CI adds extra line breaks. I'm going to loosen the check. |
The docs PR is here, marked as a draft for now: shopware/docs#1882 |
I have fixed the tests in d7ab4ec |
src/Core/Framework/MessageQueue/Command/ScheduleScheduledTaskCommand.php
Outdated
Show resolved
Hide resolved
Correction: Still not working because Is there a PHPUnit test that tests out like this already? |
@M-arcus the problem is, that the output on CI has line breaks in the middle of the sentence π¬ I am not sure, if we can make the CI output "wider" somehow, or else you would need to assert on the different parts of the outputs π |
@mitelg It's calculated here https://github.com/symfony/console/blob/7.3/Style/SymfonyStyle.php#L58 . |
thanks for your contribution @M-arcus πππ |
1. Why is this change necessary?
Currently, there is no way to change the status of a scheduled task without directly editing the database.
2. What does this change do, exactly?
It adds 2 commands to schedule and disable scheduled tasks.
scheduled-task:schedule
scheduled-task:deactivate
3. Describe each step to reproduce the issue or behavior.
Let a scheduled task fail, and now there is no way to re-enable it without editing the database correctly.
4. Please link to the relevant issues (if any).
5. Checklist