Skip to content

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

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

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

Conversation

@jacalata

@jacalata jacalata commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Closes #437.

Motivation

Classic exposed 12 site-configuration flags on editsite that tabcmd 2
was missing. Site admins doing bulk configuration on Cloud sites had no
way to script these settings and were routed to the web UI.

Behavior change

For users: 10 new flags on editsite. Two skipped:
--metrics-level (Tableau-internal telemetry, Cloud-N/A pending VizQL
team confirmation) and --cache-warmup-threshold (server-only, N/A to
Cloud).

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 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 because
    create_site_command doesn't wire these attributes.
  • --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 bug discovered

RequestFactory.py lowercases both customSubscriptionEmail and
customSubscriptionFooter on the wire; filed tableau/server-client-python#1849
and fix PR tableau/server-client-python#1851.

Test plan

  • 41 new parser tests in tests/parsers/test_parser_edit_site.py
    cover each flag's arg form, mutual exclusion, default=None on every
    new flag, both "true" and "false" on string-value flags, and
    empty-string acceptance on email/footer
  • Full parsers suite: 138 passed, 1 skipped
  • run_command attribute application (paired email/footer writes,
    disable_subscriptions inversion, _str_to_bool coercion, timezone
    precedence) not covered here; tracked in Test coverage gap: run_command logic in the recent parity sweep is untested #457

🤖 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).
Fresh-eyes review flagged that the new-flag test set only checked
default=None for two of ten flags, and only exercised "true" (not
"false") on the string-value flags. Adds:

- default=None coverage for guest_access_enabled, web_extraction_enabled,
  allow_web_authoring, allow_mobile_snapshots, subscription_email,
  subscription_footer, and time_zone (previously only cache_warmup and
  allow_subscriptions were tested).
- "false" argument on --guest-access-enabled long form and
  --web-extraction-enabled (previously only "true" was tested).
- Empty-string acceptance on --subscription-email and
  --subscription-footer; the paired _enabled flip happens in run_command
  and is tracked in the run_command coverage issue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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