Christina Forney on February 20, 2020
Quickly explore and better understand all the code everywhere with Sourcegraph Universal Code Search. With Sourcegraph, every company has access to the same kind of tools that Google and Facebook developers use every day.
🏗 Code-aware structural search toggle
📣 Campaigns with custom code execution using src-cli
🧠 Basic code intelligence support reaches 32 languages
🎯 LSIF-based precise code intelligence for Dart
🕵️♀️ New content
search keyword
🏷 Campaign UI updates
Custom branch names and GitHub labels
📌 Changes to Sourcegraph’s upgrade policy
🛎 Code intelligence and campaigns data added to Sourcegraph pings
🧪 Experimental features
Smart search field in plain text mode, custom git fetch commands, and importing code from any code host with src-expose
📝 Changelog
Every detail that changed in this release
🎖️ Thank you
Sourcegraph couldn't be what it is without the community
Deploy or upgrade: Local | AWS | DigitalOcean | Kubernetes cluster
Interactive search mode helps users construct queries using UI elements, and is now enabled by default for all users. In this mode, search filters are more discoverable and the query input is simplified to the search query pattern. A dropdown to the left of the search bar allows users to switch between interactive and plain text modes.
The option to use interactive search mode can be disabled by adding { "experimentalFeatures": { "splitSearchModes": false } }
in global settings.
Sourcegraph 3.13 adds a UI toggle for structural search, a code-aware search syntax. Structural search was introduced in Sourcegraph 3.11 and was previously enabled using the patternType:structural
query parameter. When enabled, the regexp and case sensitivity toggles will be disabled, since the search types work independently. Structural code search lets you match nested expressions and whole code blocks that can be difficult or awkward to match using regular expressions. Read more about structural search and see examples in our recent blog post "Going beyond regular expressions with structural code search".
src-cli
Sourcegraph campaigns now support running arbitrary code over all your repositories using the Sourcegraph CLI. This is helpful when you need to run a series of steps over your code, or run a formatter after making an update.
The src-cli
takes your custom action.json
file, containing a scopeQuery
and series of commands as steps
, as input. It then programmatically downloads zips of each repository that match the scopeQuery
, applies each command step, and generates a diff with the changes. The resulting diff file can then be sent to Sourcegraph so you can preview the changes and create the campaign.
For example, if I wanted to bump the version of RxJS in several repositories, my action.json
using a Docker container could be:
{
"scopeQuery": "repohasfile:yarn.lock file:^package.json$ archived:no fork:no rxjs",
"steps": [
{
"type": "docker",
"image": "sourcegraph/rxjs-upgrade:latest"
}
]
}
See our documentation for more details and examples.
Code change management campaigns are in private beta. Watch the campaigns screencasts to see what we have planned, and apply for early access to campaigns for your organization.
With the addition of GraphQL, Groovy, Objective-C, Pascal, Protobufs, Verilog, and VHDL, Sourcegraph basic code intelligence now supports 32 languages. Every Sourcegraph instance comes enabled with basic code intelligence provided by search based heuristics. For fast and precise code intelligence see our LSIF documentation.
The Dart LSIF indexer makes precise code intelligence available for Dart projects. LSIF (Language Server Index Format) is a file format for precomputed code intelligence data that you can upload to your Sourcegraph instance for your projects. Follow the LSIF quickstart guide to get started and see the most up-to-date information on languages with LSIF indexers at lsif.dev.
content
search keyword
We added a new content:
search keyword to help you search for patterns that might clash with other parts of the query. For example, if you want to search for file:file
in javascript files, you can now use the following query: file:.js content:"file:file"
. This parameter overrides any other search patterns in a query.
Our upgrade policy previously supported upgrades from two minor version increments. We have updated our policy to restrict upgrading to one minor version at a time (e.g., 3.12
-> 3.13
). Please reach out to support@sourcegraph.com if you would like assistance upgrading from a much older version of Sourcegraph. This upgrade policy is now enforced by the sourcegraph-frontend
on startup to prevent admins from mistakenly jumping too many versions.
Sourcegraph 3.13 introduces two new customization settings:
search.hideSuggestions
to true
in their user settings.auth.minPasswordLength
to the site config to enforce the password length when users create accounts or update passwords.Sourcegraph collects a small amount of high-level and aggregate data from each instance. See the complete list of the data we collect, and our ping philosophy and rules. New usage statistics—specifically, aggregate counts of the numbers of hover, go to definition, and find references actions, aggregated 50th, 95th, and 99th percentile latencies for the same actions, and a total count of code change campaigns created, will be sent to Sourcegraph via pings by default. The aggregated event count metrics can be disabled via the site admin flag disableNonCriticalTelemetry
.
This release contains several new experimental features. We look forward to hearing your feedback about them! Tweet @sourcegraph or email feedback@sourcegraph.com with your thoughts.
The plain text mode search query input field now provides syntax highlighting, hover tooltips, and diagnostics on filters. Set the user or global settings value { "experimentalFeatures": { "smartSearchField": true } }
to take advantage of this feature.
A new experimenal field experimentalFeatures.customGitFetch
allows defining custom git fetch commands for code hosts and repositories with special settings.
src-expose is a new tool that enables admins to import code from any code host. This makes it possible to bring code from other version control systems or textual artifacts from non-version controlled systems (e.g., configuration) into Sourcegraph.
The new certificates
field allows you to add certificates to trust when communicating with a code host (via API or git+http). This is useful for configurations using internal certificate authorities or self-signed certificates. Add { "experimentalFeatures" { "tls.external": { "certificates": ["<CERT>"] } } }
to your site config.
experimentalFeatures.customGitFetch
that allows defining custom git fetch commands for code hosts and repositories with special settings. #8435{ "experimentalFeatures": { "smartSearchField": true } }
.search.hideSuggestions
, which when set to true
, will hide search suggestions in the search bar. #8059certificates
as in { "experimentalFeatures" { "tls.external": { "certificates": ["<CERT>"] } } }
. This allows you to add certificates to trust when communicating with a code host (via API or git+http). We expect this to be useful for adding internal certificate authorities/self-signed certificates. #71auth.minPasswordLength
, which when set, causes a minimum password length to be enforced when users sign up or change passwords. #7521branch
attribute is now required in CreateCampaignInput
when a plan
is also specified. #7646content:
parameter for specifying a search pattern. This parameter overrides any other search patterns in a query. Useful for unambiguously specifying what to search for when search strings clash with other query syntax. #6490{ "experimentalFeatures": { "splitSearchModes": false } }
in global settings. #8461sourcegraph-frontend
on startup to prevent admins from mistakenly jumping too many versions. #8157 #7702experimentalFeatures.splitSearchModes
was removed as a site configuration option. It should be set in global/org/user settings.90s
instead of 5s
for Redis to be available before quitting. This duration is configurable with the new SRC_REDIS_WAIT_FOR
environment variable.disableNonCriticalTelemetry
.previewCampaignPlan
has been renamed to createCampaignPlan
. This mutation is part of campaigns, which is still in beta and behind a feature flag and thus subject to possible breaking changes while we still work on it.CampaignPlan.changesets
has been deprecated and will be removed in 3.15. A new field called CampaignPlan.changesetPlans
has been introduced to make the naming more consistent with the Campaign.changesetPlans
field. Please use that instead. #7966read:org
permissions for GitHub OAuth if allowOrgs
is not enabled in the site configuration. #8163\
in the search queries when using regexp. #7604enabled
and disabled
have been removed from the GraphQL API. These fields have been deprecated since 3.4. #3971Hover.__backcompatContents
was removed.The changelog for this and previous releases is available on GitHub.
Thank you to the many people who contributed to Sourcegraph since the last release!
Deploy or upgrade: Local | AWS | DigitalOcean | Kubernetes cluster
From the entire Sourcegraph team (@sourcegraph), happy coding!