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

Nodes analyzer: v0.2 refatoring #16

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Nodes analyzer: v0.2 refatoring #16

wants to merge 35 commits into from

Conversation

codeliner
Copy link
Member

@codeliner codeliner commented Mar 25, 2018

This PR contains a complete rewrite of the internal message flow structure. I've simplified the structure to only use nodes and edges instead of messages, handlers, aggregates, ... Those are just node types now so it is easier to understand and customize the message flow.
And the message flow can now directly be imported into the mgmt UI. This resolves #15

Other output formatters are removed but you can still write your own if needed.

Documentation is also included in the PR.

@codeliner codeliner changed the title Nodes analyzer Nodes analyzer: v0.2 refatoring Mar 25, 2018
@kochen
Copy link
Contributor

kochen commented Mar 26, 2018

I just gave it a try and got:

PHP Fatal error:  Uncaught Error: Class 'MessageHandlerCollector' not found in .../vendor/prooph/message-flow-analyzer/src/Helper/ProjectTraverserFactory.php:69
Stack trace:
#0 .../vendor/prooph/message-flow-analyzer/src/Cli/AnalyzeProjectCommand.php(90): Prooph\MessageFlowAnalyzer\Helper\ProjectTraverserFactory::buildTraverserFromConfig(Array)
#1 .../vendor/symfony/console/Command/Command.php(252): Prooph\MessageFlowAnalyzer\Cli\AnalyzeProjectCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 .../vendor/symfony/console/Application.php(865): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 .../vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Objec in .../vendor/prooph/message-flow-analyzer/src/Helper/ProjectTraverserFactory.php on line 69

Same thing for EventRecorderCollector, EventRecorderCollector, EventRecorderInvokerCollector.

Could you add a link to a new "default" prooph_analyzer.json configuration file, based on this: https://github.com/prooph/message-flow-analyzer/blob/nodes_analyser/docs/configuration.md#classvisitors
?

{
  "name": "Default Project",
  "fileInfoFilters": [
    "ExcludeVendorDir",
    "ExcludeTestsDir",
    "ExcludeHiddenFileInfo",
    "IncludePHPFile"
  ],
  "classVisitors": [
    "MessageCollector",
    "CommandHandlerCollector",
    "MessageProducerCollector",
    "AggregateMethodCollector",
    "EventListenerCollector"
  ]
}

@kochen
Copy link
Contributor

kochen commented Mar 26, 2018

@codeliner First run, finished OK, but I got only Nodes - no Edges.
Tried to run it again and got:

Edge with id e5fa07cd10ad6806e3098db16b3793724418a228_6f4a1d2478dd80d681f0e34da8cd07f2c0812106 is already set. Got {"data":{"id":"e5fa07cd10ad6806e3098db16b3793724418a228_6f4a1d2478dd80d681f0e34da8cd07f2c0812106","source":"e5fa07cd10ad6806e3098db16b3793724418a228","target":"6f4a1d2478dd80d681f0e34da8cd07f2c0812106"}}

even after clearing the cache and deleting the output file.

@codeliner
Copy link
Member Author

@kochen once the PR is merged the link to example config will reference the new example config file

@codeliner
Copy link
Member Author

@kochen regarding the problem with no edges. You run it against your own project right?
Any chance you can give me more information why no edges are added?
It runs perfectly fine against proophessor-do but that was my only testing playground so far.
Going to run it against one of our production systems but I alrready know that I need project specific class visitors for the project bc we work with some additions to the OSS version of prooph/event-sourcing in that project.

@codeliner
Copy link
Member Author

@kochen can you try again with my latest changes? I've removed $messageFlow->addEdge() and always use $messageFlow->setEdge() now, so duplicate edges should no longer cause exceptions.

@kochen
Copy link
Contributor

kochen commented Apr 3, 2018

@codeliner I just tried with the (current) latest changes and the result is the same - no edges between nodes.
I've tried limiting is to one src/{context} and not the entire src.

My domain classes are mostly based on those from the Proophesor-do.

@codeliner
Copy link
Member Author

@kochen I'm analyzing a very large project with this branch. It definitely works so we need to find out why it is not working for you.

Can you post some code snippets like a command handler, an aggregate, one or two commands, events?

Do you use default prooph classes or some specials?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

message-flow-analyzer create a format not accepted by mgmt-ui
2 participants