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
You can now use Regular expressions in the "Find what" field when defining environment variables, allowing you to do wildcard/partial replacements.
-
Keenan Langston commented
I would also like to see this partial variable replacement functionality available in comparisons. If the only difference between the source and target is the username, and I have environment variables set up to fix this in the deploy, I don't want to see it as different in the compare.
-
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.