-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glob patterns are not working during replacements #122
Comments
@docbill can you confirm where your replacements where stored ? in sfp, the package as such as is installed without the context of the repo. So unless this file is reachable within the context of the package, I do not think it would be supported. We might have to have specific support around it |
We store all replacements in a replacement folder in our repo. Here is a relevant sample:
A completely separate issue is I had to add a validation step in our build pipeline. Because a value like "replacements/PROD/InegrationUserTag" would work locally on a case insensitive file system, but not during a build running in an Linux container. I will reference that here, as it might help give you further context:
|
Here is another sample of a replacement that does not get performed when running sfp during the quickdeploy stage:
(This particular rule was last replacement in the list. It acts as a fall through, when none of the other replacements applied.) |
We do have a workaround. Which is to list the relevent files in the ignores files and then explitly deploy them from a script. e.g.
It is ugly, but it works. |
Thanks for the detailed write up @docbill. We will look into it |
Describe the bug
When parsing the sfdx-project.json any replacement patterns using glob are not applied.
To Reproduce
Steps to reproduce the behavior:
(Note: This requires you have a valid platform event and platform event subscriber to reference also in the project.)
{
"glob": "src/**/*.platformEventSubscriberConfig-meta.xml",
"regexToReplace": "[A-Za-z0-9]+User",
"replaceWithFile": "replacements/EmptyXmlComment"
}
Expected behavior
The string SystemUser should be replaced with the empty comment and successfully deploy.
Actual behavior
The replacement does not happen and there is an error that the SystemUser does not exist.
Platform Details (please complete the following information):
sfp -- ❤️ by flxbl.io ❤️ -Version:39.0.3 -Release:June 24
Current runner version: '2.319.1'
Operating System
Ubuntu
22.04.5
LTS
Runner Image
Image: ubuntu-22.04
Version: 20240922.1.0
Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240922.1/images/ubuntu/Ubuntu2204-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240922.1
Runner Image Provisioner
2.0.384.1
Additional context
This is particular problematic for files where it is not possible to write a replacement string that is deployable without replacement. As it means the replacement must always happen regardless of DEPLOY_TARGET for every file using that string that must be replaced.
The text was updated successfully, but these errors were encountered: