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: adds target-org and wait support to deploy report command #758

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Sep 19, 2023

What does this PR do?

Adds an optional --target-org and --wait flag to the project deploy report command. This allows checking and polling for a deploy status of a targeted org without the need for cached deploy data.

What issues does this PR fix or reference?

@W-14053314@
forcedotcom/cli#2300

QA:
do an async deploy, then:

  1. project deploy report --job-id {async deploy ID}
  2. project deploy report --job-id {async deploy ID} --target-org {non-default org}
  3. project deploy report --job-id {async deploy ID} --target-org {non-default org} --wait 10
  4. delete deploy-cache.json, then project deploy report --job-id {async deploy ID} --target-org {non-default org} --wait 10
  5. force a timeout by doing a large deploy with a short wait time on the report command. Ensure the command returns the status and not a timeout error, but it should display that the command timed out.

src/commands/project/deploy/report.ts Outdated Show resolved Hide resolved
src/commands/project/deploy/report.ts Show resolved Hide resolved
src/commands/project/deploy/report.ts Show resolved Hide resolved
@mshanemc
Copy link
Contributor

QA notes:

convert dreamhouse to mdapi and deploy with --async
[this would have a project and be in the cache]
../../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBJ8SAO looks right (gives the summary of the deploy status).
💡 I think the type of people who are using this nomadically will want a way to get the full details (test output, deployed files, etc). --json does give them that. A --verbose option might be desired, too. We could wait and see if people ask for it, though.
👎🏻 it's showing the deployOptions which looks weird for the Duration object:
| wait Duration { quantity: 50, unit: 0 }

../../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBJ8SAO --json looks right (gives the full deploy details)

seems to work fine with --wait 50 etc.


same commands, but one level up in the hierarchy (outside the project, but where an existing ID is found)
/../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBJ8SAO and --json look the same


for either flavor (report from inside project or not) this is the error with an org specified that isn't the right org

👎🏻 ../../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBJ8SAO --wait 50 -o hub =>
Error (1): INVALID_CROSS_REFERENCE_KEY: invalid cross reference id. Here, I think we could give something better (ex: "that deploy Id <0Af8N00000rMBJ8SAO> was not found in that org."

✅ works with mdapi deployment without a project (with job Id specified)
✅ works with mdapi deployment without a project --use-most-recent

[deletes cache]
✅ ../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBOISA4 --wait 50 -o [email protected]

[start a whole bunch of deploys so that the latter ones go into pending]
../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000rMBh0SAG --wait 50 -o [email protected] waits for results until they're ready!

@mshanemc
Copy link
Contributor

../../plugin-deploy-retrieve/bin/dev project:deploy:report --job-id 0Af8N00000roJ63SAE
../../plugin-deploy-retrieve/bin/dev project:deploy:start --async

results in
| wait undefined minutes

Here's a PR to make 0 the default (to avoid issues handling undefined)

#763

@shetzel shetzel merged commit 2c7f74e into main Sep 27, 2023
35 checks passed
@shetzel shetzel deleted the sh/nomadic-deploy branch September 27, 2023 03:00
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.

2 participants