Skip to content

Fix #437: add 10 editsite flags for tabcmd Classic parity - #452

Open
jacalata wants to merge 2 commits into
developmentfrom
jac/437-editsite-flags
Open

Fix #437: add 10 editsite flags for tabcmd Classic parity#452
jacalata wants to merge 2 commits into
developmentfrom
jac/437-editsite-flags

Conversation

@jacalata

@jacalata jacalata commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

tabcmd Classic exposes 12 site-configuration flags on editsite that tabcmd 2 was missing. This adds 10 of them. The 2 skipped:

  • --metrics-level — Tableau-internal VizQL telemetry, likely Cloud-N/A (pending VizQL team confirmation)
  • --cache-warmup-threshold — server-only, not applicable to Cloud

Flags added, with the SiteItem attribute each wires:

Classic flag SiteItem attribute
--guest-access-enabled / -g guest_access_enabled
--cache-warmup / --no-cache-warmup cache_warmup_enabled
--subscription-email / -e custom_subscription_email + _enabled
--subscription-footer / -f custom_subscription_footer + _enabled
--web-extraction-enabled web_extraction_enabled
--allow-subscriptions / --no-allow-subscriptions disable_subscriptions (inverted)
--allow-web-authoring / --no-allow-web-authoring authoring_enabled
--allow-mobile-snapshots / --no-allow-mobile-snapshots sheet_image_enabled
--time-zone STRING time_zone
--use-default-time-zone use_default_time_zone

Design notes

  • Paired positive/negative boolean flags default to None so an unpassed flag never touches the server setting. A naive default=False would flip cache-warmup, subscriptions, etc. OFF on every editsite call.
  • --time-zone and --use-default-time-zone are argparse-enforced mutually exclusive.
  • Flags live in a new set_edit_site_only_args helper (not set_common_site_args) because create_site_command doesn't wire these attributes; adding to the shared helper would advertise unwired flags in createsite --help.
  • --allow-mobile-snapshots maps onto sheet_image_enabled, NOT mobile_biometrics_enabled (a separate biometric-auth feature).
  • --allow-subscriptions is inverted onto disable_subscriptions because that's how the REST API expresses the setting.

Upstream TSC bugs discovered (not fixed here)

RequestFactory.py lowercases both customSubscriptionEmail and customSubscriptionFooter on the wire, so user@Domain.com will be sent as user@domain.com. To be filed separately in server-client-python.

Test plan

  • 30 new parser tests in tests/parsers/test_parser_edit_site.py cover each flag's arg form, mutual exclusion, and default=None behavior
  • Full parsers suite: 127 passed, 1 skipped (pre-existing)

Closes #437.

🤖 Generated with Claude Code

tabcmd Classic exposes 12 site-configuration flags on editsite that
tabcmd 2 was missing. This adds 10 of them (the 2 skipped items are
--metrics-level, which is Tableau-internal VizQL telemetry likely
Cloud-N/A pending VizQL team confirmation, and --cache-warmup-threshold,
which is server-only).

Flags added, with the SiteItem attribute each wires:
- --guest-access-enabled / -g       -> guest_access_enabled
- --cache-warmup / --no-cache-warmup -> cache_warmup_enabled
- --subscription-email / -e         -> custom_subscription_email + _enabled
- --subscription-footer / -f        -> custom_subscription_footer + _enabled
- --web-extraction-enabled          -> web_extraction_enabled
- --allow-subscriptions / --no-*    -> disable_subscriptions (inverted)
- --allow-web-authoring / --no-*    -> authoring_enabled
- --allow-mobile-snapshots / --no-* -> sheet_image_enabled
- --time-zone STRING                -> time_zone
- --use-default-time-zone           -> use_default_time_zone

Design notes:
- Paired positive/negative boolean flags default to None so an unpassed
  flag never touches the server setting (critical: a naive default=False
  would flip cache-warmup / subscriptions / etc. off on every editsite).
- --time-zone and --use-default-time-zone are argparse-enforced mutually
  exclusive.
- Flags live in a new set_edit_site_only_args helper (not
  set_common_site_args) because create_site_command doesn't wire these
  attributes; adding to the shared helper would advertise unwired flags
  in `createsite --help`.
- --allow-mobile-snapshots maps onto sheet_image_enabled, NOT
  mobile_biometrics_enabled (that's a separate biometric-auth feature).
- --allow-subscriptions is inverted onto disable_subscriptions because
  that's how the REST API expresses the setting.

Two upstream TSC bugs surfaced during implementation but not fixed here:
RequestFactory.py lowercases both customSubscriptionEmail and
customSubscriptionFooter on the wire, so `user@Domain.com` will be sent
as `user@domain.com`. To be filed separately.

Tests: 30 new parser tests in tests/parsers/test_parser_edit_site.py
cover each flag's arg form, mutual exclusion, and default None
behavior. Full parsers suite: 127 passed, 1 skipped (pre-existing).

Fixes #437.
@github-actions

github-actions Bot commented Aug 4, 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.py651717 74%
   list_command.py771212 84%
   list_sites_command.py2922 93%
tabcmd/commands/user
   add_users_command.py2955 83%
   create_site_users.py581111 81%
   create_users_command.py5999 85%
   delete_site_users_command.py4355 88%
   user_data.py2223131 86%
tabcmd/execution
   _version.py222 0%
   global_options.py14688 95%
   localize.py661111 83%
   logger_config.py6066 90%
   tabcmd_controller.py4277 83%
TOTAL292147384% 

The initial commit predated a black run; CI's black check failed on this
file (repo pins black 22).
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