Introducing Sourcegraph Server 2.3

By Quinn Slack on December 5, 2017

Search code over all of your company's repositories, save and reuse common search queries and scopes, and do it all more quickly with style. This release also includes previews of diff/commit search and author/date filters, which help you debug issues and find usage examples in your company’s code.

Sourcegraph Server gives the power of great code search to every developer at your company, so you can ship better code faster. It runs securely in your own network and is easy to install and upgrade.

Ready to install or upgrade? Start a free trial of Sourcegraph Server 2.3 to get great code search today. Current customers can upgrade now.

Key highlights of Sourcegraph Server 2.3:

Better GitHub.com and GitHub Enterprise integration

Sourcegraph Server now integrates more closely with GitHub.com and GitHub Enterprise to synchronize the list of searchable repositories. You can now specify a token for a bot user with access to the precise set of repositories to make searchable on Sourcegraph Server. This works for public and private repositories. You can even connect Sourcegraph Server to GitHub.com and multiple GitHub Enterprise servers at the same time.

Previously, server admins needed to add each repository manually. That still works for any Git repository host, and we'll expand this easier integration method to support more hosts soon.

See how to set up Sourcegraph Server to search over repositories hosted on:

Light color theme

By popular request, we've added a light color theme in addition to our current dark theme! It's not just aesthetic: we've heard from people who use Sourcegraph on their daily train commute and on the beach (really!), and the light color theme handles glare better. Click the sun/moon toggle next to your profile avatar to switch between the light and dark themes.

SS2.3 light theme

Organizations

You can now create and join organizations (also known as “orgs”). Organizations are named groups of users with an associated JSON settings file. These settings take effect for all users who are members of the organization. What kinds of settings, you might ask? This release includes custom search scopes and saved queries, and more features that rely on configuration will be rolling out soon.

Server admins can create organizations that new users automatically join, and any user can create organizations and invite new members from the settings page.

SS2.3 orgs

Custom search scopes

Every project and team has a different set of repositories they commonly work with and search over. We've added custom search scopes to enable users and organizations to search over predefined subsets of files and repositories. Instead of typing the set of files and repositories you search over, you can now simply define a search scope and select it from the dropdown next to the search box whenever you need.

SS2.3 settings and search scopes

Saved queries

Saved queries let you save and describe search queries so you can easily monitor the results on an ongoing basis. You might think of them as the beginning of “Google Alerts or IFTTT/Zapier for your code.”

You can create a saved query for anything searchable, including (with this release) diffs and commits across all branches of your repositories. Saved queries can be an early warning system for common problems in your code--and a way to monitor best practices, the progress of refactors, etc.

See some examples of useful saved queries, including:

  • Recently security-related changes on all branches (which we recommend tech leads monitor every day)
  • Hacks and TODOs in code
  • New usages of specific functions
  • Lint-disable on unmerged branches
SS2.3 saved queries

Admin dashboard

Server admins now have a dashboard to view and manage users and usage. Go to the settings page and navigate to the admin tab to view the number of page views and search queries users have executed on Sourcegraph. Add admin users by adding usernames to the adminUsername field in your server configuration.

More single sign-on (SSO) integrations: OpenID Connect and SAML

Sourcegraph Server now supports single sign-on (SSO) user authentication via OpenID Connect and SAML 2.0. This includes (but is not limited to) support for the following SSO providers: Okta, OneLogin, Ping Identity, Auth0, Salesforce Identity, and Microsoft Azure Active Directory.

Search and code intelligence on GitHub.com in Chrome/Firefox

The Sourcegraph Chrome extension and Firefox extension now support Sourcegraph Server. After entering the Sourcegraph Server URL in the browser extension settings page, a Sourcegraph search toggle icon will appear in the GitHub search box. Customers of Sourcegraph Enterprise can integrate with GitHub Enterprise and get code intelligence (hovers, go-to-definition, etc.) on GitHub.com and GitHub Enterprise.

SS2.3 GitHub browser extension

Repository list page

Click Browse in the navigation bar to view a list of all repositories on the server that are available for searching and browsing.

Markdown view

Markdown files are now rendered. See an example rendered public markdown file on Sourcegraph.com. To view raw markdown, click the “View source” button on the top right of the code view.

Faster file tree

The file tree now only shows the siblings of the current file, so it’s much easier to use when you’re deep inside a repository. And it does the right thing if you navigate to parent directories using the breadcrumbs. Previously the file tree would always show the entire tree, but based on feedback, we think the new tree works better for both large and small repositories.

Go to canonical URL ‘y’ hotkey

Press the y key when viewing a file to go to its permanent, canonical URL, with the full 40-character Git commit SHA in the URL.

Enterprise improvements

Sourcegraph Enterprise customers get all of these improvements plus more, including code intelligence improvements and others detailed separately in the Enterprise release notes.

Other features (in preview)

We’re also excited to ship previews of other features, by popular demand. We expect these features to be out of preview for next month’s release. In the meantime, please try them, send feedback, and report issues.

You can now search over commit diffs using the type:diff operator in search queries. This is useful when debugging issues (“what changed about the parseDocument function?”) and finding usage examples (“show me a self-contained commit adding a new page to our web app”). See a sample diff search on a public repository on Sourcegraph.com.

But that’s not all! For the intrepid, you can search within commit diffs on multiple branches by specifying them in a repo: field after the @ sign. See non-master-branch commits containing const in a public repository on Sourcegraph.com, for example. After the @, separate Git refs with :, specify Git ref globs by prefixing them with *, and exclude commits reachable from a ref by prefixing it with ^. We’ll improve documentation as this feature nears release.

Like diff search above, but use type:commit to search inside commit messages. See all commits mentioning “bug” or “fix” in a public repository on Sourcegraph.com, for example.

New search filters: author, committer, before, after, and commit message

To go along with diff and commit search, we’ve added new search filters. While in preview, these filters only apply to type:diff and type:commit searches, not to normal file searches.

  • author:name or author:[email protected] to show only diffs or commits authored by that user (example)
  • committer:name or committer:[email protected] (same as above, but for the Git committer, which sometimes differs from the Git author)
  • after:”3 weeks ago”, before:”june 25, 2017”, before:”last thursday”, etc., to filter by commit date (example)
  • message:”hello” to show only commits or diffs whose commit message (including the full message body) contains “hello” (example)

Upgrade today

Want to try Sourcegraph Server? Request a free trial. You can also see the product overview and pricing.

Current customers can upgrade now.