Overview

#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 brought versioned ComponentSource-specific settings: as either the component itself evolves (an SDC/code component gains new props, a block plugin gains new settings, the field type used for a particular SDC/code component prop shape changes, etc.), we'll be able to still access instances that were created for a previous version and keep those component instances operational.

Furthermore, this also allows storing less information in the ComponentTreeItem's inputs field property.

#3523841 introduced all the necessary infrastructure on the server side (a lot), optimized the storage of inputs for all GeneratedFieldExplicitInputUxComponentSourceBase-powered component sources, updated the client side (a little) to adjust for the changes, and hence kept it all working.

Part of that is:

If we take those scenarios as inputs, we should be able to create a determinstic hashing approach that gives us a unique version ID for each component and set of those constraints.

But that issue did notenable the validation that verifies the versions are indeed deterministic hashes. The logic for that already exists, but if we enable it, 110 tests fail.

So, clearly, the logic in \Drupal\experience_builder\Entity\VersionedConfigEntityBase::generateVersionStringForData() which uses

    $typed_data = \Drupal::service(TypedConfigManagerInterface::class)->createFromNameAndData($config_schema_type, $data);
    assert($typed_data instanceof Mapping);
    $normalized_data = $typed_data->toArray();

… does not quite result in the expected normalization that should result in deterministic hashes 😭

Proposed resolution

Investigate why the result of TypedConfigManagerInterface::createFromNameAndData()->toArray() is not deterministic.

User interface changes

None.

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

wim leers created an issue. See original summary.

wim leers’s picture

Title: [PP-1] Ensure deterministic version hashes » Ensure deterministic version hashes
Assigned: Unassigned » larowlan

larowlan made their first commit to this issue’s fork.

larowlan’s picture

Status: Active » Needs review
wim leers’s picture

Assigned: larowlan » wim leers

You got this to green already?! Reviewing! 🥳

wim leers’s picture

wim leers’s picture

Title: Ensure deterministic version hashes » Ensure deterministic version hashes for ComponentSource-specific settings, thanks to config schema-powered normalization
Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community

This looks great! I'm relieved to see it was ~95% working already, and basically fixing 2 small bugs was all this took. Whew!

Even though the majority of the infrastructure already existed, I think expanding the issue title to precisely describe what this is about may come in handy during future git archeology 🤓

  • wim leers committed 78dc6805 on 0.x authored by larowlan
    Issue #3528159 by larowlan, wim leers: Ensure deterministic version...
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.