Quinn Slack on October 20, 2019
Sourcegraph is the standard developer platform for code search and navigation at many of the largest and most advanced technology companies. With Sourcegraph, every company has access to the same kind of tools that Google and Facebook developers use every day.
We're excited to announce Sourcegraph 3.9. This release contains lots of behind-the-scenes work, both foundational and forward-looking.
🔎 Search queries are now literal (not regexp) by default
🤖 Manage cross-repository PR campaigns
📊 Monitor the health of your Sourcegraph instance
🧠 LSIF-based code intelligence for multi-language repositories
🛠 Faster repository cloning on large instances
⚙️ Export settings for easier bug reporting
📑 Experimental paginated search API
⚓️ Kubernetes: migration to using StatefulSets
📝 Changelog (everything that changed in this release)
Deploy or upgrade: Local | AWS | DigitalOcean | Kubernetes cluster
In Sourcegraph 3.9, search query terms are interpreted literally instead of as regular expressions by default. You can toggle this behavior using the .*
icon in the search field.
We made this change to better match the expectations of most users (after a ton of feedback). Special characters such as *
, (
, and .
are matched literally, so you can search for things like import { foo }
or *MyType
without needing to escape or quote your query.
Regular expressions are still supported, and we expect some users to prefer regexps for all of their queries. To default to regexp queries for a single user or for all users, set the search.defaultPatternType
setting in user settings (/settings
) or global settings (/site-admin/global-settings
), respectively.
Other backcompat notes:
patternType
flag in their queries to specify the desired behavior.patternType:regexp
in the query.repo:
and file:
filters continue to accept regexps.
Keeping your code secure and up-to-date often requires making changes and merging pull requests across many repositories. As a step toward shipping support for large-scale code change campaigns, Sourcegraph now lets you track status and activity on campaigns of pull requests across repositories for GitHub and Bitbucket Server.
For example, if you've applied a critical security fix to 1,000 repositories, Sourcegraph makes it easy to see which and how many PRs are open/merged/closed, and you can monitor comments and review activity to see how to help get the fix approved and deployed.
Next, we plan to ship the ability to create branches and PRs across hundreds or thousands of repositories for common use cases (such as fixing security issues, upgrading dependencies, and refactoring usage of deprecated APIs).
Code change management campaigns are in private beta. Watch the code change management screencasts to see what we have planned, and apply for early access to this feature.
Sourcegraph's built-in monitoring with Grafana and Prometheus has been enhanced with default dashboards and alerts to help you confidently assess the health of your Sourcegraph instance. Sourcegraph is one of the most-used internal tools inside many large customers, and we've incorporated our learnings from these high-scale deployment environments. See monitoring and tracing documentation for more information.
LSIF-based code intelligence now works on repositories with multiple projects and languages. Languages currently supported for LSIF include Go, TypeScript, Python, and C/C++, with support for Java currently in development. Enable LSIF-powered code intelligence for your repositories by adding a simple step to your CI build process.
See the new lsif.dev site for list of languages with LSIF indexers (which means you can get precise, LSIF-based code intelligence on Sourcegraph).
Sourcegraph now reacts more quickly to changes in the external services you configure (such as the code hosts to mirror repositories from). For example, when you add a new code host to Sourcegraph, its repositories will become available more quickly for searching and browsing.
(We made this improvement by applying external service updates in a streaming, not serial, fashion. Repositories are now added to Sourcegraph’s database and cloned immediately and one-by-one, instead of first loading the entire list of repositories from the code host and then syncing the entire list to the database. On large Sourcegraph instances that mirror 10,000s+ of repositories from code hosts, the first repositories will show up much more quickly than before.)
Sourcegraph settings and configuration can now be viewed on a single page for easier exporting when reporting a bug. To view, go to ‘Report a bug’ on the site admin side panel or navigate to /site-admin/report-bug
.
Note that secrets and tokens are not automatically redacted. Please review the full settings export before sharing externally.
To enable better programmatic consumption of search results, Sourcegraph 3.9 introduces the ability to consume an entire search result set via multiple paginated search requests. The results will be returned with a stable order. This new paginated search API is experimental and is not yet ready for production use, but we are eager to hear feedback from early adopters as we work to further improve it. (If you're interested, see the paginated search documentation and architecture design document)
For Sourcegraph users and customers that deploy using Kubernetes, our Kubernetes deployment manifest for indexed-search pods has changed from a Deployment to a StatefulSet. This is to enable future work on horizontally scaling indexed search.
To retain your existing indexes, follow the migration guide. If you upgrade without following these instructions, Sourcegraph’s indexed search will be temporarily unavailable (and overall search performance will suffer) while your code is reindexed.
Search queries can now be interpreted literally.
search.defaultPatternType
setting to configure the default pattern type, regexp or literal, for searches.patternType:
search token which overrides the search.defaultPatternType
setting, and the active state of the dot-star icon in determining the pattern type of the query.repoHasFile:
will now be recognized, not just repohasfile:
. #5168search
GraphQL API field now takes a two new optional parameters: version
and patternType
. version
determines the search syntax version to use, and patternType
determines the pattern type to use for the query. version
defaults to "V1", which is regular expression searches by default, if not explicitly passed in. patternType
overrides the pattern type determined by version.patternType:regexp
to the end of queries to ensure deterministic results regardless of the patternType configurations on an instance. All new saved searches are required to have a patternType:
field in the query.repohascommitafter
unusable in the presence of an empty repository. #5149externalURL
not being configured in the management console could go unnoticed. #3899nameTransformations
setting to GitLab external service to help transform repository name that shows up in the Sourcegraph UI.Deploy or upgrade: Local | AWS | DigitalOcean | Kubernetes cluster
From the entire Sourcegraph team (@sourcegraph), happy coding!