ManageIQ / floe

Floe is a runner for Amazon States Language workflows
Apache License 2.0
0 stars 5 forks source link

[WIP] Common error message helper. #209

Closed kbrock closed 2 months ago

kbrock commented 3 months ago

Overview.

This is the 3rd attempt.

Depends upon:

Goals

Changes

Parsing

Next processing

Reduction of scope

I did the following changes to reduce the scope of this

I can easily add the first 2 items back but I was trying to keep this down.

Before / After

- Missing field "States"
+ Workflow requires Hash field "States"
- Missing field "StartAt"
+ Workflow requires String field "StartAt"
- "StartAt" not in the "States" field
+ Workflow requires field "StartAt" to be in "States" list but got [Foo]
- Choice state must have "Choices"
+ States.Choice1 requires Array field "Choices"
- "Choices" must be a non-empty array
+ States.Choice1 requires Array field "Choices"
- "Default" not in "States"
+ States.Choice1 requires field "Default" to be in "States" list but got [MissingState]
- Invalid state type: [Invalid]
+ States.FirstState requires String field "Type" but got invalid value [Invalid]
- Missing "Type" field in state [FirstState]
+ States.FirstState requires String field "Type"
- (ruby runtime error)
+ States.FirstMatchState.Choices.0.Data requires Path field "Variable"
- Path [wrong] must start with "$"
+ States.FirstMatchState.Choices.0.Data requires Path field "Variable" Path [wrong] must start with "$"
- (ignored)
+ States.FirstMatchState.Choices.0.Not.0.Data does not recognize field "Next"

Changelog History

  1. Pass a Validator instead of workflow.
  2. Pass an Enhance payload with getter methods.
  3. State#include Validation. <==

Have another branch that:

kbrock commented 3 months ago

update:

update:

kbrock commented 3 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

update:

update:

kbrock commented 2 months ago

update:

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

update:

miq-bot commented 2 months ago

This pull request is not mergeable. Please rebase and repush.

kbrock commented 2 months ago

Goal is to simplify this PR

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

update:

kbrock commented 2 months ago

WIP: This keeps starting small and growing large. Conflating too many ideas. Going to move the path code into the full name change.

This may become multiple PRs:

kbrock commented 2 months ago

I'm merging the dsl work into here and I squashed the commits down to the various forms of this code (did not keep the payload validator.)

This has run its course with a good chunk of the error message changes being promoted to #229

miq-bot commented 2 months ago

Checked commits https://github.com/kbrock/floe/compare/d863da22369f5d6cc8534b7c19760e77bd344e0f~...eab13df464653ad94e412afcf9436222f9233553 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 22 files checked, 0 offenses detected Everything looks fine. :+1: