Skip to content

Improve tbots.py target name resolution and interactive experience - #3987

Merged
GrantYu9 merged 11 commits into
UBC-Thunderbots:masterfrom
ryanwarfield:ryan/interactive-tbots-experience
Oct 14, 2026
Merged

GrantYu9 merged 11 commits into
UBC-Thunderbots:masterfrom
ryanwarfield:ryan/interactive-tbots-experience

Conversation

@ryanwarfield

@ryanwarfield ryanwarfield commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR:

  • Pulls out ActionArgument and find_fuzzy_target into their own files to avoid circular deps
  • Switches the interactive cli to directly call the fuzzy search, and cleans up the flow (no more searching twice if your search doesn't come up with any matches)
  • Increase the threshold to skip the search dialogue from tbots.py test x from 50 to 65 (opens more frequently).
  • Make the target search dialogue more clear about whats going on
  • Include every target in the search dialogue instead of just 10

New Behaviour:

./tbots.py run thunderscope # runs thunderscope_main with no prompt
./tbots.py run e # opens up an interactive search dialog (before it ran some random test)
./tbots.py test e # same thing

./tbots.py
? What would you like to do? Test
? Which tests? Specific test
<search dialogue opens>
? Number of times to run each test (leave empty for 1): 1

# updated build menu
~/h/t/src►./tbots.py 
? What would you like to do? Build
? What would you like to build? (Use arrow keys)
 » Specific target
   Bazel pattern
   All
image

Dialogue when running ./tbots.py test e

image

Testing Done

An unhealthy number of runs of tbots.py 💀

Resolved Issues

resolves #3887

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@StarrryNight StarrryNight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left some small nits but looks great to me! Tested it myself and it works pretty well.

Comment thread src/cli/fuzzy_target.py
Comment thread src/cli/cli_params.py Outdated

@StarrryNight StarrryNight left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@GrantYu9
GrantYu9 self-requested a review October 14, 2026 19:12

@GrantYu9 GrantYu9 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall looks good to me.

I like the expanded amount of results shown and matched results.

I'm unsure of the logistics or benefits of this, but I was thinking we could also add a "Run" option along with the other options:
Image showing how there isn't a 'Run' option when './tbots.py' is run

I'll probably open this as another issue.

@GrantYu9
GrantYu9 merged commit f726a69 into UBC-Thunderbots:master Oct 14, 2026
8 checks passed
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.

Improve experience of using interactive search in tbots.py

3 participants