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

package version create command is not computing the profiles properly. #540

Closed
manisfdcsfdx opened this issue Aug 4, 2020 · 3 comments
Closed

Comments

@manisfdcsfdx
Copy link

Summary

package version create command is computing profiles from other package directory, not considering forceignore and which results in improper profiles

Steps To Reproduce:

  1. setup a project with multiple package and unpackage directory.
{
    "packageDirectories": [
        {
            "path": "src/access-management"
        },
        {
            "path": "src/utils",
            "package": "utils",
            "versionName": "Ver 1.0.0",
            "versionNumber": "1.0.0.NEXT",
            "default": false,
            "dependencies": []
        },
        {
            "path": "src/core",
            "package": "core",
            "versionName": "Ver 1.0.0",
            "versionNumber": "1.0.0.NEXT",
            "default": true,
            "dependencies": [
                {
                    "package": "utils",
                    "versionNumber": "1.0.0.LATEST"
                }
            ]
        }
    ],
    "namespace": "",
    "sfdcLoginUrl": "https://login.salesforce.com",
    "sourceApiVersion": "48.0",
    "packageAliases": {
        "utils": "0Ho...",
        "core": "0Ho..."
    }
}
  1. add relevant components and profiles into src/utils which supports utils source metadata

  2. add relevant components and profiles (same profiles from src/utils) into src/core which supports core source metadata

  3. add all the profiles (same profiles from src/utils and src/core) from sandbox to src/access-management ( placeholder for all the profiles to deploy which give permissions to managed package components as well as custom components )

  4. run package version create with -r | --preserve flag
    sfdx force:package:version:create -v devHub -f config\project-scratch-def.json -x -w 120 -r -p core

  5. preserved files location will be printed in terminal. open location and check md-files will have all the profiles from other package and unpackage if they have any reference to src/core components.

  6. md-files/profiles will have all the profiles which has reference to src/core but package.xml will have not have them.

Expected result

  1. package version command should only respect the profile inside package directory of requested package on creation
  2. If it is designed to work in this way to compute profiles in the entire project, then it should respect forceignore
  3. if profile compute is designed to not to respect forceignore then it should create proper profiles and package.xml in md-files. md-files/profiles has 12 profiles but package.xml has only 9 profile [this ignored the profile which we needed]

Actual result

md-files/profiles will have all the profiles which has reference to src/core but package.xml will have not have them.

Additional information

Feel free to attach a screenshot.
image
image

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.63.0-c897e8bb1a win32-x64 node-v10.20.1

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

sfdx-cli/7.63.0-c897e8bb1a win32-x64 node-v10.20.1

C:\Projects\worksafe\wsv-salesforce-advisory>sfdx plugins --core
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 3.0.0 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.9.1 (core)
dependencies-cli 2.0.1 (link) C:\Plugin\dependencies-cli
generator 1.1.2 (core)
salesforce-alm 48.10.0 (48.10.0)
salesforcedx 48.19.0 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
├─ salesforcedx-templates 48.18.0 (core)
└─ custom-metadata 1.0.1 (core)

sfdmu 3.5.0
sfdx-browserforce-plugin 1.7.0
sfdx-cli 7.63.0 (core)
sfpowerkit 2.0.17 (link) C:\Plugin\sfpowerkit
shane-sfdx-plugins 4.37.2

OS and version: Windows 10

@zchhaenngg
Copy link

I've had this problem, too.

@clairebianchi
Copy link
Contributor

@manisfdcsfdx I will pass this information onto the packaging team. They do not use Github for issues, therefore it is best to submit a customer case.

@balindersingh
Copy link

I am getting similar error even my package doesn't have any profile and there is no dependency package

`1) Can’t create package version. Removing metadata components from a second-generation managed package is a pilot feature that requires acceptance into a pilot program.

To join the Remove Metadata Components from 2GP pilot, file a case in the Salesforce Partner Community.

To create a package version without removing metadata components, restore the removed components and try creating the package version again. Add components {Profile=[Admin]} back into the package version, and create the package version again. `

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

No branches or pull requests

4 participants