Skip to content

fix: correct and standardize tabcmd 2 output messages to match tabcmd 1#432

Open
jacalata wants to merge 6 commits into
developmentfrom
jac/fix-output-messages
Open

fix: correct and standardize tabcmd 2 output messages to match tabcmd 1#432
jacalata wants to merge 6 commits into
developmentfrom
jac/fix-output-messages

Conversation

@jacalata

@jacalata jacalata commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes output message bugs identified in fix: output message bugs in listsites, deletegroup, export, createsiteusers, removeusers #429 by comparing tabcmd 2 output against tabcmd 1
  • Adds TABCMD_CLASSIC_OUTPUT=true env var to opt in to ===== prefix on all INFO lines (off by default, matching tabcmd 2's clean style)
  • Eliminates spurious logging: INFO line printed before every command
  • Adds "Signing in..." status line during login to match tabcmd 1 behaviour
  • Fixes wrong field (site.id UUID vs site.content_url) in listsites output
  • Fixes wrong variable (group_id UUID vs args.name) in deletegroup status message
  • Fixes raw exception class name vs human-readable message in createsiteusers error list
  • Fixes wrong locale key (removeusers.server vs new removeusers.group) in removeusers command
  • Fixes double-space in export save message and delete status message when content type is empty
  • Demotes noisy debug lines ("Fetched user details", error message detail) from INFO to DEBUG

Details

The ===== prefix approach uses a single change in logger_config.py (the logging formatter) rather than touching every locale string. When TABCMD_CLASSIC_OUTPUT is not set, INFO output is clean plain text; when set, every INFO line gets the ===== prefix that tabcmd 1 used.

The logging: INFO bug was a type mismatch: namespace.logging_level is a string "INFO" but the code compared it against logging.INFO (integer 20), so the condition was always true.

Closes items 1–9 in #429 (item #10, logout redirect, is not applicable with PAT auth).

Test plan

  • All 337 existing unit tests pass (pytest tests/)
  • Manual test: tabcmd login / tabcmd logout produce clean output without ===== prefix
  • Manual test: TABCMD_CLASSIC_OUTPUT=true tabcmd login produces =====-prefixed INFO lines
  • tabcmd listsites shows human-readable SITEID (not UUID)
  • No logging: INFO line appears before command output

🤖 Generated with Claude Code

jacalata and others added 6 commits July 21, 2026 18:44
…esiteusers, removeusers

- listsites: show site content_url instead of internal UUID for SITEID
- deletegroup: log group name instead of UUID in delete status message
- export/save_to_file: pass filename as content name to fix double-space in "Saved  to '...'" message
- createsiteusers: append str(e) to error_list instead of e.__class__.__name__ so error details show readable messages
- removeusers: use new tabcmd.removeusers.group string key that includes the group name in the status message

Fixes #429

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ebug noise

- logger_config.py: add ===== prefix to INFO format so all action lines match tabcmd 1 style in one place
- session.py: remove hardcoded ===== from _print_server_info lines (now added by formatter); demote "Fetched user details from server" to debug
- constants.py: demote tabcmd.debug.error_message log call from info to debug so it no longer appears in normal output
- delete_command.py: default content_type to "workbook" in status message to fix double-space when type is undetected
- tabcmd_messages_en.properties: remove hardcoded ===== from tabcmd.listing.header (would double-prefix with formatter)

Closes remaining items from #429

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids the ===== prefix being applied to the version/help display.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Plain output is the default. Set TABCMD_CLASSIC_OUTPUT=true (or 1/yes) to
restore the ===== prefix on all INFO-level messages for backward compatibility
with tabcmd 1 output style.

Also moves the version banner in tabcmd_controller to print() so it is never
prefixed regardless of mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The condition compared logging_level string 'INFO' to the integer
logging.INFO (20), which was always True, causing the print to fire
on every invocation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
session.login string already existed; add logger.info call at the
start of _sign_in() to surface it as a distinct step after connecting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

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.py3955050 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.py581111 81%
   create_users_command.py5999 85%
   delete_site_users_command.py4355 88%
   user_data.py2223131 86%
tabcmd/execution
   _version.py222 0%
   global_options.py12588 94%
   localize.py661111 83%
   logger_config.py6266 90%
   tabcmd_controller.py4077 82%
TOTAL287445884% 

@bcantoni

Copy link
Copy Markdown
Contributor

@jacalata looks good - my only question, do we need tabcmd.removeusers.group added to the other language files too?

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.

2 participants