feat: declare the mappings field as a json-path-mapper - #9
Merged
Conversation
Core's mapping helper used to be called `generic-data-mapping-helper`, named
after this plugin, and it knew this plugin's property names: it read `url`,
`format`, `method`, `headers` and `body` off the settings object and printed
the template hint as `{{generic_data.<var>}}`.
Core no longer knows any of that. The widget is `json-path-mapper`, and the
manifest says which of our properties hold each part of the probe request and
what each mapping row's keys are called. The values below are the same names
the widget used to assume, so nothing about the field changes for the user —
they are simply declared now instead of hardcoded in core.
`fiestaboard_version` moves to the release that introduced the widget. Below
that floor the field degrades to a plain array of objects, so holding the
update back leaves those boards on a manifest their core renders properly.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Moves
mappingsonto core's capability-named widget,json-path-mapper,and declares the two things core used to know about this plugin by name.
Core's mapping helper shipped as
generic-data-mapping-helper— named afterthis plugin — and it hardcoded our property names: it read
url,format,method,headersandbodyoff the settings object, and printed the templatehint as
{{generic_data.<var>}}. Core no longer knows any of that:Every value is the name the widget used to assume, so nothing changes for the
user — the same probe request, the same three inputs per row, the same stored
shape. They are declared now instead of assumed.
Core side: Fiestaboard/FiestaBoard#1557.
Blocked on core #1557 — read before merging
The
fiestaboard_versionfloor here is>=8.25.5, which is a prediction, nota fact. Core #1557 is not merged yet. FiestaBoard bumps a patch version per
merged PR (the PR is titled
refactor(...), sopr-labelgives itpatch), andmainis on 8.25.4 — so 8.25.5 is right if #1557 is the next PR to land. Ifanything else merges first, re-derive the floor from the release that actually
contains #1557 and update it here before merging this PR.
Nothing breaks if the order slips the other way. #1557 keeps
generic-data-mapping-helperas an accepted alias, so this repo was neverrequired to move in lockstep, and a core below the floor treats the new widget
name as a warning rather than a load failure (Fiestaboard/FiestaBoard#1554) —
the field just degrades to a plain array of objects. The floor exists so the
hourly plugin auto-update holds those boards on the manifest their core can
render properly, not because anything would break.
Version
1.2.2 → 1.3.0. No behaviour change, but the manifest now requires a core
capability it did not before, and the compatibility floor moves a long way
(
>=4.2.0→>=8.25.5).TDD
All four tests were written first and observed RED before the manifest changed.
mappingsuses the capability-named widgetAssertionError: assert 'generic-data-mapping-helper' == 'json-path-mapper'probenames this plugin's own request propertiesKeyError: 'ui:options'keysnames the properties a mapping row actually hasKeyError: 'ui:options'AssertionError: >=4.2.0 predates json-path-mapper/assert (4, 2, 0) >= (8, 25, 5)The
probeandkeystests do not just compare literals — they also assertthat every property named on the right-hand side is actually declared in
settings_schema.propertiesand inmappings.items.propertiesrespectively, sorenaming a settings property without updating the block fails here rather than
silently probing with that part missing.
Verification
pytest tests/— 75 passed before, 79 passed after (+4). Coverage gate(70%) unaffected; the new file is pure manifest assertions.
mainas it is today (no #1557):validate_manifest→valid: True, errors: [], with the single warningsettings_schema.mappings: unknown ui:widget 'json-path-mapper' — the settings form will fall back to a plain input. It loads.valid: True, errors: [],no warnings —
probeandkeysare recognised grammar, not unknown keys.json.loadsround-trips the manifest.feeds[].mappingsis deliberately left alone: it has noui:widgettoday andrenders as a plain nested array, which is unchanged by any of this.