Fix #437: add 10 editsite flags for tabcmd Classic parity - #452
Open
jacalata wants to merge 3 commits into
Open
Conversation
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.
The initial commit predated a black run; CI's black check failed on this file (repo pins black 22).
3 tasks
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>
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.
Closes #437.
Motivation
Classic exposed 12 site-configuration flags on
editsitethat tabcmd 2was 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 VizQLteam confirmation) and
--cache-warmup-threshold(server-only, N/A toCloud).
--guest-access-enabled/-gguest_access_enabled--cache-warmup/--no-cache-warmupcache_warmup_enabled--subscription-email/-ecustom_subscription_email+_enabled--subscription-footer/-fcustom_subscription_footer+_enabled--web-extraction-enabledweb_extraction_enabled--allow-subscriptions/--no-allow-subscriptionsdisable_subscriptions(inverted)--allow-web-authoring/--no-allow-web-authoringauthoring_enabled--allow-mobile-snapshots/--no-allow-mobile-snapshotssheet_image_enabled--time-zone STRINGtime_zone--use-default-time-zoneuse_default_time_zoneDesign notes:
Noneso anunpassed flag never touches the server setting. A
default=Falsewould flip cache-warmup, subscriptions, etc. off on every
editsitecall.
--time-zoneand--use-default-time-zoneare argparse-enforcedmutually exclusive.
set_edit_site_only_argshelper becausecreate_site_commanddoesn't wire these attributes.--allow-mobile-snapshotsmaps ontosheet_image_enabled, notmobile_biometrics_enabled(a separate biometric-auth feature).--allow-subscriptionsis inverted ontodisable_subscriptionsbecause that's how the REST API expresses the setting.
Upstream TSC bug discovered
RequestFactory.pylowercases bothcustomSubscriptionEmailandcustomSubscriptionFooteron the wire; filed tableau/server-client-python#1849and fix PR tableau/server-client-python#1851.
Test plan
tests/parsers/test_parser_edit_site.pycover 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
run_commandattribute 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