Skip to content

Unchecking deceased children by default#6065

Merged
sergei-maertens merged 7 commits intomainfrom
feature/5857-uncheck-deceased-children-by-default
Mar 27, 2026
Merged

Unchecking deceased children by default#6065
sergei-maertens merged 7 commits intomainfrom
feature/5857-uncheck-deceased-children-by-default

Conversation

@robinmolen
Copy link
Copy Markdown
Contributor

Closes #5857

Changes

Changing the default value of the Family members prefill plugin option include_deceased to False. 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

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Checked new model fields are usable in the admin
    • Problem detection in the admin email digest is handled
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how
  • Documentation

    • Added documentation which describes the changes

@robinmolen robinmolen requested a review from vaszig March 11, 2026 14:09
Copy link
Copy Markdown
Contributor

@vaszig vaszig left a comment

Choose a reason for hiding this comment

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

Comment thread src/openforms/prefill/contrib/family_members/tests/test_plugin.py Outdated
Comment thread src/openforms/prefill/contrib/family_members/tests/test_plugin.py
@robinmolen robinmolen force-pushed the feature/5857-uncheck-deceased-children-by-default branch from ff1ec35 to 461c081 Compare March 17, 2026 11:18
@robinmolen
Copy link
Copy Markdown
Contributor Author

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).

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.

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

Good point! I've updated the default include_deceased values of these functions 👍

@robinmolen robinmolen force-pushed the feature/5857-uncheck-deceased-children-by-default branch from 461c081 to 66cc86f Compare March 17, 2026 11:42
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.07%. Comparing base (25c6806) to head (936078e).
⚠️ Report is 32 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/openforms/contrib/haal_centraal/clients/brp.py Outdated
Comment thread src/openforms/prefill/contrib/family_members/tests/test_plugin.py Outdated
@robinmolen robinmolen force-pushed the feature/5857-uncheck-deceased-children-by-default branch 2 times, most recently from deb9a2d to b8a160c Compare March 18, 2026 13:32
Copy link
Copy Markdown
Contributor

@vaszig vaszig left a comment

Choose a reason for hiding this comment

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

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?

Comment thread src/openforms/contrib/haal_centraal/tests/test_brp_clients.py Outdated
Comment thread src/openforms/contrib/haal_centraal/tests/test_brp_clients.py Outdated
Comment thread src/openforms/contrib/haal_centraal/tests/test_brp_clients.py Outdated
# 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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Comment thread src/openforms/contrib/haal_centraal/tests/test_brp_clients.py
@robinmolen
Copy link
Copy Markdown
Contributor Author

robinmolen commented Mar 23, 2026

Edit: the v2 test files are used by other tests, like CoSignPrefillV2Tests. So we cannot delete them just yet. These tests should probably also be updated to use VCR, but i think thats out of scope

…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
@robinmolen robinmolen force-pushed the feature/5857-uncheck-deceased-children-by-default branch from b8a160c to 3a62115 Compare March 23, 2026 11:32
Copy link
Copy Markdown
Member

@sergei-maertens sergei-maertens left a comment

Choose a reason for hiding this comment

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

Does the github release issue template need updates with the new cassette paths?

@robinmolen
Copy link
Copy Markdown
Contributor Author

There is indeed a small update for the prepare release template.

It now names openforms.contrib.haal_centraal.tests.test_integration specifically, i'll make it more global as multiple files in the openforms.contrib.haal_centraal namespace now use VCR cassettes.

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.
@sergei-maertens sergei-maertens merged commit 20ca5c3 into main Mar 27, 2026
32 of 33 checks passed
@sergei-maertens sergei-maertens deleted the feature/5857-uncheck-deceased-children-by-default branch March 27, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default to unchecked "include_deceased" for Childeren

3 participants