Skip to content
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

fix: profiles are searched only within package directories #397

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Sep 21, 2023

During package version creation, profiles are only searched within package directories.

@W-13932401@
forcedotcom/cli#2336

});
// Look for profiles in all package directories
private findAllProfiles(excludedDirectories: string[] = []): string[] {
const pkgDirs = this.project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this would solve the problem completely. Imagine you have several packageDirectories A,B,C that contain profiles.

If you create a PV for A, this would be pulling in profiles from B,C, right?

Maybe this should still take a path to search in (the pkgDir corresponding to what's being packaged) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the screenshot on forcedotcom/cli#2336 it's that scenario

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, this is the desired behavior. To confirm, we'll need someone from the packaging team to review this.

@mshanemc
Copy link
Contributor

QA: used the https://github.com/mdapi-issues/mre-2gp-unrelated-profiles (always solid repros from @amtrack )

packageProfileApi logs

{"level":30,"time":1695315191755,"name":"sf:PackageProfileApi","msg":"The profile \"Dummy Profile\" from the \"/Users/shane.mclaughlin/eng/repros/mre-2gp-unrelated-profiles/force-app/main/default/profiles/Dummy Profile.profile-meta.xml\" directory was added to this package version."}
{"level":30,"time":1695315191755,"name":"sf:PackageProfileApi","msg":"The \"custom\" profile setting was removed from the \"Dummy Profile\" profile."}
{"level":30,"time":1695315191755,"name":"sf:PackageProfileApi","msg":"The \"userLicense\" profile setting was removed from the \"Dummy Profile\" profile."}
{"level":30,"time":1695315191755,"name":"sf:PackageProfileApi","msg":"The \"userPermissions\" profile setting was removed from the \"Dummy Profile\" profile."}

installed package in an empty scratch org, no obvious issues.

@mshanemc mshanemc merged commit be50af0 into main Sep 21, 2023
9 checks passed
@mshanemc mshanemc deleted the sh/pvc-scoped-profiles branch September 21, 2023 17:13
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.

2 participants