Commit Graph

16613 Commits

Author SHA1 Message Date
3c651c940b Add convenience by-class getter for payloads (& use it)
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
a35e925479 Add convenience by-class getter for subjects
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
fe3d719a13 Use step run args in existing actions
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
68b5bab9cc Introduce step run args to simplify step run arguments
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
460cbd9e12 Construct and pass subject entries to step runners
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
00e8c4f3e5 Make steps specify required/provided subject keys
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
c28d8ad79c Introduce subject entry to carry subject & payload data
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
b0aad2216a Split subscriber subject to Subject & Payload
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
18aedf3d1a Split segment subject to Subject & Payload
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
e38e79f385 Split integration subject to a service (Subject) and data (Payload)
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
757f1dc01a Use subject data type for workflow runs, remove subject loading from storage
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
c30244b30f Introduce subject data type for storage
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
c58a5a4308 Add workflow step arg schema validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
282c987d4f Require root step by workflow schema
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
d7b65bd980 Run validation on workflow create and update
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
e220b70c78 Add workflow validator service with workflow graph validation rules
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
a3ea91adae Add no split rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
65927cc281 Add no join rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
cafe2ed8a7 Add no cycle rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
a3797b976a Add triggers under root rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
325418e826 Add no duplicate edges rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
11a711e42c Add consisten steps map rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
0aa4cd4863 Add no unreachable steps rule for workflow validation
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
e472c00b1c Implerment depth-first pre-order workflow graph walker with plug-in node visitors
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
e3668a8187 Add constant for root step type
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
8590cb1409 Rename automation "Validators" namespace to a more universal "Validation"
[MAILPOET-4629]
2022-09-23 12:42:03 +03:00
a1775dd010 Delete user properly in multisite environment
[MAILPOET-4666]
2022-09-22 10:37:25 +02:00
2c159b1694 Document the types of two SendingQueue properties that were undocumented
It was also necessary to add an if condition to check the type of a
variable before calling one of the methods of one of the documented
properties.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
f578f3f16a Remove method Tasks\Newsletter\getNewsletterSegments()
This method was used only once inside SendingQueue and it can be
replaced by NewsletterEntity::getSegmentIds() to simplify the code.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
686ee18d16 Replace calls to assert() with Assert::assertInstanceOf()
Doing this as it was mentioned in the review process of the PR.

For more context see: https://wp.me/pcNwfB-wR

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
d79cecbef2 Replace some of the uses of SendingQueue model with Doctrine
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
ccbdbd3e93 Refactor getNewsletterFromQueue() to use Doctrine instead of Paris
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
4ca656a217 Rename $queue to $sendingTask
Doing this for consistency and to make it more clear that $sendingTask
contains an instance of \MailPoet\Tasks\Sending and not an instance of
\MailPoet\Models\SendingQueue.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
a7d0ad6568 Set the type of all the Newsletter parameters that use the Sending class
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
3b9a60c039 Rename NewsletterTest::queue to NewsletterTest::sendingTask
Doing this for consistency and to better makr that this property
contains an instance of \MailPoet\Tasks\Sending and not an instance
of \MailPoet\Models\SendingQueue.

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
168ce20a40 Use NewsletterEntity instead of Newsletter model in Links
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
9a92068d5b Refactor Newsletter to use Doctrine instead of the Newsletter model
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
f6afe987c8 Add return type declaration for Newsletter::prepareNewsletterForSending()
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
68c3277195 Replace Subscriber model with Doctrine in Tasks\Newsletter
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
fd0acbd6cf Refactor Newsletter to use Doctrine instead of the NewsletterSegment model
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
f4053b0583 Stop using a mock of NewslettersRepository to prevent errors in tests
This commit changes the SendingQueueTest test class to always use a real
NewslettersRepository object instead of a mock object when instantiating
SendingQueue. This is necessary to prevent false errors in the tests.

Using a mock of the NewslettersRepository in this test class means that
all code inside SendingQueue that uses this repository could behave in
unpredictable ways. As it was happening with a few tests incorrectly
failing after dd6e02e2c16a3a0ef7ad2c12479917e33c312c77:

https://app.circleci.com/pipelines/github/mailpoet/mailpoet/11132/workflows/7b4df151-5a10-48f0-9711-dd590a764880/jobs/192389/tests#failed-test-0

In this case, the code was not changing the status of the newsletter
because findOneById() was returning an empty Newsletter entity instead
of the real Newsletter entity that corresponds to the object in the
database. And, thus, $newsletter->getType() was returning `null` instead
of `standard`.

This problem was already partially addressed in the commit below that
removed some of the usages of the NewslettersRepository mock:

5042cdd15e

[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
05664a0c6a Refactor markNewsletterAsSent() to use Doctrine instead of Paris
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
a4bb49852d Replace Subscriber model with Doctrine in NewsletterTest
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
2137503e09 Replace NewsletterSegment model with Doctrine in NewsletterTest
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
9bf025874c Replace SendingQueue model with Doctrine in NewsletterTest
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
cc43b25b7d Replace most of the uses of Newsletter model with Doctrine in NewsletterTest
[MAILPOET-4363]
2022-09-21 16:03:21 +02:00
d0c65b9446 Cleanup MP API test
[MAILPOET-4295]
2022-09-21 16:02:23 +02:00
09f5790120 Move getSubscribers integration test into specific test file
[MAILPOET-4295]
2022-09-21 16:02:23 +02:00
1dac2522c6 Refactor public API getSubscriber to doctrine
[MAILPOET-4295]
2022-09-21 16:02:23 +02:00
3d4ca982a6 Update Woo COT build in test to the latest beta
[MAILPOET-4572]
2022-09-21 10:49:10 -03:00