Conversation
Sm/hierarchies
QA NOTES
QA POST-MERGE UPDATE (export and import)
|
|
I still have a few things to test. If it is helpful, there is the bash script I am using:
#!/bin/bash
# Create an Account
# - Create a Case related to Account
# - Create a Task related to Case
# - Create an Opportunity related to Account
# - Create a Task related to Opportunity
QUERIES=(
# "SELECT Id, Name, (SELECT Name, Address__c FROM Properties__r), (SELECT FirstName) FROM Broker__c"
# "SELECT Id, Name, (SELECT Id, CaseNumber, (SELECT Id, Subject FROM Tasks) FROM Cases) FROM Account"
# "SELECT Id, Name, (SELECT Id, Name, StageName, CloseDate, (SELECT Id, Subject FROM Tasks) FROM Opportunities), (SELECT Id, CaseNumber, (SELECT Id, Subject FROM Tasks) FROM Cases) FROM Account"
"SELECT Id, Name, (SELECT Id, Name, StageName, CloseDate, (SELECT Id, Subject FROM Tasks) FROM Opportunities), (SELECT Id, Subject, Status, (SELECT Id, Subject FROM Tasks) FROM Cases) FROM Account"
# "SELECT Id, Name, (SELECT Id, Origin, (SELECT Id FROM Tasks), (SELECT Id, ActivityDateTime, DurationInMinutes FROM Events) FROM Cases) FROM Account"
# "SELECT Id, (SELECT Id FROM Tasks), (SELECT Id FROM Events) FROM Case"
# "SELECT Id, Name, Phone, Website, NumberOfEmployees, Industry, (SELECT Lastname, Title, Email FROM Contacts) FROM Account WHERE Name LIKE 'SampleAccount%'"
# "SELECT Id, Name, (SELECT Id, Origin, (SELECT Id FROM Tasks), (SELECT Id, ActivityDateTime, DurationInMinutes FROM Events) FROM Cases) FROM Account"
)
PACKAGE_NAME=$(cat package.json | jq -r '.name')
# if name is not dreamhouse-lwc, then echo warning and exit
if [ "$PACKAGE_NAME" != "dreamhouse-lwc" ]; then
echo "This script should be ran from the root of a Dreamhouse project"
exit 0
fi
DATA_BETA_DIR="/Users/ewillhoit/dev/plugin-data"
DREAMOUSE_DIR=$(pwd)
TIME=$(date +%s)
INDEX=0
for QUERY in "${QUERIES[@]}"
do
TEST_DIR="$DREAMOUSE_DIR/data-export/$TIME/$INDEX"
INDEX=$((INDEX+1))
mkdir -p "$TEST_DIR"
echo "$QUERY" > "$TEST_DIR/query.txt"
echo "Running query: $QUERY"
# echo "SF command"
# sf data tree export -q "$QUERY" -d "$TEST_DIR" --plan --json 2>&1 | tee "$TEST_DIR/export-output.json"
# git -C "$TEST_DIR" init
# git -C "$TEST_DIR" add -A
# git -C "$TEST_DIR" commit -m "sf command" --no-gpg-sign
echo "Beta export command"
# With --plan
$DATA_BETA_DIR/bin/run.js data tree beta export -q "$QUERY" -d "$TEST_DIR" --plan --json 2>&1 | tee "$TEST_DIR/export-output.json"
# Without --plan
# $DATA_BETA_DIR/bin/run.js data tree beta export -q "$QUERY" -d "$TEST_DIR" --json 2>&1 | tee "$TEST_DIR/export-output.json"
# git -C "$TEST_DIR" diff
echo "Beta export command"
# With --plan
JSON=$($DATA_BETA_DIR/bin/run.js data import beta tree --plan "$(ls $TEST_DIR/*-plan.json)" --json)
# Without --plan
# JSON=$($DATA_BETA_DIR/bin/run.js data import beta tree --files "$(ls $TEST_DIR/Account*.json)" --json)
echo $JSON | jq '.'
echo $JSON > "$TEST_DIR/import-output.json"
echo -n "Number or records: "
echo $JSON | jq '.result | length'
done
|
That's the API's limit. The |
|
Ah, I see that now. That warning message was lost in all the json output |
QA UPDATE
|
| - 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" | ||
| <%= 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.
Do a quick scan for incorrect formatting like these
There was a problem hiding this comment.
This is a formatter issue, it is escaping the underscores
|
|
||
| # flags.files.summary | ||
|
|
||
| Comma-separated and in-order JSON files that contain the records, in sObject tree format, that you want to insert. |
There was a problem hiding this comment.
Haven't we been suggesting passing the flag multiple times with arrayWithDeprecation instead of separated values?
QA UPDATE
|
QA UPDATE
|
Edit the command plan
…lugin-data into sm/soql-5-levels
|
I am unable to reproduce large record error I was seeing a few days ago. I am now getting past 1536 records (to 3072) and on the next run a get a |
What does this PR do?
Phase 1: Beta
data import beta treeanddata export beta treeBreaking changes between existing and beta
import betaremoves its hidden, deprecatedcontent-type. Only json files are supported. Usage: ~5 per year.import betaremoves the--config-helpflag. The schema stuff is in the command help. Usage: ~1 per week.Other differences
export --planwrites Object names as the file name. It used to append anson the end. So the filename is nowAccount.jsonandFoo__c.jsoninstead ofAccounts.jsonand the awfulFoo__cs.jsonexport betano longer writes empty child objects. Previously, you'd see properties with{records: []}that had no effect on imports.import betawith--plandoes not care aboutresolveRefsandsaveRefsimport betawith--plandoes not care about the order of files in yourplanfile. It'll defer unresolved references until they're resolved.export betanow handles more than 2 levels of child objects in a query using--plan(up to 5, that's the SOQL limit)export betaandimport betahandle objects that refer to objects of the same type (ex: Account with ParentId, User with Manager)import betausing--planhandles more than 200 records. It will batch them into groups of 200 per object. The new record limit is not documented--it most likely comes from your OS call stack depth or other org limits (data storage, api call limits)importsupported plan files where thefilesproperty could contain objects. I'm really not sure how those files were generated, but I don't think the export command made them. Forimport betaonly work with strings and will throw an error otherwise.import betain--filesmode (not--plan) will import the files in parallel (files can't reference each other without--plan)importprovides deprecation warnings for bothcontent-typeandconfig-helpflagsExport files created by
export betaare compatible withimportandimport betaPhase 2: GA the new commands, put the old under
legacy. [July 10 2024]legacyand mark themhiddenanddeprecatedwith the Phase 3 dateforce:aliases to the new commandsbetabut have thebetaalias. adddeprecateAliasesso people stop using thebetathing.exportwith--jsonto warn that it will change json output (stop returning the saveRefs/resolveRefs) after Phase 3 datePhase 3: retire the legacy commands and all their dependent code [Nov 10 2024]
exportstop writing the unusedsaveRefsandresolveRefsproperties on plan files, and stop returning them in jsonobjectpart offiles, and removesaveRefsandresolveRefsbetaalias fromimport|exportchanges
What issues does this PR fix or reference?
forcedotcom/cli#2663
@W-14876905@
@W-14980455@
forcedotcom/cli#248
QA notes
the query provided in the repro will get data and create files, but they aren't
importable because of required fields on Events. This query will let you round trip it