Skip to content

[Spike] Map between stored and form addressing of a configuration - #692

Draft
markus-moser wants to merge 1 commit into
2026.xfrom
spike/configuration-path-mapper
Draft

[Spike] Map between stored and form addressing of a configuration#692
markus-moser wants to merge 1 commit into
2026.xfrom
spike/configuration-path-mapper

Conversation

@markus-moser

Copy link
Copy Markdown
Contributor

Spike — for review of the approach, not for merge as it stands. Nothing consumes ConfigurationPathMapper yet; it exists to settle a question before a review/diff surface is built on top of the configuration editor.

transformBackendToForm() is not shape-preserving, so a dotted address into the stored configuration does not name the same field in the form. Two rules cover every divergence:

  1. general.active|description|group|name are lifted to the form root.
  2. Mapping items are addressed by mappingId in the stored document and by list index in the form.

Everything else is the same path on both sides.

The tests document three findings that matter for anything diffing a configuration:

  • The mapping is config-dependent, not a string rewrite. Resolving an item needs the document.
  • It is asymmetric. An address naming a mapping item the configuration does not carry — an item some other version adds — has no form path at all, because there is no row to point at.
  • mappingId is minted in the Studio form, so a configuration written before it, or by the console, carries none. Those rows are skipped rather than given a positional key, so a caller can tell the difference.

Gates

Gate Result
PHPStan (level 5) 0 errors
php-cs-fixer 0 files to fix
Codeception unit 11 tests, 34 assertions, green

🤖 Generated with Claude Code

transformBackendToForm() flattens general.* and the mapping list is addressed by
mappingId when stored but by index in the form, so a dotted address into the
stored document does not name the same field in the editor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

2 participants