Find and fix issues in your code with Repo Grep Checks
Today OpsLevel is introducing a powerful new check type: the Repo Grep Check. With Repo Grep, engineering orgs have a simple, scalable workflow for asking questions of their codebase, no matter how many git repos they have, or how varied those repos are.
As a result, engineering teams can more easily get important data and insights out of their codebase. That means more time for taking action.
Questions like the examples below are now straightforward to answer–and take action on–thanks to Repo Grep.
- Do all my repos contain a Graphql schema–a file ending in '.graphql' ?
- Have all my services deprecated and removed any dependency on RabbitMQ?
- How many Tier 1 services have left `TODO` comments in their code?
The magic of Repo Grep is that it combines regex searches on file contents and wildcard matching on directories and filenames via globbing. This makes open-ended searches easy.
An SRE at one of our early beta customers shared this feedback in Slack after trying it out for this first time:
BOOM. Set it up in five minutes and now we know who has the GraphQLTelemetryPlug instrumented. That was awesome.
So I like this new check A LOT! It just saved me several hours of writing pipeline code to get the same data.
Let’s unpack their feedback and walk through why they were so excited about this new capability.
The challenge of cross-cutting issues in distributed architectures
When architectures have hundreds of different services, that often means hundreds of separate instances of security, infrastructure, observability, or other non-functional configurations.
For developers with features to write and bugs to fix, these cross-cutting issues aren’t top of mind, and typically not their areas of expertise anyways. So platform teams (SRE, Security, Infrastructure, etc.) are tasked with staying on top of them.
The work takes many different names–upgrades, instrumentations, deprecations, patches, optimizations, paying down tech debt–but always involves understanding the status quo.
Sometimes this data already exists neatly in a particular tool or in specific config files. But often it’s scattered across your codebase, in many different repos, directories, or files.
Without the right tools, determining the status quo in these situations is a time consuming, inefficient process for platform engineers.
Writing and running custom scripts to scrape data from hundreds of repos each time there’s a new cross-cutting issue is clunky at best and miserable at worst. It’s a process with lots of room for frustration, human error, and thorny edge cases.
And often the work isn’t documented or saved so that it’s discoverable and reusable–because there’s no clear tool or framework for it. And the results at the end of that tedious process? Those have to be manually enriched, formatted, and shared across the organization via a spreadsheet.
Opportunity costs
When it's time consuming and tedious to ask and answer questions of your codebase, there are tradeoffs and other downstream consequences. For platform engineers, it means triaging and then spending time on only the most mission-critical issues.
Engineering leadership can also be negatively impacted. Without the complete picture on topics like security vulnerabilities, tech debt, or compliance with engineering standards, it’s harder for them to make strategic decisions about where teams should spend their time or how to balance product and operational work.
Repo Grep: the right tool for the job
In addition to the flexible search that combines globbing and regex, other benefits of Repo Grep include:
- It’s repeatable and reusable. Because it lives in OpsLevel’s Service Maturity rubric, grep checks are always on. Any changes to the results are surfaced in near real time.
- It’s built for scale. Let us worry about rate limits and compatibility across git providers.
- It’s precise. With intuitive filters, it’s simple to only apply grep checks to relevant services.
- Reporting is automated. The results of grep checks are integrated with your service catalog. No spreadsheets required. Plus, query the structured check results programmatically or pipe that data in your own data warehouse for further analysis.
Hopefully it’s clear now why our beta customer above was so excited about their first Repo Grep Check! It’s a powerful search that's even more useful because it’s integrated with all the other context and functionality of OpsLevel’s service ownership platform.
Closing the loop
Easily finding answers to hard questions is great, but it’s only half the battle. High performing engineering teams close the loop and take action based on what they’ve learned. That might be corrective action to fix a high-risk flaw. Or a proactive enhancement to deliver better performance to end users, or optimize resource consumption.
For any of these scenarios, OpsLevel helps platform teams connect the dots and drive change via Campaigns. With Campaigns, defining, communicating, and tracking important engineering initiatives is seamless.
If you’re ready to run higher quality, more secure, and more reliable code in production, request your demo of OpsLevel and bring Repo Grep to your codebase.
FAQ
How does Repo Grep compare to existing Repo File and Repo Search checks?
Repo Grep includes all the functionality (and more) of both Repo File and Repo Search. For new use cases, Repo Grep is usually the right choice. If you know exactly what file location in repos you'd like to search for, Repo File is still preferable, as it will evaluate slightly faster.
How does Repo Grep compare to other code search tools?
Repo Grep only searches repositories that you've linked to services in your OpsLevel catalog. And there's no search bar. But if you're interested in find and fixing issues, improving code quality, promoting code reuse, and enforcing you preferred patterns you'll find Repo Grep very useful.
Can you tell me more about globbing and regex?
Learn more about globbing here. Details on our Rust regex are here.
How do I set up a Repo Grep check?
In order to use Repo Grep, you must first have a git integration configured in your OpsLevel account. Only git repos that are associated to a service in your catalog are in scope. Multiple repos associated to a single service? No problem!
You can create a grep check from the Service Maturity rubric, or (coming very soon) with tooling like our CLI and Terraform. Check out the UI workflow here.
Can I see more of Repo Grep?
Check out a full screen, interactive tour here.