Skip to content

Fix #35: --nowait / --silent-progress on createsiteusers - #455

Draft
jacalata wants to merge 1 commit into
developmentfrom
jac/35-createsiteusers-nowait
Draft

Fix #35: --nowait / --silent-progress on createsiteusers#455
jacalata wants to merge 1 commit into
developmentfrom
jac/35-createsiteusers-nowait

Conversation

@jacalata

@jacalata jacalata commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

tabcmd Classic accepts --nowait and --silent-progress on createsiteusers; 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-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 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 ClientXML with_transaction param 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-complete we validate leniently and submit whatever parses. Doesn't cover server-side row failures mid-import; those still 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.

⚠️ Draft: depends on TSC release

Depends on tableauserverclient >= (next release), which will ship JobItem.status_notes from tableau/server-client-python#1852 (merged). Draft while awaiting a tagged TSC release + tabcmd's TSC pin bump.

Test plan

  • 3 new parser tests: --nowait, --silent-progress, both together
  • 4 new behavior tests: default calls bulk_add+wait_for_job; --nowait skips wait_for_job; --silent-progress still waits; both flags coexist
  • Full unit-test suite: 344 passed, 2 skipped
  • Live-fire against Tableau Cloud (post-TSC-release)

Closes #35.

🤖 Generated with Claude Code

…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.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
tabcmd
   __main__.py121212 0%
   _version.py111111 0%
   tabcmd.py151515 0%
   version.py955 44%
tabcmd/commands
   commands.py101010 0%
   constants.py771818 77%
   server.py1351818 87%
tabcmd/commands/auth
   session.py3945050 87%
tabcmd/commands/datasources_and_workbooks
   datasources_and_workbooks_command.py1571818 89%
   datasources_workbooks_views_url_parser.py14255 96%
   delete_command.py601616 73%
   export_command.py1202525 79%
   get_url_command.py1274747 63%
   publish_command.py1232828 77%
   runschedule_command.py2177 67%
tabcmd/commands/extracts
   create_extracts_command.py4288 81%
   decrypt_extracts_command.py2722 93%
   delete_extracts_command.py3766 84%
   encrypt_extracts_command.py2722 93%
   extracts.py2022 90%
   reencrypt_extracts_command.py2722 93%
   refresh_extracts_command.py481010 79%
tabcmd/commands/group
   create_group_command.py2955 83%
   delete_group_command.py2722 93%
tabcmd/commands/project
   create_project_command.py4688 83%
   delete_project_command.py3544 89%
   publish_samples_command.py3044 87%
tabcmd/commands/site
   create_site_command.py3455 85%
   delete_site_command.py2722 93%
   edit_site_command.py3822 95%
   list_command.py771212 84%
   list_sites_command.py2922 93%
tabcmd/commands/user
   add_users_command.py2955 83%
   create_site_users.py781717 78%
   create_users_command.py5999 85%
   delete_site_users_command.py4355 88%
   user_data.py2223131 86%
tabcmd/execution
   _version.py222 0%
   global_options.py12544 97%
   localize.py661111 83%
   logger_config.py6066 90%
   tabcmd_controller.py4277 83%
TOTAL289346084% 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant