Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Conversation

ruslan-kurchenko
Copy link
Contributor

@ruslan-kurchenko ruslan-kurchenko commented Jul 24, 2023

Summary generated by Reviewpad on 07 Aug 23 05:10 UTC

This pull request fixes the installation of packages using the v58.0 PackageInstallRequest parameters. It updates the securitytype flag options to ['Custom', 'Full', 'None'] and the default value to 'Full'. It also updates the upgradetype flag options to ['delete-only', 'deprecate-only', 'mixed-mode'] and the default value to 'mixed-mode'.

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_packageinstallrequest.htm

Checklist

All items have to be completed before a PR is merged

  • Adhere to Contribution Guidelines
  • Updates to Decision Records considered?
  • Updates to documentation at DX@Scale Guide considered?
  • Tested changes?
  • Unit Tests new and existing passing locally?

@reviewpad
Copy link

reviewpad bot commented Jul 24, 2023

Thank you @ruslan-kurchenko for this first contribution!

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Jul 24, 2023
@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (bdd20d1) 46.92% compared to head (0ac25d1) 46.92%.

❗ Current head 0ac25d1 differs from pull request most recent head 5ba8df3. Consider uploading reports for the commit 5ba8df3 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1370   +/-   ##
=======================================
  Coverage   46.92%   46.92%           
=======================================
  Files          70       70           
  Lines        2653     2653           
  Branches      309      309           
=======================================
  Hits         1245     1245           
  Misses       1379     1379           
  Partials       29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@azlam-abdulsalam
Copy link
Contributor

@ruslan-kurchenko Does this have any dependency on updated packaging lib? As we do not use the cli, we need to check the compatibility

@ruslan-kurchenko
Copy link
Contributor Author

It is based on jsforce dependency.

Actual exception info:
Screenshot 2023-07-25 at 07 50 37

Stack:

INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST: 
  Security Type: bad value for restricted picklist field: AdminsOnly\n    
    at HttpApi.getError (/usr/local/lib/node_modules/@dxatscale/sfpowerscripts/node_modules/jsforce/lib/http-api.js:307:12)\n    
    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    
    at async /usr/local/lib/node_modules/@dxatscale/sfpowerscripts/node_modules/jsforce/lib/http-api.js:154:23\n    
    at async Tooling.create (/usr/local/lib/node_modules/@dxatscale/sfpowerscripts/node_modules/jsforce/lib/connection.js:929:133)\n    
    at async createPackageInstallRequest (/usr/local/lib/node_modules/@dxatscale/sfpowerscripts/node_modules/@salesforce/packaging/lib/package/packageInstall.js:50:20)\n    
    at async SubscriberPackageVersion.install (/usr/local/lib/node_modules/@dxatscale/sfpowerscripts/node_modules/@salesforce/packaging/lib/package/subscriberPackageVersion.js:326:46)

jsforce place where it fails:
Screenshot 2023-07-25 at 07 51 36

@azlam-abdulsalam, let me know if there is anything else I should do or if I should make it somehow backward compatible.

@azlam-abdulsalam
Copy link
Contributor

no @ruslan-kurchenko just wondering why we dont have the same error in the orchestrator, is it wired differently?

@ruslan-kurchenko
Copy link
Contributor Author

Good call, @azlam-abdulsalam. It might use different API version to create the PackageInstallRequest record. I will investigate more.

…tible-with-latest-packageinstallrequest-tooling-sobject
@reviewpad
Copy link

reviewpad bot commented Aug 7, 2023

Reviewpad Report

‼️ Errors

  • Unconventional commit detected: 'Merge branch 'main' into 1369-sfp-packageunlockedinstall-is-not-compatible-with-latest-packageinstallrequest-tooling-sobject' (5ba8df3)

⚠️ Warnings

  • Please rebase your pull request on the latest changes

@azlam-abdulsalam
Copy link
Contributor

@ruslan-kurchenko any updates on this?

@rody
Copy link
Contributor

rody commented Aug 9, 2023

The latest sf cli (@salesforce/cli/2.2.7 darwin-arm64 node-v20.5.0) seems to be using the "old" parameters (I have not dug deeper in the library code).

-s, --security-type=<option>    [default: AdminsOnly] Security access type for the installed package. (deprecation notice: The default --security-type value will change from AllUsers to AdminsOnly in v47.0 or later.)
                                  <options: AllUsers|AdminsOnly>
  -t, --upgrade-type=<option>     [default: Mixed] Upgrade type for the package installation; available only for unlocked packages.

Is it a change only on v58 of the API?

@ruslan-kurchenko
Copy link
Contributor Author

@azlam-abdulsalam In orchestrator default values used: security type == 'none', upgrade type = 'mixed-mode'

Screenshot 2023-08-24 at 18 51 28 Screenshot 2023-08-24 at 18 51 17

I believe the changes in the MR are correct.

Copy link
Contributor

@azlam-abdulsalam azlam-abdulsalam left a comment

Choose a reason for hiding this comment

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

okie

Copy link
Contributor

@azlam-abdulsalam azlam-abdulsalam left a comment

Choose a reason for hiding this comment

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

okie

@azlam-abdulsalam azlam-abdulsalam merged commit e0c728a into main Sep 3, 2023
@azlam-abdulsalam azlam-abdulsalam deleted the 1369-sfp-packageunlockedinstall-is-not-compatible-with-latest-packageinstallrequest-tooling-sobject branch September 3, 2023 22:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sfp package:unlocked:install is not compatible with latest PackageInstallRequest Tooling sObject
3 participants