Repository navigation
feat(bundle): debug:durable lists the workflows and their handlers - #1046
Merged
Merged
Conversation
# Conflicts: # tests/unit/DurableBundle/DependencyInjection/Fixtures/container-snapshot.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To read a workflow today you open the class and look for the attributes.
debug:messengeranddebug:event-dispatcheranswer the same question for their component; Durable has no equivalent.debug:durablelists the registered workflows:(An illustration of the shape, not captured output.) With a type or a class, it shows the entry point and each handler by the name a caller sends:
parcel.pickedfor a signal,statusfor a query,change-addressfor an update, with the method and its parameter types.What is in the diff
WorkflowDescriber,WorkflowDescriptionandWorkflowHandler(new,Gplanchat\Durable\Workflow): a workflow class read into readonly objects, with the lookupsWorkflowDefinitionLoaderuses (inputParameters()for the entry point, so the environment and activity stubs do not appear). A class with no#[AsWorkflowMethod]raisesWorkflowHasNoEntryPoint.DebugDurableCommandtakes the list of workflow classes as its only argument.WorkflowPassfills that argument with the classes it already registers, so the command lists what the registry holds.WorkflowPassTestcovers the argument.Tests:
WorkflowDescriberTestandDebugDurableCommandTestare the first commit and fail until the next two.Checked on this branch: the whole
unitsuite (3339 tests), PHPStan on the repository (exit 0), Psalm (exit 0, no baseline entry), php-cs-fixer on each changed file.Not covered
#[Activities(Contract::class)]on a parameter, and the contract's methods deserve their own section. That is the next slice.--format=jsonand no backend or task-queue summary yet.WorkflowPassTest.ActivityContractCacheWarmercan come if the cost shows.This adds a public command, so it needs a second reviewer before the gate.