Skip to content

Conversation

@jacalata
Copy link
Contributor

@jacalata jacalata commented Jan 8, 2025

The 'list' methods only show an ID and name, which isn't always enough.. Fixing #268

These are the new arguments

list:
{projects,workbooks,datasources,flows}
View content
--machine Format output as csv for machine reading

Attributes to display:
-a, --address Show web address of the item
--children Show children of the item
-d, --details Show all attributes of the item
-n, --name Show item name
-o, --owner Show item owner

jacalata and others added 2 commits January 7, 2025 14:37
(cherry picked from commit 14c2dbbb5ed94766545bf759e6b4db445cc4cf92)
@jacalata jacalata changed the base branch from main to development January 8, 2025 02:18
@bcantoni
Copy link
Contributor

@jacalata is going to rebase these off the latest development branch, then we'll review and get the changes in.

@jacalata jacalata requested a review from Copilot July 31, 2025 09:28

This comment was marked as outdated.

jacalata and others added 5 commits July 31, 2025 02:37
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Jul 31, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
tabcmd
   __main__.py101010 0%
   tabcmd.py141414 0%
   version.py633 50%
tabcmd/commands
   commands.py101010 0%
   constants.py771818 77%
   server.py1302020 85%
tabcmd/commands/auth
   session.py3704646 88%
tabcmd/commands/datasources_and_workbooks
   datasources_and_workbooks_command.py1521818 88%
   datasources_workbooks_views_url_parser.py1401010 93%
   delete_command.py601616 73%
   export_command.py1192525 79%
   get_url_command.py1274747 63%
   publish_command.py831919 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
   create_site_users.py571010 82%
   create_users_command.py601010 83%
   delete_site_users_command.py4355 88%
   user_data.py2213131 86%
tabcmd/execution
   _version.py222 0%
   global_options.py12588 94%
   localize.py691111 84%
   logger_config.py4266 86%
   tabcmd_controller.py4277 83%
TOTAL275743184% 

- Add all() method to getter mock objects to support ListCommand functionality
- Add machine attribute to test args to prevent AttributeError
- Set up proper server object mocks (workbooks, projects, datasources, flows)
- Fixes failing tests in test_run_commands.py and test_listing_commands.py

(thanks to Cursor for the assist)
@bcantoni
Copy link
Contributor

bcantoni commented Aug 1, 2025

@jacalata I added a commit here to fix the tests. Please double-check me on that and if it looks good we can both approve and then merge :)

@jacalata jacalata requested review from bcantoni and Copilot August 5, 2025 22:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the 'list' command functionality by adding new options to display additional attributes beyond just ID and name, addressing issue #268. The enhancement provides users with more control over what information is displayed when listing content.

Key changes:

  • Added new command-line arguments for controlling display attributes (--machine, --name, --owner, --details, --address)
  • Implemented header generation and formatted output for different content types
  • Added comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tabcmd/commands/site/list_command.py Core implementation of new listing attributes and formatting logic
tabcmd/locales/en/tabcmd_messages_en.properties Added localization strings for headers, labels, and help text
tests/commands/test_listing_commands.py Added comprehensive test coverage for new functionality
tests/commands/test_run_commands.py Updated existing tests to support new command arguments
tests/commands/test_session.py Moved slow integration test and added explanatory comment
tests/commands/test_publish_command.py Minor formatting cleanup (removed extra blank line)
Comments suppressed due to low confidence (3)

tabcmd/commands/site/list_command.py:61

  • The variable name 'id' shadows the built-in Python function. Consider renaming it to 'item_id' or 'content_id' to avoid confusion.
                    id = item.id

tabcmd/commands/site/list_command.py:72

  • The variable name 'id' shadows the built-in Python function. Consider renaming it to 'item_id' or 'content_id' to avoid confusion.
                    id = _("tabcmd.listing.label.id").format(item.id)

tabcmd/commands/site/list_command.py:102

  • The variable name 'id' shadows the built-in Python function. Consider renaming it to 'id_header' or 'header_id' to avoid confusion.
        id = _("tabcmd.listing.header.id")

jacalata and others added 5 commits August 7, 2025 12:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
this will need test updates too

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jacalata jacalata requested a review from renoyjohnm August 14, 2025 21:01
@jacalata jacalata merged commit 30b05c7 into development Aug 27, 2025
19 checks passed
@jacalata jacalata deleted the jac/list-with-details branch August 27, 2025 21:18
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.

4 participants