Christina Forney on April 20, 2020
Explore, navigate, and better understand all code, everywhere, faster with Sourcegraph Universal Code Search. Uber, Lyft, Yelp, and other enterprises rely on Sourcegraph to improve developer productivity and manage large-scale code changes.
π£ Campaigns beta available to all site admins
π Faster syncing of GitHub repository permissions
π Experimental AND/OR operators for search contents
π New visibility filter for scoping searches to public or private repositories
π Getting started prompt contains more context
π§© Extension and code intelligence UI improvements
βοΈ User event logs available in user settings
π§ͺ Experimental deterministic search results
π΄ Setting to include forked and archived repositories
π Deploy Sourcegraph behind a proxy
π 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
Go in-depth with the 3.15 release by watching the recorded livestream with Product Manager Christina Forney and CTO Beyang Liu.
NOTE: Sourcegraph site admins should definitely check out Beyang discussing improvements to monitoring, observability, and alerting.
Campaigns are available for general use in beta by any Sourcegraph instance admin. Users of Sourcegraph.com will need to run a private Sourcegraph instance with their repositories added to try running campaigns on their code. Sourcegraph admins can enable campaigns on their instance by adding {"experimentalFeatures": { "automation": "enabled" }}β
to their site configuration settings.
We are excited to hear about the campaigns you run, answer questions you have, and hear your feedback! Get in touch on Twitter @sourcegraph, file an issue in our public issue tracker, or email feedback@sourcegraph.com.
Campaigns are currently in beta. During the beta period, campaigns are free to use. After the beta period, campaigns will be available as a paid add-on. Please contact us for more information.
Sourcegraph 3.15 adds faster repository permissions syncing at scale for GitHub. This functionality was previously introduced for GitLab and Bitbucket Server in Sourcegraph 3.14. Rather than syncing a userβs permissions when they log in and potentially blocking them from seeing search results, Sourcegraph syncs these permissions asynchronously in the background, opportunistically refreshing them in a timely manner. See the documentation for more details.
Enable this feature by adding "permissions.backgroundSync": {"enabled": true}
in your site configuration settings.
Search for file contents using AND and OR expressions in queries. These operators enable more expressive searches in regexp and structural search modes. The documentation includes more details about how to these operators and their precedence and grouping.
For example, if you want to find all of the places where two functions are within the same file, you can use the AND operator: conf.Get( and log15.Error(
β see example query results.
Or, if you want to find everywhere two functions are used whether or not the other is present, you would use the OR operator: conf.Get( or log15.Error(
β see example query results.
You can even use them together: ("conf.Get(" or "log15.Error(") and after
β see example query results.
Currently, operators only support searching file contents and do not apply to search scopes - you will see an alert if your query is not supported.
Enable this feature by adding {"experimentalFeatures": {"andOrQuery": "enabled"}}
to site configuration settings.
We continue to invest heavily in making Sourcegraph easier to monitor and debug out-of-the-box.
Additionally:
Search error rate and latency is now broken down by type on the frontend dashboard:
IMPORTANT: If you have previously configured alert thresholds on the frontend dashboard manually (instead of on the Grafana home dashboard as typically recommended), you will need to reconfigure those alert thresholds again after upgrading.
We've added a new tool to all Sourcegraph deployments by default: Distributed tracing. It is a powerful tool for investigating performance issues. You can enable tracing selectively per-request and capture detailed information about, for example, a search request which can then easily be inspected to find out what the slowest parts were within the inner-workings of Sourcegraph.
To use tracing, please see our documentation.
Additionally, it is now possible to log all search and GraphQL requests slower than N milliseconds, using the new site configuration options observability.logSlowGraphQLRequests
and observability.logSlowSearches
. When Sourcegraph's monitoring (or your instances' users) inform you that queries are slow, this allows you to see the exact details of the search or GraphQL request needed to reproduce it.
The new visibility:
search scope enables filtering based on a repositoryβs shared state on the code host. Scope options include any, public, or private, and defaults to visibility:any
when the scope is not specified.
When using Sourcegraph for the first time on a private instance, a getting started section is shown to help admins and users make sure their Sourcegraph instance is properly configured, and that they know how to perform a search. The getting started steps now include more context about how to complete each step.
Even small things can have a large impact on user experience, and we are working on improving how users interact with Sourcegraph. For this release, we cleaned up the design of buttons contributed by extensions in the Sourcegraph webapp and on code host integrations. In addition, we reworked our logic for when we display loading indicators in hover tooltips that sometimes caused tooltips to not show up reliably. These changes provide a more consistent experience with visual elements and component interactions.
Users and site administrators can now view a log of their actions/events in user settings. This enables site admins to perform rough audits of users and also helps users better understand the information Sourcegraph logs.
A new experimental search scope stable:true
has been added to provide results with a deterministic search result order. This search scope only applies to file contents and is limited to 5,000 maximum results. You should consider using the paginated search API if you need more than 5,000 results.
Sourcegraph 3.14 removed archived and forked repositories from search results by default. While this was an improvement to most users, some organizations have a configuration that necessitates searching these repositories. Sourcegraph 3.15 enables those organizations to add a global setting to their instance to always include forks or archived repositories in searches. Enable this in global, organization, or user settings with "search.includeForks": true
or "search.includeArchived": true
respectively.
For organizations that need to run Sourcegraph behind a proxy, git fetch
and git clone
now inherit the parent process environment variables. This allows site admins to set HTTPS_PROXY or git http configurations via environment variables. For cluster environments, site admins should set this on the gitserver container.
visibility:
filter, search results can now be filtered based on a repository's visibility (possible filter values: any
, public
or private
). #8344sourcegraph/git-extras
is now enabled by default on new instances. #3501/etc/sourcegraph/gitconfig
to $HOME/.gitconfig
. This is a convenience similiar to what we provide for repositories that need HTTP(S) or SSH authentication. #658"permissions.backgroundSync": {"enabled": true}
. #8890stable:true
to a query ensures a deterministic search result order. This is an experimental parameter. It applies only to file contents, and is limited to max. 5,000 results (consider using the paginated search API if you need more than that.). #9681.git fetch
and git clone
now inherit the parent process environment variables. This allows site admins to set HTTPS_PROXY
or git http configurations via environment variables. For cluster environments, site admins should set this on the gitserver container. #250and
- and or
-expressions in queries. This is enabled via the global settings value {"experimentalFeatures": {"andOrQuery": "enabled"}}
. #8567"search.includeForks": true
or "search.includeArchived": true
respectively. #9927observability.logSlowGraphQLRequests
and observability.logSlowSearches
.Observability (monitoring): More metrics monitored and alerted on, more legible dashboards
symbols
-> frontend-internal
requests are now monitored. #9732Observability (debugging): Distributed tracing is a powerful tool for investigating performance issues. The following changes have been made with the goal of making it easier to use distributed tracing with Sourcegraph:
"observability.tracing": { "sampling": "..." }
allows a site admin to control which requests generate tracing data."all"
will trace all requests."selective"
(recommended) will trace all requests initiated from an end-user URL with ?trace=1
. Non-end-user-initiated requests can set a HTTP header X-Sourcegraph-Should-Trace: true
. This is the recommended setting, as "all"
can generate large amounts of tracing data that may cause network and memory resource contention in the Sourcegraph instance."none"
(default) turns off tracing."observability.tracing": {
"sampling": "selective"
}
useJaeger
, is deprecated in favor of observability.tracing
.Multiple backwards-incompatible changes in the parts of the GraphQL API related to Campaigns #9106:
CampaignPlan.status
has been removed, since we don't need it anymore after moving execution of campaigns to src CLI in #8008.CampaignPlan
has been renamed to PatchSet
.ChangesetPlan
/ChangesetPlanConnection
has been renamed to Patch
/PatchConnection
.CampaignPlanPatch
has been renamed to PatchInput
.Campaign.plan
has been renamed to Campaign.patchSet
.Campaign.changesetPlans
has been renamed to campaign.changesetPlan
.createCampaignPlanFromPatches
mutation has been renamed to createPatchSetFromPatches
..*
in the filter pattern were ignored and led to missing search results. #9152Observability (monitoring):
alert_count
metric. #9832The 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!