Skip to content

Implement runtime file component registration config resolution - #6271

Merged
sergei-maertens merged 12 commits into
mainfrom
cleanup/6269-runtime-file-component-registration-config-resolution
May 15, 2026
Merged

Implement runtime file component registration config resolution#6271
sergei-maertens merged 12 commits into
mainfrom
cleanup/6269-runtime-file-component-registration-config-resolution

Conversation

@sergei-maertens

@sergei-maertens sergei-maertens commented May 8, 2026

Copy link
Copy Markdown
Member

Closes #6269

Changes

The file component now supports registration configuration where the catalogue identifier and document type descrition are specified. This is paired against the configured API group's catalogi API service and resolves into the correct version of a document type for a given submission.

Additionally, I've added some optimization to avoid looking up the same catalogue and/or document types over and over if multiple similar configurations are provided.

Finally, the file component configuration is quite cumbersome, so I added an option to copy registration plugin options into the components which we can do in JS quite easily, that should reduce the impact for form builders.

Problem detection with mis-matched configuration is deferred and will be implemented as part of #6262

I verified that uploads inside repeating groups are also properly picked up in the component table.

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

@github-actions github-actions Bot added the needs-backport Fix must be backported to stable release branch label May 8, 2026
Comment on lines +213 to +222
document_type_configuration = file_component.get("registration", {}).get(
"documentType", {}
)
_document_type_description = document_type_configuration.get("description", "")
_catalogue = document_type_configuration.get("catalogue", {})
if (
_document_type_description
and (_catalogue_domain := _catalogue.get("domain"))
and (_catalogue_rsin := _catalogue.get("rsin"))
):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is set up very defensively on purpose - we don't have proper backend validation yet for component configuration and have to deal with legacy component configurations too

Comment thread src/openforms/registrations/contrib/zgw_apis/plugin.py
@sergei-maertens
sergei-maertens force-pushed the cleanup/6269-runtime-file-component-registration-config-resolution branch from 5b905bc to 23b0b1f Compare May 8, 2026 16:24
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.07%. Comparing base (cf6adf7) to head (68a81b9).
⚠️ Report is 563 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6271   +/-   ##
=======================================
  Coverage   97.07%   97.07%           
=======================================
  Files         865      866    +1     
  Lines       32700    32756   +56     
  Branches     2975     2981    +6     
=======================================
+ Hits        31743    31799   +56     
  Misses        646      646           
  Partials      311      311           

☔ View full report in Codecov by Harness.
📢 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.

@sergei-maertens
sergei-maertens force-pushed the cleanup/6269-runtime-file-component-registration-config-resolution branch 5 times, most recently from aa921b0 to 4ced948 Compare May 11, 2026 15:36
@sergei-maertens
sergei-maertens marked this pull request as ready for review May 11, 2026 16:40
@sergei-maertens
sergei-maertens force-pushed the cleanup/6269-runtime-file-component-registration-config-resolution branch from cc51f68 to 9cb9e2a Compare May 11, 2026 16:41
@sergei-maertens
sergei-maertens requested a review from SonnyBA May 11, 2026 16:43
@sergei-maertens

Copy link
Copy Markdown
Member Author

@annashamray @SonnyBA whomever gets first to review this, I think it's best to go commit-by-commit

@sergei-maertens
sergei-maertens force-pushed the cleanup/6269-runtime-file-component-registration-config-resolution branch from 9cb9e2a to b6724e4 Compare May 13, 2026 08:48
Comment thread src/openforms/registrations/contrib/objects_api/submission_registration.py Outdated
Comment thread src/openforms/contrib/zgw/resolvers.py Outdated
Comment on lines +140 to +148
if (!componentDraft.registration) {
componentDraft.registration = {};
}
if (!componentDraft.registration.documentType) {
componentDraft.registration.documentType = {};
}
componentDraft.registration.documentType.catalogue = catalogue;
componentDraft.registration.documentType.description = description;
});

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.

Should we empty the other values (informatieobjecttype) that won't be used whenever this action is performed? Only assigning these values might give the impression that the other fields might still be used (if those were filled in before) while they're not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no I'm deliberately not doing that, in case something goes wrong that we can still reconstruct what the original situation was. The documentation/comments make it clear that the new situation is preferred if it's available, and this matches the behaviour of the registration plugin configuration options.

@annashamray annashamray left a comment

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.

Just a couple small remarks

Comment thread src/openforms/registrations/contrib/zgw_apis/plugin.py Outdated
This one exposes the file-component configuration options.
…pe description

For the components that don't use the default specified document type
from the plugin settings, it's reasonable to assume that they will use
at least the same catalogue for the file component uploads. A copy
function to the components allows doing this in bulk, after which only
the document type description itself may still need tweaking.

This commit needs to be backported to 3.5 to allow migrating/preparation
for the 4.0 upgrade. From 4.0 onwards, we should move this config out
of the component registration options entirely and could possibly
also offer a dropdown to select the document type.
@sergei-maertens
sergei-maertens force-pushed the cleanup/6269-runtime-file-component-registration-config-resolution branch from b6724e4 to 68a81b9 Compare May 15, 2026 15:30
@sergei-maertens
sergei-maertens merged commit 21388a0 into main May 15, 2026
33 checks passed
@sergei-maertens
sergei-maertens deleted the cleanup/6269-runtime-file-component-registration-config-resolution branch May 15, 2026 15:52
@sergei-maertens

Copy link
Copy Markdown
Member Author

Backport commits to 3.5.x (PR: #6298):

sergei-maertens added a commit that referenced this pull request May 15, 2026
…ile-component-doctype-resolution

Runtime file component doctype resolution (#6271 backport)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-backport Fix must be backported to stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support (catalogue, description) references for file component registration

3 participants