-
Notifications
You must be signed in to change notification settings - Fork 78
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
sf package version create use profiles not only from path #2336
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
@olektymchenko Is this the same issue as described in #620? |
@amtrack |
We are experiencing the same issue with profiles that do not even belong to the package getting included in the package. |
Also observing the issue with profiles being pulled into packages. @salesforce/cli/2.2.7 darwin-arm64 node-v18.16.1 |
Is there an update for this please? |
Please... |
Same issue experienced here - is there an update or workaround? |
It's been a week with no updates, we are blocked at this time. Can you at least provide a temporary workaround? |
I know this will be an unpopular response, but the behavior for packaging commands is owned by a team who does not monitor this issues repo. If you are blocked by this I highly recommend contacting customer support so they can open a support case for that team, which is how they respond to issues like this. As a workaround, there may be something from #620 that can help. |
As a workaround we had to create a script that changes the format of every "profile" file from ".profile-meta.xml" to be a ".txt" file before the command |
@ecampamavens - is the package version created successfully if you add those profiles to your |
@ecampamavens and @shetzel -- I believe this is expected behavior. The behavior of the package version creation is to take all metadata specified in the This behavior was a surprise to many folks when we first saw it a couple of years ago. Here is a post from Dileep Burki, Salesforce Product Manager for Packaging, on the "Unlocked Packages" group; specifically look for Dileep's comment on the thread from Feb 28, 2019, 4:14 PM EST -- the 3rd bullet point. In that section, Dileep says the following:
As @amtrack mentioned above, there have also been similar issues raised about this behavior (#540 and #620). The only effective workarounds that I have found are one of the following:
The second option is where most of my teams stay. In our case, we are working with clients that already have well established orgs and user profiles. Since we are adding new "apps" to existing orgs via our packages, our "apps/packages" should not "own" the profile metadata and it should be managed elsewhere by the client. That may not fit everyone's scenario but it does give insight into the thought process that we have using. For what it is worth, here is an idea that is worth upvoting that is related to this question. I hope this helps. |
@ImJohnMDaniel I wonder how this "started" to be an issue as of a week ago for us when we have been creating package version with the same project structure for over 2 years. I am testing a package version creation using the ".forceignore" suggestion from @shetzel. I will update you once complete. |
Yeah, I got nothing for you on that question. I just remember the issue from a couple of years ago. |
@ecampamavens - are you saying that without any changes to the metadata in the project you can no longer run the same command used for the past 2 years? If that's the case, then it's possible a change to the packaging plugin (or more likely the packaging library it depends on) has changed behavior. If you run |
@shetzel update on packaging issue, I tried building the same package with the |
@olektymchenko, @shetzel and @ImJohnMDaniel I switched to version |
This issue has been linked to a new work item: W-13932401 |
@amtrack @ecampamavens @calvinle1 |
@olektymchenko aren't you the author? Unfortunately I cannot provide a repo since we are IP protected, I do confirm that for the |
This issue is related to the issues I've been experiencing with sfdx-scanner. I was able to give a team member a copy of my package.json and yarn.lock files from my plugin install directory and they were able to create packages with the latest version of this library. In the meantime @shetzel we are able to consistently reproduce this by running packaging commands in the salesforce/cli:latest docker containers |
@olektymchenko Can you please add "includeProfileUserLicenses": true in your sfdx-project.json file and try to re-create the package version |
@olektymchenko @shetzel There is not necessarily a user-facing error message. Here is a repo with detailed instructions for reproduction: https://github.com/mdapi-issues/mre-2gp-unrelated-profiles. I can still confirm this issue with the following sf version and
|
@shetzel It looks like this is also reproducible if you locally install an npm package in your project that contains a profile, which is commonly used in packages for tests. Git worktrees can also cause this to fail if you have a worktree that still contains profiles. |
@amtrack @ethan-sargent - thanks for the repros and extra info. I have a fix about ready to go in for this. |
A fix to the More news: a new property on "packageDirectories" in sfdx-project.json is coming soon (possibly next week) that will further scope Profile searching to only the directory being packaged. |
Problem still visible here because I have an Admin.profile in another folder than the packaged one :( Had to remove the profile that was used in scratch orgs ! :( |
@nvuillam I believe we have to remove any folders from the sfdx-project.json file. If a profile exists within a folder that is named in the sfdx-project.json file, then the script will grab it. I removed these folders from the file and it works fine now. |
I used the workaround, but is has no sense to browse files that are outside of the folder corresponding to the package we want to generate 😩 |
@ecampamavens as @shetzel mentioned, you can use the workaround Of course, it's a weird built-in behavior that maybe made sense some time ago. |
Summary
sf package version create use component not only from specified path
Steps To Reproduce
I have this folders structure and only "core-package" should be packaged
core-package
unlocked-package
internal-components (which I don't want to package at all)
The following commands were executed
sf package create --name "AAA_Test" --package-type Managed --path "aaa-core" --description "AAA Test Package Description" --target-dev-hub AAA_Prod
sf package version create --package "AAA_Test" --definition-file config/project-scratch-def.json --wait 20 --installation-key-bypass --code-coverage --target-dev-hub AAA_Prod
Expected result
Package is created
Actual result
Creation fails because sf is trying to package components not from path specified during package creation
System Information
powershell 5
{
"cliVersion": "@salesforce/cli/2.1.7",
"architecture": "win32-x64",
"nodeVersion": "node-v18.15.0",
"osVersion": "Windows_NT 10.0.19044",
"shell": "cmd.exe",
"rootPath": "C:\Users\sssssssss\AppData\Local\sf\client\2.1.7-355d833",
"pluginVersions": [
"@oclif/plugin-autocomplete 2.3.2 (core)",
"@oclif/plugin-commands 2.2.18 (core)",
"@oclif/plugin-help 5.2.13 (core)",
"@oclif/plugin-not-found 2.3.31 (core)",
"@oclif/plugin-plugins 3.1.6 (core)",
"@oclif/plugin-search 0.0.20 (core)",
"@oclif/plugin-update 3.1.26 (core)",
"@oclif/plugin-version 1.3.7 (core)",
"@oclif/plugin-warn-if-update-available 2.0.43 (core)",
"@oclif/plugin-which 2.2.25 (core)",
"@salesforce/cli 2.1.7 (core)",
"apex 2.3.6 (core)",
"auth 2.8.9 (core)",
"data 2.5.1 (core)",
"deploy-retrieve 1.16.0 (core)",
"info 2.6.31 (core)",
"limits 2.3.26 (core)",
"login 1.2.20 (core)",
"org 2.9.25 (core)",
"packaging 1.21.1 (user)",
"schema 2.3.20 (core)",
"settings 1.4.20 (core)",
"sobject 0.1.37 (core)",
"source 2.10.25 (core)",
"telemetry 2.2.3 (core)",
"templates 55.5.5 (core)",
"trust 2.4.32 (core)",
"user 2.3.24 (core)",
"@salesforce/sfdx-scanner 3.14.0 (user)",
"sfdx-git-delta 5.24.1 (user)"
]
}
The text was updated successfully, but these errors were encountered: