Problem/Motivation

Playing around with the CMI system on a local Core sprint with Beejeebus, I came across and discussed heavily a little oddity; If you do a fresh install of Drupal 8, export the config without making any changes, then do another fresh install of Drupal 8 and import said config, it will pickup a large number of differences due to changed UUIDs.

Somewhat related to #1969800: Add UUIDs to default configuration, however this is related to default YML that is dynamically generated, such as breakpoint.breakpoint.module.toolbar.narrow.yml, where there is no default YML file in the toolbar module to have set the UUID in the first place, so therefore the UUID will always be different on a fresh install even if the content of the YML file is identical.

Proposed resolution

On the initial creation of the dynamically generated default YML file, the actual content of the file should be used as part of the UUID generation, so that a file like breakpoint.breakpoint.module.toolbar.narrow.yml will have the same UUID as long as it has the same content on a fresh install of Drupal 8.

This may also allow for all default YML files to no longer need a hardcoded UUID to be included as as long as the content of the file is the same the UUID would be the same.

#1969800: Add UUIDs to default configuration

Files: 
CommentFileSizeAuthor
#2 2100043-breakpoint.patch1.51 KBtayzlor

Comments

yched’s picture

The 'body' field & instances on node entities have the same issue I think.
Currently they get added at by runtime on creation of a node type. The standard profile contains CMI files for node.type.{article,page}.yml, and the import of those files during site install triggers the creation of the 'body' field & instances.

In #1969800: Add UUIDs to default configuration it was concluded that standard profile should ship CMI files (including pre-determined UUIDs) for field.field.node.body & field.instance.node.{article,page}.body.

Why wouldn't the same apply for breakpoint.breakpoint.module.toolbar.narrow ?

tayzlor’s picture

FileSize
1.51 KB

This is how the breakpoint files might look if we just put UUIDs in the YAML file. This seems to resolve the issue on the config import page for things like breakpoint.breakpoint.module.toolbar.narrow (and the like).

Since I'd been looking at this anyway (as part of #1969800: Add UUIDs to default configuration), I was going to roll this into the patch over there, but thought i'd cross post this snippet here since its related to the discussion and shows how it might look.

My small patch here only covers off breakpoints and not breakpoint groups. Plus we'd still need to cover all the field related things yched is talking about (which do have the same issue).

alexpott’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

Since #2133325: Create a site UUID on install and only allow config sync between sites with the same UUID the scenario described in the issue summary is not possible.