fix: scopeProfiles excludes profiles correctly with ./-prefixed paths @W-22149938@#887
Open
WillieRuemmele wants to merge 4 commits into
Open
fix: scopeProfiles excludes profiles correctly with ./-prefixed paths @W-22149938@#887WillieRuemmele wants to merge 4 commits into
WillieRuemmele wants to merge 4 commits into
Conversation
… @W-22149938@ Two bugs caused package version create to include phantom profile names in package.xml when scopeProfiles: true was set: 1. findAllProfiles built glob ignore patterns that couldn't match ./-prefixed directory paths from sfdx-project.json (e.g. `**/./src-access-management/**` never matches). Normalize the path before globbing. 2. excludedProfiles from generateProfiles() were full path stems but the manifest filter compared them against profile member names. Use path.basename() to extract the name for comparison.
… test Register the sibling directory as a packageDirectory so the test exercises the actual globbing path (getUniquePackageDirectories → glob with ignore patterns) rather than relying on pattern matching against subdirectories.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
findAllProfilesbuilt glob ignore patterns that couldn't match./-prefixed directory paths fromsfdx-project.json(e.g.**/./src-access-management/**never matches anything). Fixed by normalizing paths before building the glob pattern.excludedProfilesreturned fromgenerateProfiles()were full file path stems (e.g./tmp/.../profiles/Admin) but the manifest filter compared them against profile member names (e.g.Admin). Fixed by extractingpath.basename()before comparison.Fixes #416
Work Item
@W-22149938@: Package version create with scopeProfiles: true includes profile names of other package directories in package.xml
Proof of Work
Test plan
sf package version createsucceeds withscopeProfiles: truewhen other package directories use./-prefixed pathspackage.xmlpackage.xmlmembers