Fix #35: --nowait / --silent-progress on createsiteusers - #455
Draft
jacalata wants to merge 1 commit into
Draft
Conversation
…elease)
tabcmd Classic accepts --nowait and --silent-progress on createsiteusers;
tabcmd 2 was missing both flags. Adding them meaningfully requires more
than argparse: Classic sends the CSV as a single bulk-import job and
polls the server-side JobItem, while tabcmd 2 has been walking the CSV
row by row and calling users.add per user. With no server-side job to
poll, --nowait had nothing to skip.
This PR switches createsiteusers to server.users.bulk_add + a single
JobItem, and wires the two flags.
Behavior changes:
- Default: submit bulk_add, wait for the JobItem to complete via
server.jobs.wait_for_job, print a summary derived from the completed
job's status_notes (CountOfUsersAddedToSite / CountOfUsersSkipped /
CountOfUsersProcessed) plus any per-row error notes. Same shape as
Classic's default output.
- --nowait: submit bulk_add and return immediately. Job ID is printed
before return so callers can query it via a separate call.
- --silent-progress: still waits for the job, but suppresses the
status header, the queued-job line, and the per-row summary. Framework
logging (errors, debug) is unaffected.
- --complete / --no-complete: Classic used a ClientXML with_transaction
param that the REST endpoint doesn't expose, so we approximate with
client-side pre-flight validation:
- --complete (default): validate_file_for_import(strict=True), any
malformed row aborts the whole import before submission.
- --no-complete: validate leniently, submit whatever parses.
Doesn't cover server-side row failures mid-import; those fall through
to job.status_notes on the completed job.
Flag spelling: Classic uses --nowait (one word). The existing
set_no_wait_option helper defined --no-wait but had zero callers, so
switched the spelling to Classic's without a compatibility alias.
Depends on TSC >= (next release), which will ship JobItem.status_notes
(tableau/server-client-python#1852, merged). Draft while awaiting a
tagged TSC release + tabcmd's TSC pin bump.
Fixes #35.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
tabcmd Classic accepts
--nowaitand--silent-progressoncreatesiteusers; tabcmd 2 was missing both. Adding them meaningfully requires more than argparse: Classic sends the CSV as a single bulk-import job and polls the server-sideJobItem, while tabcmd 2 has been walking the CSV row by row and callingusers.addper user. With no server-side job to poll,--nowaithad nothing to skip.This PR switches
createsiteuserstoserver.users.bulk_add+ a singleJobItem, and wires the two flags.Behavior changes
bulk_add, wait for theJobItemto complete viaserver.jobs.wait_for_job, print a summary derived from the completed job'sstatus_notes(CountOfUsersAddedToSite/CountOfUsersSkipped/CountOfUsersProcessed) plus any per-row error notes. Same shape as Classic's default output.--nowait: submitbulk_addand return immediately. Job ID is printed before return so callers can query it separately.--silent-progress: still waits for the job, but suppresses the status header, the queued-job line, and the per-row summary. Framework logging (errors, debug) is unaffected.--complete/--no-complete: Classic used a ClientXMLwith_transactionparam the REST endpoint doesn't expose, so we approximate with client-side pre-flight validation. Under--complete(default) any malformed row aborts before submission; under--no-completewe validate leniently and submit whatever parses. Doesn't cover server-side row failures mid-import; those still fall through tojob.status_noteson the completed job.Flag spelling
Classic uses
--nowait(one word). The existingset_no_wait_optionhelper defined--no-waitbut had zero callers, so switched the spelling to Classic's without a compatibility alias.Depends on
tableauserverclient>= (next release), which will shipJobItem.status_notesfrom tableau/server-client-python#1852 (merged). Draft while awaiting a tagged TSC release + tabcmd's TSC pin bump.Test plan
--nowait,--silent-progress, both togetherbulk_add+wait_for_job;--nowaitskipswait_for_job;--silent-progressstill waits; both flags coexistCloses #35.
🤖 Generated with Claude Code