Overview

In #3523841: Versioned Component config entities (SDC, JS: prop_field_definitions, block: default_setting, all: slots for fallback) + component instances refer to versions ⇒ less data to store per XB field row we added support for versioned components.
There are places in the front-end code where we consult the components endpoint to get field data/json schema about a component that might need updating.
Consider a scenario where we have an old version of a component in the page - the components input form correctly renders the old version of the form (widgets etc) but the front-end might be getting json schema and hence validation rules for the current version.

Proposed resolution

Add an e2e test to validate that we can edit old versions.
If it fails, address places in the FE where we consult that list and explore how we could pass the 'point in time' validation rule for legacy versions.

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

larowlan created an issue. See original summary.

wim leers’s picture

Issue tags: +e2e

Good call.

wim leers’s picture

Component: Page builder » Data model
wim leers’s picture

larowlan’s picture

I went looking for any existing tests that enable xb_test_storage_prop_shape_alter which would be the obvious way to test this and found component-transforms.cy.js which looks to do exactly what we were looking for here.

That was added in #3515629: FieldWidget's XB transforms must be bubbled by the Field Widget rendering to inform the client which was early May, but this issue was opened in June - so that leads me to believe it might not be enough on its own.

I will recreate the steps in that test and see if it is already providing the coverage we need and expand it as needed.

larowlan’s picture

Assigned: larowlan » Unassigned
Status: Active » Needs review

Expanded the existing test to assert that the input in the old component version passes validation.
Because our validation is tied to the json schema and that _doesn't_ change I think we're in good shape here

wim leers’s picture

Assigned: Unassigned » wim leers

That was fast!

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

I'd have liked to see a more comprehensive end-to-end test, but I see now that the issue summary was quite specific about this: […] the front-end might be getting json schema and hence validation rules for the current version. so 👍

It is very nice to see such a nice little expansion of an existing test though, so merging this; more expansive test coverage will be necessary in #3463996: [META] When the field type, storage/instance settings, widget, expression or requiredness for an SDC/code component prop changes, the Content Creator must be able to upgrade anyway :)

  • wim leers committed f8a556ba on 1.x authored by larowlan
    Issue #3528284 by larowlan: Add e2e tests that prove we can edit an old...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.