-
Notifications
You must be signed in to change notification settings - Fork 120
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
WIP: Define permitted next nodes for all flows #2002
Conversation
TODO: Expand this commit message. Consider moving this commit after all the commits to add the relevant permitted_next_nodes statements
Updated using: $ rails r script/generate-checksums-for-smart-answer.rb \ additional-commodity-code
Updated using: $ rails r script/generate-checksums-for-smart-answer.rb \ am-i-getting-minimum-wage $ rails r script/generate-checksums-for-smart-answer.rb \ minimum-wage-calculator-employers
Updated using: $ rails r script/generate-checksums-for-smart-answer.rb \ benefit-cap-calculator
Other than my comments above, this looks good to me. I agree that initially we could just update the flows which use |
Updated using: $ rails r script/generate-checksums-for-smart-answer.rb \ am-i-getting-minimum-wage $ rails r script/generate-checksums-for-smart-answer.rb \ minimum-wage-calculator-employers
Updated using: rails r script/generate-checksums-for-smart-answer.rb \ calculate-married-couples-allowance
We no longer have any graphs that can not be visualised
Rubocop warning: "Unused block argument"
Rubocop warning: "Surrounding space missing for operator ="
Rubocop warning: "Unused block argument - response".
@floehopper: Can you take another look at this pull request, please? If you think the result is OK then I plan to rewrite history and open another pull result. Here's the plan:
I think this ordering of commits should mean that all the tests pass each time. |
Minor: I might be inclined to combine the checksum update commits with their respective commit which changes the flow. I think separating changes to the test artefacts into separate commits can be useful, because there are often a lot of files changing, but I'm not sure it's justified in the case of just a checksum change. |
Very minor: I might be inclined to incorporate the Rubocop changes in the commits which triggered them. |
Other than my comments, this LGTM 👍 |
Yup - I'm planning to do that in the new branch. |
Good idea. |
Closing in favour of PR #2010. |
Trello card - https://trello.com/c/jtjRNOW9/97-update-all-flows-to-use-permitted-next-nodes
I've updated
Question::Base#next_node_for
to raise an exception if thenext_node
isn't found in the list ofpermitted_next_nodes
.I've updated the first three flows to use
permitted_next_nodes
where required to get an idea of how they're going to look.NOTE. Using
next_node :symbol
ornext_node_if
automatically add the nodes topermitted_next_nodes
so I've only updated the flows/questions that usenext_node
with a block.The advantage of using
permitted_next_nodes
is that it allows us to visualise the flows.Visualising additional-commodity-code
Before
After