Partial environment variable replacement and wildcards
Some types of metadata, such as Platform Event Subscriber Configuration, have attributes identifying a user by username. As such, regardless of the value in the source environment, the value deployed to the target org must match the username pattern of that org.
For example, if the value in the source repo is <user>name@example.com</user>, when deployed to a sandbox, it must be <user>name@example.com.sandbox1</user>. From sandbox to sandbox: <user>name@example.com.sandbox1</user> must become <user>name@example.com.sandbox2</user>. And finally, when going from sandbox to production: <user>name@example.com.sandbox1</user> to <user>name@example.com</user>.
This could be solved by supporting environment variable partial replacement with wildcards:
Production Org:
Find: @example.com*
Replace with: @example.com
Sandbox Org:
Find: @example.com*
Replace with: @example.com.sandboxName
Thanks Mike for submitting your idea.
Gearset's Environment Variables feature already supports partial string replacements, which means you can get Gearset to replace 'sandbox1' bit of the <user> tag value with 'sandbox2', as follows:
Target: Sandbox2
Metadata Type: Platform Event Subscriber Configuration
Item: Any item
Find: sandbox1
Replace with: sandbox2
-
Mike commented
@Gearset Team - that only works if the value in source has .sandboxName appended. However, we keep production's value in source, which has nothing after the email address. As such, there's nothing to replace.