Sourcegraph 3.10: Improved search autocompletion, native GitLab integration, and search and replace campaigns

Christina Forney

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.

Deploy or upgrade: Local | AWS | DigitalOcean | Kubernetes cluster

Improved autocompletion for search query filters

Autocomplete suggestions make it easier to use filters in your Sourcegraph searches. Use ctrl-space to trigger suggestions for filters you can apply to your query. As you type, the suggestions become more relevant, helping you to apply correct filter options or autocomplete repository or file names.

Sourcegraph provides native code intelligence to GitLab

Sourcegraph users use the Sourcegraph browser extension to take advantage of go-to-definition and find references on their code hosts. GitLab recognizes the value this brings to developer productivity and has partnered with Sourcegraph to provide this functionality natively to all GitLab users. Read our feature announcement and GitLab’s post about collaborating in the open.

Soon, GitLab.com users will be able to opt-in to native code intelligence for public repositories by enabling Sourcegraph in their user preferences. This feature is being rolled out incrementally to public projects on GitLab.com, and will first be available on the GitLab repository.

Users with private GitLab instances or repositories can enable Sourcegraph code intelligence as of GitLab 12.5. Take a look at the Sourcegraph integration documentation for how to configure it on your instance.

Create cross-repository search and replace campaigns

Sourcegraph now supports creating and tracking code-aware search and replace campaigns on GitHub and Bitbucket Server. When running a search and replace campaign, you can preview the changes across repositories and then generate the corresponding pull requests on your GitHub and Bitbucket Server instances. Once created, you can track the PRs to completion in a burndown chart.

Sourcegraph is introducing Comby syntax for automated search and replace campaigns. Comby syntax is code-aware and simplifies finding patterns in code. This new capability makes operations that could require complex or awkward regexp queries much simpler to write.

For example, to change how errors are logged throughout your code, like in this commit in the Go source:

// match:
errors.New(fmt.Sprintf(:[args]))

// replace:
fmt.Errorf(:[args])

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.

Precise LSIF-based code intelligence for 5 languages

With the completion of the Java LSIF indexer, LSIF-based precise code intelligence now supports five languages: Go, Typescript, Java, C++, and Python. See lsif.dev for the most up-to-date information on the list of languages with LSIF indexers.

We are looking for feedback from project owners interested in trying out precise code intelligence! Use our new LSIF quickstart guide to try it out manually before adding it as a step in your CI.

Scaling search for our largest customers

Customers wanting better indexed search performance or wishing to add many more thousands of repositories to Sourcegraph are now in luck! Sourcegraph's indexed search can now scale horizontally in cluster deployments.

The Kubernetes deployment manifest for indexed-search services has changed from a Normal Service to a Headless Service. This enables Sourcegraph to individually resolve indexed-search pods. Services are immutable, so a migration is required.

IMPORTANT: required migration for all Kubernetes deployments. Please see the 3.10 migration guide for details.

Fully automated release testing process

As part of Sourcegraph’s ongoing commitment to providing the highest quality, stable releases, our manual QA process has in the last two months been turned into a fully automated regression testing suite. We continue to aggressively invest in automated testing of Sourcegraph to provide extremely stable and reliable releases, and ultimately better features for our users. Look forward to reading more about this in an upcoming blogpost from Sourcegraph CTO, Beyang Liu, on our blog.

Changelog

3.10.0

Added

  • Indexed Search supports horizontally scaling. Instances with large number of repositories can update the replica field of the indexed-search StatefulSet. See configure indexed-search replica count. #5725
  • Bitbucket Cloud external service supports exclude config option. #6035
  • sourcegraph/server Docker deployments now support the environment variable IGNORE_PROCESS_DEATH. If set to true the container will keep running, even if a subprocess has died. This is useful when manually fixing problems in the container which the container refuses to start. For example a bad database migration.
  • Search input now offers filter type suggestions #6105.
  • The keyboard shortcut Ctrl+Space in the search input shows a list of available filter types.

Changed

  • Required Kubernetes Migration: The Kubernetes deployment manifest for indexed-search services has changed from a Normal Service to a Headless Service. This is to enable Sourcegraph to individually resolve indexed-search pods. Services are immutable, so please follow the migration guide.
  • Fields of type String in our GraphQL API that contain JSONC now have the custom scalar type JSONCString. #6209
  • ZOEKT_HOST environment variable has been deprecated. Please use INDEXED_SEARCH_SERVERS instead. ZOEKT_HOST will be removed in 3.12.
  • Directory names on the repository tree page are now shown in bold to improve readability.
  • Added support for Bitbucket Server pull request activity to the campaign burndown chart. When used, this feature leads to more requests being sent to Bitbucket Server, since Sourcegraph needs to keep track of how a pull request's state changes over time. With the instance scoped webhooks in our Bitbucket Server plugin as well as up-coming heuristical syncing changes, this additional load will be significantly reduced in the future.

Fixed

  • Support hyphens in Bitbucket Cloud team names. #6154
  • Server will run redis-check-aof --fix on startup to fix corrupted AOF files. #651
  • Authorization provider configuration errors in external services will be shown as site alerts. #6061

Removed

3.9.4

Changed

  • The experimental search pagination API's PageInfo object now returns a String instead of an ID for its endCursor, and likewise for the after search field. Experimental paginated search API users may need to update their usages to replace ID cursor types with String ones.

Fixed

  • The experimental search pagination API no longer omits a single repository worth of results at the end of the result set. #6286
  • The experimental search pagination API no longer produces search cursors that can get "stuck". #6287
  • In literal search mode, searching for quoted strings now works as expected. #6255
  • In literal search mode, quoted field values now work as expected. #6271
  • type:path search queries now correctly work in indexed search again. #6220

3.9.3

Changed

  • Sourcegraph is now built using Go 1.13.3 #6200.

3.9.2

Fixed

  • URI-decode the username, password, and pathname when constructing Postgres connection paramers in lsif-server #6174. Fixes a crashing lsif-server process for users with passwords containing special characters.

3.9.1

Changed

  • Reverted #6094 because it introduced a minor security hole involving only Grafana. #6075 will be fixed with a different approach.

The changelog for this and previous releases is available on GitHub.

Thank you

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, happy coding!

Get Cody, the AI coding assistant

Cody makes it easy to write, fix, and maintain code.