generated from salesforcecli/lerna-template
-
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: beta tree exports/import #810
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
4cd7ba1
refactor: handling for future cache undefined changes
mshanemc 577bf1c
fix: type improvements around url prop
mshanemc 62bdf57
feat: 5 levels of sobjects for data export
mshanemc efc3a16
Merge remote-tracking branch 'origin/main' into sm/soql-5-levels
mshanemc 6eabec8
test: ut for most of the functions
mshanemc 80eb242
chore: snapshot
mshanemc 700fc1b
feat: more than 200 records, self-referencing records
mshanemc 942bb6d
chore: dead code cleanup
mshanemc b5af082
chore: ts-pruning
mshanemc d083e28
chore: remove duplicate aliases from beta command
mshanemc 683702b
chore: remove duplicate aliases from beta command
mshanemc 85c257f
style: note about aliases
mshanemc 76ef8ea
test: regex g fix and snapshot
mshanemc 23476cb
refactor: move ads to correct command
mshanemc b8ac8ca
refactor: logger from higher level, reorganize common imports
mshanemc 356ce1c
docs: transition plan
mshanemc e45909a
test: ut for functions, refactoring and flag deprecations
mshanemc 0993ecf
refactor: common function for response.hasErrors check
mshanemc e90b092
style: comment cleanup
mshanemc c68aa69
test: nuts that might be working, can't tell without scratch org sign…
mshanemc c88b75f
Merge branch 'sm/soql-5-levels' into sm/hierarchies
mshanemc 41fe339
fix: apply prefix to plan file
mshanemc f567868
test: nuts for beta import/export
mshanemc 0985f74
Merge pull request #821 from salesforcecli/sm/hierarchies
mshanemc 260c530
docs: eric's idea about pinned issue
mshanemc 41cabab
feat: order doesn't matter in plan files
mshanemc c7814af
test: nut for out-of-order-files with shared-child
mshanemc dcd7eaa
docs: order-doesn't-matter as a feature
mshanemc 60ef9b5
refactor: logger instead of comments
mshanemc e81ea06
feat: recursion break for unresolvable refs, plus a nice error and NUTs
mshanemc 74df975
refactor: hashing instead of stringify in fingerprints, nuts for both…
mshanemc 38bcc9d
refactor: prefix validation
mshanemc 14823e0
feat: export lots of records
mshanemc 7a37434
edit command plan
jshackell-sfdc 9a9a5ac
feat: validates that --files don't contain refs
mshanemc f70004b
style: header/formatting
mshanemc c7aeb73
refactor: consolidate to 1 definition of ref
mshanemc 5fe73db
Update NewTreeCommandsPlan.md
jshackell-sfdc e1ed038
Update NewTreeCommandsPlan.md
jshackell-sfdc 2a5041f
Merge pull request #822 from salesforcecli/jshackell-edit
mshanemc 7dbeec6
Merge branch 'sm/soql-5-levels' of https://github.com/salesforcecli/p…
mshanemc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# New Data Tree Commands Plan | ||
|
||
We're improving the `data export tree` and `data import tree` commands, but doing it in phases. | ||
|
||
## Phase 1: Beta the new commands. [Now] | ||
|
||
Our plan: | ||
|
||
1. Introduce the new `data import beta tree` and `data export beta tree` commands. | ||
1. Both commands use the new helper functions. | ||
1. Update the existing commands' output with a message that encourages users to try the new commands. | ||
1. Ensure that export files created by `data export beta tree` are compatible with both `data import tree` and `data import beta tree`. | ||
|
||
These are the breaking changes between the existing and beta commands: | ||
|
||
- `data import beta tree`: We removed the hidden and deprecated `--content-type` flag. The command supports only JSON files. Usage of the flag: ~5 per year. | ||
- `data import beta tree`: We removed the `--config-help` flag because the schema information is in the command help. Usage of the flag: ~1 per week. | ||
|
||
Other differences: | ||
|
||
- `data export tree --plan` uses the object names as the new file name. Previously it appended an `s` on the end, but the new one doesn't. So the filename is now `Account.json` and `Foo__c.json` instead of `Accounts.json` and the awful `Foo__cs.json`. | ||
- `data export beta tree` no longer writes empty child objects. Previously, you saw properties with `{records: []}` that had no effect when imported. | ||
- `data import beta tree --plan` doesn't care about `resolveRefs` and `saveRefs`. | ||
- `data import beta tree --plan` doesn't care about the order of files in your `plan` file. Rather, it defers unresolved references until they're resolved. | ||
- `data export beta tree --plan` now handles more than 2 levels of child objects in a query. It can handle up to 5 levels, which is the SOQL limit. | ||
- Both `data export beta tree` and `data import beta tree` handle objects that refer to objects of the same type. For example, an Account with ParentId that's an Account or a User with Manager that's a User. | ||
- `data import beta tree --plan` handles more than 200 records. It batches them into groups of 200 per object. The new record limit isn't documented; it most likely comes from your operating system call stack depth or other org limits, such as data storage or api call limits. | ||
- `data import tree` supported plan files where the `files` property could contain objects. It's unclear how those files were generated, but probably not from the `data export tree` command. The new `data import beta tree` command works only with strings and throws an error otherwise. | ||
- `data import beta tree --files` (and not `--plan`) imports the files in parallel. Files can only reference each other if you specify `--plan`. | ||
- `data import tree` outputs deprecation warnings for both `--content-type` and `--config-help` flags. | ||
|
||
## Phase 2: GA the new commands, put the old ones under the `legacy` sub-topic. [July 10, 2024] | ||
|
||
Our plan: | ||
|
||
1. Pin an issue when the change goes into the release candidate so if users run into problems they can quickly find the `legacy` commands. | ||
1. Move the "old" commands to `legacy` and mark them `hidden` and `deprecated` with the Phase 3 date. | ||
1. Move the `force:` aliases to the new commands. | ||
1. Remove the `beta` sub-topic from the new commands, but keep the `beta` alias so they will still work. Add the `deprecateAliases` property to encourage users to stop using the commands in the `beta` sub-topic. | ||
1. Update `data export tree --plan` to display a warning that the JSON output is going to change after the Phase 3 date. Specifically, the JSON output won't include `saveRefs` and `resolveRefs` information. | ||
|
||
## Phase 3: Retire the `legacy` commands and all their dependent code. [Nov 10 2024] | ||
|
||
Our plan: | ||
|
||
1. Update `data export tree --plan` to stop writing the unused `saveRefs` and `resolveRefs` properties on plan files, and stop returning them in JSON output. | ||
1. Tighten the schema to remove the `object` part of `files`, and remove `saveRefs` and `resolveRefs`. | ||
1. Check messages for any that aren't being used, then remove them. | ||
1. Remove the `beta` alias from `data import tree` and `data export tree`. | ||
1. Update the pinned issue to reflect these changes. | ||
|
||
## How Does This Beta->Legacy Thing Work? | ||
|
||
Salesforce CLI uses `beta` and `legacy` subtopics to safely introduce beta versions of existing commands and then GA them. This approach allows you to try out the beta, while continuing to use the existing command at the same time. Let's look at an example to see how this works. | ||
|
||
- We create and release the `data export beta tree` command, which is similar to the existing `data export tree` command, but with improvements and possibly breaking changes. The two separate commands co-exist, which means if you run `sf commands`, you see both the existing and `beta` command. | ||
- After the beta period is over, we GA the changes by moving the functionality we added to `data export beta tree` to the "official" `data export tree` command. We also move the functionality in the _old_ `data export tree` to a new command called `data export legacy tree`. We hide and deprecate both the `legacy` and `beta` versions of the command, but alias the `beta` version to the `data export tree` command because they're now the same. If you run `sf commands` you see only the `data export tree` command, although the `legacy` version is still available (but hidden) if you really need it. | ||
- At some point, we remove the `data export legacy tree` command; we'll warn you, don't worry. We also remove the `beta` alias. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do a quick scan for incorrect formatting like these
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.
huh?
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.
This is a formatter issue, it is escaping the underscores