-
Notifications
You must be signed in to change notification settings - Fork 98
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
Cd/forceignore bug #1093
Cd/forceignore bug #1093
Conversation
// `forceignore.denies` will pass a relative path to node-ignore, e.g. | ||
// `path/to/force-app` -> `force-app`, note that there's no trailing slash | ||
// so node-ignore will treat it as a file. | ||
if (!this.tree.isDirectory(dir) && this.forceIgnore?.denies(dir)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mshanemc it turns out the bug also affects a real FS tree:
path.relative
doesn't return a trailing slash so node-ignore
will treat as a file, called here:
https://github.com/forcedotcom/source-deploy-retrieve/blob/f288319e55378d1a7caca5bcd762b77b2c59f30a/src/resolve/forceIgnore.ts#L66C1-L66C1
another option I showed you this morning was to add the trailing slash before passing dir
to denies
, but then have to remove it again or it will not be able to file the folder in the tree:
for (const file of this.tree.readDirectory(dir)) { |
that also worked, but not sure if it's the right solution:
https://stackoverflow.com/questions/980255/should-a-directory-path-variable-end-with-a-trailing-slash
QA notes: using dreamhouse and ✅ created class ✅ Now, let's try to break it
(looks like this is broken in main, not necessarily a bug in this PR) Note: if you put this back in the
|
What does this PR do?
Updates the metadata resolver to skip the first forceignore check when resolving components recursively if the dir is a folder.
in the linked GH issue below, when building the component set from the API response SDR is trying checking if
unpackaged
should be ignored here:source-deploy-retrieve/src/resolve/metadataResolver.ts
Line 74 in f288319
forceignore.denies
will pass a relative path tonode-ignore
that doesn't have a trailing slash so it is treated as a file when matching the forceignore rules against it:source-deploy-retrieve/src/resolve/forceIgnore.ts
Line 66 in f288319
What issues does this PR fix or reference?
forcedotcom/cli#2404
@W-13948748@