Skip to content

fix: scopeProfiles excludes profiles correctly with ./-prefixed paths @W-22149938@#887

Open
WillieRuemmele wants to merge 4 commits into
mainfrom
wr/fixScopeProfilesExcludeGlob
Open

fix: scopeProfiles excludes profiles correctly with ./-prefixed paths @W-22149938@#887
WillieRuemmele wants to merge 4 commits into
mainfrom
wr/fixScopeProfilesExcludeGlob

Conversation

@WillieRuemmele

Copy link
Copy Markdown
Member

Summary

  • Bug 1: findAllProfiles built glob ignore patterns that couldn't match ./-prefixed directory paths from sfdx-project.json (e.g. **/./src-access-management/** never matches anything). Fixed by normalizing paths before building the glob pattern.
  • Bug 2: excludedProfiles returned from generateProfiles() 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 extracting path.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

  • Tests: 41 passing (0 failing)
  • Lint: 0 errors (pre-existing warnings only)
  • Type check: clean
  • New test added for ./-prefixed path exclusion

Test plan

  • Verify sf package version create succeeds with scopeProfiles: true when other package directories use ./-prefixed paths
  • Verify profiles from excluded directories do not appear in the generated package.xml
  • Verify profiles that have no matching metadata nodes are correctly excluded from package.xml members

… @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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant