Unicorn icon indicating copy to clipboard operation
Unicorn copied to clipboard

Unicorn.DataProvider.10.1.config role:require setting prevents the config from being loaded on XM0

Open islaytitans opened this issue 2 years ago • 2 comments

Do you want to request a feature or report a bug? Bug

What is the current behavior? Unicorn.DataProvider.10.1.config role:require is set to "Standalone" however XM0 doesn't have a Standalone mode for local development. Unlike XP0, XM0 creates both a CM and CD instance. Therefore the config is not included.

Resulting in saved changes to items are not written to the file system automatically. However Syncing or Reserializing works correctly when triggered through the Unicorn interface.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Install a clean 10.2 XM0
  2. Add Unicorn 4.1.6 to the CM webroot
  3. Change Unicorn.Configs.Example.example to be Unicorn.Configs.Example.config so it monitors /sitecore/layout/Layouts/YourSite
  4. Add an item under /sitecore/layout/Layouts/YourSite and save
  5. Observe the yml file is not created in the targetDataStore

What is the expected behavior? After completing step 4 the yml file should automatically appear the in the targetDataStore.

I can make the expected behaviour to occur by changing Unicorn.DataProvider.10.1.config role:require="Standalone" to role:require="Standalone or ContentManagement" but obviously we only need that change on locals. I'm currently investigating if you can change a role:require value via a config transform.

Please mention your Sitecore version and Unicorn version. Sitecore - 10.2 Unicorn - 4.1.6

It's also worth mentioning this issue also affects Unicorn.UI.DeployedContentEditorWarnings.config as they're typically warnings / text you want to show on Prod to content editors. Not so much of an issue as you can patch Unicorn.DevMode to be true

islaytitans avatar Feb 03 '22 11:02 islaytitans

Yea it's a little bit fuzzy, since Sitecore and the roles it ships with has changed a bit over the years while Unicorn at least attempts to remain as compatible as possible with as many versions as possible. The reason I've not made the change you suggest is also the same reason you mention yourself; if I change the default role to Standalone or ContentManagement this might come as a surprise to people who are currently deploying to an upstream environment where they expect the dataprovider to be inactive.

Possibly the best solution would be to make this driven by an environment variable of some sort, but I'm not entirely certain that this is actually possible. Something along the lines of role:require="$(env:UNICORN_DATAPROVIDER_ROLE)" or some such. Definitely open to any suggestions you could offer - as long as they don't introduce a "surprise gotcha" to existing installations.

cassidydotdk avatar Feb 03 '22 11:02 cassidydotdk

I think it should be safe to change it to Standalone or ContentManagement, in the new world of more XM and less XP, we are going to see more people with only ContentManagement role enabled.

markgibbons25 avatar Aug 16 '22 05:08 markgibbons25