-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat!: ga new tree commands #975
Conversation
This issue has been linked to a new work item: W-16113657 |
@@ -30,7 +30,7 @@ Directory in which to generate the JSON files; default is current directory. | |||
|
|||
- Export records retrieved with the specified SOQL query into a single JSON file in the current directory; the command uses your default org: | |||
|
|||
<%= config.bin %> <%= command.id %> --query "SELECT Id, Name, (SELECT Name, Address__c FROM Properties__r) FROM Broker__c" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump dev-scripts to avoid linting the .md files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aww, it's on current dev-scripts. I don't know why that's still happening. Maybe something in vscode ext?
}; | ||
|
||
public async run(): Promise<ImportResult[] | JsonMap> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we changing so much of these commands for the GA? shouldn't this PR just be changing command files/states/warnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the command that was src/commands/data/import/tree.ts
moved to src/commands/data/import/legacy/tree.ts
and the command that was src/commands/data/import/beta/tree.ts
moved here.
git doesn't know we swapped the files so it tries to diff this file
FYI, I created a separate PR with my messages updates. I thought I was gonna have more comments, which is why I separated it out, but it turned out to be rather small: #976 |
@@ -46,15 +47,19 @@ export default class Export extends SfCommand<DataPlanPart[] | SObjectTreeFileCo | |||
}; | |||
|
|||
public async run(): Promise<DataPlanPart[] | SObjectTreeFileContents> { | |||
this.info( | |||
'Try the the new "sf data export beta tree" command. It support SOQL queries with up to 5 levels of objects!' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they run the legacy command, you'll get a suggestion for a beta command, it should just b e"data export tree" right
➜ ../../oss/plugin-data/bin/run.js data export legacy tree --query "SELECT ID FROM Account"
Try the the new "sf data export beta tree" command. It support SOQL queries with up to 5 levels of objects!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even then,
➜ ../../oss/plugin-data/bin/run.js data export beta tree --query "SELECT ID FROM Account"
› Error: command data:export:beta:tree not found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just going to remove that. at this point, you're intentionally choosing this old command to avoid the new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, you found that I had the "beta" alias wrong on the new commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the beta deprecation is accurate, but there's no information on the legacy commands
➜ ../../oss/plugin-data/bin/run.js data export beta tree --query "SELECT ID FROM Account"
Warning: The "data export beta tree" command has been deprecated. Use "data export tree" instead.
wrote 1 records to Account.json
➜ dreamhouse-lwc git:(main) ✗ hub:(GLOBAL - DevHub) scratch:(test-enhclzordbdi@example.com)
➜ ../../oss/plugin-data/bin/run.js data export tree --query "SELECT ID FROM Account"
wrote 1 records to Account.json
➜ dreamhouse-lwc git:(main) ✗ hub:(GLOBAL - DevHub) scratch:(test-enhclzordbdi@example.com)
➜ ../../oss/plugin-data/bin/run.js data export legacy tree --query "SELECT ID FROM Account"
Wrote 1 records to Account.json
good catch...looks like we need both |
QA Notes✅ : warning on legacy 💡 : could improve, ok since it matches current behavior - I didn't have required information in the ➜ ../../oss/plugin-data/bin/run.js data import tree --files Account.json -o test-ddwy6vblev4p@example.com
Error (ERROR_HTTP_400): {"hasErrors":true,"results":[{"referenceId":"AccountRef1","errors":[{"statusCode":"REQUIRED_FIELD_MISSING","message":"Required fields are missing: [Name]","fields":["Name"]}]}]}
✅ : no note to try beta on standard command |
What does this PR do?
GA the new tree commands
See the plan at https://github.com/salesforcecli/plugin-data/blob/main/NewTreeCommandsPlan.md
unrelated
data resume
command was incorrectly marked deprecated, pointing people to use the oldforce:
command. 🤷🏻♂️why aren't there UT for the new commands?
What issues does this PR fix or reference?
forcedotcom/cli#2738
@W-16113657@