Adam Herzog on June 20, 2020
We've shipped Sourcegraph 3.17 with many improvements to help you explore, navigate, and understand your code with universal code search:
🧠 Faster and automatic precise code intelligence
Precise code intelligence is now 35% faster than in 3.16. The experimental feature of automatic precise code intelligence will bring precise results to more repositories faster.
📊 Product preview: Code insights
Answer high-level questions about your codebase and track changes over time by aggregating data in Sourcegraph (experimental).
🔎 AND/OR operators for code search
AND/OR queries are included in the recently added literal search mode, and enabled for all users (no longer considered experimental).
🛠 Sourcegraph admin features
Easier alerting configuration, default repository permission syncing, updated Gitolite exclude pattern, improved debugging, and out-of-date notifications.
📝 Changelog
Includes every detail that changed in this release.
🎖️ Thank you
Sourcegraph couldn't be what it is without our contributors.
Install Sourcegraph 3.17 or update to Sourcegraph 3.17.
Precise code intelligence queries are now faster. The following chart shows the decrease in query latency while running our integration test suite compared to the previous two Sourcegraph releases. Sourcegraph 3.17 is 50% faster than in Sourcegraph 3.15, and 35% faster than in Sourcegraph 3.16.
In Sourcegraph 3.16, our precise code intelligence backend was rewritten from TypeScript to Go. This was part of a larger effort to aggressively optimize conversion and querying of LSIF data. That effort is now well underway!
The task of uploading and processing precise code intelligence bundles, which has previously been a sticking point on private instances with large repositories, has also been improved (around 45% faster than Sourcegraph 3.16 and 48% faster than Sourcegraph 3.15). The following chart shows the time required to upload the indexes for our integration test suite. This includes three commits from etcd-io/etcd, pingcap/tidb, and distributedio/titan, and two commits from uber-go/zap.
We’ve also poured some love into the on-disk format of precise code intel bundles (each bundle is now 30-50% smaller than the previous release). This should be helpful in private instances with large, frequent index uploads and constrained disk, where frequent eviction of recent bundles was previously an issue.
We plan to continue on this path of performance improvements, and the next release will focus on processing multiple bundles concurrently in order to multiply the benefit of this release’s raw latency gains.
An experimental feature on sourcegraph.com/search will automatically create an LSIF index for eligible repositories based on their popularity, so that the repository will have precise results on hover, definition, and reference operations. We are currently able to index Go repositories containing a go.mod file that do not require additional build steps, and are working on expanding the set of eligible repositories to support additional languages and more sophisticated repository structures.
To see this experiment in action, find a Go repository hosted on GitHub that has not been picked up by Sourcegraph. Then, visit that repository on sourcegraph.com/search. After navigating through the codebase for a while, you should see the hover tooltips and definition results become more accurate.
Currently, a repository will need 50 navigation events (hovers, jump to definition, find references) to trigger the auto-indexing procedure. We are continually tuning these heuristics to bring precise results to more repositories faster.
The Sourcegraph team is developing code insight functionality to help you answer high-level questions about your code. Code insights can use Sourcegraph code search, code intelligence, or even external services to give you the information you care about. Example insights include:
We would love to learn the big questions you have about your codebase! Share them with us in this quick code insights survey or email us at feedback@sourcegraph.com.
In Sourcegraph 3.15, we introduced experimental AND/OR queries for file content in regular expressions and structural search modes. Now in Sourcegraph 3.17, AND/OR queries are included in the recently added literal search mode, and enabled for all users (no longer considered experimental).
Initially, AND/OR operators support searching file contents. Operators for filters like repo:
and file:
will be supported in upcoming releases.
Configure Sourcegraph to send alerts about its health to notifiers like Slack, PagerDuty, and webhooks. Set observability.alerts
in your Sourcegraph configuration to automatically have alerts set up and subscribed to relevant notifiers in Grafana:
"observability.alerts": {
"id": "my-alert",
"level": "critical",
"notifier": { "type": "slack", /* ... */ }
}
For more information, see the Sourcegraph alerting documentation.
Sourcegraph 3.14 and Sourcegraph 3.15 introduced a faster and more scalable permissions syncing solution that could be enabled for your code host integrations. This background permissions syncing is now on by default for GitHub, Bitbucket Server, and GitLab for any integration with repository permissions configured. Please read our documentation for more details.
The Gitolite exclude
setting in the Gitolite external service configuration now supports a regular expression through the pattern field. Adding this regex support improves Gitolite’s pattern matching abilities.
This is consistent with how we exclude in other external services, and is a replacement for the deprecated configuration.
{
"exclude": [
// Exclude a single repository by name
{
"name": "github.com/my-team/repository-with-all-our-secrets"
},
// Exclude all repositories matching a regexp
{
"pattern": ".*/security-team/.*"
}
]
}
A unified set of container metrics, compatible across both Kubernetes and Docker Compose deployment types, provides the following information about containers through Grafana dashboards and alerting in both deployment types:
Recent alerts history is now included when filing a bug report from the report-a-bug-page (for example, https://sourcegraph.example.com/site-admin/report-bug) to better enable us to diagnose issues.
We have added experimental support for detecting if your instance is over or under-provisioned through a set of new dashboards and warning-level alerts.
Sourcegraph now shows update notifications to site admins (at 1 month out-of-date), and to users (at 4 months out-of-date). This will help encourage admins to keep their Sourcegraph instance current with the latest bug fixes, security updates, and new features and functionalities. Keeping Sourcegraph current ensures that you don’t run into issues due to running on a stale version.
These notifications start out as subtle informational alerts, and at 6+ months out-of-date, they will appear as red dismissible banners:
We are running a survey to understand how companies are dealing with massive amounts of code (aka Big Code).
fork
or archived
options are not explicitly set. #10624src_gitserver_repos_removed_disk_pressure
which is incremented everytime we remove a repository due to disk pressure. #10900gitolite.exclude
setting in Gitolite external service config now supports a regular expression via the pattern
field. This is consistent with how we exclude in other external services. Additionally this is a replacement for the deprecated blacklist
configuration. #11403observability.alerts
in the site configuration, instead of via the Grafana web UI. This does not yet support all Grafana notification channel types, and is not yet supported on sourcegraph/server
(#11473). For more details, please refer to the Sourcegraph alerting guide.and
and or
are now enabled by default in all search modes for searching file content. #11521content:"structural-pattern"
if the pattern without quotes conflicts with other syntax. #11481index:no
is present in the query.blacklist
configuration option for Gitolite is DEPRECATED and will be removed in 3.19. Use exclude.pattern
instead.The changelog for this and previous releases is available on GitHub.
A big thank you to everyone who contributed to Sourcegraph since the last release!
Install Sourcegraph 3.17 or update to Sourcegraph 3.17.
We want to hear what you think about Sourcegraph and the new updates in 3.17. Post on Twitter (remember to include (@sourcegraph) and we'll send you Sourcegraph swag!
Any questions about Sourcegraph? Get in touch on Twitter @sourcegraph, file an issue in our public issue tracker, or email feedback@sourcegraph.com. We look forward to hearing from you!
From the entire Sourcegraph team, happy coding!