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: add id on version create timeout #485

Merged
merged 3 commits into from
Jan 12, 2024
Merged

fix: add id on version create timeout #485

merged 3 commits into from
Jan 12, 2024

Conversation

iowillhoit
Copy link
Contributor

@iowillhoit iowillhoit commented Jan 11, 2024

Adds the request id to the error message when the package version create command times out. This Id can be used with sf package version create report -i THE_ID to look up the status of the version creation.

Added info to the error.message and also added the id as VersionCreateRequestId using setData on SfError. The key for this was derived from these docs

Sidenote: The applyErrorAction (source) does not appear to be working as expected. The action property is being stripped off when the error is thrown.

QA:

  • Pull branch
  • yarn compile
  • yarn link
  • cd to plugin-packaging
  • yarn link @salesforce/packaging
  • From an sf project with a Package run ../plugin-packaging/bin/run.js package version create --package Dreamhouse --wait 1 -x --code-coverage --version-description "Test version" --version-number 59.0.0.NEXT --json
    • Note the --wait 1, this should time out before finishing
  • Note the error message includes Run 'sf package version create report -i 08cKY00000001wQYAQ' to check the status."
  • Note that the json includes the ID under data.VersionCreateRequestId

Fixes forcedotcom/cli#2605
@W-14670120@

@shetzel
Copy link
Contributor

shetzel commented Jan 12, 2024

QA:
Created package versions that timed out. The ID was in both the messaging and JSON.

 ~/dev/salesforcecli/plugin-packaging/bin/run.js package version create -x -p 0Ho1Q000000k9mDSAQ -w 1 -v gs0
Version create.... Error
Error (1): The client has timed out. Run 'sf package version create report -i 08c1Q000000k9uRQAQ' to check the status.

~/dev/salesforcecli/plugin-packaging/bin/run.js package version create -x -p 0Ho1Q000000k9mDSAQ -w 1 -v gs0 --json
{
  "code": 1,
  "context": "PackageVersionCreateCommand",
  "commandName": "PackageVersionCreateCommand",
  "data": {
    "VersionCreateRequestId": "08c1Q000000k9uWQAQ"
  },
  "message": "The client has timed out. Run 'sf package version create report -i 08c1Q000000k9uWQAQ' to check the status.",
  "name": "PollingClientTimeout",
  "status": 1,
  "stack": "PollingClientTimeout: The client has timed out. Run 'sf package version create report -i 08c1Q000000k9uWQAQ' to check the status.\n    at PollingClient.subscribe (/Users/shetzel/dev/forcedotcom/packaging/node_modules/@salesforce/core/lib/status/pollingClient.js:91:19)\n    at async PackageVersion.pollCreateStatus (/Users/shetzel/dev/forcedotcom/packaging/lib/package/packageVersion.js:195:20)\n    at async PackageVersionCreateCommand.run (file:///Users/shetzel/dev/salesforcecli/plugin-packaging/lib/commands/package/version/create.js:205:24)\n    at async PackageVersionCreateCommand._run (/Users/shetzel/dev/salesforcecli/plugin-packaging/node_modules/@oclif/core/lib/command.js:304:22)\n    at async Config.runCommand (/Users/shetzel/dev/salesforcecli/plugin-packaging/node_modules/@oclif/core/lib/config/config.js:417:25)\n    at async run (/Users/shetzel/dev/salesforcecli/plugin-packaging/node_modules/@oclif/core/lib/main.js:85:16)\n    at async main (file:///Users/shetzel/dev/salesforcecli/plugin-packaging/bin/run.js:6:3)\n    at async file:///Users/shetzel/dev/salesforcecli/plugin-packaging/bin/run.js:9:1",
  "exitCode": 1,
  "warnings": []
}

@shetzel shetzel merged commit 11b920f into main Jan 12, 2024
10 checks passed
@shetzel shetzel deleted the ew/show-id-on-timeout branch January 12, 2024 17:32
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.

sf package version create output doesn't contain an ID to continue polling when --wait is hit
2 participants