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

sfdx force\:package\:beta\:version\:create is breaking the sfdx-project.json file convention #1764

Closed
arafesthain opened this issue Oct 19, 2022 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@arafesthain
Copy link

arafesthain commented Oct 19, 2022

Summary

Using new package beta command & seeing bug (or at least undocumented breaking changes).

Steps To Reproduce:

  • Create a new unlock package version
  • See that the dependencies in the sfdx project.json is updated with a new format (not documented)

Expected result

image

package version:package version id

Actual result

image

There is now a subscriberPackageVersionId:[packageVersionId] format that is breaking our CI chain.

System Information

{
  "cliVersion": "sfdx-cli/7.172.0",
  "architecture": "linux-x64",
  "nodeVersion": "node-v16.17.1",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 1.3.3 (core)",
    "@oclif/plugin-commands 2.2.0 (core)",
    "@oclif/plugin-help 5.1.15 (core)",
    "@oclif/plugin-not-found 2.3.5 (core)",
    "@oclif/plugin-plugins 2.1.4 (core)",
    "@oclif/plugin-update 3.0.2 (core)",
    "@oclif/plugin-version 1.1.3 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.9 (core)",
    "@oclif/plugin-which 2.1.1 (core)",
    "alias 2.1.5 (core)",
    "apex 1.2.0 (core)",
    "auth 2.2.13 (core)",
    "community 2.0.3 (core)",
    "config 1.4.21 (core)",
    "custom-metadata 2.0.1 (core)",
    "data 2.1.4 (core)",
    "generator 2.0.5 (core)",
    "info 2.1.9 (core)",
    "limits 2.0.5 (core)",
    "org 2.2.7 (core)",
    "packaging 1.9.4 (core)",
    "schema 2.1.10 (core)",
    "signups 1.2.7 (core)",
    "source 2.0.17 (core)",
    "telemetry 2.0.2 (core)",
    "templates 55.1.0 (core)",
    "trust 2.1.0 (core)",
    "user 2.1.10 (core)",
    "@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)",
    "salesforce-alm [54](https://github.com/WorldlineSMI/sf-ps-arrow/actions/runs/3281841792/jobs/5404414163#step:5:55).8.1 (core)"
  ],
  "osVersion": "Linux 5.15.0-1020-azure",
  "shell": "unknown",
  "rootPath": "/home/runner/pnpm-global/5/node_modules/.pnpm/[email protected][72](https://github.com/WorldlineSMI/sf-ps-arrow/actions/runs/3281841792/jobs/5404414163#step:5:73).0/node_modules/sfdx-cli"
}
  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)
    bash
@arafesthain arafesthain added the investigating We're actively investigating this issue label Oct 19, 2022
@github-actions
Copy link

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.

@WillieRuemmele WillieRuemmele added the bug Issue or pull request that identifies or fixes a bug label Oct 19, 2022
@git2gus
Copy link

git2gus bot commented Oct 19, 2022

This issue has been linked to a new work item: W-11935313

@WillieRuemmele
Copy link
Member

hey @arafesthain I'm just trying to reproduce this now, and I'm failing to see this.
I'm using the dreamhouse-lwc project
I'm running
sfdx force:package:beta:create -t Unlocked -r force-app -v DevHub -n MyPkg
sfdx force:package:beta:version:create --package MyPkg -x

 ➜  sfdx force:package:beta:version:create:report -i 08c3i000000fyjLAAQ
=== Package Version Create Request

 Name                          Value                                                                             
 ───────────────────────────── ───────────────────────────────────────────────────────────────────────────────── 
 ID                            08c3i000000fyjLAAQ                                                                
 Status                        Success         

and I'm not seeing a dependencies section generated in the sfdx-project.json file. I'm seeing updates to the packageDirectories with the new package, and updates to the packageAliases like I would expect.

Can you provide some more specific steps to reproduce?

@mrichbb
Copy link

mrichbb commented Oct 31, 2022

@WillieRuemmele we are facing this issue as well with the new commands.

Did you ensure that the dreamhouse-lwc project has a dependency on another package before you create the package version?

Here is an illustration of what the file looks like before and after using the beta package version create command.

Before

{
    "packageDirectories": [
        {
            "path": "force-app",
            "default": true,
            "package": "DreamhouseLWC",
            "versionName": "Summer '22",
            "versionNumber": "55.0.0.NEXT",
            "dependencies": [
                {
                    "package": "[email protected]"
                }
            ]
        }
    ],
    "namespace": "",
    "sourceApiVersion": "55.0",
    "packageAliases": {
        "DreamhouseLWC": "0Ho3h000000PBghCAG",
        "[email protected]": "04t3h000004sq5YAAQ",
        "[email protected]": "04t3h000004bhxlAAA",
        "[email protected]": "04t3h000004mAlZAAU",
        "[email protected]": "04t3h000004mB2TAAU",
        "[email protected]": "04t3h000004mBEHAA2",
        "[email protected]": "04t3h00000XXXXXXXX"
    }
}

After

{
    "packageDirectories": [
        {
            "path": "force-app",
            "default": true,
            "package": "DreamhouseLWC",
            "versionName": "Summer '22",
            "versionNumber": "55.0.0.NEXT",
            "dependencies": [
                {
                    "subscriberPackageVersionId": "04t3h00000XXXXXXXX"
                }
            ]
        }
    ],
    "namespace": "",
    "sourceApiVersion": "55.0",
    "packageAliases": {
        "DreamhouseLWC": "0Ho3h000000PBghCAG",
        "[email protected]": "04t3h000004sq5YAAQ",
        "[email protected]": "04t3h000004bhxlAAA",
        "[email protected]": "04t3h000004mAlZAAU",
        "[email protected]": "04t3h000004mB2TAAU",
        "[email protected]": "04t3h000004mBEHAA2",
        "[email protected]": "04t3h00000XXXXXXXX",
        "[email protected]": "04t3h00000YYYYYYYY"
    }
}

Somewhat of a separate issue. After the version is created, the VS Code extensions also complain about the dependency missing a package name after the dependency section is re-written. Although referring to a dependency that way seems to be perfectly valid.

@WillieRuemmele
Copy link
Member

Thank you @mrichbb - I have a fix ready for review 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

4 participants