W-16971607 feat: multi-stage-output/new csv flags#1110
Conversation
| options: { | ||
| connection: (await Org.create({ aliasOrUsername: entry.username })).getConnection(), | ||
| }, | ||
| }; |
There was a problem hiding this comment.
simplified resolveResumeOptionsFromCache so that it matches data import/export's cache resolver.
The previous implementation had a few unused properties and one (undocumented?) functionality:
passing a job ID that didn't exist in the cache wouldn't cause an error, the resolver would return it as if it was found in the local cache.
Added code ƒor specific bulk commands using this to avoid breaking changes.
| * | ||
| * It will create the specified bulk ingest job, set up the oclif/MSO stages and return the job info. | ||
| * */ | ||
| // eslint-disable-next-line complexity |
There was a problem hiding this comment.
had to add this after adding the warning/deprecation/validation checks.
src/bulkIngest.ts
Outdated
|
|
||
| if (opts.verbose && !['delete', 'hardDelete', 'upsert'].includes(opts.operation)) { | ||
| throw new SfError( | ||
| 'Verbose mode is limited for `sf data delete/upsert bulk` for backwards-compat only and will be removed after March 2025.' |
| jobIdOrMostRecent: string | boolean; | ||
| jsonEnabled: boolean; | ||
| wait: Duration; | ||
| warnFn: (message: SfCommand.Warning) => void; |
There was a problem hiding this comment.
were you matching a pattern here? passing in a logFn/warnFn?
There was a problem hiding this comment.
yep:
Line 57 in 3f72588
to allow using command's this.log/warning methods here (need to wrap in arrow function for this scoping).
src/resumeBulkBaseCommand.ts
Outdated
| unit: 'minutes', | ||
| min: 0, | ||
| defaultValue: 0, | ||
| defaultValue: 5, |
There was a problem hiding this comment.
this will affect commands that don't currently pass --wait and that are expecting async behavior
There was a problem hiding this comment.
True, but given the current behavior I think it's a better (and non-breaking) experience.
This base class is only used by sf data upsert/delete resume, without a default wait time these resume commands would return exit code 0 and suggest to re-run them again even if the job didn't finish:
data update/import resume also have --wait=5 as default.
| // validation | ||
| if (opts.externalId && opts.operation !== 'upsert') { | ||
| throw new SfError('External ID is only required for `sf data upsert bulk.'); | ||
| } |
There was a problem hiding this comment.
inlined error msg b/c it's for devs only to avoid passing externalId when it's not needed.
| throw new SfError( | ||
| 'Verbose mode is limited for `sf data delete/upsert bulk` for backwards-compat only and will be removed after March 2025.' | ||
| ); | ||
| } |
There was a problem hiding this comment.
ditto, dev-only error to block --verbose on new bulk commands.
| columnDelimiter, | ||
| }).catch((err) => { | ||
| stages.stop('failed'); | ||
| throw err; |
There was a problem hiding this comment.
chained catch to set failed stage properly (and avoid passing stages to createIngestJob)
| 'Resuming a synchronous operation via `sf data upsert/delete resume` will not be supported after March 2025.' | ||
| ); | ||
| await opts.cache.createCacheEntryForRequest(job.id, ensureString(conn.getUsername()), conn.getApiVersion()); | ||
| } |
There was a problem hiding this comment.
src/resumeBulkBaseCommand.ts
Outdated
| unit: 'minutes', | ||
| min: 0, | ||
| defaultValue: 0, | ||
| defaultValue: 5, |
There was a problem hiding this comment.
True, but given the current behavior I think it's a better (and non-breaking) experience.
This base class is only used by sf data upsert/delete resume, without a default wait time these resume commands would return exit code 0 and suggest to re-run them again even if the job didn't finish:
data update/import resume also have --wait=5 as default.
| jobIdOrMostRecent: string | boolean; | ||
| jsonEnabled: boolean; | ||
| wait: Duration; | ||
| warnFn: (message: SfCommand.Warning) => void; |
There was a problem hiding this comment.
yep:
Line 57 in 3f72588
to allow using command's this.log/warning methods here (need to wrap in arrow function for this scoping).
QA Noteson a call with Cristian to verify everything |
|
@cristiand391 When importing a CSV file which has only 1 column it looks like the auto-detection of the column delimiter fails (and therefore also the import job):
I'm able to work around this by using Do you think there is a way to make this work without breaking anything? |
|
@amtrack thanks for reporting, fixed it ⬆️ (available in the nightly channel) |

What does this PR do?
--line-endingflag to bulk commands that take a CSV file as inputsf data delete/upsert bulkcommands to use MSOWhat issues does this PR fix or reference?
@W-16971607@
forcedotcom/cli#3061