Skip to content

Add UDI support for relation, user and user-group entity types#17490

Merged
bergmania merged 7 commits into
release/15.0from
v15/hotfix/udi-getter-extensions
Nov 12, 2024
Merged

Add UDI support for relation, user and user-group entity types#17490
bergmania merged 7 commits into
release/15.0from
v15/hotfix/udi-getter-extensions

Conversation

@ronaldbarendse

@ronaldbarendse ronaldbarendse commented Nov 11, 2024

Copy link
Copy Markdown
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

While trying to add support for schema deployment of user groups in Deploy (to fix issue umbraco/Umbraco.Deploy.Issues#237), we already noticed v13 doesn't persist the user group GUID key to the database (but returns a random GUID after each save) and likely because of that also doesn't support getting the UDI for this entity (as UDIs use either a GUID or string value for the identifier part).

Instead of working around all IEntity.GetUdi() calls in Deploy, this PR adds UDI support for the following entity types:

  • Relation: umb://relation/GUID
  • User: umb://user/GUID
  • User group: umb://user-group/GUID

I've also updated the GetUdi() extension methods on Script and Stylesheet to their interfaces and obsoleted the UdiParserServiceConnectors class (which isn't used by the CMS or Deploy anymore).

The unit tests are updated to include verifying whether the extension method works for these new types and the IScript and IStylesheet interfaces.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides adding Relation, User and UserGroup, I've re-ordered the existing ones alphabetically, grouped per 'UDI type'.

@AndyButland AndyButland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me and would allow cleaning up some code in Deploy where we have to work around the fact that some entities - in particular user groups - don't have full support for UDIs.

Only issue may be timing of course... as we're pretty close to final release now. If @bergmania doesn't feel we can get this in for 15, then we could retarget for 16 and continue the workarounds in Deploy for one more version. But hopefully it's OK as the changes other than any reformatting are quite small.

Just to explain the background, this has come up in a review for a new feature we are working on in Deploy, which currently has some ugly workarounds for this issue. So it isn't needed specifically for the release of Deploy running on Umbraco 15; rather it's to support a feature we'll look to bring out shortly after.

@bergmania bergmania merged commit b002ac8 into release/15.0 Nov 12, 2024
@bergmania bergmania deleted the v15/hotfix/udi-getter-extensions branch November 12, 2024 07:46
@bergmania

Copy link
Copy Markdown
Member

Looks okay to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants