Skip to content

Conversation

nicholasmarais1158
Copy link
Contributor

Summary

This change extends tctl bots instances ls to support filtering and sort. These features are already available in the ListBotInstances rpc. It also removes the generation field from the output if favour of version.

Registered the --format flag - while it was supported in code, it wasn't added as a flag to the command.

Changelog: Added filter and sort flags to tctl bots instances ls
Updates: #55926

Changes

  • Use v2 rpc
  • Add --format, --search, --query, --sort-index and --sort-order flags
  • Allow enabling the auth cache for the test process - required for sorting
  • Added tests for tctl bots instances ls

Demo

Fuzzy search for "github" sorted by hostname
Screenshot 2025-10-15 at 16 14 56

Filter by bot name sorted with most recent first
Screenshot 2025-10-15 at 16 24 51

Advanced query for versions and join method showing oldest versions first
Screenshot 2025-10-15 at 16 40 36

Reviewer notes

Here's a script to insert a bunch of bot instances to make testing easier; bot_instances.sql

$ sqlite3 <your cluster's data dir>/backend/sqlite.db
sqlite> .read bot_instances.sql

The bots for these instances wont exist, but that not a problem within the scope of this change.

Be sure to restart your cluster afterwards - the cache will not be notified of the changes.

Delete all instances afterwards to tidy up, if you like;

delete from kv where key like '/bot_instance/%';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant