Coder Social home page Coder Social logo

dogmacli's Introduction

Dogma Command Line Tools

The dogma command line interface contains various tools for working with Dogma applications.

Latest Version Build Status Code Coverage

Installation

go install github.com/dogmatiq/dogmacli/cmd/dogma@latest

dogmacli's People

Contributors

jmalloc avatar dependabot[bot] avatar github-actions[bot] avatar dogmatiq-automation[bot] avatar

Watchers

 avatar James Cloos avatar Kevin Millar avatar

dogmacli's Issues

Validate control flow within routing methods.

  • every declared consumed message type should be handled
  • any other type should result in a `panic(dogma.UnexpectedMessage)
  • if there is a type switch (or similar simple branching) warn if a case is for a message that is not declared as being consumed

Validate control flow within timeout hint methods.

  • every declared consumed message type should be handled
  • any other type should result in a `panic(dogma.UnexpectedMessage)
  • if there is a type switch (or similar simple branching) warn if a case is for a message that is not declared as being consumed

We also need to ensure that projections implemented using projectionkit are analysed properly.

Check for processes that never end.

This check might not be feasible as it is perfectly reasonable to have a process that lives for the entire lifetime of the application, but perhaps we can mark those processes in some way.

Most processes should be fairly short lived.

Add check that identities do not collide.

  • As per the spec (MUST)
    • handlers can't share names
    • handlers and their application must have distinct keys
  • As per recommendations (SHOULD)
    • don't share app name with a handler

We also need to ensure that projections implemented using projectionkit are analysed properly.

Add flag to disable recommendations.

Some of the checks align with SHOULD clauses from the specification, but we should be able to run in a mode that only complains if MUST clauses are violated.

Check that aggregate handlers are pure.

This is a bit of a catch-all task that ensures aggregate handlers are pure functions - they should get everything they need from the commands they receive and their current state.

@danilvpetrov I seem to recall in Hive that we may have broken this rule - one of the aggregates is responsible for choosing a domain name randomly, or something like that? Or was it actually deterministic?

Validate control-flow within handler methods.

  • every declared consumed message type should be handled
  • any other type should result in a `panic(dogma.UnexpectedMessage)
  • if there is a type switch (or similar simple branching) warn if a case is for a message that is not declared as being consumed

We also need to ensure that projections implemented using projectionkit are analysed properly.

Check for process timeout loops.

If a process creates a timeout, but upon handling that timeout only schedules another timeout, (and so on) there is an infinite loop that never produces any meaningful work.

Ensure handlers declare consumed/produced messages correctly.

  • Aggregates
    • must consume at least one command
    • must produce at least one event
  • Processes
    • must consume at least one event
    • must produce at least one command
    • (timeouts are optional)
  • Integrations
    • must consume at least one command
    • (events are optional)
  • Projections
    • must consume at least one event
    • ensure that projections implemented using projectionkit are analysed properly

None of them can declare the same message type more than once.

Check that timeout times are derived from times in messages, not the system time.

This one might be near impossible, but it should at least catch some common cases like using time.Now().

I'm not 100% confident this is something we want to enforce all the time, but it might be better to produce a diagnostic about it so that its brought to people's attention, then relax it if we find valid use cases for using the system time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.