Github search is great for searching one repo, or searching all repos in an organization, but what if you want to search all ROS repos no matter what org they’re in? Sourcegraph lets you do that. I created some
SearchContexts on the public instance that let you search almost all released ROS source code.
call_asyncin Python code in ROS Humble:
context:@sloretz/ROS-Humble lang:python call_async
- Find XML files with a
<launch>tag in ROS Rolling:
context:@sloretz/ROS-Rolling lang:xml "<launch>"
- Find repositories in ROS Noetic that have been archived:
Query syntax reference: Search query syntax - Sourcegraph docs
These search the repos at the branch given in the
source entry of each repository on rosdistro. Not every repository has a source entry, and those that do sometimes have the wrong branch. For example, a maintainer might release a package in ROS Iron from their
main branch, but later create an
iron branch and forget to update it. For repos that don’t have a source entry I made the
SearchContexts search the latest release branch in the release repository for each released package.
A lot of repositories are not indexed on the public Sourcegraph instance, though the core ones mostly are. I don’t know how frequently these are reindexed.
- ROS Noetic: 516 out of 754 repos are indexed
- ROS Humble: 347 out of 519 repos are indexed
- ROS Iron: 318 out of 446 repos are indexed
- ROS Rolling: 309 out of 439 repos are indexed
SearchContexts will need to be periodically updated as repos are added and updated in rosdistro. They reflect the repos and branches as of this morning, or of whenever I get around to updating them in the future.
I also have only been playing with these contexts today, so let me know if you find issues. I’ll do my best to fix them.