Unchecking deceased children by default#6065
Conversation
vaszig
left a comment
There was a problem hiding this comment.
-
Looking at the ticket I am a bit confused. I thought that according to this #5857 (comment) we would expect an answer from NL DS (maybe you are aware of something else though).
-
Maybe we should change the default values for these too?
https://github.com/open-formulieren/open-forms/blob/main/src/openforms/contrib/haal_centraal/clients/brp.py#L211
https://github.com/open-formulieren/open-forms/blob/main/src/stuf/stuf_bg/client.py#L105
ff1ec35 to
461c081
Compare
During the previous refinement (9th of March) we decided that we can safely pick this up, and if municipalities expected it differently they would let us know.
Good point! I've updated the default |
461c081 to
66cc86f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6065 +/- ##
==========================================
- Coverage 97.09% 97.07% -0.02%
==========================================
Files 883 883
Lines 33192 33189 -3
Branches 2973 2972 -1
==========================================
- Hits 32228 32219 -9
- Misses 648 652 +4
- Partials 316 318 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
deb9a2d to
b8a160c
Compare
vaszig
left a comment
There was a problem hiding this comment.
I have some questions/remarks again!
Apart from the ones below I have one more concerning the mocked files in the openforms/contrib/haal_centraal/tests/files, I would expect that the ones for v2 are not necessary any more, no?
| # https://brp-api.github.io/Haal-Centraal-BRP-bevragen/v1/redoc#tag/Ingeschreven-Personen/operation/GetKinderen | ||
| self.requests_mock.get( | ||
| "https://personen/api/ingeschrevenpersonen/999990676/kinderen", | ||
| "https://personen/api/ingeschrevenpersonen/999990792/kinderen", |
There was a problem hiding this comment.
This is confusing to me..This is a test concerning v1.3 according to the class attribute, but here we use a BSN which is not part of the mocked data in ingeschrevenpersonen.v1-full.json (this comment is relevant with the tests below too).
I mean we use requests_mock here but we get children from the container, not the mocked data.
There was a problem hiding this comment.
The reason why i updated the BSN values, and the responses, was to keep the v2 and v1.3 tests aligned. The tests use the same setup which decides the get_family_members() function parameters and expected results.
I thought updating the v1.3 tests conform the container data was the correct thing to do, but if its not let me know. I do see i've missed some BSN value updates in the results, i'll correct those
There was a problem hiding this comment.
In my opinion this is a bit confusing. I would expect the tests for v2 to use the container and the the v1 the mocked data (since the container is part of the testing suite for v2 - https://brp-api.github.io/Haal-Centraal-BRP-bevragen/v2/getting-started#probeer-en-test-de-api-lokaal). So, if sharing a class is not the case any more I would split them. @sergei-maertens do you agree?
There was a problem hiding this comment.
The point of sharing a base class was to enforce the same input would lead to the same output for both versions of the API.
If we must align the test BSNs, then I'd also update the mock data so that the test itself remains consistent with the mock data, while also being consistent with the v2 test.
Separating the test classes entirely introduces the risk that we have different behaviours.
On the other hand, afaik nobody actually uses BRP v1.3 as it never really went into production, and it is scheduled for removal in Open Forms 4.0 (see #6087) so let's not spend too much effort on this.
There was a problem hiding this comment.
In these tests the v1.3 mock files are (and were) used twice as input. For these tests the v2 tests can use the same BSN values, as this results into the same test result. For the tests that needed to be updated, we could create mock files, but that would just result into moving the json data around.
The v1.3 mock files are also used in other tests, updating these will create more work. And considering BRP v1.3 will most likely be removed, its probably not worth it.
So, i think we can safely keep it as is
|
Edit: the v2 test files are used by other tests, like |
…default value By default, the 'include_deceased' option should be set to `False`. The change that deceased children should be included in the form is rather low, it's more likely that they should be excluded. Furthermore, forgetting to uncheck this option might lead to unfortunate situations.
Because excluding deceased children is now the standard, the test parameters and results needed to be updated.
…value The default values for `include_deceased` in the the BRP client `get_family_members` and the StUF BG client `get_partners_or_children` functions have been updated to `False`.
…f requests_mock The BRP client tests for BRP version 2 now use VCR testing instead of requests_mock. This allows us to more easily cover different scenario's, like excluding or including deceased family members. Additionally, this gets us one step closer to removing `requests_mock` all together from the codebase. The version 1.3 BRP tests continue to use `requests_mock`. This is due to high difficulty finding Docker images that represent the v1.3 BRP correctly. v1.3 will likely be dropped at some point (#6087), so converting these tests doesn't seem worth the hassle. Because a lot of the v1.3 and v2 BRP tests use the same shared requests and expect the same results, the tests for v1.3 have been updated to use the v2 BRP Docker image data. All the bsn values and responses are present in the v2 BRP Docker image data. The `requests_mock`'s for v1.3 have been updated to use the v2 BRP Docker image data.
…y members Added tests that validate the including and excluding of deceased family members when using the Haal Centraal BRP v2 client
b8a160c to
3a62115
Compare
sergei-maertens
left a comment
There was a problem hiding this comment.
Does the github release issue template need updates with the new cassette paths?
|
There is indeed a small update for the prepare release template. It now names |
The `openforms.contrib.haal_centraal` namespace now has multiple test files using VCR cassettes. To reflect this, the prepare-release template now names the entire namespace instead of a specific test file.
Closes #5857
Changes
Changing the default value of the Family members prefill plugin option
include_deceasedtoFalse. With that, the Family member prefill plugin tests have also been updated, to reflect the new default situation.Checklist
Check off the items that are completed or not relevant.
Impact on features
Dockerfile/scripts
./binfolderCommit hygiene
Documentation