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

Makes ...there_is_another | false | okay in tables #580

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

BryceStevenWilley
Copy link
Collaborator

there_is_another | true is invalid in a story table, because it will always be
true, and it will start an infinite loop of adding more elements to whatever list is
gathering.

However, you might be asked to add elements to a pre-filled list. In my case, I
add Individuals to the users and other_parties from existing EFM case
information, and then ask if the interviewee wants to add more users. Therefore
I can't use target_number in the story table, as the number won't include the
number of elements already added to the list (which Kiln can't figure out). I
can however, use there_is_another = False, which will terminate.

This does change how things are handled and documented, but IMO is a good
change. Let me know if we want a discussion here.

@BryceStevenWilley BryceStevenWilley added question Further information is requested bite-sized Well circumscribed small task labels Jul 13, 2022
Copy link
Collaborator

@plocket plocket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is permissive, but adds branching complexity that may not be necessary. Adding a test can help with that. If this is implemented, I'd rather leave it out of the documentation to avoid user confusion. That way, if it happens accidentally (e.g. with the Story Table generator), it's not a blocker, but it avoids people trying to explicitly use it.

@plocket
Copy link
Collaborator

plocket commented Jul 25, 2022

The changelog comment should mention that this should not be documented [and why it's not being documented].

Copy link
Collaborator

@plocket plocket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the tests and the changelog (as described) and this should be good to go. Let me know if you want another review.

BryceStevenWilley added a commit to SuffolkLITLab/docassemble-ALKilnSetup that referenced this pull request Aug 18, 2022
Sets up a valid situation where you would need `there_is_another` to be
directly set to false, instead of using `target_number` like the docs say.

First used in SuffolkLITLab/ALKiln#580
BryceStevenWilley added a commit to SuffolkLITLab/docassemble-ALKilnSetup that referenced this pull request Aug 18, 2022
Sets up a valid situation where you would need `there_is_another` to be
directly set to false, instead of using `target_number` like the docs say.

First used in SuffolkLITLab/ALKiln#580
@plocket
Copy link
Collaborator

plocket commented Aug 29, 2022

Sorry to waffle on this, but regarding documentation we might want to have another conversation. I'm now rethinking. It might be ok to document with a hefty warning. Otherwise I'm concerned we'll forget this and be surprised by it later. Now that I look at it again, the case you made for the need is compelling.

@BryceStevenWilley
Copy link
Collaborator Author

Otherwise I'm concerned we'll forget this and be surprised by it later.

I'm not super concerned about this, given

  1. I don't think it's that surprising? Given that it'll do exactly what you expect it to do, and it's only surprising compared to our 2nd-order rules about using it.
  2. For things like this, I'm more likely to check the code than I am to check the documentation, and I think as maintainers we should be doing that.

Still okay with adding this in the documentation though. My concern isn't that it needs a warning (IMO it doesn't), but that it's adding complexity to our main suggested solution, which is "just use target_number".

@plocket
Copy link
Collaborator

plocket commented Aug 29, 2022

Fair enough. Let's just leave it out for now in that case.

`there_is_another | true` is invalid in a story table, because it will always be
true, and start an infinite loop of adding more elements to whatever list is
gathering.

However, you might be asked to add elements to a pre-filled list. In my case, I
add Individuals to the `users` and `other_parties` from existing EFM case
information, and then ask if the interviewee wants to add more users. Therefore
I can't use `target_number` in the story table, as the number won't include the
number of elements already added to the list (which Kiln can't figure out). I
can however, use `there_is_another = False`, which will terminate.
Ensure that no warnings are thrown in the report, and that it can successfully
pass.

Needed to add functions to check for the non-existance of things in the report,
and corrected some misspellings in other feature files that I came across.
@BryceStevenWilley
Copy link
Collaborator Author

If I'm reading your last comment correctly, you agree that this doesn't need extra documentation outside of the CHANGELOG, and this is ready for merging, correct? There is a test added for it, and it's in the CHANGELOG now, so I think everything else is ready.

@BryceStevenWilley BryceStevenWilley merged commit 69a279e into releases/v4 Nov 9, 2022
@BryceStevenWilley BryceStevenWilley deleted the there_is_another_false branch November 9, 2022 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bite-sized Well circumscribed small task question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants