Code AI platform with Code Search & Cody
Go to file
Stephen Gutekanst 52a4d556d6
API docs: introduce running tally tables for optimized stats/counting (#26136)
In this change, we introduce a few running tally tables whose names are self-describing:

* `lsif_data_apidocs_num_pages` - used to optimize a query in lsifstore.
* `lsif_data_apidocs_num_dumps` - generally useful info, and used by the OOB migration.
* `lsif_data_apidocs_num_search_results_public` - generally useful info I would like to expose in the future
* `lsif_data_apidocs_num_search_results_private` - generally useful info I would like to expose in the future

We also introduce a running tally table `lsif_data_apidocs_num_dumps_indexed` which records the number of LSIF dumps that have been indexed for search by the OOB migrator, making the `Progress` percentage calculation for the API docs' OOB search migrator very cheap - as it had previously caused high CPU usage in codeintel-db due to the expensive `count()` involved. See #25856

Additionally, this concludes the major DB-schema rework I have been doing for the API docs search backend and re-enables API docs search by default, so that indexing will once again continue on Sourcegraph.com.

Fixes #25856

Helps #21938

Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
2021-10-18 08:54:31 -07:00
.buildkite Lighthouse: Fix port and run synchronously (#26102) 2021-10-15 09:54:28 +01:00
.github Update label-notify.yml to include delivery team (#26028) 2021-10-13 12:29:55 -04:00
.vscode web: add empty build-config package (#25965) 2021-10-12 16:14:50 +00:00
client [cloud] Add org codehost connections and repositories (#26029) 2021-10-18 17:15:09 +02:00
cmd [cloud] Add org codehost connections and repositories (#26029) 2021-10-18 17:15:09 +02:00
dev web: codemod web/enterprise/extensions web/enterprise/productSubscription web/enterprise/searchContexts components to CSS modules (#26038) 2021-10-15 00:23:47 +07:00
doc doc/admin: clearer table for required token scopes (#26195) 2021-10-18 10:22:26 -04:00
docker-images upgrade cadvisor to v0.42.0 (#26126) 2021-10-14 23:02:09 +00:00
enterprise API docs: introduce running tally tables for optimized stats/counting (#26136) 2021-10-18 08:54:31 -07:00
hacktoberfest ask contributors to comment on the issue they are tackling (#26127) 2021-10-14 15:48:46 -07:00
internal API docs: introduce running tally tables for optimized stats/counting (#26136) 2021-10-18 08:54:31 -07:00
lib Throw validation error in ParseChangesetSpecExternalID (#25956) 2021-10-12 13:46:21 +00:00
migrations API docs: introduce running tally tables for optimized stats/counting (#26136) 2021-10-18 08:54:31 -07:00
monitoring executor: Add better observability to untracked time during job (#26087) 2021-10-14 15:54:30 -05:00
schema gitlaboauth: Allow configuring a different api scope (#26152) 2021-10-18 11:32:43 +02:00
third-party-licenses chore: update third-party licenses (#25867) 2021-10-11 00:09:57 +00:00
ui/assets Fix .gitignore to properly handle img assets (#25106) 2021-09-20 17:32:52 +00:00
.dockerignore web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
.editorconfig sg: add run-set for core app (#23156) 2021-07-23 07:59:43 +00:00
.eslintignore web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
.eslintrc.js Allow default export for storybook stories (#23630) 2021-08-05 12:28:40 -07:00
.gitattributes monitoring: migrate monitoring docs to Sourcegraph API Docs (#22876) 2021-07-16 10:34:17 +08:00
.gitignore Performance: Pre-compress and serve Brotli assets (#25952) 2021-10-15 11:55:12 +01:00
.gitmodules Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
.golangci.yml Fix ioutil rule in golangci-lint (#24583) 2021-09-03 12:42:57 +02:00
.graphqlrc.yml Support multiple GraphQL schema files (#20077) 2021-04-19 14:35:49 +02:00
.mailmap Add Camden to mailmap (#19488) 2021-03-26 16:32:13 +00:00
.mocharc.js web: make web integration tests great again! (#25027) 2021-09-23 16:32:25 +02:00
.nvmrc Upgrade to node.js 16 (#24109) 2021-08-19 12:32:43 +02:00
.percy.yml web: make web integration tests great again! (#25027) 2021-09-23 16:32:25 +02:00
.prettierignore monitoring: migrate monitoring docs to Sourcegraph API Docs (#22876) 2021-07-16 10:34:17 +08:00
.stylelintignore docs: extension architecture (#15679) 2020-12-02 21:17:24 -05:00
.stylelintrc.json Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
.tool-versions ci: add trivy security scanning step (#25756) 2021-10-13 16:28:07 -07:00
.yarnrc Ignore workspace root check (#19608) 2021-03-31 15:30:11 +01:00
babel.config.js GraphQL Client: Add Apollo/client and implement on profile settings page (#22166) 2021-06-29 09:23:33 +01:00
CHANGELOG.md Move fix for primary email bug (#26166) 2021-10-18 15:16:22 +00:00
CODENOTIFY Deglobalize CODENOTIFY settings for eseliger (#16710) 2020-12-14 15:50:22 +01:00
CONTRIBUTING.md Update CONTRIBUTING.md (#26010) 2021-10-13 10:28:14 +00:00
doc.go Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
go.mod Support httpgzip debugging (#26187) 2021-10-18 12:53:13 +01:00
go.sum Support httpgzip debugging (#26187) 2021-10-18 12:53:13 +01:00
graphql-schema-linter.config.js Support multiple GraphQL schema files (#20077) 2021-04-19 14:35:49 +02:00
gulpfile.js Improve integration test suite CI run script (#24666) 2021-09-07 16:07:11 +02:00
jest.config.base.js chore: Add use-resize-observer mock (#25361) 2021-09-28 14:05:41 +07:00
jest.config.js web: add empty build-config package (#25965) 2021-10-12 16:14:50 +00:00
LICENSE update licensing language (#25620) 2021-10-04 15:40:59 +01:00
LICENSE.apache Move all client code into client/ folder (#14480) 2020-10-07 22:23:53 +02:00
LICENSE.enterprise clarify license (#2543) 2019-03-03 16:39:46 +08:00
lighthouserc.js Lighthouse: Fix port and run synchronously (#26102) 2021-10-15 09:54:28 +01:00
package.json search: fix tour blocking monaco autocomplete (#26132) 2021-10-15 13:22:30 -07:00
postcss.config.js extensibility: add featured extensions to registry (#21665) 2021-06-10 13:55:20 -04:00
prettier.config.js Publish Sourcegraph as open source 🚀 2018-09-30 23:13:36 -07:00
README.md docs: Move "install sg" step up in quickstart (#25829) 2021-10-08 11:20:37 +02:00
renovate.json update upstream alpine (#24896) 2021-09-13 12:27:29 -05:00
SECURITY.md consolidate security policy (#7906) 2020-01-21 10:03:11 -08:00
sg.config.yaml dev/sg: introduce 'sg ci logs' with Loki support (#25835) 2021-10-12 11:14:50 -04:00
shell.nix nix: add golangci-lint (#25592) 2021-10-01 15:39:40 +02:00
tsconfig.all.json web: add empty build-config package (#25965) 2021-10-12 16:14:50 +00:00
tsconfig.json web: flatten frontend packages inside of the client folder (#19378) 2021-03-26 15:35:26 +08:00
yarn.lock search: fix tour blocking monaco autocomplete (#26132) 2021-10-15 13:22:30 -07:00

Sourcegraph

build

Sourcegraph is a fast and featureful code search and navigation engine.

sourcegraph com_github com_golang_go_-_blob_src_net_http_request go_L855_6

Features

Try it now

Sourcegraph has three editions:

  • Sourcegraph Cloud lets you search over the open-source ecosystem plus your private code. Search strings, search patterns, search symbols and find references across your entire codebase and the open-source world.
  • Sourcegraph Enterprise lets you run your own Sourcegraph instance in your own environment.
  • Sourcegraph OSS is an open-source version of Sourcegraph that provides the core functionality of Sourcegraph (code search, code browsing, basic code navigation), but lacks more advanced features (enterprise authentication, repository permissions, admin controls, advanced code navigation, etc.)

Source code for all three editions is contained in this repository. See the License section for more details.

More:

  • Install the open-source browser extension to add Sourcegraph-like powers to your code review and code host.
  • File feature requests and bug reports in our issue tracker.
  • Visit about.sourcegraph.com for more information about features, use cases, and organizations that use Sourcegraph.

Self-hosted installation

Sourcegraph Enterprise (free up to 10 users)

The fastest way to run Sourcegraph self-hosted is with the Docker container. See the quickstart installation guide. There are also several additional ways of running a production instance.

Sourcegraph OSS

  1. Install dependencies
  2. Clone this repository
  3. Install sg
  4. Ensure Docker is running
  5. Initialize the PostgreSQL database
  6. Configure the HTTPS reverse proxy
  7. Start the development server
    sg start oss
    

Sourcegraph should now be running at https://sourcegraph.test:3443.

For detailed instructions and troubleshooting, see the local development documentation.

Development

Refer to the Developing Sourcegraph guide to get started.

Documentation

The doc directory has additional documentation for developing and understanding Sourcegraph:

License

This repository contains both OSS-licensed and non-OSS-licensed files. We maintain one repository rather than two separate repositories mainly for development convenience.

All files in the enterprise and client/web/src/enterprise fall under LICENSE.enterprise.

The remaining files fall under the Apache 2 license. Sourcegraph OSS is built only from the Apache-licensed files in this repository.