# Technical Changelog This page documents all notable changes to Sourcegraph. For more detailed changelog posts, please [read here](https://sourcegraph.com/changelog/). {/* CHANGELOG_START */} # 6.1 Patch 5 ## v6.1.5633 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.5633) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.5633) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.5633) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.5633) ### Features #### Cody - Allow non-aws bedrock endpoints with Bedrock provider `(PR #4196)` - Add AWS Bedrock client support for non-AWS Bedrock-compatible endpoints Backport 9054d7c14db0ecf96200c2985c5b550b6dd2ded0 from #4145 ### Reverts There were no reverts for this release ### Uncategorized #### Others - feat(cody gateway): Update default chat model to Claude 3.7 Sonnet wi… `(PR #4207)` - See [https://github.com/sourcegraph/sourcegraph/pull/4063](https://github.com/sourcegraph/sourcegraph/pull/4063) - [Backport 6.1.x] Add thinking/chain-of-thought support for Anthropic models via Vertex AI `(PR #4202)` - [Backport 6.1.x] bitbucket: Add support for subpath in cloneurl resolution `(PR #4195)` {/* RSS={"version":"v6.1.5633", "releasedAt": "2025-03-21"} */} # 6.1 Patch 4 ## v6.1.4020 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.4020) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.4020) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.4020) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.4020) ### Features #### Source - sub-repo-perms: add limited support for IPv4 wildcard semantics `(PR #4018)` - Backport 04606e20fbc8f13ad473533820b8f5df71e20ad7 from #3989 ### Reverts There were no reverts for this release {/* RSS={"version":"v6.1.4020", "releasedAt": "2025-03-12"} */} # 6.1 Patch 3 ## v6.1.2889 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.2889) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.2889) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.2889) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.2889) ### Features #### Search - Adds `Team` support in SvelteKit ownership panel `(PR #3830)` - Implement ownership information for the Sveltekit rewrite. Backport 30f3ea6a6c115c633291c388ff599ff107d7f38b from #3738 - add ownership panel MVP to sveltekit app `(PR #3829)` - Adds read-only ownership panel to Sveltekit frontend - Gated behind 'svelte-ownership' feature flag Backport 469f2ea37a214f3c0eb1cbde012625bdbef84b6f from #3558 ### Fix #### Batch Changes - transformChanges.group.directory should not interpret file names as directories `(PR #3726)` - fix(batches): transformChanges.group.directory should not interpret file names as directories Backport 6ffff463be1743b89ab865018e46a34ff4e549f5 from #3721 #### Cody-Gateway - removes ModelCapabilityEdit from Claude 3.7 Sonnet `(PR #3737)` #### Search - missing symbol changes from merge commits in Rockskip `(PR #3844)` - This fixes a bug in Rockskip (symbol search) where we would miss symbol changes introduced by merge commits. This bug manifested in incorrect search results and errors of symbols service similar to "pathspec (...) did not match any files". Backport d8426a9aec4930ce71922562fdebdcfd0d657cb4 from #3699 #### Source - Fix bug where the token always has to be entered when editing certain code host connections `(PR #3751)` - Fixed issue where the code host connection editor would always ask for the token to be re-entered. Backport 428c1eef19d68b38037bd35457632a007a78494d from #3719 #### Workspaces - apply jitter to global reconciler `(PR #3772)` #### Others - update cody web to 0.31.1 to fix issue with pasting linebreaks (#3696) `(PR #3729)` - fix: prompt templates should not fail when pasting linebreaks ### Chore #### Security - Update Caddy `(PR #3906)` ### Refactor #### Search - Normalize `displayName` across `Person` and `Team` types `(PR #3825)` ### Reverts There were no reverts for this release {/* RSS={"version":"v6.1.2889", "releasedAt": "2025-03-05"} */} # 6.1 Patch 2 ## v6.1.1295 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.1295) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.1295) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.1295) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.1295) ### Features #### Cody-Gateway - add thinking/reasoning support to Anthropic models `(PR #3708)` - Added support for chain-of-thought reasoning in Anthropic models, allowing users to see the model's thinking process for complex tasks. Backport 389bf9a4f2cf8ed7762cf8876b0efe4064e2b234 from #3507 ### Reverts There were no reverts for this release {/* RSS={"version":"v6.1.1295", "releasedAt": "2025-02-25"} */} # 6.1 Patch 1 ## v6.1.376 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.376) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.376) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.376) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.376) ### Features #### Agents - add support for globally enabled rules (#3480) `(PR #3502)` - simplify agent admin onboarding experience `(PR #3501)` - You can now create a GitHub App with all the right permissions/events for code review agents. Previously, you had to manually customize the apps. Backport 87e8d77f464912cbd4356a8c3c39fba1d099e3b6 from #3473 #### Cody - add "autocomplete" capability to Claude Haiku models `(PR #3638)` #### Tenant - telemetry for adding code `(PR #3560)` ### Fix #### Agents - fix bug when using global rules in default revision `(PR #3524)` - fix bug where POST /reviews always failed `(PR #3522)` - improve error reporting in `POST /reviews` `(PR #3518)` - render errors as strings in agent run logs `(PR #3516)` - Errors are now rendered as strings in agent run logs. Previously, they rendered as `Source: {}`, which wasn't helpful. Backport d1f18d280fc9d3a985a284c31e819412d2add606 from #3514 - hide listing of rules to fix unconditional error `(PR #3498)` #### Code Intelligence - Correctly handle document counts exceeding MaxInt32 `(PR #3596)` - Fixes a bug in SCIP index processing for instances with a long history of processing large uploads. Backport 48e7b47898ee7710f12270c6861c335a2ef75f48 from #3595 #### Release - check for and remove timescaledb extension `(PR #3584)` - fix(rel): remove TimescaleDB from existing database if found during upgrade to Postgres 16 on the codeinsights database. Backport 71b4af3d6faef054803db0151b2cc7b151bb1c0e from #3556 #### Security - Allow the admin's HTTP auth provider headers in CORS preflight requests `(PR #3540)` - HTTP header auth username and email headers, if configured, are no longer blocked by CORS. Backport 782b98a780dac335576b8f43affb4b1a10123882 from #3512 #### Others - transformChanges.group.directory should ignore file names `(PR #3594)` - fix: transformChanges.group.directory now ignores file names Backport 3b76fe4ab146565b0e736231353b1e24f1468241 from #3576 - Fix missing JSON schema on serve-git connection page `(PR #3567)` - do not close stream when tab is unfocused `(PR #3529)` - Fixes an (unreleased) issue that could cause duplicate search results when switching between tabs. Backport 746a29a25d6e54dfe7ab38f70855a9f58a652426 from #3528 ### Chore #### Agents - Allow non-site-admins to read agent endpoints [CODY-4962] `(PR #3511)` - GET access to `/.api/agent/*` endpoints for non-site admins Backport 321543c38aab312c7d3924e19617f9f247c3a5fa from #3504 ### Reverts There were no reverts for this release ### Uncategorized #### Others - Backport 3542 to 6.1.x `(PR #3612)` - [Backport 6.1.x] tenant: Report newRepositoryTotalSizeBytes for setSelectedRepos `(PR #3568)` {/* RSS={"version":"v6.1.376", "releasedAt": "2025-02-19"} */} # 6.1 Patch 0 ## v6.1.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.1.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.1.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.1.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.1.0) ### Features #### Agents - allow code review agent to auto-run based on feature flags `(PR #3477)` - Code review agents can now automatically run on GitHub Pull Requests (actions: `opened` and `synchronize`) based on a feature flag. Both boolean (true/false) and rollout (percentage-based ) feature flags are supported. For example, this means you can enable automatic reviews on 10% of all opened PRs. - Review Diagnostic Feedback [CODY-4951] `(PR #3456)` - Adds a feedback UI for diagnostics within the Agents app. - report progress with GitHub Commit Status API `(PR #3445)` - The Code Review Agent now reports live status with the GitHub Commit Status API making it possible to open Agent logs directly from GitHub. - Make Review Agent leverage PR title and description (CODY-4749) `(PR #3431)` - make review triggers configurable `(PR #3368)` - You can now request review from the Review Agent by posting a pull request comment with a configurable substring - Code reviews deduplicate diagnostics from historical review [CODY-4743] `(PR #3355)` - Code reviews deduplicate diagnostics from historical reviews - add basic review rules to repo `(PR #3335)` - rules-related API improvements `(PR #3305)` - read the cody repo for rules as well `(PR #3212)` - show rules that apply to a file in the code view `(PR #3200)` - more agents UI updates `(PR #3177)` - add Run API, view live progress on agent runs `(PR #3171)` - Add `GET /.api/agents/runs` to list runs of an agent, and other related endpoints including the ability to view logs - make Review agent handle large diffs `(PR #3136)` - The Review agent can now review larger diffs. - expose rules API endpoints and use rule URIs instead of IDs `(PR #3056)` - Adds Conversation HTTP handlers and generated DB columns [CODY-4751] `(PR #3021)` - Adds HTTP handlers for `/.api/conversations` for creating and filtering conversations as well as a DB method for querying conversations. - agents UI and requisite new APIs `(PR #2818)` #### Code Intelligence - Syntactic indexing job resetter `(PR #3336)` - Periodically delete old audit logs from syntactic jobs `(PR #3278)` #### Cody - Add Prompt Caching to Code Context (CODY-4807) `(PR #3198)` #### Cody-Gateway - add actor-auth-status metric `(PR #3460)` - Add cache related token usage data to telemetry(CODY-4808) `(PR #3396)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - Roll out new Gemini Models `(PR #3357)` - Move Gemini 2.0 Flash from Experimental to GA, add Gemini 2.0 Flash-Lite Preview Experimental and Gemini 2.0 Pro Experimental #### Enterpriseportal - add tracking for verified domains `(PR #3447)` #### Lib/Msp - add OTEL instrumentation to gRPC clients by default `(PR #3428)` #### Local - install mise as part of `sg setup` and deprecate asdf `(PR #2877)` #### Model-Config - Implement reasoning parameters for OpenAI models `(PR #3489)` #### Msp/Auditlog - add trace ID to response headers `(PR #3248)` #### Release - Add init subsection to release.yaml `(PR #3223)` - feat: add init cmd subsection to release.yaml parser - feat: add init section to release.yaml #### Release - `sg upgradetest` `(PR #3388)` - allow the upgradetest to be run locally without knowing the bazel invocation required to stamp the build etc - unlock local minor and major branch upgradetests #### Search - Add enterprise starter cta to dotcom search home `(PR #3090)` #### Telemetry - add events for repo page views `(PR #3265)` - add billing metadata to toggles `(PR #3264)` #### Tenant - fix workspace management UI quirks `(PR #3227)` #### Web - Update cloning status to new designs `(PR #2760)` #### Workspace - workspace creation error UX `(PR #3383)` #### Workspaces - attach cf ray id to otel traces `(PR #3387)` - add WORKSPACES_ROUTER_DISABLE_RECONCILERS `(PR #3382)` - upsert/delete route on manual reconcile `(PR #3378)` - contact support to claim a name `(PR #3340)` - record clientside payment errors `(PR #3319)` - remove profanity blocks `(PR #3317)` - add cancellation/churn notifications in Slack `(PR #3314)` - add 'code search and code navigation' to plan page `(PR #3267)` - allow creation form to be pre-filled with a coupon `(PR #3228)` - seat-purchase notifications for Slack `(PR #3225)` - allow Stripe promo codes only, enforce short-lived promo codes `(PR #3222)` - enforce SAMS client per instance, add instance debug UI `(PR #3138)` - metric for Cloudflare interactions, include status from Stripe `(PR #3117)` - internal admin trigger to reconcile workspace `(PR #3070)` - add instance class option for employees `(PR #3067)` - write snapshot of workspace details into BigQuery on creation `(PR #3049)` - plans page refresh `(PR #2983)` #### Workspaces/Billing - add workspace name/displayname to Slack notifications `(PR #3262)` - include total seats in slack notification `(PR #3260)` #### Workspaces/Slack - make coupons links, refactor slack formatting `(PR #3332)` #### Workspaces/Telemetry - add marketingtracking and anonymous UID `(PR #3343)` #### Others - prompt templates editor supports @ current mentions `(PR #3397)` - feat: prompt templates editor supports dynamic @ mentions - add event for codeintel highlights `(PR #3261)` - Add support for VoyageAI reranker `(PR #3155)` ### Fix #### Agents - redirect to settings page after creating agents `(PR #3471)` - Creating a new agent now redirects to the settings page for further setup - correct typo in system prompt `(PR #3421)` - disable Agents unless feature flag is enabled `(PR #3420)` - show diagnostics on review page `(PR #3358)` - fix bug where review agent posted comments on wrong lines `(PR #3347)` - Add fallback when rules list is empty (CODY-4834) `(PR #3285)` - use globs instead of regexp for include/exclude filters `(PR #3277)` - Rule include/exclude patterns are now interpreted as globs (`*.go`) instead of regexp (`.*\.go`). Negative include patterns like `!*.go` will be interpreted as exclude patterns, and vice versa. - remove agents from the navbar on dotcom `(PR #3166)` #### Auth - Add missing allowSignup option to HTTP header auth provider `(PR #3232)` - fix/auth: "http-header" auth provider can "allowSignup": false to disable automatic account creation #### Ci - disable puppeteer browser tests `(PR #3298)` - disable client checks `(PR #3290)` - update licenses script and rerun it `(PR #3053)` #### Code Intelligence - Optimize GetSymbolUsages core query `(PR #3035)` - Decorrelate subquery for hover docs `(PR #3031)` - Bound number of docs read for GetHover `(PR #3000)` #### Cody - include token usage in OpenAI streaming requests `(PR #3441)` - Check that completion exists `(PR #3410)` - include token usage in OpenAI streaming requests `(PR #3376)` - use max_completion_tokens field for OpenAI `(PR #3362)` - Pull correct client-name param `(PR #3167)` - show actual chat quota usage for free-tier users `(PR #2970)` - filter allowed models by capability for PLG users `(PR #2506)` #### Cody-Gateway - v1/limits handler `(PR #2908)` #### Dev - internal/memcmd: add support for using mise in tests `(PR #3256)` #### Local - set GOWORK=off for frontend in sg `(PR #3111)` #### Models - update OpenAI o3-mini model pricing `(PR #3303)` #### Msp/Iam - grant Cloud Deploy executor access to images `(PR #3175)` #### Msp/Runtime - fix pgx pool stats metric `(PR #3126)` #### Multi Tenant - bring back description text to the github add account setup step `(PR #3325)` - improve workspace validation states `(PR #3093)` #### Multitenant/Mt-Router - fix up routes and redirect `(PR #3195)` #### Release - fix migrator update check `(PR #3173)` - fix(rel): fix migrator upgrade check #### Search - Change chevrons in in-file search panel `(PR #3367)` - Web app broken if settings contains 'message' key `(PR #3363)` - Bust cache for new logo (favicon) `(PR #3350)` - Use separate light and dark SG logo variants `(PR #3280)` - Link to correct dashboard page in extensions CTA `(PR #3182)` - Fix search aggregation chart popover `(PR #3046)` - Chat tips modal covered by file sidebar `(PR #3016)` #### Source - Fix Gerrit clone URL resolution `(PR #3446)` - Fix inability to update Gerrit code host config URL `(PR #3361)` - Fix bug where the URL of a Gerrit code host connection could not be updated. - web: ensure list of external accounts has unique entry for each key `(PR #3323)` - A bug on the user's account security page that could result in duplicated / buggy entries has been fixed. - RepoSource.BitbucketServer.CloneURLToRepoName(): support more URL shapes `(PR #3224)` - The logic that translates Bitbucket clone URLs to repository names has been fixed to support: - URLs that have no scheme (like `"bitbucket.sgdev.org/sourcegraph/sourcegraph"`) - SSH clone urls that don't have a `ssh://` scheme prefix (like `git@bitbucket.sgdev.org:sourcegraph/sourcegraph.git`) - gitserver: merge base: add explicit test to ensure ordering of RevisionNotFoundErrors `(PR #2779)` #### Tenant/Repositories - do not show search text if empty `(PR #3321)` #### Ui - Display Revision not found instead of Empty repo `(PR #3235)` #### Web - add missing separator under organizations `(PR #3253)` #### Workspaces - correctly apply management retries `(PR #3384)` - spread out routerreconciler workload more `(PR #3377)` - reduce frequency of custom input telemetry event `(PR #3342)` - apply coupon when estimating price on existing subscription `(PR #3331)` - tweak plan page copy again `(PR #3328)` - use display name on join page `(PR #3326)` - drill coupon from homepage, make sure coupon is applied immediately `(PR #3312)` - more sentence-casing fixes `(PR #3255)` - fix capitalization in creation form `(PR #3218)` - hide open-invites toggle when email domain is not allowed `(PR #3213)` - price is monthly `(PR #3197)` - fix name validation `(PR #3165)` - include class in unseen instance counts, remove unseen instances from normal counts `(PR #3134)` - log check-name errors as unexpected errors `(PR #3075)` - test that post-normalization bad words are caught `(PR #3047)` #### Workspaces/At-Capacity - capitalize error message `(PR #3381)` #### Workspaces/Metrics - report all workspace/instance states `(PR #3297)` #### Others - Color removed from filter sidebar in search `(PR #3399)` - change workspace icon in profile menu `(PR #3241)` - Fix yaml file `(PR #3183)` - index matches safely `(PR #3168)` - server checks reindex at 5.10 now `(PR #2881)` - single docker server checks for 5.10-reindex.completed instead of 5.1-reindex.completed ### Chore #### Agents - Basic Telemetry for Code Review [CODY-4903] `(PR #3389)` - [CODY-4830] Update Conversation and Review store patterns `(PR #3259)` - remove typebox for runtime type validation `(PR #3214)` #### Ci - migrate rules_oci to MODULE.bazel `(PR #3352)` - fixes gazelle issues `(PR #3296)` - migrate rules_go and gazelle to bazel mod `(PR #1716)` #### Cloud - update cloud-mi2 wolfi base image `(PR #3199)` #### Code Intelligence - Make scip-syntax parallelism configurable `(PR #3206)` - Use clearer names & error propagation in SCIW initialization `(PR #2997)` #### Deps - upgrade sourcegraph-accounts-sdk-go `(PR #3142)` #### Dev - Upgrade to pnpm v9.15.4 `(PR #3266)` - Delete go.mod for monitoring/ directory `(PR #2951)` #### Modelconfig - remove spammy logs `(PR #3452)` #### Msp/Cloudsql - remove pgx.Acquire span `(PR #3141)` #### Release - update src-cli dependencies for 6.0.0 release `(PR #3186)` - Release src-cli 6.0.0 #### Search - Permanently enable the new web app on dotcom `(PR #3448)` - Remove new branding branching logic `(PR #3270)` #### Security - Auto-update all packages in Sourcegraph base images `(PR #3482)` - Auto-update all packages in Sourcegraph base images `(PR #3239)` #### Workspaces - Remove cody upsell in workspace creation `(PR #3391)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - Update ES Cody limits to 2x Enterprise `(PR #3069)` - make user metadata available on userauth.UserInfo `(PR #3051)` #### Workspaces/Blocklists - add 'unconfigured' to blocked names `(PR #3043)` #### Workspaces/Web - rename 'quickJoin' vars to 'openInvite' `(PR #2974)` #### Others - update list of allowed headers for untrusted clients `(PR #3486)` - add events for hoverables `(PR #3433)` - update third-party licenses `(PR #3414)` - Output formatting updates based on feedback `(PR #3349)` - Entitle URL updates `(PR #3345)` - Add more doc comments for file checker types `(PR #3307)` - update third-party licenses `(PR #3273)` - fix integration tests `(PR #3263)` - Update teams.yml for product platform changes `(PR #3252)` - Remove orphaned modules / import to non-exisiting module `(PR #3219)` - Drop hubspot logging from non-dotcom auth methods `(PR #3132)` - update third-party licenses `(PR #3095)` - Remove gorilla/context `(PR #3089)` - Layout finetuning of Creating Workspaces and Tenant Onboarding `(PR #3065)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) ### Reverts - Revert: use max_completion_tokens field for OpenAI and the inclusion of token usage in OpenAI streaming requests `(PR #-1)` - Revert "Omnibox: route likely code generation commands to Chat (#2969)" `(PR #2969)` ### Uncategorized #### Others - Update Cody Web v0.31.0 `(PR #3474)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - gateway: Bump limits for ES `(PR #3409)` - gomod: update Zoekt for file language fix `(PR #3408)` - msp: use TFC robot email for IAP `(PR #3400)` - Alexjean baptiste cody 4813 azure gpt model enum update or override `(PR #3380)` - web: Make CTA for workspaces correctly reload page for marketing content `(PR #3341)` - Fix path to pt to updated `useObservables` family of hooks `(PR #3322)` - Removing DeepSeek V3 model `(PR #3309)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - workspaces: Never show wallet payments `(PR #3304)` - sg: Extend the mise check to early-exit if env var is set `(PR #3302)` - refactor(cody-gateway) Remove support for OpenAI o1-mini model (CODY-4839) `(PR #3295)` - Remove support for OpenAI o1-mini model. - refactor(cody-gateway) Deprecate Gemini 1.5 Flash, Claude 3 Opus, Claude 3 Haiku, and Mixtral 8x7B (CODY-4839) `(PR #3293)` - Deprecate Gemini 1.5 Flash, Claude 3 Opus, Claude 3 Haiku, and Mixtral 8x7B - gomod: bump Zoekt after package restructuring `(PR #3271)` - Adding O3 mini model to OpenAI `(PR #3254)` - Adding O3 mini model to OpenAI `(PR #3254)` - telemetry: add ClientFeature for more granular reporting of search events `(PR #3229)` - Search: enable scip-ctags for C `(PR #3215)` - cleanup: simplify search observables and switch to fetch-event-source `(PR #3196)` - completions: improve prometheus metrics for code/chat completions `(PR #3181)` - partially fix erroneous `svelte-check` errors in local dev `(PR #3180)` - Adding DeepSeek V3 support through fireworks `(PR #3170)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - lib/marketingtracking: publish module for SAMS to consume `(PR #3169)` - web: Some more user menu polish `(PR #3140)` - remove builtin rules from code review agent `(PR #3086)` - workaround for `sg start minimal-sveltekit` and other "minimal" entrypoints `(PR #3085)` - doc/workspaces: fix link to chargeback playbook `(PR #3076)` - generate TypeScript types and runtime type validators for Agent API `(PR #3055)` - Update sg setup for employees `(PR #2990)` - chore(Workspaces) Fix repo size increment from 500mb to 1 gig `(PR #2977)` - feat(agents) Conversations API DB Tables [CODY-4683] `(PR #2964)` - Adds `agent_conversations` and `agent_conversation_messages` tables as well as `ConversationStore` - Replace o1 preview model with o1 `(PR #2924)` - OPTIONAL; info at [https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c) - feature(codeintel): add syntax highlighting for Svelte `(PR #2690)` - Added syntax highlighting for `.svelte` files - mt-router: allow passthrough for instance health check endpoint `(PR #2689)` ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - Fix Gerrit clone URL resolution (#3446) `(PR #3449)` - Fix inability to update Gerrit code host config URL (#3361) `(PR #3439)` - Fix bug where the URL of a Gerrit code host connection could not be updated.(cherry picked from commit e6da1ceb9586bf109339f06220c1fdbbf570a6d9) - prompt templates editor supports @ current mentions (#3397) `(PR #3436)` - feat: prompt templates editor supports dynamic @ mentionsPR description tips: [https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e](https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e) - Roll out new Gemini Models (#3357) `(PR #3412)` - Move Gemini 2.0 Flash from Experimental to GA, add Gemini 2.0 Flash-Lite Preview Experimental and Gemini 2.0 Pro ExperimentalCo-authored-by: arafatkatze [arafat.da.khan@gmail.com](mailto:arafat.da.khan@gmail.com) (cherry picked from commit 4aa5aa41cc0f5e2be80c77e8e8709e198ff54b94)PR description tips: [https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e](https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e) - Backport 3254 to 6.0.x `(PR #3300)` - [backport] fix/web: add missing separator under organizations (#3253) `(PR #3282)` - Auto-update all packages in Sourcegraph base images `(PR #3237)` - [backport] feat/tenant: fix workspace management UI quirks (#3227) `(PR #3230)` - [backport] feat/web: Update cloning status to new designs (#2760) `(PR #3158)` - Layout finetuning of Creating Workspaces and Tenant Onboarding (#3065) `(PR #3139)` Revert "Fix: Buildkite Pipeline generates images with specific cloud tags for S2 deployments" `(PR #2985)` Revert "fix: set the tag in the push_all.sh script" `(PR #2989)` - Fix: Buildkite Pipeline generates images with specific cloud tags for S2 deployments `(PR #2985)` - NA - no customer facing changes {/* RSS={"version":"v6.1.0", "releasedAt": "2025-02-17"} */} # 6.0 Patch 1 ## v6.0.2687 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.0.2687) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.0.2687) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.0.2687) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.0.2687) ### Features #### Cody-Gateway - Roll out new Gemini Models (#3357) `(PR #3412)` - Move Gemini 2.0 Flash from Experimental to GA, add Gemini 2.0 Flash-Lite Preview Experimental and Gemini 2.0 Pro ExperimentalCo-authored-by: arafatkatze [arafat.da.khan@gmail.com](mailto:arafat.da.khan@gmail.com) (cherry picked from commit 4aa5aa41cc0f5e2be80c77e8e8709e198ff54b94)PR description tips: [https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e](https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e) #### Multitenant - add support for alternate default tenant hostname `(PR #3176)` #### Security - Create Binary Authorization attestations when promoting images to public `(PR #3478)` #### Others - prompt templates editor supports @ current mentions (#3397) `(PR #3436)` - feat: prompt templates editor supports dynamic @ mentionsPR description tips: [https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e](https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e) ### Fix #### Multi Tenant - fixing paper cuts for mt marketing launch (#3242) `(PR #3281)` - misc wording fixes in workspaces onboarding `(PR #3207)` - fixes welcome message alert `(PR #3174)` #### Source - Fix Gerrit clone URL resolution (#3446) `(PR #3449)` - Fix inability to update Gerrit code host config URL (#3361) `(PR #3439)` - Fix bug where the URL of a Gerrit code host connection could not be updated.(cherry picked from commit e6da1ceb9586bf109339f06220c1fdbbf570a6d9) - Normalize code host URLs during code host config unmarsha… `(PR #3438)` - gitserver: Unambiguously identify commit boundaries in git log `(PR #3411)` - Commit listing should work correctly for repos which contain arbitrary characters in commit messages. This also affects downstream functionality such as commit graph updates needed for precise code navigation.Backport 2eae8e1 from #3359 ### Chore #### Security - Auto-update all packages in Sourcegraph base images `(PR #3237)` ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 6.0.x] gitserver: Fix API endpoint for installation token creation `(PR #3432)` - [backport] chore/source: Update src-cli to 6.0.1 (#3365) `(PR #3416)` - Update src-cli version to 6.0.1 - [backport] fix/tenant: fix invitation expiry, user management UX improvements (#3353) `(PR #3356)` - [Backport 6.0.x] tenant: Also allow to add fork repos `(PR #3348)` - Backport 3254 to 6.0.x `(PR #3300)` - [backport] feat/prompts: support public prompts/saved-searches in workspaces using RBAC (#3257) `(PR #3294)` - [backport] fix/web: add missing separator under organizations (#3253) `(PR #3282)` - [backport] feat/tenant: fix workspace management UI quirks (#3227) `(PR #3230)` {/* RSS={"version":"v6.0.2687", "releasedAt": "2025-02-12"} */} # 6.0 Patch 0 > Attention - Postgres 12 is no longer supported! If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v6.0.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v6.0.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v6.0.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v6.0.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v6.0.0) ### Features #### Agents - make review agent configurable via program files `(PR #2962)` - The Review agent now requires the program file `.sourcegraph/review-agent.json` with at least the content `"{}"` to enable posting Pull Requests review through the GitHub App. The JSON file may contain additional configuration options to override defaults of the `ReviewRequestConfiguration` object (see OpenAPI spec) #### Ci - publish images with branch tag on release branch `(PR #3039)` - tag release branch images with branch image tag `(PR #3032)` #### Cloud - add support to collect web vitals metrics to web-svelte `(PR #2735)` #### Code Intelligence - Add audit logs for changes to syntactic jobs `(PR #2893)` - highlights json files with tree-sitter `(PR #2469)` - Improved highlighting for JSON files #### Cody - improve rendering of diagnostics as GitHub comments `(PR #2954)` - The Review Agent now includes the rule ID when posting comments on pull requests. By default, the minimum review severity is errors (previously it was warning). When the minimum severity is overridden to be warnings, then the review comments will also include the severity. - make Review Agent rule detection configurable `(PR #2913)` - Configure custom review rules for the Review Agent by adding `*.rule.md` files nested under `.sourcegraph/` directories in any ancestor director of files in the diff. - Sourcegraph Agents `(PR #2739)` - New `/.api/agents/**` endpoints to manage the creation of Sourcegraph Agents (EAP feature). - New support to automatically review GitHub Pull Requests with a Review Agent via GitHub Apps (EAP feature). - first stab at a Code Review Agent API `(PR #2568)` - New `GET /.api/tools` endpoint to list tool definitions for Sourcegraph API endpoints to use with the LLM /chat/completions endpoint for function calling. - New `POST /.api/review/diff` endpoint to get a list of code review comments given a git diff (including GitHub pull requests and Gitlab merge requests). #### Dev - add support to export otel metrics to prom in local dev `(PR #2781)` #### Dotcom - support Svelte workspace switcher in dotcom `(PR #2675)` - enable workspaces-prod proxy `(PR #2664)` - add feature flag to enable React switcher in dotcom POC `(PR #2659)` #### Msp - add client details to MSP audit logs `(PR #2887)` - enable CloudSQL Enterprise Plus with postgresql.highAvailability `(PR #2682)` - upgrade CloudSQL to POSTGRES_16 `(PR #2667)` - support BigQuery table partitioning `(PR #2597)` #### Multi Tenant - enable extension setup step for everyone `(PR #3137)` - add org wasn't added modal UI `(PR #3072)` - add cancel subscription UI `(PR #3044)` - polish join workspace and status pages `(PR #2900)` - support 3ds and redirection-based payment flow for workspace creation `(PR #2865)` - Enable the new Sourcegraph branding by default `(PR #2801)` - polish workspace creation flow `(PR #2787)` - prepare common svelte UI for workspaces app `(PR #2734)` - connect repositories management page to API `(PR #2688)` - improve switch tenant UI `(PR #2656)` - add workspace billing settings page `(PR #2600)` - add workspace settings users page `(PR #2504)` - add workspace settings general page `(PR #2503)` - add workspace settings main layout `(PR #2502)` #### Multi-Tenant/Mt-Router - add prod deployment `(PR #2622)` #### Multitenant - Add UseRandomExternalAccount code host connection option and use it in MT `(PR #2821)` - Disable web app toggle by default on workspaces `(PR #2771)` - no pings, no telemetry redaction `(PR #2491)` #### Rbac - add USER_EXTERNAL_ACCOUNTS#READ_ALL_USERS for workspace admin `(PR #2512)` #### Release - address pg12 -> pg16 drift with normalization `(PR #2950)` - Normalize drift detection to handle for postgres 12 to 16 upgrade #### Search - Code search is homepage for workspaces `(PR #3127)` - Add upsell menu items `(PR #3122)` - Update production favicon `(PR #2909)` - Add omnibox routes `(PR #2797)` - Add new main navigation (feature flagged) `(PR #2768)` - Use new brand logo to web apps (feature flagged) `(PR #2767)` - (new web app) Add download option to file page `(PR #2461)` - (new web app) Add padding and messages to end of search results `(PR #2455)` #### Source - multitenant: add "edit" state when editing workspace repositories `(PR #2849)` #### Telemetry - allowlist model metadata on `privateMetadata` `(PR #2832)` #### Tenant/Billing - use EstimateWorkspaceSubscriptionSubtotal in UpdateSeatsModal `(PR #2930)` #### Tenants/Telemetry - report external URL for workspace identifier `(PR #2602)` #### Web/Tenant - update selected repos and repo size with pending state `(PR #2925)` #### Workspace - Open up instance url inside of vs code `(PR #2782)` - add billing link to request-to-join template params `(PR #2596)` #### Workspaces - add background goroutine job that emits telemetry about repo count and size `(PR #3130)` - metrics for subscription renewals and debt collection `(PR #2886)` - prevent workspace ID prefix from being used in names `(PR #2841)` - import suspiciousnames to blocklist `(PR #2803)` - add AdministrationService, /internal UI for suspending workspaces `(PR #2786)` - add some plans telemetry `(PR #2783)` - restrict display name length `(PR #2776)` - add suspension states `(PR #2751)` - bypass some workspace name checks with SAMS user metadata `(PR #2733)` - allow configurable sender address `(PR #2729)` - add seat count events `(PR #2665)` - state transition log `(PR #2661)` - required email domains `(PR #2614)` - improve wording of name-check errors, add telemetry `(PR #2593)` - initial web and service telemetry `(PR #2522)` - global creation control `(PR #2498)` - status pages for workspace not found and suspended `(PR #2438)` - handle SAMS user deletion `(PR #2384)` #### Workspaces/Billing - counter for stripe API usage `(PR #2855)` #### Workspaces/Internal - support ID lookup `(PR #2839)` #### Workspaces/Routerreconciler - make upsert reconcile incremental `(PR #2848)` #### Workspaces/Settings - add workspace ID to sidebar `(PR #2728)` #### Workspaces/Web - add telemetry events for workspace plans `(PR #2840)` - set title to Sourcegraph Workspaces `(PR #2834)` #### Others - add CTA for agents API `(PR #2799)` - prompt templates now support specific @ mentions `(PR #2793)` - feat: prompt templates now support specific @ mentions - propagate bestScoringLine and use that to center chunks in the search UI `(PR #2683)` - For broad matches, we now center the best-scoring line in search results - add tools support to LLM API (aka. function calling) `(PR #2537)` - The `/.api/llm/chat/completions` endpoint now support function calling via the `tools` property. This feature works when using the LLM providers: OpenAI, Anthropic, Fireworks, AWS Bedrock, and Gemini. - add ability to boost user-relevant repos for `patterntype:nls` `(PR #2489)` ### Fix #### Actor - better preserve anonymous user ID for telemetry `(PR #2546)` #### Agents - Remove leftover printf statement `(PR #3079)` - Backport 9639850855bb169f7dee4fbcff869c77c17f9328 from #3007 - fix bug in AgentStore.ListByWebhookID and LLMChatClient `(PR #3054)` - Fixed bug in Review Agent where it didn't post review comments even for small diffs Backport 4710b59 from #3019 #### Auth - Improve session expiration behavior `(PR #2765)` - We are changing the behavior of session expiration to be a hard-cap instead of a rolling window. `auth.sessionExpiry` will now set a hard-limit on the sessions lifetime, and users will have to re-authenticate after this period. To preserve the previous behavior where sessions would be invalidated after they haven't been used for a while, a new configuration option named `auth.maxSessionIdleDuration` has been introduced that controls session expiration based on inactivity. - Don't expire sessions based on OAuth token validity `(PR #2761)` - Fixed an issue where Sourcegraph user sessions initiated via OAuth integrations did not respect the `auth.sessionExpiry` configuration and expired much earlier. #### Ci - include push version tag to private registry `(PR #3074)` - add handling for unbound variable in push_all.sh `(PR #3036)` #### Cloud - add explicit bucket to lcp metrics `(PR #2846)` - typo in metric attrs name `(PR #2804)` #### Code Intelligence - Better cleanup in syntactic indexing worker `(PR #3156)` - Don't create unscoped Logger `(PR #2945)` - Overwrite old->new commit for syntactic indexing jobs `(PR #2764)` - Handle missing committer date in policy code `(PR #2696)` - Add DB constraints for syntactic jobs+policies `(PR #2566)` - In the site admin configuration for code graph policies, restricts the creation of policies for syntactic indexing to HEAD-only. This restriction may be lifted in the future. Policies for precise auto-indexing are not affected. - Enforce auth conditions in repo scheduling `(PR #2549)` #### Cody - add billing metadata to prompt library events `(PR #3116)` - make public OpenAPI docs work again `(PR #3081)` - Backport dc8deea005067145855b03a3344675386bc75be7 from #3078 - minor fixes `(PR #2916)` #### Cody-Gateway - fail-open Enterprise subscription sync `(PR #2775)` #### Dev - Fix transitive use of global counters in tests `(PR #2905)` #### Dev/Svelte - send all 'default.' requests to server `(PR #2923)` #### Dotcom - tweaks for dotcom-mode workspace switcher `(PR #2684)` #### Gitserver - Return error on no merge base `(PR #2790)` #### Goroutine - do not redact stacktrace `(PR #2571)` #### Intent - Remove heuristic for marking one-term queries as searches `(PR #2580)` #### Multi Tenant - fixes welcome message alert `(PR #3174)` - fix flashes and incorrect free up seat mutation in user management `(PR #3058)` - add support for workspace vscode sign up flow `(PR #2942)` - force to keep only one dropdown menu visible `(PR #2903)` - fix small paper cuts in workspace-creation flow `(PR #2809)` - fix Safari 16.6 billing layout (sub-grids rows) `(PR #2721)` - add a better error handling for workspace settings pages `(PR #2707)` - fix post workspace delete redirection `(PR #2698)` - fix user management reduce seats case `(PR #2647)` - fixes update seats modal max count validation `(PR #2616)` - fixes general setting page re-submitting problem `(PR #2548)` #### Multitenant - Public repositories should no longer be duplicatable `(PR #2828)` - Only evaluate newly added repositories `(PR #2701)` - add telemetry for when repositories are added or removed `(PR #2346)` - N/A - add telemetry event for when onboarding repository checks fail `(PR #2337)` - N/A #### Navbar - add divider after orgs `(PR #2921)` #### Observability - align Cody completions metrics queries with chart names in Grafana `(PR #2476)` #### Release - add handling of cp failure for postgres conf `(PR #3113)` - fix(rel): add handling for permissions errors when handling custom Postgres configurations in database containers.Backport 67bddb2 from #3041 #### Search - Fix brand logo and colors `(PR #3120)` - Do not show code search menu item when code search is disabled `(PR #3118)` - (new web ui) Add search upsell page `(PR #2979)` - Update breadcrumbs integration test `(PR #2960)` - Cody marketing page redirect on dotcom `(PR #2952)` - update response dashboards to use streaming search `(PR #2932)` - Insights: fix mouse click cursor behavior when creating new insight `(PR #2851)` - accept escaped characters in `content` filters `(PR #2807)` - fix repo-rev (button-group) ui `(PR #2806)` - add response telemetry for streaming search `(PR #2784)` - VSCode Search extension - auth panel not loading when filesystem is case sensitive `(PR #2713)` - fixes `404 errors when trying to load "authSidebar.js"` when the Code Search VS Code extension is used with the VSCode Remote SSH extension - remove alert suggesting structural search `(PR #2615)` - (new web ui) Open files in new tab when clicked on with ctrl/cmd `(PR #2557)` - add missing return in SearchQuery.RepositoryRevSpecs `(PR #2521)` - (new web app) Redirect /cody to /cody/chat `(PR #2475)` - (new web app) Set correct fuzzy finder request headers `(PR #2449)` - (new web app) Respect notices settings `(PR #2417)` #### Source - Check if user can access installations for public repositories `(PR #2963)` - Change ListSelectedRepositories to filter for the random external account connection `(PR #2911)` - Fix UseRandomExternalAccount connection check `(PR #2904)` - multitenant: fix nil panic in ListSelectedRepositories multitenant endpoint `(PR #2844)` - Do not create a connection with no repositories `(PR #2395)` #### Telemetry - uniformly apply marketingtracking, clean up deprecated values `(PR #2601)` #### Telemetry/Teestore - do not write to store concurrently in tx `(PR #2888)` #### Telemetrygatewayexporter - support export target without a port `(PR #2745)` #### Tenant - disable workspaces for SOAP users `(PR #2490)` #### Tenant/Reconciler - use nil-safe field getter when applying feature flags `(PR #2408)` #### Tenant/Settings - fix workspace display name update `(PR #2705)` #### Tenant/Users - only spin on specific action `(PR #2971)` #### Tenants/Web - magic redirect to sign-out -> sign-in if Workspaces requests return Code.Unauthenticated `(PR #2421)` #### Ui - Update error page when GitHub account is not yet connected `(PR #3059)` - Disable adding more MT repositories while repositories are being saved `(PR #3010)` - set sideEffects path in client/ui to correct `init.ts` path `(PR #2773)` #### Workspaces - dynamic logout link `(PR #2854)` - catch panics in connectrpc handlers `(PR #2837)` - remove trace ID from block result `(PR #2831)` - include all workspaces in name availability check `(PR #2794)` - check for user metadata if 'sourcegraph.com' is a required email domain `(PR #2654)` - ignore missing subscription when pruning invitations, rename ReconcileConsumedSeats `(PR #2650)` - improve UX when email domain is not allowed `(PR #2618)` - error indicates name must be lowercase `(PR #2599)` - rename URL fields to URI per AIP `(PR #2595)` - prevent panic in billing renewer `(PR #2570)` - address seat count problems `(PR #2482)` #### Workspaces/Billing - no-op SubscriptionUpdater returns ErrNoSubscriptionUpdateRequired `(PR #2572)` #### Workspaces/Blocklists - relax restrictions around generic terms `(PR #2712)` #### Workspaces/Dev - do not use wrangler with concurrency `(PR #2730)` #### Workspaces/Settings - remove workspace ID on collapse `(PR #2742)` #### Others - respect errors from sql row iterations `(PR #2948)` - std upgradetest with pv set doesn't go beyond targetVersion `(PR #2928)` - NA - Add missing error assignment `(PR #2864)` - Tweak relevant repos heuristic `(PR #2655)` - extract runner config into env vars `(PR #2637)` - don't show current prompt in suggested area `(PR #2582)` - fix: don't show current prompt in suggestions - always saturate the limit when boosting `(PR #2479)` - add context to intent call `(PR #2432)` ### Chore #### Ci - Add new search team members to teams.yml `(PR #2724)` #### Code Intelligence - Log connection stats on cancellation for precise queries `(PR #3003)` - Remove duplicate IndexEnqueuer interfaces `(PR #2944)` - Remove spurious "=" in site admin UI for editing policies `(PR #2902)` - Syntactic policies UI restrict to HEAD `(PR #2774)` - Introduce experimental olly package with helper functions `(PR #2753)` - Fix flaky test in syntactic indexing store_test `(PR #2722)` - Document quirks in various pattern syntaxes `(PR #2687)` - Use collections.SliceMultiMap in policies API `(PR #2565)` - Enqueue syntactic jobs in a single query `(PR #2555)` - Remove reposcheduler.Store interface `(PR #2551)` - Move unwrap function to check package `(PR #2540)` - Add test for precise usagesForSymbol `(PR #2535)` - Add doc comment about precondition `(PR #2534)` - Add fast path for commit checking `(PR #2532)` - Bump scip dependency `(PR #2531)` - Fix wrong napkin math in comment `(PR #2528)` - Avoid panic on missing committer date `(PR #2527)` - Avoid panic on nil metadata `(PR #2526)` - Rename & move codenav.PinnedIndexCommits -> codegraph.PinnedUploadKey `(PR #2454)` #### Cody - use same buckets for completions latency metrics `(PR #2746)` - Remove codypcw's buf.gen.yaml `(PR #2673)` - Create proper interface for CompletionsHandler [CODY-4619] `(PR #2623)` - measure completions overhead by feature `(PR #2533)` - measure sg instance to cody gw network latency `(PR #2501)` - refactor completions handler latency metrics `(PR #2496)` - measure completions handler overhead `(PR #2478)` - add upstream request tracing for completions `(PR #2429)` - remove test domain `(PR #2400)` #### Dev - Cap number of connections more explicitly `(PR #3001)` - Document purpose of onconflict linter `(PR #2882)` - Avoid horizontal scaling for syntactic enqueuer `(PR #2813)` - Clarify docs for redispool.Store & NewPeriodicGoroutine `(PR #2812)` - Fix flaky ordering in test `(PR #2811)` - Add env var to disable assertions `(PR #2810)` - Add columns to track which policy created an auto-indexing job `(PR #2788)` - Introduce String() method on api.CommitID `(PR #2757)` - Replace Id -> ID in internal/codeintel `(PR #2755)` - Fix typo in function name `(PR #2693)` - Add helper function for printing error trees `(PR #2692)` - Improve doc comment for REDMetrics `(PR #2635)` - Remove unused field in REDMetrics `(PR #2634)` - Use clearer names & comments in Rockskip `(PR #2624)` - Rename db -> codeIntelDB in Rockskip for clarity `(PR #2606)` - Refactor Rockskip service config to dedicated type `(PR #2605)` - Move codeintel/core.Option to lib/core `(PR #2578)` - Add collections.SliceMultiMap type `(PR #2564)` - Add collections.SetMultiMap type `(PR #2556)` - Migrate other directories from require.NoError to check.MustNoError `(PR #2554)` - Migrate internal/ from require.NoError to check.MustNoError `(PR #2553)` - Migrate cmd/ from require.NoError to check.MustNoError `(PR #2552)` - Filter out archived and forked repos in reposcheduler `(PR #2550)` - Auto-indexing is disabled for forks and archived repositories. This is currently not configurable. - Migrate cmd/ from require.Equal to check.MustEqual `(PR #2541)` - Minor enhancements to check package `(PR #2530)` - Introduce generic collections.Stack type `(PR #2511)` - Move iterext package to lib/ `(PR #2510)` - Move collections package to lib/ `(PR #2509)` - Move rapidext package to lib/ `(PR #2508)` - Introduce types for limiting reads `(PR #2470)` - Replace ioutil -> io due to deprecation `(PR #2465)` - Generalize bytesize package to handle more units `(PR #2464)` - Update prettier ignore file for Svelte app `(PR #2416)` #### Msp - upgrade ConnectRPC `(PR #2710)` - upgrade MSP cloud.google.com/go dependencies `(PR #2709)` - upgrade TF providers, remove nobl9 `(PR #2681)` #### Search - Migrate Button component to Svelte 5 `(PR #2868)` - Upgrade to SvelteKit v2.16.0 and Svelte v5.19.0 `(PR #2867)` - (new web ui) Run `pnpm format` `(PR #2850)` - vsce: patch release v2.2.20 `(PR #2748)` - Add changelog entry for PR 2713 `(PR #2747)` - (new web ui) Update to Svelte 5.16.2 `(PR #2590)` - (new web app) Update svelte and kit to latest versions `(PR #2567)` #### Security - Auto-update all packages in Sourcegraph base images `(PR #2500)` - Auto-update all packages in Sourcegraph base images `(PR #2360)` #### Workspaces - Fix url/text for user menu workspace link `(PR #2843)` - Style fixes on Workspace Settings, General Settings and User settings `(PR #2798)` - refactor name-checking to helper `(PR #2726)` - add some improved API docstrings `(PR #2708)` - enable MSP rollouts `(PR #2619)` - rename 'loginservice' to 'xdomainloginservice' `(PR #2544)` - move SPA handler to 'spaservice' subpackage `(PR #2543)` - Update workspace repo size limit `(PR #2480)` #### Others - Layout finetuning of Creating Workspaces and Tenant Onboarding (#3065) `(PR #3139)` - Polish buy seats modal `(PR #2917)` - Remove intent heuristic `(PR #2791)` - Delete unused DeleteOrg code `(PR #2585)` - Replace NewBuffer([]byte("str")) -> NewBufferString("str") `(PR #2466)` - make error message actionable for invalid date format `(PR #2401)` ### Test #### Tenant/Reconciler - E2E QA sanity checks on reconciler `(PR #2460)` ### Refactor #### Dev - Cleanup and fix new web app build process `(PR #2474)` ### Reverts - revert sentry, opsgenie, fix deprecation notice `(PR #-1)` - Revert "fix/batch: use latest ubuntu LTS in hello world template (#28… `(PR #28)` - Revert "fix: set the tag in the push_all.sh script" `(PR #2989)` ### Uncategorized #### Others - [Backport 6.0.x] Update Cody Web v0.29.0 `(PR #3162)` - [backport] feat/web: Update cloning status to new designs (#2760) `(PR #3158)` - [Backport 6.0.x] onboarding: add input field to selected repo List `(PR #3154)` - Backport 3148 to 6.0.x `(PR #3151)` - [Backport 6.0.x] repoupdater: Don't grow backoff bigger than int32 `(PR #3135)` - [Backport 6.0.x] workspace settings: mention query in info message `(PR #3112)` - [Backport 6.0.x] fix(agents): use plural naming convention for API endpoints `(PR #3080)` - Renamed REST API endpoints to consistently use plural names in `/.api/review**` and `/.api/tool`. For example, `GET /.api/reviews/diagnostics/ID` instead of `GET /.api/review/diagnostic`. See OpenAPI spec for updated paths. Backport 864c824e184a7dc84df694797c5603883d72ccf1 from #3028 - BACKPORT - Revert "feat: add CTA for agents API (#2799)" `(PR #3048)` - [Backport 6.0.x] Changes naming "Open" to "Unused" seats `(PR #3029)` - Omnibox: route likely code generation commands to Chat `(PR #2969)` - Update Cody Web v0.27.0 `(PR #2968)` - Update Cody Web v0.26.0 `(PR #2966)` - Update Cody Web v0.25.0 `(PR #2959)` - auth: Fixup check for canSignOut `(PR #2958)` - omnibox: hard boost current repo and relevant repos `(PR #2943)` - allowlist `language` on `cody-autoedit` `(PR #2941)` - tenant(web): Don't advertise upcoming code host support `(PR #2940)` - web: Fix page header for create workspace page `(PR #2939)` - web: Fix currency localization `(PR #2938)` - tenant: Only set feature flags required for the launch `(PR #2937)` - tenant: Add structured log message about missing tenant to alert on `(PR #2935)` - Omnibox: disable intent detection when CG is unavailable `(PR #2934)` - Update Cody Web to 0.24.0 `(PR #2920)` - Update Cody to 0.24.0 - bug: Adds a link to stripe portal on the Last Payment Failed warning `(PR #2919)` - sg: make `.tool-versions` parsing better and silence mise `(PR #2918)` - tenant: Set cody gateway rate limits `(PR #2915)` - Adds style to pending invited users `(PR #2898)` - Adds style to pending invited users `(PR #2898)` - tenant: Add back without cancel for dormancy check `(PR #2883)` - tenant(repos): Expose mirrorInfo for repos for all repos to admins `(PR #2876)` - web: Prevent access to workspace setup and settings for non-admins `(PR #2874)` - accessrequest: Don't allow access requests for authenticated users `(PR #2873)` - auth: Don't repeat code for mocked providers `(PR #2872)` - auth: Code cleanup `(PR #2862)` - web: Fix click target for delete workspace button `(PR #2861)` - session: Remove sign-out cookie `(PR #2860)` - session: Don't invalidate every active user session on sign out `(PR #2859)` - tenant: Don't special case user account in onboarding `(PR #2847)` - tenant: Enable agentic feature flags `(PR #2830)` - web: Use new logo in more places `(PR #2823)` - workspaces: Update favicon `(PR #2819)` - [CODY-4627] Agent Review Tables take 3 `(PR #2815)` - Adds implementations for `GET .api/agents/review/{review_id}`, `GET .api/agents/review/diagnostic/{diagnostic_id}/`, and `POST .api/agents/review/diagnostic/{diagnostic_id}/feedback` - web: Temporarily restore logo but break Safari dark mode logo `(PR #2808)` - gomod: bump Zoekt for BM25 line scoring `(PR #2780)` - Disable streaming in LLM API if not explicitly enabled `(PR #2778)` - `./api/llm/chat/completions` only streams response if `"stream": true` is passed in the request body - workspaces: Apply correct repo size limit `(PR #2772)` - Added more clarity around workspace deletion `(PR #2769)` - workspaces: Add back org namespace to list of selected repos `(PR #2737)` - security/fix: always return absolute URLs `(PR #2727)` - Order by NULLS LAST when sorting repositories in GQL API `(PR #2725)` - tenant: Set dormancy threshold to 1 week `(PR #2723)` - Remove clustering dev script `(PR #2720)` - web: Port new user menu to react `(PR #2718)` - globalstate: Simplify store and reduce writes `(PR #2717)` - only `UPDATE global_state` to set initialized if not initialized `(PR #2716)` - globalstate: Don't update row on every call `(PR #2715)` - skip pre-exit hook on aspect-default queue `(PR #2694)` - web: More alignment of nav dropdown with designs `(PR #2691)` - tenant: Small improvements to MT app `(PR #2680)` - Update Cody Web v0.22.0 `(PR #2678)` - NLS: support quoted phrases `(PR #2677)` - workspaces: Consolidate web config and add web URL `(PR #2670)` - auth: Fixup some auth redirections `(PR #2668)` - NLS: simplify query parsing logic `(PR #2662)` - cmd/cloud-ops-interview: init service `(PR #2658)` - gomod: bump Zoekt for 'best line match' feature `(PR #2653)` - auth: Don't allow CreatePassword when builtin auth is off `(PR #2644)` - tenant(githubapp): Expose Sourcegraph repo on resolver list `(PR #2641)` - change model to beta `(PR #2639)` - gating: Allow cloud init for workspaces instance `(PR #2638)` - NLS: disable stemming `(PR #2620)` - tenant: Enable autoedits in every tenant on creation `(PR #2607)` - NLS: always rank literal matches first `(PR #2598)` - repo: Allow to get totalCount for repositories as non-admin `(PR #2591)` - auth: Make sign out more explicit and clean up normalization `(PR #2589)` - auth: Clarify integration points and middlewares `(PR #2588)` - auth: Consolidate auth provider redirects `(PR #2587)` - httpapi Cleanup handler creation `(PR #2586)` - auth: Slightly clean up auth code `(PR #2584)` - conf: Use sourcegraph controlled default domain `(PR #2583)` - restrict auto-edits model to only pro users `(PR #2579)` - NLS: avoid tokenizing filenames `(PR #2576)` - NLS: simplify find symbol heuristic `(PR #2561)` - respect `count:` for nls search `(PR #2560)` - logging: Fix incorrect use of logger `(PR #2525)` - change the deployment id for autoedits model `(PR #2507)` - sg: add support to retrieve a sams idp client `(PR #2497)` - frontend: Reduce amount of dependencies passed around `(PR #2450)` - tenant: Mark tenant as seen even if request is cancelled `(PR #2441)` - tenant: Add intent detection FF for new hosts `(PR #2437)` - ci: Execute backcompat tests as PG16 `(PR #2427)` - tenant: Allow to add 100 repos to the GitHub App `(PR #2426)` - tenant: Allow to add more than 30 repos to the GitHub App `(PR #2425)` - bitbucketcloud: Fix repo perms syncing for inherited permissions and groups `(PR #2398)` - Fixed an issue with Bitbucket Cloud permission syncing where inherited permissions and group permissions were not correctly reflected. - dotcom, workspaces: propagate 'plg' namespace metadata as feature flags `(PR #2382)` - gating: Consolidate License and Subscription resolvers `(PR #2359)` - gating: Move repo size and count constraints into provider `(PR #2356)` - gating: Implement more parts of workspaces gating `(PR #2355)` - gating: Enable workspaces gating provider `(PR #2307)` - gating: Add GrantDisplayName to Provider `(PR #2306)` - gating: Add provider specific background routines `(PR #2305)` - gating: Move TelemetryExportMode and AccessTokenInstanceIdentifier into Provider `(PR #2304)` - gating: Reduce number of references to global gating provider `(PR #2301)` - gating: Remove license mocks `(PR #2300)` - gating: Move license expiration checks fully into CheckGrant `(PR #2299)` - gating: Remove unused fields from ProductLicenseInfo `(PR #2297)` - gating: Remove unused redundant licenseinfo resolver `(PR #2296)` - gating: Unexport Plan and check for all license keys `(PR #2295)` - gating: Add MaximumUserCount to provider interface `(PR #2294)` - gating: Implement TrueUp feature `(PR #2293)` - gating: Remove IsFreePlan `(PR #2210)` - redis: Clarify store requirements and improve test setup `(PR #2020)` - repo: Expose repository settings page as read-only to non-admins `(PR #1897)` - authz: Craft authz provider factory and pass around explicitly `(PR #1893)` - repoupdater: Remove in memory scheduler `(PR #1473)` - tenant: Mark all views as security_invoker `(PR #744)` ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - Log connection stats on cancellation for precise queries `(PR #3002)` - Cap number of connections more explicitly `(PR #2999)` - Auto-update all packages in Sourcegraph base images (5.11.x) `(PR #2494)` - [Backport 5.11.x] bitbucketcloud: Fix repo perms syncing for inherited permissions and groups `(PR #2399)` - Fixed an issue with Bitbucket Cloud permission syncing where inherited permissions and group permissions were not correctly reflected. {/* RSS={"version":"v6.0.0", "releasedAt": "2025-01-29"} */} # 5.11 Patch 5 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.6271 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.6271) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.6271) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.6271) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.6271) ### Chore #### Code Intelligence - Log connection stats on cancellation for precise queries `(PR #3002)` #### Dev - Cap number of connections more explicitly `(PR #2999)` ### Reverts There were no reverts for this release {/* RSS={"version":"v5.11.6271", "releasedAt": "2025-01-23"} */} # 5.11 Patch 4 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.5234 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.5234) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.5234) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.5234) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.5234) ### Features #### Perforce - Use depot name for label cache `(PR #2805)` ### Fix #### Source - Possible Perforce changelists are now converted to their respective git commit during ResolveRevision `(PR #2825)` ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Manual Backport]: update shellcheck to 0.10.0 `(PR #2838)` - NA {/* RSS={"version":"v5.11.5234", "releasedAt": "2025-01-17"} */} # 5.11 Patch 3 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.4013 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.4013) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.4013) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.4013) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.4013) ### Features #### Security - Sign release images `(PR #2703)` - Publish signatures for release containers. Backport c11764be4adb377521e4067c4852953d7c434e24 from #2697 #### Others - Allow single container server to run postgresql-16 `(PR #2714)` - server: runs postgresql from /var/run/postgresql instead of /run/postgresql Backport 36c78cdf596e1b22079512931fa526346c2ec821 from #2711 ### Fix #### Release - recover from unclean database shutdowns in pgsql entrypoint `(PR #2706)` - fix(rel): fix issue with Postgres docker container failing upgrades after an unclean database shutdown. Backport ca5185ce2528b67e1ce6bcb5170f96d3699e11e0 from #2660 ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 5.11.x] fix(Bitbucket Cloud): Fix pagination logic for bitbucket cloud permissions `(PR #2700)` - Fixed an issue where Bitbucket Cloud permission syncs could produce incomplete results, resulting in lacking permissions. Backport 389661481f0f0a2385ef4f78f4113ab6ba14f4d5 from #2699 {/* RSS={"version":"v5.11.4013", "releasedAt": "2025-01-11"} */} # 5.11 Patch 2 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.3601 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.3601) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.3601) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.3601) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.3601) ### Features #### Code Intelligence - Make syntactic indexing write partial index to disk already GZIP compressed `(PR #2646)` ### Reverts There were no reverts for this release {/* RSS={"version":"v5.11.3601", "releasedAt": "2025-01-08"} */} # 5.11 Patch 1 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.2732 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.2732) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.2732) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.2732) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.2732) ### Fix #### Search - propagate disk space to NewFirecrackerWorkspace `(PR #2574)` - Addresses errors similar to: `failed to prepare workspace: failed to create ext4 filesystem in backing file: "mke2fs 1.45.5 (07-Jan-2020)\nThe file losetup: /var/lib/firecracker/loop-devices/workspace-loop-47749-3763347387: Warning: file is smaller than 512 bytes; the loop device may be useless or invisible for system tools.\n/dev/loop13 does not exist and no size was specified.\n": exit status 1` - Affects reading and using the environment variable `EXECUTOR_FIRECRACKER_DISK_SPACE` Backport 22db2a97a0393cdd233a92da7ade96cd59bb99ef from #2562 ### Chore #### Security - Auto-update all packages in Sourcegraph base images (5.11.x) `(PR #2494)` ### Reverts There were no reverts for this release {/* RSS={"version":"v5.11.2732", "releasedAt": "2025-01-03"} */} # 5.11 Patch 0 > Attention - If upgrading from Sourcegraph version 5.9 or earlier, this release will update our included database container images from Postgres 12 to Postgres 16. > Customers are advised to have a database backup before upgrading. See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice for more information. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.11.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.11.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.11.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.11.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.11.0) ### Features #### Ci - add bazel mod tidy to ci steps [#1661](https://github.com/sourcegraph/sourcegraph/pull/1661) #### Cloud - add tag field to mt config [#2035](https://github.com/sourcegraph/sourcegraph/pull/2035) #### Code Intelligence - Pass limits to scip-syntax and collect summary from it [#2058](https://github.com/sourcegraph/sourcegraph/pull/2058) - configurable time and size limits for scip-syntax [#1947](https://github.com/sourcegraph/sourcegraph/pull/1947) - Adds configurable limits for file size and parsing time for syntactic indexing #### Cody - update cody web to 0.20.0 [#2396](https://github.com/sourcegraph/sourcegraph/pull/2396) - update cody-web to 0.18.0 [#2365](https://github.com/sourcegraph/sourcegraph/pull/2365) - add autoedits models to models.json [#1873](https://github.com/sourcegraph/sourcegraph/pull/1873) - Add `UserShouldUseEnterprise` to `/.api/client-config` (PRIME-596) [#1872](https://github.com/sourcegraph/sourcegraph/pull/1872) #### Cody-Gateway - add Gemini 2.0 Flash experimental model [#2309](https://github.com/sourcegraph/sourcegraph/pull/2309) #### Codygateway - expand flagging to workspaces actors [#2290](https://github.com/sourcegraph/sourcegraph/pull/2290) - off-by-default workspaces actor source [#1941](https://github.com/sourcegraph/sourcegraph/pull/1941) #### Database - support drift detection of policies [#2000](https://github.com/sourcegraph/sourcegraph/pull/2000) - drift detection now detects missing table policies. - include policies in schema md and json [#1999](https://github.com/sourcegraph/sourcegraph/pull/1999) - schema.md and schema.json now include table policies. #### Dev - Adding wait option to sg access command [#1930](https://github.com/sourcegraph/sourcegraph/pull/1930) #### Gateway - Add v2 endpoint stubs [#1526](https://github.com/sourcegraph/sourcegraph/pull/1526) #### Gating - extract license validity checks to gating.Provider.CheckGrant [#2018](https://github.com/sourcegraph/sourcegraph/pull/2018) - replace licensing.Check with gating.GetGlobalProvider().Check [#2009](https://github.com/sourcegraph/sourcegraph/pull/2009) - allow gating.Provider to be global [#2008](https://github.com/sourcegraph/sourcegraph/pull/2008) - extract into standalone package, stub out CodyGatewayAuthenticator [#2007](https://github.com/sourcegraph/sourcegraph/pull/2007) #### Graphql - multitenant: add repository restriction validation when adding repos [#2017](https://github.com/sourcegraph/sourcegraph/pull/2017) #### Local - use mac/linux keystores to store secrets instead of plain text file on disk [#2001](https://github.com/sourcegraph/sourcegraph/pull/2001) - store entitle token in sg secrets [#1856](https://github.com/sourcegraph/sourcegraph/pull/1856) #### Memcache - add tenancy-friendly LRU memory cache [#1934](https://github.com/sourcegraph/sourcegraph/pull/1934) #### Msp - introduce simple telemetry recorder for managed services [#2146](https://github.com/sourcegraph/sourcegraph/pull/2146) #### Multi-Tenant - add "add repositories" setup flow step [#2112](https://github.com/sourcegraph/sourcegraph/pull/2112) - Add first UI implementation of GitHub connect setup page [#1966](https://github.com/sourcegraph/sourcegraph/pull/1966) #### Multi-Tenant/Workspaces - add support to query ws by name in integrations svc [#2321](https://github.com/sourcegraph/sourcegraph/pull/2321) #### Multitenant - Set maximum repos size to 500mb [#2027](https://github.com/sourcegraph/sourcegraph/pull/2027) #### Rbac - add separate permission for viewing exported telemetry [#1989](https://github.com/sourcegraph/sourcegraph/pull/1989) #### Release - run `sg cut` in buildkite to automate nightly pipeline test [#2116](https://github.com/sourcegraph/sourcegraph/pull/2116) - release: nightly release pipeline is working - backcompat test use release registry [#1202](https://github.com/sourcegraph/sourcegraph/pull/1202) #### Search - correctly lower repo name regexes [#2209](https://github.com/sourcegraph/sourcegraph/pull/2209) - Special uppercase regex tokens are no longer inverted for repository name search. eg `repo:foo\B` correctly interprets `\B` as `not at ASCII word boundary`. Previously it would transform the expression into `repo:foo\b`. - use pattern optimizations for repo ExcludePattern [#2186](https://github.com/sourcegraph/sourcegraph/pull/2186) - Searches which exclude repositories are faster on larger instances. We now use the same performance optimizations as repo inclusion. #### Security - Add access token ID to audit events [#2034](https://github.com/sourcegraph/sourcegraph/pull/2034) #### Sg - add 'sg user metadata' commands [#2261](https://github.com/sourcegraph/sourcegraph/pull/2261) #### Source - MT GitHub App connections now use generic App connection [#2338](https://github.com/sourcegraph/sourcegraph/pull/2338) - Add App-level GitHub App code host connections [#2127](https://github.com/sourcegraph/sourcegraph/pull/2127) - Sourcegraph now supports App-level GitHub App connections that aren't tied to a specific Installation ID. - Add maxDeletions option to code host connections [#2003](https://github.com/sourcegraph/sourcegraph/pull/2003) #### Telemetry - include SAMS user ID if monolithsams is configured [#1936](https://github.com/sourcegraph/sourcegraph/pull/1936) - propagate x-requested-with headers to request client… [#1775](https://github.com/sourcegraph/sourcegraph/pull/1775) #### Workspaces - add metric to count number of unseen instances [#2303](https://github.com/sourcegraph/sourcegraph/pull/2303) - report instances and workspaces status [#2262](https://github.com/sourcegraph/sourcegraph/pull/2262) - add features to workspace results [#2171](https://github.com/sourcegraph/sourcegraph/pull/2171) #### Others - extend prompt tags with pagination and increased limit [#2344](https://github.com/sourcegraph/sourcegraph/pull/2344) - feat: extend prompt tags with pagination and increased limit - editing tags on prompts [#2278](https://github.com/sourcegraph/sourcegraph/pull/2278) - feat: editing tags on prompts - (multi-tenant): add invite users and final setup step [#2211](https://github.com/sourcegraph/sourcegraph/pull/2211) - management page prompt categories [#2178](https://github.com/sourcegraph/sourcegraph/pull/2178) - feat: management page prompt categories - prompt categories nav for web [#2177](https://github.com/sourcegraph/sourcegraph/pull/2177) - feat: add tags as filter to prompts and their navigation - add prompt labels to the GraphQL API [#2131](https://github.com/sourcegraph/sourcegraph/pull/2131) - feat: add prompt labels to the GraphQL API - Call new intent detection model via Gateway [#2113](https://github.com/sourcegraph/sourcegraph/pull/2113) - add CommitsIter to `GitserverClient` [#2080](https://github.com/sourcegraph/sourcegraph/pull/2080) - New intent detection API on Gateway [#2016](https://github.com/sourcegraph/sourcegraph/pull/2016) - more telemetry for batch changes [#2014](https://github.com/sourcegraph/sourcegraph/pull/2014) - feat(batches): more telemetry events - add support to `patterntype:nls` for `type:code` and `type:text` [#1961](https://github.com/sourcegraph/sourcegraph/pull/1961) - add OR support for text search pattern types [#1915](https://github.com/sourcegraph/sourcegraph/pull/1915) - collect contributor data [#1765](https://github.com/sourcegraph/sourcegraph/pull/1765) - feat: calculate contributor stats ### Fix #### Code Intelligence - reports symbols for TypeScript type aliases [#2339](https://github.com/sourcegraph/sourcegraph/pull/2339) - Properly report symbols for TypeScript type aliases #### Cody - update cody web to 0.19.0 [#2376](https://github.com/sourcegraph/sourcegraph/pull/2376) - add cody.notices to json schema [#2373](https://github.com/sourcegraph/sourcegraph/pull/2373) - fix prompt library UI layouts [#2288](https://github.com/sourcegraph/sourcegraph/pull/2288) - fix prompt avatar for generated initials avatar [#2239](https://github.com/sourcegraph/sourcegraph/pull/2239) - switch to Snowball stopwords [#2223](https://github.com/sourcegraph/sourcegraph/pull/2223) - Narrowed down the stopwords list used in Cody context, to fix an issue where we could miss highly relevant files. - disable reranking for airgapped instances [#2168](https://github.com/sourcegraph/sourcegraph/pull/2168) - Fixes a bug in Cody context where airgapped instances would attempt to use the reranker model, which increased the context retrieval latency. - fix prompt creation telemetry [#2057](https://github.com/sourcegraph/sourcegraph/pull/2057) #### Codyauditlog - inline audit log entry for consistency [#2072](https://github.com/sourcegraph/sourcegraph/pull/2072) #### Codygateway - configurable workspace user ban state cache, lower default [#2357](https://github.com/sourcegraph/sourcegraph/pull/2357) - fix listing flagged prompts from workspaces users [#2354](https://github.com/sourcegraph/sourcegraph/pull/2354) #### Dev - Fix window context extraction logic for multitenant [#1998](https://github.com/sourcegraph/sourcegraph/pull/1998) #### Dev/Codygateway - partially fix Cody Gateway QA suite [#2005](https://github.com/sourcegraph/sourcegraph/pull/2005) #### Dev/Msp - remove actual interval from error message to fix flakey months [#2031](https://github.com/sourcegraph/sourcegraph/pull/2031) #### Gateway - benchmark: various fixes [#2119](https://github.com/sourcegraph/sourcegraph/pull/2119) #### Msp - fix error message for image tag resolution [#2283](https://github.com/sourcegraph/sourcegraph/pull/2283) #### Msp/Operationdocs - update Entitle request links [#2281](https://github.com/sourcegraph/sourcegraph/pull/2281) #### Mulitenant - add rote tests for repositoryChecker implementations [#2258](https://github.com/sourcegraph/sourcegraph/pull/2258) - N/A - add rote test for workspaceGitHubAppAccountResolver [#2257](https://github.com/sourcegraph/sourcegraph/pull/2257) - N/A - add test suite for (s *serviceImpl) listRepositoriesSearch [#2255](https://github.com/sourcegraph/sourcegraph/pull/2255) - add test suite for (r *workspaceGitHubAppResolver) ListUserGitHubRepositories [#2199](https://github.com/sourcegraph/sourcegraph/pull/2199) #### Multitenant - enable workspace specific routes only for workspace instance [#2287](https://github.com/sourcegraph/sourcegraph/pull/2287) - add rote tests for workspaceGitHubAppRepositoryResolver [#2259](https://github.com/sourcegraph/sourcegraph/pull/2259) - N/A - add test suite for (r *workspaceGitHubAppResolver) ListPublicGitHubRepositories [#2198](https://github.com/sourcegraph/sourcegraph/pull/2198) - N/A - graphql: add installation repos test suite [#2174](https://github.com/sourcegraph/sourcegraph/pull/2174) #### Release - Fix regressions from 5.10 release process [#2405](https://github.com/sourcegraph/sourcegraph/pull/2405) - refactor and fix bugs in release test<details> #### Sams - fix notification handlers [#1990](https://github.com/sourcegraph/sourcegraph/pull/1990) #### Search - fix small svelte UI paper cuts [#2317](https://github.com/sourcegraph/sourcegraph/pull/2317) - Executors: set the user/group on the job spec only if configured. [#2203](https://github.com/sourcegraph/sourcegraph/pull/2203) - Also validates `KUBERNETES_RUN_AS_USER` and `KUBERNETES_RUN_AS_GROUP`. - Must be integers in the range [0, 2147483647]. - fix fuzzy finder layout in Safari 18.1 [#2061](https://github.com/sourcegraph/sourcegraph/pull/2061) #### Source - Use GitHub GraphQL client to do repo searches [#2340](https://github.com/sourcegraph/sourcegraph/pull/2340) - Decode installationRepos' args.After correctly [#2126](https://github.com/sourcegraph/sourcegraph/pull/2126) - Fix layout on repo admin search box [#1960](https://github.com/sourcegraph/sourcegraph/pull/1960) #### Telemetry - include anonymous user ID in externalAuthSignup events [#2074](https://github.com/sourcegraph/sourcegraph/pull/2074) #### Telemetrygateway - update generated bindings [#1939](https://github.com/sourcegraph/sourcegraph/pull/1939) #### Worker/Sams - fix userRolesStrings [#1992](https://github.com/sourcegraph/sourcegraph/pull/1992) #### Workspaces - handle missing class name in instances [#2286](https://github.com/sourcegraph/sourcegraph/pull/2286) - create: improve cancellation handling [#2167](https://github.com/sourcegraph/sourcegraph/pull/2167) - CodeUnauthenticated for missing session ID, dont include trace ID in log message [#2032](https://github.com/sourcegraph/sourcegraph/pull/2032) #### Workspaces/Integrations - do not list billing subscriptions if no workspaces [#2233](https://github.com/sourcegraph/sourcegraph/pull/2233) #### Others - set high match limit for NLS [#2352](https://github.com/sourcegraph/sourcegraph/pull/2352) - remove surplus typename [#2265](https://github.com/sourcegraph/sourcegraph/pull/2265) - fix: remove surplus typename - use byte columns for contributors to support non-utf8 characters [#2122](https://github.com/sourcegraph/sourcegraph/pull/2122) - skip revision if not found instead of throwing error [#2121](https://github.com/sourcegraph/sourcegraph/pull/2121) - slow down contributor jobs [#2120](https://github.com/sourcegraph/sourcegraph/pull/2120) - add internal actor to contributor job [#2101](https://github.com/sourcegraph/sourcegraph/pull/2101) - Correctly handle overlapping paths in Perforce protection rules [#1745](https://github.com/sourcegraph/sourcegraph/pull/1745) ### Chore #### Ci - Enable svelte-check in CI for multi-tenant [#2242](https://github.com/sourcegraph/sourcegraph/pull/2242) - skip license-check workflow on draft prs [#2087](https://github.com/sourcegraph/sourcegraph/pull/2087) - add -x flag to the script [#2029](https://github.com/sourcegraph/sourcegraph/pull/2029) - bazel - pull static psql as tool dep [#1970](https://github.com/sourcegraph/sourcegraph/pull/1970) - pg-utils - upload static psql [#1969](https://github.com/sourcegraph/sourcegraph/pull/1969) #### Cloud - switch ephemerals to dev enterprise portal [#2090](https://github.com/sourcegraph/sourcegraph/pull/2090) #### Code Intelligence - Remove EMPTY_STATS_JSON object [#2363](https://github.com/sourcegraph/sourcegraph/pull/2363) - Fix incorrect error handling [#2316](https://github.com/sourcegraph/sourcegraph/pull/2316) - Move cursor last for consistency [#2311](https://github.com/sourcegraph/sourcegraph/pull/2311) - Refactor uploadhandler logic for clarity [#2086](https://github.com/sourcegraph/sourcegraph/pull/2086) - Update scip version and use faster parsing API [#2085](https://github.com/sourcegraph/sourcegraph/pull/2085) - Simplify code to avoid single-implementation interfaces [#2046](https://github.com/sourcegraph/sourcegraph/pull/2046) - Fix incorrect test inputs [#2043](https://github.com/sourcegraph/sourcegraph/pull/2043) - Simplify SyntacticIndexingJobStore [#2042](https://github.com/sourcegraph/sourcegraph/pull/2042) - Remove RepositorySchedulingService [#2041](https://github.com/sourcegraph/sourcegraph/pull/2041) - Remove IndexEnqueuer interface with a single implementation [#2040](https://github.com/sourcegraph/sourcegraph/pull/2040) #### Cody - Add QA's test domain to the enterprise domain list [#2392](https://github.com/sourcegraph/sourcegraph/pull/2392) - monitor completions latency by feature [#2345](https://github.com/sourcegraph/sourcegraph/pull/2345) - remove retired claude models [#2047](https://github.com/sourcegraph/sourcegraph/pull/2047) - Fix typos and minor warnings around Cody Gateway [#2025](https://github.com/sourcegraph/sourcegraph/pull/2025) - migrate code completion model resolution to use models.json [#1980](https://github.com/sourcegraph/sourcegraph/pull/1980) - Make LegacyModelRedirects public [#1951](https://github.com/sourcegraph/sourcegraph/pull/1951) #### Cody-Gateway - log model capability mismatch [#2181](https://github.com/sourcegraph/sourcegraph/pull/2181) #### Dev - Replace cmp.Diff -> check.(Must)?NoDiff (part 3) [#2154](https://github.com/sourcegraph/sourcegraph/pull/2154) - Replace cmp.Diff -> check.(Must)?NoDiff (part 2) [#2151](https://github.com/sourcegraph/sourcegraph/pull/2151) - Replace cmp.Diff -> check.(Must)?NoDiff (part 1) [#2150](https://github.com/sourcegraph/sourcegraph/pull/2150) - Introduce more type safe testing package [#2049](https://github.com/sourcegraph/sourcegraph/pull/2049) #### Dotcom - UI copy, list by instance domain, correctly return invalid argument on update [#1916](https://github.com/sourcegraph/sourcegraph/pull/1916) #### Gateway - Fix logged model name format in "not allowed" errors [#2056](https://github.com/sourcegraph/sourcegraph/pull/2056) - Don't ignore API version when comparing modelRefs for RateLimit filtering [#2024](https://github.com/sourcegraph/sourcegraph/pull/2024) - Use `models.json` in Cody Gateway (PRIME-600, PRIME-612) [#1759](https://github.com/sourcegraph/sourcegraph/pull/1759) #### Graphqlbackend - remove deprecated monitoring queries [#2075](https://github.com/sourcegraph/sourcegraph/pull/2075) #### Local - pg_version_check - force db to be postgres [#1979](https://github.com/sourcegraph/sourcegraph/pull/1979) #### Monolithsams - migrate to official SAMS SDK [#1987](https://github.com/sourcegraph/sourcegraph/pull/1987) #### Plg - Add Cody Pro upgrade script [#1903](https://github.com/sourcegraph/sourcegraph/pull/1903) #### Sams - enable SDK caching for authentication middleware clients [#1988](https://github.com/sourcegraph/sourcegraph/pull/1988) #### Search - Upgrade prettier for web-sveltekit [#2221](https://github.com/sourcegraph/sourcegraph/pull/2221) - Add private metadata for language on code nav events [#2190](https://github.com/sourcegraph/sourcegraph/pull/2190) - (new web ui) Upgrade to Svelte 5 [#2183](https://github.com/sourcegraph/sourcegraph/pull/2183) - Update client side code intel telemetry to include provenance and tab [#2142](https://github.com/sourcegraph/sourcegraph/pull/2142) #### Security - Pin otel-collector package version [#2452](https://github.com/sourcegraph/sourcegraph/pull/2452) - Update src-cli to version 5.11.1 [#2447](https://github.com/sourcegraph/sourcegraph/pull/2447) - Update src-cli version to 5.11.1 Backport 2721fd9106eb033afe4cca96164f7ecc5e0b6f88 from #2444 - Update src-cli to version 5.11.0 [#2366](https://github.com/sourcegraph/sourcegraph/pull/2366) - Update src-cli version to 5.11.0 - Auto-update package lockfiles for Sourcegraph base images [#2302](https://github.com/sourcegraph/sourcegraph/pull/2302) #### Source - Use sghttp CloneURL to make a copy of a URL [#2315](https://github.com/sourcegraph/sourcegraph/pull/2315) - simplify oauth middleware [#1946](https://github.com/sourcegraph/sourcegraph/pull/1946) #### Telemetry - remove example values, deprecate SafeAction [#2107](https://github.com/sourcegraph/sourcegraph/pull/2107) #### Workspace - Update picker with small changes for current link [#2227](https://github.com/sourcegraph/sourcegraph/pull/2227) #### Workspaces - add seats metadata by listing subscriptions in bulk [#2189](https://github.com/sourcegraph/sourcegraph/pull/2189) - make openfga cancelled errors easier to detect [#2117](https://github.com/sourcegraph/sourcegraph/pull/2117) - ListWorkspaces: concurrently fetch membership [#2104](https://github.com/sourcegraph/sourcegraph/pull/2104) - set workspace ID on create span [#2084](https://github.com/sourcegraph/sourcegraph/pull/2084) - UX Updates for Workspaces service [#2078](https://github.com/sourcegraph/sourcegraph/pull/2078) - mark emails as transactional [#1984](https://github.com/sourcegraph/sourcegraph/pull/1984) - add tracing on Cloudflare KV ops, improve retry policies [#1957](https://github.com/sourcegraph/sourcegraph/pull/1957) #### Workspaces/Billing - add rehttp on stripe 429 [#2079](https://github.com/sourcegraph/sourcegraph/pull/2079) - add traced HTTP client to Stripe SDK [#1962](https://github.com/sourcegraph/sourcegraph/pull/1962) #### Others - Update Calendar Release Notifications [#2230](https://github.com/sourcegraph/sourcegraph/pull/2230) - N/A - add CODENOTIFY files for Cody Prime team [#2185](https://github.com/sourcegraph/sourcegraph/pull/2185) - Avoid materializing set values just for iteration [#2045](https://github.com/sourcegraph/sourcegraph/pull/2045) - Enable exhaustruct on syntactic_indexing folder [#2044](https://github.com/sourcegraph/sourcegraph/pull/2044) - cleanup stale branches [#1977](https://github.com/sourcegraph/sourcegraph/pull/1977) - Remove unreferenced scripts [#1942](https://github.com/sourcegraph/sourcegraph/pull/1942) - update repo not found for dotcom [#1940](https://github.com/sourcegraph/sourcegraph/pull/1940) - Cleanup some local dev things [#1906](https://github.com/sourcegraph/sourcegraph/pull/1906) - Address Gazelle deprecation warnings [#1789](https://github.com/sourcegraph/sourcegraph/pull/1789) - Use enum for executor runtime instead of boolean flags [#1788](https://github.com/sourcegraph/sourcegraph/pull/1788) - Rename executor Config fields & simplify code [#1787](https://github.com/sourcegraph/sourcegraph/pull/1787) - Use collections.Set for marking allowed RepoID values. [#1743](https://github.com/sourcegraph/sourcegraph/pull/1743) - Move license check types to handler [#1697](https://github.com/sourcegraph/sourcegraph/pull/1697) ### Refactor #### Ci - add DefaultQueue for the default queue to use [#2096](https://github.com/sourcegraph/sourcegraph/pull/2096) ### Reverts - Revert "feat(cody-gateway): add Gemini 2.0 Flash experimental model [#-1](https://github.com/sourcegraph/sourcegraph/pull/2326) - Revert "completions: Use authenticator interface for access token" [#1694](https://github.com/sourcegraph/sourcegraph/pull/2169) - Revert "chore(ci): temporary exclude diff tests (#1923)" [#1923](https://github.com/sourcegraph/sourcegraph/pull/1926) ### Uncategorized #### Others - [Backport 5.11.x] bitbucketcloud: Fix repo perms syncing for inherited permissions and groups [#2399](https://github.com/sourcegraph/sourcegraph/pull/2399) - Fixed an issue with Bitbucket Cloud permission syncing where inherited permissions and group permissions were not correctly reflected. - worker: Disable routines for codeintel inside routines logic [#2386](https://github.com/sourcegraph/sourcegraph/pull/2386) - tenant: Prevent in-app deadlock while initializing globalstate [#2383](https://github.com/sourcegraph/sourcegraph/pull/2383) - tenant: Mark tenant as last seen async [#2381](https://github.com/sourcegraph/sourcegraph/pull/2381) - nls: add ability to boost results from a repo [#2375](https://github.com/sourcegraph/sourcegraph/pull/2375) - Intent detection: add heuristics [#2364](https://github.com/sourcegraph/sourcegraph/pull/2364) - autoedits: remove rewrite speculation field for the chat endpoint [#2361](https://github.com/sourcegraph/sourcegraph/pull/2361) - Hitesh/change direct route method [#2351](https://github.com/sourcegraph/sourcegraph/pull/2351) - change deepseek model for autoedits [#2350](https://github.com/sourcegraph/sourcegraph/pull/2350) - Reapply "feat(cody-gateway): add Gemini 2.0 Flash experimental model" [#2348](https://github.com/sourcegraph/sourcegraph/pull/2348) - auth: Simplify middlewares [#2336](https://github.com/sourcegraph/sourcegraph/pull/2336) - http: Refactor HTTP_TRACE to use Sourcegraph logger [#2335](https://github.com/sourcegraph/sourcegraph/pull/2335) - http: Drop Blackhole middleware [#2334](https://github.com/sourcegraph/sourcegraph/pull/2334) - editor: Add missing Gerrit remoteURL resolution [#2332](https://github.com/sourcegraph/sourcegraph/pull/2332) - gitserver: Fix input parsing issue in diff searches [#2331](https://github.com/sourcegraph/sourcegraph/pull/2331) - tenant: Mention repos that were not found [#2328](https://github.com/sourcegraph/sourcegraph/pull/2328) - tenant: Use SiteID for workspace management API interaction [#2327](https://github.com/sourcegraph/sourcegraph/pull/2327) - NLS: use reranker in batch search too [#2325](https://github.com/sourcegraph/sourcegraph/pull/2325) - NLS: only rerank keyword matches [#2324](https://github.com/sourcegraph/sourcegraph/pull/2324) - NLS: fix bug where we could skip reranking [#2320](https://github.com/sourcegraph/sourcegraph/pull/2320) - bugfix: anchor include patterns for symbol tree [#2319](https://github.com/sourcegraph/sourcegraph/pull/2319) - Fixed a web app bug that could cause symbols to be shown in the symbol tree for files that share a name with the viewed file - NLS: initial reranker integration [#2298](https://github.com/sourcegraph/sourcegraph/pull/2298) - Redis: remove unused rcache methods [#2292](https://github.com/sourcegraph/sourcegraph/pull/2292) - chore(workspaces) Ensure an api error populating list of workspaces do… [#2291](https://github.com/sourcegraph/sourcegraph/pull/2291) - gomod: bump Zoekt for BM25 improvement [#2282](https://github.com/sourcegraph/sourcegraph/pull/2282) - tenant: Indicate to webapp that workspaces UIs should be shown [#2279](https://github.com/sourcegraph/sourcegraph/pull/2279) - repoupdater: Fix panic when traversing public repos [#2273](https://github.com/sourcegraph/sourcegraph/pull/2273) - dev/workspaces: get local o11y working again [#2263](https://github.com/sourcegraph/sourcegraph/pull/2263) - tenant: Use workspace ID as site id [#2256](https://github.com/sourcegraph/sourcegraph/pull/2256) - tenant: Fix missing tenant context in conf validation [#2247](https://github.com/sourcegraph/sourcegraph/pull/2247) - ranking: revert changes to concurrency limits [#2236](https://github.com/sourcegraph/sourcegraph/pull/2236) - NLS: initial support for type:path [#2234](https://github.com/sourcegraph/sourcegraph/pull/2234) - enable predicted outputs for S2 instance for fireworks models [#2226](https://github.com/sourcegraph/sourcegraph/pull/2226) - dev(search): (new web ui) Upgrade svelte-check [#2220](https://github.com/sourcegraph/sourcegraph/pull/2220) - add deepseek completions model for autoedits [#2219](https://github.com/sourcegraph/sourcegraph/pull/2219) - workspaces/billing: implement payment charge for purchase extra seats [#2217](https://github.com/sourcegraph/sourcegraph/pull/2217) - Reranker: make sure to record telemetry [#2188](https://github.com/sourcegraph/sourcegraph/pull/2188) - tenant/worker: Add tenant to context for worker in ST mode [#2184](https://github.com/sourcegraph/sourcegraph/pull/2184) - tenant: Implement dynamic limits for GitHub App [#2172](https://github.com/sourcegraph/sourcegraph/pull/2172) - repo: Drop next_sync_at prioritization [#2160](https://github.com/sourcegraph/sourcegraph/pull/2160) - gateway: benchmark: fix http-then-websocket initial request failures [#2159](https://github.com/sourcegraph/sourcegraph/pull/2159) - repoupdater: Fix interval out of range [#2155](https://github.com/sourcegraph/sourcegraph/pull/2155) - pings: Remove hubspot integration [#2144](https://github.com/sourcegraph/sourcegraph/pull/2144) - workspace-reconciler: update tenant name and display name [#2141](https://github.com/sourcegraph/sourcegraph/pull/2141) - repoupdater: Make backoff after failure to fetch/clone more exponential [#2140](https://github.com/sourcegraph/sourcegraph/pull/2140) - gitserver: Record LastError, LastOutput when hitting a timeout [#2139](https://github.com/sourcegraph/sourcegraph/pull/2139) - gitserver: Simpify repo state syncer [#2138](https://github.com/sourcegraph/sourcegraph/pull/2138) - tenant: Add context to OIDC verifier [#2137](https://github.com/sourcegraph/sourcegraph/pull/2137) - tenant: Fix missing tenant in oauth requests [#2136](https://github.com/sourcegraph/sourcegraph/pull/2136) - tenant: Expose configured limits in GQL API [#2123](https://github.com/sourcegraph/sourcegraph/pull/2123) - add colorful icons for gitlab and bitbucket [#2114](https://github.com/sourcegraph/sourcegraph/pull/2114) - chore(workspaces) Remove an extra quote [#2111](https://github.com/sourcegraph/sourcegraph/pull/2111) - tenant: Temporarily bump limit to 10GB again [#2110](https://github.com/sourcegraph/sourcegraph/pull/2110) - tenant: Fix multitenant repo selection update [#2109](https://github.com/sourcegraph/sourcegraph/pull/2109) - NLS: boost literal matches [#2108](https://github.com/sourcegraph/sourcegraph/pull/2108) - bug(multitenant): Fix GraphQL resolvers for repo search [#2098](https://github.com/sourcegraph/sourcegraph/pull/2098) - batches: Fix trigger function with tenancy [#2092](https://github.com/sourcegraph/sourcegraph/pull/2092) - Deprecate unused pings, reducing load on local PG instances [#2082](https://github.com/sourcegraph/sourcegraph/pull/2082) - NLS: perform single search for code and text results [#2081](https://github.com/sourcegraph/sourcegraph/pull/2081) - fix cookie name [#2077](https://github.com/sourcegraph/sourcegraph/pull/2077) - NLS: created dedicated search job [#2076](https://github.com/sourcegraph/sourcegraph/pull/2076) - appliance: Remove from UserNav [#2069](https://github.com/sourcegraph/sourcegraph/pull/2069) - repo: Fix race condition in code host syncer [#2060](https://github.com/sourcegraph/sourcegraph/pull/2060) - authz: Adjust default settings for perms syncing [#2052](https://github.com/sourcegraph/sourcegraph/pull/2052) - The default values for repo permission syncing have been adjusted. If you specified overrides, this means no change on your instance.Adjusted defaults:`permissions.syncScheduleInterval` is now 60s instead of 15s, in favor of scheduling more jobs at once (see below).`permissions.syncOldestUsers` and `permissions.syncOldestRepos` have been adjusted to `100` from `10` to schedule pending permission sync jobs faster.`permissions.syncJobCleanupInterval` has been bumped from every minute to every hour. Cleaning completed jobs is purely to prevent unbounded growth and every minute was more aggressive than necessary.The default concurrency for repo- and user-centric sync jobs has been bumped from 1 to 5 to account for larger instances. Historically, GitHub prevented concurrent API access in secondary rate limiting but this has been lifted to be much more lenient long ago. `permissions.syncReposMaxConcurrency` has also been introduced to compliment `permissions.syncUsersMaxConcurrency`. - tenant: Fix concurrent creation in DB [#2039](https://github.com/sourcegraph/sourcegraph/pull/2039) - tenant: Do not fail on startup [#2038](https://github.com/sourcegraph/sourcegraph/pull/2038) - add code_completion feature flag for autoedit model [#2037](https://github.com/sourcegraph/sourcegraph/pull/2037) - pings: Move handler code into cmd/pings [#2021](https://github.com/sourcegraph/sourcegraph/pull/2021) - authz: Remove unused iteration over authProviders [#2019](https://github.com/sourcegraph/sourcegraph/pull/2019) - cody: Fix incorrect language in Cody auth dialog [#2013](https://github.com/sourcegraph/sourcegraph/pull/2013) - auth: Bring auth.Providers reads further up [#2011](https://github.com/sourcegraph/sourcegraph/pull/2011) - tenant: Restructure multitenant GitHub app implementation [#2010](https://github.com/sourcegraph/sourcegraph/pull/2010) - deps: upgrade SAMS SDK [#2006](https://github.com/sourcegraph/sourcegraph/pull/2006) - repo: NeedsRepositoryConfiguration is independent of permissions [#1981](https://github.com/sourcegraph/sourcegraph/pull/1981) - repoupdater: Enable dbbacked scheduler by default [#1975](https://github.com/sourcegraph/sourcegraph/pull/1975) - repoupdater: Split dbworker for clones and fetches [#1974](https://github.com/sourcegraph/sourcegraph/pull/1974) - repoupdater: Introduce higher priority for clones [#1972](https://github.com/sourcegraph/sourcegraph/pull/1972) - gitserver: Increase duration buckets [#1971](https://github.com/sourcegraph/sourcegraph/pull/1971) - Added option to create search job from action menu in the results page [#1968](https://github.com/sourcegraph/sourcegraph/pull/1968) - tenant: Return multitenantGitHubApp for all users [#1967](https://github.com/sourcegraph/sourcegraph/pull/1967) - workspaces: use `time.Now` as the modtime for "index.html" [#1956](https://github.com/sourcegraph/sourcegraph/pull/1956) - workspaces: add a quick log to show the modtime of index.html [#1953](https://github.com/sourcegraph/sourcegraph/pull/1953) - Redis: add warning about using KEYS command [#1913](https://github.com/sourcegraph/sourcegraph/pull/1913) - remove debugging code [#1909](https://github.com/sourcegraph/sourcegraph/pull/1909) - auth: Craft GatingProvider interface and use in AuthProviders [#1892](https://github.com/sourcegraph/sourcegraph/pull/1892) - auth: Small code cleanup [#1891](https://github.com/sourcegraph/sourcegraph/pull/1891) - events: Deprecate hashedLicenseKey in events from client [#1887](https://github.com/sourcegraph/sourcegraph/pull/1887) - llms: Fixup and streamline cody rate limits [#1700](https://github.com/sourcegraph/sourcegraph/pull/1700) - licensing: Implement NonAdmins feature [#1699](https://github.com/sourcegraph/sourcegraph/pull/1699) - licensing: Simplify free tier logic a bit [#1695](https://github.com/sourcegraph/sourcegraph/pull/1695) - enterprise-portal: add RegisterRoleResources background routine [#1687](https://github.com/sourcegraph/sourcegraph/pull/1687) - enterprise-portal: add SAMS notification handler for UserRolesUpdated [#1686](https://github.com/sourcegraph/sourcegraph/pull/1686) - security: Auto-update package lockfiles for Sourcegraph base images [#1678](https://github.com/sourcegraph/sourcegraph/pull/1678) - workerutil: Move into tenant package [#1533](https://github.com/sourcegraph/sourcegraph/pull/1533) - dbworker: RFC for tenant-aware, fast dequeues [#1487](https://github.com/sourcegraph/sourcegraph/pull/1487) ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - [Backport 5.10.x] Context: switch to Snowball stopwords (#2223) [#2225](https://github.com/sourcegraph/sourcegraph/pull/2225) - Narrowed down the stopwords list used in Cody context, to fix an issue where we could miss highly relevant files.Backports [https://github.com/sourcegraph/sourcegraph/pull/2223](https://github.com/sourcegraph/sourcegraph/pull/2223) {/* RSS={"version":"5.11 Patch 0", "releasedAt": "2024-12-19"} */} # 5.10 Patch 3 > Warning: This release updates the database container images from Postgres 12 to Postgres 16, and begins using Wolfi based images. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice! > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.10.3940 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.10.3940) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.10.3940) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.10.3940) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.10.3940) ### Features #### Security - introduce UntrustedExternalClient [#2433](https://github.com/sourcegraph/sourcegraph/pull/2433) Backport 3f079a57978179aa2ad3f310195346a8c574f9ce from #2349 ### Fix #### Database - do not log DSN secrets when changed [#2434](https://github.com/sourcegraph/sourcegraph/pull/2434) - We no longer log the postgresql DSN when it changes. Previously this could contain the secret PGPASSWORD. Backport 2bd9c09969fff536c6fb29108656658d3f875047 from #2272 ### Reverts There were no reverts for this release {/* RSS={"version":"5.10 Patch 3", "releasedAt": "2024-12-19"} */} # 5.10 Patch 2 > Warning: This release updates the database container images from Postgres 12 to Postgres 16, and begins using Wolfi based images. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice! > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.10.2832 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.10.2832) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.10.2832) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.10.2832) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.10.2832) ### Features #### Cody - update cody web to 0.17.0 version `(PR #2285)` - update cody web to 0.16.0 version `(PR #2284)` Backport 964eceae584e4eff56df9711da68fef7047cbc40 from #2254 ### Fix #### Bazel - syft checksum update `(PR #2218)` #### Cody - disable reranking for airgapped instances `(PR #2194)` #### Release - Remove `--link` and add optional args env var `(PR #2216)` - fix(rel): change `pg_upgrade` behavior to use copy instead of hard links Backport 13caa807d96dd4b5dd872fec2a38322d1888134a from #2192 - remove -x flag in readiness check on database containers `(PR #2135)` - fix(rel): address issue with readiness check outputting passwords to logs. Backport 655a739e8e791d7aab1977d2c26543a3a4871809 from #2132 ### Chore #### Ci - bzlmod migration for rules_syft `(PR #2193)` - Backport fbf92aedbb81f00766d7107015b7697352b5c482 from #1812 ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 5.10.x] Context: switch to Snowball stopwords (#2223) `(PR #2225)` - Narrowed down the stopwords list used in Cody context, to fix an issue where we could miss highly relevant files.Backports [https://github.com/sourcegraph/sourcegraph/pull/2223](https://github.com/sourcegraph/sourcegraph/pull/2223) - [Backport 5.10.x] bugfix: do not load commit history eagerly `(PR #2201)` - Fixes a bug where the new web app may consume an outsized amount of backend resources when browsing large repositories. Backport 79546146e2bfa4e3fcee1a8e825ad48823c8cd77 from #2197 - [Backport 5.10.x] Cody context: clean up resolvers `(PR #2187)` {/* RSS={"version":"v5.10.2832", "releasedAt": "2024-12-12"} */} # 5.10 Patch 1 > Warning: This release updates the database container images from Postgres 12 to Postgres 16, and begins using Wolfi based images. Customers are advised to take a database backup before upgrading! See our [Postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice! > > Warning: `automatic` upgrades will require setting the environment variable `SRC_AUTOUPGRADE_IGNORE_DRIFT=true` on the `sourcegraph-frontend` deployment/container. > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.10.1164 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.10.1164) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.10.1164) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.10.1164) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.10.1164) ### Fix #### Database - remove 5.10 deprecation dates on out of band migrations `(PR #1996)` - We are removing the deprecation dates on out of band migrations which deprecated in 5.10. This is to unblock MVU and autoupgrades which are encountering a bug with deprecated out of band migrations. Backport f654dcc9200e2dda2deddc8f98bcd972e6a873fd from #1995 #### Search - disable zoekt go-git optimization by default `(PR #2051)` - Disabled an indexed search optimization which would skip files accidentally (`ZOEKT_DISABLE_GOGIT_OPTIMIZATION=true`). Backport 34ada948bdcee3d75499c98f4db5c32986943e88 from #2050 ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 5.10.x] oob: Actually run for all tenants `(PR #1994)` {/* RSS={"version":"v5.10.1164", "releasedAt": "2024-12-03"} */} # 5.10 Patch 0 > Warning: Admins are advised to upgrade directly to v5.10.1164 circumventing this release. > > Warning: This release updates the database container images from Postgres 12 to Postgres 16, and begins using Wolfi based images. Customers are advised to have a database backup before upgrading! See our [postgres 12 end of life](https://sourcegraph.com/docs/admin/postgres12_end_of_life_notice#postgres-12-end-of-life) notice! > > Warning: `automatic` and migrator `upgrade` command will not work for this release, please upgrade directly to `v5.10.1164`, or to a 5.9 version and conduct a standard upgrade using migrator's default `up` command! > > Also be sure to check your deployment type's [upgrade notes](http://sourcegraph.com/docs/admin/updates#instance-specific-procedures)! ## v5.10.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.10.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.10.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.10.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.10.0) ### Features #### Autoedit - add autoedit model to use chat completions end point `(PR #1809)` #### Ci - move rules_pkg to MODULE.bazel `(PR #1660)` #### Cody - fix ootb prompt details page `(PR #1902)` - update cody web to 0.14.0 version `(PR #1895)` - add support for out-of-the-box prompts `(PR #1726)` - support openai predicted outputs `(PR #1625)` - Cody Gateway: add support for OpeanAI predicted outputs - added `systemPreInstruction` (CODY-4032) `(PR #1402)` - adds `systemPreInstruction` to the `modelConfiguration` key in site admin config that allows injecting a prelude prompt into every chat request for an enterprise #### Cody-Gateway - add gpt-4o-mini model `(PR #1591)` - Cody Gateway: add `gpt-4o-mini` to Cody Gateway allow list - Cody Gateway: add `gpt-4o-mini` to DotCom models list #### Conf/Deploy - add 'workspace' deploy type `(PR #1710)` #### Dev - use svelte-dev for multi-tenant `(PR #1843)` - add alias 'sg bz cf' for 'sg bz configure' `(PR #1827)` - add '-open=false' option for 'sg sams login' `(PR #1498)` - Adding sg command to request Entitle bundles `(PR #1370)` #### Gateway - Add `/models.json` endpoint (PRIME-601) `(PR #1728)` - Disable flagged model blocking for enterprise (PRIME-602, PRIME-605) `(PR #1659)` #### Github - add client ID support for GitHub App authentication `(PR #1622)` - The GitHub app authentication package now supports authenticating a GitHub app via the OAuth client ID following the announcement of [https://github.blog/changelog/2024-05-01-github-apps-can-now-use-the-client-id-to-fetch-installation-tokens/](https://github.blog/changelog/2024-05-01-github-apps-can-now-use-the-client-id-to-fetch-installation-tokens/) #### Graphql - add support for reading GitHub App Installation repos from GitHub REST API `(PR #1711)` - A new GraphQL query, `GithubAppRepositoriesForInstallation`, has been added that provides a paginated list of all the GitHub repositories that are accessible to the GitHub app with the provided installation id. - add endpoint for getting github app installations scoped by user `(PR #1606)` - A new graphql endpoint has been added, GithubAppInstallationsForUser, that returns installation information for the global GitHub multi tenant app when running in multitenant mode. #### Internal/Github - add pagination support and test for GetUserInstallations `(PR #1572)` - The Github API client's [GetUserInstallations](https://docs.github.com/en/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token) route, which lists of GitHub App installations the user has access to, now has pagination support. #### Lib/Cloudapi - add support for workload identity to auth roundtripper `(PR #1623)` #### Local - add bazel mod tidy to `sg bazel configure` step `(PR #1656)` #### Msp - apply default max DB conns of 8*CPU `(PR #1394)` #### Msp/Cloudsql - annotate cloudsql trace spans with target database `(PR #1398)` #### Mt-Router - add support for SOAP redirect `(PR #1510)` #### Multi-Tenant - redirect to workspaces/join on user-not-found `(PR #1604)` #### Multitenant - Rework GraphQL resolvers and add back App installation link `(PR #1819)` - Add temporary UI for workspace repository management `(PR #1791)` - add helper routine for instantiating github app from multitenant credentials `(PR #1758)` - A simple helper routine to the multitenantenv package that automatically populates a github app struct with the provided validated credentials. - use default cookie for github app oauth login `(PR #1571)` - The routing logic for multitenant mode now has a new route that uses the "last seen tenant" cookie to route github app login authorization callbacks to the appropriate tenant. #### Release - add pg16 and pg16 codeinsights to published images `(PR #1731)` - feat(rel): Add Postgresql 16 and Postgresql 16 codeinsights images to published image list. - add pg 16 codeinsights entrypoint and tests `(PR #1730)` - feat(rel): Add self updating to Postgres 16 codeinsights db image. - add pg 16 entrypoint and tests `(PR #1718)` - feat(rel): Add self updating to Postgres 16 container image. - Add wolfi postgres 16 codeinsights-db base image `(PR #1619)` - feat(rel): Add Postgres 16 CodeInsights Wolfi image - Add wolfi postgres 16 base image `(PR #1617)` - feat(rel): Add Postgres 16 Wolfi image #### Release - Handle postgres version upgrades in upgrade test `(PR #1918)` - refactor upgradetest - introduce proper handling of the postgres version upgrade Backport 9ccdf4200e3e08cea56bffe5779ca8a6cda2909c from #1894 #### Search - include file paths in reranker items `(PR #1866)` - Cody context now incorporates filename information in reranking, improving context quality when the reranker is enabled. - (new web ui) Add 'open in code host' button to repo root and folder pages `(PR #1776)` - (new web ui) Copy URL to clipboard when clicking 'Permalink' `(PR #1774)` - (new web ui) Show file/folder name in title instead of full path `(PR #1735)` - (new web ui) Add survey toast `(PR #1453)` - (new web ui) Show loading indicator when navigating up the file tree `(PR #1465)` #### Sg - add workspaces common operations `(PR #1845)` - support `get`, `list`, and `delete` workspaces to `sg` #### Source - Allow GitHub code host connections to specify an external account as the authenticator `(PR #1842)` - multitenant: add worker job for inserting github multitenant app credentials `(PR #1668)` - A new worker job has been added that updates the database with the credentials for the global github app when running in multitenant mode. #### Telemetry - Add request client name and version to telemetry gateway payload `(PR #1607)` #### Tenant/Reconciler - report backpressure when tenants > 0.85*targetMaxTenants `(PR #1719)` - exclude DESTROY_SUCCESS from global reconcile `(PR #1534)` #### Workspaces - check basic email validity to create invite `(PR #1849)` - always set displayName=name if displayName is not set `(PR #1838)` - email all workspace admins when a user joins a workspace `(PR #1824)` - add CheckWorkspaceName RPC `(PR #1822)` - Initial iteration of new creation flow `(PR #1806)` - check billing seats when joining and inviting `(PR #1770)` - always apply DEFAULT_WORKSPACE_INSTANCE_CLASS on workspace create `(PR #1763)` - accept instance class `(PR #1752)` - list eligible-to-join workspaces in UI `(PR #1672)` - explicit invites POC `(PR #1624)` - error-log illegal state transitions for Sentry `(PR #1616)` - list includes workpsaces a user can join via open invite `(PR #1586)` - make membership limits configurable `(PR #1584)` - name, display name, and open invite email domain blocklists `(PR #1539)` - free up assigned workspace slot when workspace is DESTROY_SUCCESS `(PR #1535)` - prevent management API from reading workspaces in deletion state `(PR #1508)` - prune iam store on deletion `(PR #1504)` - implement router pruning, add 'pruned_router_at', 'pruned_iam_at' `(PR #1480)` - delete and reconcile routes `(PR #1440)` #### Workspaces/Blocklists - improve heuristics and errors `(PR #1801)` #### Workspaces/Instances - add UNAVAILABLE, CAPACITY_PRESSURE states `(PR #1712)` #### Workspaces/Integrations - provide workspace uri `(PR #1477)` #### Workspaces/Web - as-you-type name validation POC `(PR #1858)` #### Others - switch to buildkite for nightly release pipeline `(PR #1690)` - N/A - add new telemetry v2 events for server side batch changes `(PR #1666)` - add events for interactions with search input toggle buttons `(PR #1469)` - add events for codenav actions `(PR #1441)` - make filters sidebar collapsible `(PR #1437)` - Search filters sidebar is now collapsible - add dynamic filters and aggregation for repo metadata and topics `(PR #1420)` - Added dynamic filters and the ability to aggregate by repo metadata and repo topic - render mdx as markdown `(PR #1392)` - Render .mdx files as markdown ### Fix #### Batch Changes - titles now break over multiple lines if they are too long `(PR #1582)` - fix(batches): titles now break over multiple lines if they are too long - do not ignore bool env var parsing error `(PR #1537)` #### Client - address pnpm lint:js:web issues and add job in CI `(PR #1520)` #### Code Intelligence - Align repo batch settings between syntactic and precise indexing `(PR #1663)` - Fix wrong offset in policy iteration `(PR #1546)` #### Cody - use models from model config for PLG chat `(PR #1870)` - sync allowed models in dotcom user rate limits with models.json `(PR #1864)` - filter allowed models based on subscription tier `(PR #1636)` #### Database - drop unique slug contraint from github app table `(PR #1689)` - The github_apps table has removed an erroneous unique constraint that accidentally incorporated an app's slug (which is mutable) as part of the unique identifier for an app. #### Database - update generated squash and schemas `(PR #1917)` #### Dev - fix kill pubsubemulator `(PR #1850)` - correctly pick up error message from 'sg sams login' `(PR #1482)` #### Enterpriseportal - allow list to accept display name query of 2 characters `(PR #1603)` #### Gateway - add blocked phrase if request was blocked due to flagged models list (PRIME-603) `(PR #1670)` - Make model cost a pointer (CODY-4007) `(PR #1427)` #### Graphql - refactor getGithubAppFromEnvvar to use multitenantEnv.Config.AsGithubApp `(PR #1767)` - The logic in the new multitenant GraphQL resolvers has been reworked to use the new helper methods introduced in the Multitenant GitHub app configuration logic introduced in [https://app.graphite.dev/github/pr/sourcegraph/sourcegraph/1758/](https://app.graphite.dev/github/pr/sourcegraph/sourcegraph/1758/). #### Insights - Fix incorrect line counts in non-default config `(PR #1517)` - Code insights should show correct line counts when enhanced language detection is turned off (note: this setting is on by default). #### Local - display external env overrides when displaying environment variables `(PR #1595)` - sg - fix images query to point to correct rule `(PR #1430)` #### Release - fix oob migrations hanging `(PR #1959)` - NA Backport a943412a99852332f921b52a0ee3179dc3331d20 from #1958 - add vacuum after reindex in Postgres upgrade script `(PR #1779)` - fix(rel): Add vacuum to Postgres upgrade process - install `sg` in the nightly pipeline GHA `(PR #1675)` - N/A #### Release - correct views drift in postgres 16 `(PR #1878)` - add migrations to handle database drift caused during postgres 12 to postgres 16 upgrade - fix drift check in local upgradetest `(PR #1832)` - Fix bug in local upgrade test preventing final stage drift check via private monorepo #### Search - consistently marshal SearchTypeRegex as regexp `(PR #1919)` - We sometimes would emit `patternType:regex` instead of `patternType:regexp`. We now always do regexp as well as treating regex as an alias for regexp. Backport a095b39ac39cfcbe3526ecf85ed6d50cb5fa3d9d from #1808 - Executors on Kubernetes: propagate user and group from Executor env vars to batch change job pod `(PR #1863)` - The environment variables `KUBERNETES_RUN_AS_USER` and `KUBERNETES_RUN_AS_GROUP` contribute to the Job `PodSpec`'s `SecurityContext`. - The default value for those variables is `-1`, which could cause errors with some Kubernetes clusters. - (new web app) Only update user activity data once on load `(PR #1797)` - (new web ui) Respect 'window.context.disableFeedbackSurvey' flag `(PR #1778)` - (search input) Treat not, and, or as keywords regardless of case `(PR #1733)` - (new web ui) Fix dimensions of line selection marker `(PR #1417)` - (new web ui) Add rollover effect to RadioButtonGroup `(PR #1416)` - (new web ui) Fix duplicate lint suggestion insertion `(PR #1413)` - (new web ui) Remove unintentional vertical scrollbars `(PR #1411)` - (new web ui) Only show specific repo menu items when features are enabled `(PR #1401)` #### Security - Do not expand env vars in executor logs `(PR #1811)` - This change reduces the risk of secrets being emitted in executor logs even if there are bugs in the secret redaction logic. #### Sg - remove noop -d declaration for psql `(PR #1455)` - specify postgres database for psql commands `(PR #1450)` #### Source - p4-fusion now decodes encode file paths from Perforce `(PR #1347)` - When cloning Perforce depots, Sourcegraph will now decode encoded paths correctly (paths that include characters like `@` and `#`) #### Tenant/Reconciler - do not check dormancy if still in PROVISION states, only check if needed `(PR #1605)` - on getTenantErr, report destroy state if in destroy state `(PR #1563)` #### Workspaces - properly represent workspace state to management API `(PR #1816)` - fix DESTROY_PENDING proto adapter, improve handling of unknown states `(PR #1814)` - improve CreateWorkspace resilience `(PR #1773)` - remove broken down-migration statements `(PR #1754)` - support creating workspaces over API `(PR #1714)` - do not list all workspaces if user has no memberships `(PR #1671)` - tidy up email-disabled error log `(PR #1667)` #### Workspacesreconciler - fix double-counting of checked workspaces `(PR #1753)` #### Others - Prompt page tweaks `(PR #1899)` - revision picker growth `(PR #1875)` - more contrast updates `(PR #1871)` - Reranker: recreate from config on every call `(PR #1865)` - prompt library visual updates `(PR #1852)` - Use standard protojson library for reducing memory `(PR #1846)` - Increase contrast everywhere `(PR #1840)` - make owner nullable in prompts `(PR #1746)` - only retry queries `(PR #1706)` - Reranker: listen to config changes, do not mutate config `(PR #1705)` - retry graphql on 502 errors `(PR #1683)` - fix(web): retry graphql requests on network errors - styling changes to explore panel and badges `(PR #1528)` - increase contrast of highlighted code background and line numbers in selected area `(PR #508)` ### Chore #### Ci - container structure test bzlmod migration `(PR #1818)` - migrate protobuf and rules_proto rules to bzlmod `(PR #1749)` - move buildifier prebuilt to bzlmod `(PR #1709)` - increase buildifier timeout to 6m `(PR #1658)` - move bazel_skylib to bzlmod `(PR #1654)` - bazel - remove build_tests_only flag for db tests `(PR #1610)` - bazel - add config settings to switch between pg-12 and pg-16 binaries `(PR #1601)` - refactor bazel migrations `(PR #1583)` - update github workflow for pg-12 and pg-16 package variants `(PR #1580)` - upgrade aspect bazel lib `(PR #1425)` - Upgrade to latest rules proto grpc `(PR #1424)` - enable db tests task to run on ci agents with postgres 16 `(PR #1293)` - upgrade rules_pkg `(PR #976)` - upgrade aspect cli `(PR #975)` #### Code Intelligence - Remove unused return value & pass TraceLogger `(PR #1551)` - Enable exhaustruct for more subfolders (part 2) `(PR #1547)` - Document why RepositoryID field is nil `(PR #1545)` - Add helper types for relationships `(PR #1542)` #### Dev - Delete tracking-issue package `(PR #1556)` - Add iterator helper for pagination `(PR #1555)` - Fix links to sg monorepo in Markdown `(PR #1554)` - Add more helper functions to iterext `(PR #1549)` - Enable exhaustruct for more subfolders `(PR #1544)` - Add helper package for property-based testing `(PR #1540)` - Introduce helper package for iter.Seq `(PR #1522)` - Fix links to sg monorepo `(PR #1519)` - Simplify language detection code in inventory `(PR #1518)` - Flip polarity of boolean for language detection `(PR #1516)` - Use a lazyFile type to consolidate lazy file content fetching `(PR #1515)` - Rename functions for clarity `(PR #1514)` - Remove direct usages of enry.IsVendor `(PR #1513)` - Simplify sorting logic `(PR #1512)` - Rename type Lang -> LanguageStats `(PR #1511)` - Migrate from sync.WaitGroup to conc APIs `(PR #1495)` - Fix warning about missing integrity field `(PR #1494)` - Update for loops for newer syntax `(PR #1488)` - Factor out offset & limit logic `(PR #1486)` - Switch to alternate orderedmap library `(PR #1414)` - Clarify docs & naming in debugserver code `(PR #1384)` #### Dev/Mt-Router - silence cache miss on default `(PR #1565)` #### Dotcom - rename 'cody services' to just 'cody gateway' `(PR #1466)` #### Frontend - Store model config in global var `(PR #1805)` #### Gateway - A few small docs fixes `(PR #1751)` - Make provider type more specific `(PR #1750)` #### Local - small improvements to sg entitle `(PR #1794)` #### Msp/Iam - suggest standard IAM_MAX_DB_CONNS as env var `(PR #1499)` #### Release - remove postgres-12 wolfi from published images `(PR #1737)` - chore(rel): remove unused Postgres 12 images - remove appliance from published images and codebase `(PR #1732)` - chore(rel): remove appliance from published images #### Release - remove check against latest full version in `--post-release-version` code path `(PR #1585)` #### Search - (new web ui) Improve search home page SG logo rendering `(PR #1813)` - add NodeJS 20 to the Bundled Executor image `(PR #1569)` - Update search web app title and description for SEO on dotcom `(PR #1509)` - Add JDK 17 and 21 to the Bundled Executor image `(PR #1502)` - (new web ui) Remove beta badge from search progress popover `(PR #1418)` - update CPU and MEM panels for zoekt `(PR #1368)` - We have updated the CPU and MEM monitoring panels for Zoekt on Grafana. The new panels reduce redundancy and provide more insight into MEM distribution. #### Source - simplify oauth middleware `(PR #1876)` - Update the gitserver image lockfile to contain the latest p4-fusion `(PR #1410)` - Default perforce changelist mapping to enabled `(PR #1376)` #### Telemetry - align billing metadata values with 'sourcegraph/cody' `(PR #1396)` #### Telemetry/Geolocation - update DB-IP Lite database `(PR #1468)` - The local geolocation inference database used in telemetry and audit logs has been updated. #### Telemetrygateway - bump slow-request threshold `(PR #1647)` #### Tenant/Reconciler - add some additional diagnostics `(PR #1795)` #### Workspaces - include longer s&p500 names for fuzzy matching `(PR #1844)` - make unexpected errors more friendly `(PR #1821)` - add spans on write interactions `(PR #1807)` - instantiate large blocklists once in store `(PR #1562)` #### Workspaces/Web - use unified client constructor `(PR #1828)` #### Others - Rename method to indicate lack of redaction clearly `(PR #1790)` - Reorder fields in executor Config `(PR #1785)` - Remove custom Set type `(PR #1742)` - Rename Set.Values() -> ValuesNonDet() for clarity `(PR #1741)` - Avoid materializing Set Values() just for length `(PR #1739)` - Add env var to disable precise & syntactic `(PR #1707)` - Bump autoindexing image SHAs `(PR #1703)` - Move CodyGatewayRateLimit calculation to where it's used `(PR #1693)` - remove env lock mechanism `(PR #1593)` - fix(dev): remove env.Get lock that could cause a runtime panic - update event names `(PR #1500)` - remove robert from many CODENOTIFYs `(PR #1421)` - update new search events to make them easier to use `(PR #1395)` ### Refactor #### Local - move reset-pg to internal/db `(PR #1573)` ### Reverts - Revert "chore/dev: upgrade aspect_bazel_lib to 2.9.4 (#1713)" `(PR #1713)` ### Uncategorized #### Others - [Backport 5.10.x] Revert "chore(source): simplify oauth middleware" `(PR #1928)` - githubapp: Expose monolith GitHub app ClientID `(PR #1904)` - pnpm: Remove leftover appliance links in workspace `(PR #1900)` - core: Fixup pnpm lockfile `(PR #1886)` - tenant: Hide unlink button for SAMS external accounts `(PR #1885)` - auth: Hide unlink button for external accounts that cannot be unlinked `(PR #1884)` - svelte: Correctly hide navbar entries `(PR #1883)` - svelte: Add back settings link `(PR #1882)` - workspaces/billing: attach metadata and context without cancel whenever possible `(PR #1881)` - web: respect `expanded` in the search results URL `(PR #1880)` - Fixed an issue where searches from saved URLs may now show aggregations by default - add timeout to gateway calls `(PR #1879)` - workspaces: Align styling for join page `(PR #1860)` - workspaces: Add tables for listing workspaces `(PR #1857)` - workspaces: Slightly tweak style `(PR #1851)` - workspaces: Directly link to installation target `(PR #1848)` - tenant: Suppress some irrelevant missing_context pprof traces `(PR #1847)` - Workspaces: Fix workspace picker rendering in React `(PR #1841)` - fix permissions connection resolver ordering `(PR #1839)` - workspaces: Add seat selector on plan page `(PR #1835)` - workspaces/billing: create RPC for purchasing seats `(PR #1831)` - workspaces/billing: extract subscription attribute computation into a `Plan` helper `(PR #1830)` - workspaces: Add updated workspace pickers for tenant `(PR #1829)` - workspaces: Add field to pre-purchase extra seats `(PR #1826)` - workspaces/billing: implement periodic workers for subscription renewal `(PR #1823)` - auth: Fix background contexts in validate authz provider `(PR #1802)` - redispool: support more configuration options `(PR #1799)` - workspaces/billing: add tests to `cmd/workspaces/internal/billing` `(PR #1786)` - workspaces/billing: update test for `ManagementService.CreateWorkspace` `(PR #1784)` - workspaces/billing: add database tests for customers `(PR #1783)` - workspaces/billing: add database tests for transactions `(PR #1782)` - Require `X-Requested-With` for Cody API (CODY-4209) `(PR #1781)` - `X-Requested-With` is now a required HTTP header for Cody API calls - Context: narrow down stopwords list `(PR #1780)` - workspaces/billing: ignore invoices that are not for the current instance `(PR #1777)` - workspaces/billing: support soft-deleting subscriptions `(PR #1772)` - feature/internal: upsert github credentials on tenant creation `(PR #1769)` - The multitenant reconciler now proactively inserts the credentials for the shared multitenant GitHub app whenever a new tenant is created. - lib/cloudapi: add mt instance type `(PR #1766)` - tenant: Add configuration for MT GitHub App to localdev `(PR #1756)` - Seed builtin prompts `(PR #1755)` - Prompts including "Document Code", "Explain Code", "Generate Unit Tests", "Find Code Smells" - tenant: Enable onebox on tenant creation `(PR #1748)` - Onebox: introduce 'nls' patterntype `(PR #1744)` - workspaces/billing: implement Stripe webhook handler `(PR #1740)` - cody-gateway: update deployment id for model `(PR #1729)` - workspaces/billing: implement seat purchase and consumption `(PR #1723)` - localdev: Disable precise, syntactic codeintel in multitenant mode `(PR #1720)` - workspaces/billing: use the "correct" way to list customer payment methods `(PR #1717)` - `sg start sveltekit-minimal` for quickly running the new UI `(PR #1702)` - conf: Move more types to conftypes `(PR #1692)` - Remove experimental admin onboarding v2 `(PR #1691)` - telemetry: Implement telemetry exports for workspaces `(PR #1677)` - autoedit: add speculative decoding `(PR #1673)` - autoedit: Add speculative decoding support from fireworks - fix `marketingTracking` sending null `(PR #1669)` - Prompts: fix prompt name validation and prompts migration `(PR #1664)` - Add GraphQL resolvers to read and set a list of repositories for a GH App installation ID `(PR #1657)` - fixup: remove Git conflict marks in `sg.config.yaml` `(PR #1649)` - Require prompt field before successful submission `(PR #1639)` - Add builtin prompts field to prompts `(PR #1633)` - Zoekt: refactor memory dashboards `(PR #1618)` - workspaces: add billing prototype for subscription creation `(PR #1611)` - admin: Update report an issue link `(PR #1608)` - change default autoedit model `(PR #1589)` - feat(cloud) sg cloud eph deploy: support ms env `(PR #1581)` - add Cody.promptLibrary telemetry `(PR #1568)` - worker: Group tasks by purpose `(PR #1566)` - Improve policy iterator tests to not rely on SQL for insertion `(PR #1560)` - repoupdater: Fix slow scheduling of cloned->uncloned repos `(PR #1552)` - repoupdater: Fix reporting of background routines `(PR #1550)` - Update Prompts Library UI (list page) `(PR #1548)` - Update prompt detail header UI `(PR #1538)` - Context: remove experimental intent routing `(PR #1536)` - Add 'recommended' checkbox to new creation UI. `(PR #1531)` - dormancy: Also fall asleep tenants that never see traffic `(PR #1530)` - Fix reranker not being applied `(PR #1529)` - sg: Fix local dev pguser setup `(PR #1506)` - Context: ensure we propagate timeouts and missing repos `(PR #1505)` - Make Visual Studio Experimental `(PR #1503)` - Context: always use more items for reranker `(PR #1476)` - Remove insert prompt mode `(PR #1475)` - Add missing Cody Web Alert CSS variable override `(PR #1474)` - repoupdater: Fix no rows returned error `(PR #1472)` - add autoedits to cody gateway `(PR #1459)` - ci: bump go-mod-tidy step timeout `(PR #1452)` - Add commands to prompts migration `(PR #1449)` - repoupdater: Speed up repo_update_job dequeues `(PR #1448)` - repoupdater: Clean up metrics `(PR #1447)` - repoupdater: Speed up and simplify not fetched metric `(PR #1446)` - migration: Checkpoint new repo_update_jobs migration `(PR #1445)` - gomod: bump Zoekt for query perf fix `(PR #1438)` - Implement prompt detail page re-design `(PR #1423)` - Re-designed prompt detail page. - Add page faults to Zoekt memory metrics `(PR #1422)` - chore/source Update src-cli version to 5.8.2 `(PR #1415)` - chore/source Update src-cli version to 5.8.2 - siteadmin: Reset pagination cursors after filter change `(PR #1404)` - bugfix: fix settings link `(PR #1393)` - gomod: bump Zoekt for go-git optimization `(PR #1391)` - Update Marketing URLs in the site footer links `(PR #1390)` - Soft delete prompts `(PR #1386)` - Widen blocked phrases, but only confine blocked phrases to expensive (aka flagged) models `(PR #1344)` - repoupdater: Drop support for gitUpdateInterval `(PR #1339)` - The site config setting `gitUpdateInterval` has been deprecated and removed. We are removing it in favor of smarter heuristics like webhooks, user traffic, and repo staleness. - repoupdater: Remove total from schedule and update queue state `(PR #1338)` - Add system workspace admin role `(PR #1327)` - Add syntactic worker to images so it gets updated in helm charts `(PR #1323)` - feature/source: adjust exclude definition in github schema to disallow using name, id with other filter conditions `(PR #1250)` - The github code host connection schema for `exclude` has been updated to enforce that the name and id fields can't be combined with any other fields. - Add gitSSHCipher for git code hosts `(PR #1175)` - RFC: Dormancy and tenant states `(PR #756)` - web telemetry: update `marketingTracking` to retrieve latest cookies set on web `(PR #460)` ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - Fix wrong offset in policy iteration `(PR #1559)` - Release: Prep stitched migration graph for release (#1388) `(PR #1389)` - n/a {/* RSS={"version":"v5.10.0", "releasedAt": "2024-11-27"} */} # 5.9 Patch 4 ## v5.9.17785 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.9.17785) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.9.17785) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.9.17785) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.9.17785) ### Fix #### Cody - Allow specification of additional chat GPT models for Cody `(PR #3434)` Backport 5190f43a4d09810e69400c5d0e6d9176b3c4b815 from #3380 # 5.9 Patch 3 ## v5.9.1590 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.9.1590) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.9.1590) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.9.1590) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.9.1590) ### Fix #### Code Intelligence - Fix wrong offset in policy iteration `(PR #1559)` #### Cody - fix broken homepage redirect for cody only plans `(PR #1626)` - When using an instance with a Cody-only license, accessing the home page now correctly redirects you to /cody/dashboard, instead of a non-existent /cody page. Backport a4cb5a0723bad18e1c215d81231db457d1abfbdb from #1621 #### Search - (new web ui) Disable persistence for history/explore panel `(PR #1614)` ### Chore #### Release - remove extra v identifier for version in artifact exporter `(PR #1594)` Backport c4b838103ce2f71e7591ade720e8bdf17f9a5b39 from #1490 ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 5.9.x] azure: Add support for repositoryPathPattern `(PR #1629)` - Added support for the `repositoryPathPattern` property to Azure DevOps code host connections. - Fixed an issue where Azure DevOps repo names included a port number - aligning with other code host connection implementations Backport 762bd89a12825ff05de98d9c2d8adfcf1ef5bf4a from #1543 {/* RSS={"version":"v5.9.1590", "releasedAt": "2024-11-13"} */} # 5.9 Patch 2 ## v5.9.347 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.9.347) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.9.347) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.9.347) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.9.347) ### Fix #### Dev - hoist env vars init to avoid repo-updater panic `(PR #1527)` ### Reverts There were no reverts for this release {/* RSS={"version":"v5.9.347", "releasedAt": "2024-11-06"} */} # 5.9 Patch 1 ## v5.9.45 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.9.45) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.9.45) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.9.45) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.9.45) ### Reverts There were no reverts for this release ### Uncategorized #### Others - "Add syntactic worker to images so it gets updated in helm charts"" `(PR #1483)` {/* RSS={"version":"v5.9.45", "releasedAt": "2024-11-05"} */} # 5.9 Patch 0 ## v5.9.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.9.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.9.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.9.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.9.0) ### Features #### Api - Added a better error message for 429 errors for `/.api/cody/completions` (CODY-4097) `(PR #1380)` #### Audit - add tenant to audit logs, fix log stack `(PR #960)` #### Batch Changes - show name of additional fields that cause errors `(PR #799)` - feat(batches): show name of additional fields that cause errors #### Ci - generate frozen files as part of stich_migration_graph generation `(PR #957)` - record Test infrastructure failures `(PR #884)` - add library that writes to TEST_INFRASTRUCTURE_FAILURE_FILE if it is defined for test failures #### Cloud - allow monolithsams instances to have no conf auth providers `(PR #1247)` - add support to override target managed service endpoints `(PR #1238)` - add support to override license generation public key from cloud site config `(PR #1193)` #### Code Intelligence - Syntactic indexing grafana monitoring dashboard `(PR #1263)` #### Cody - add more API docs content `(PR #1378)` - add CLI tool to compute PCW `(PR #1349)` - Add Claude 3.5 Sonnet (Latest) & Claude 3 Opus (Latest) `(PR #1244)` - add Cody Audit Log `(PR #1232)` - add cody audit log table and store `(PR #1182)` - Expose token usage in the LLM API `(PR #1070)` - The `/.api/completions/stream` API now includes used input/output tokens and the upstream model name in the response body when using the query parameter `api-version=5` or higher. Does not apply to: Vertex Anthropic, Azure OpenAI (mo model name, and no token usage in streaming response), Gemini (no model name in streaming response) - LLM chat completions now support `stream: false` when using Azure OpenAI and OpenAI-compatible providers. - update telemetry feature prefix for Cody API `(PR #1023)` - add embedded API docs via OpenAPI/Redocly `(PR #1014)` - New OpenAPI API docs within the instance at the URL `$SRC_ENDPOINT/api/openapi/public`. Alternatively, reach the page at "User > Settings > OpenAPI Reference". - add basic telemetry recording for Cody API `(PR #943)` - add support to format raw API responses for Cody `(PR #877)` - The raw HTTP API now accepts the query paramter `format=cody` or header `Accept: application/cody` to render files and directories as context items for Cody. Example request path: `/github.com/sourcegraph/cody/-/raw/agent/src/index.ts?format=cody`. #### Cody-Gateway - add new claude-3-5-haiku-latest model `(PR #1471)` Cody Gateway: add new claude-3-5-haiku-latest dotcom models list Backport 11e7481ba3c810ae5b47d32b8cf32066e2f0b2bb from #1470 - deprecate old claude 3.5 sonnet `(PR #1248)` #### Dev - add externalSecret support for commandsets `(PR #1027)` - sg sams login and cookie-less workspace creation `(PR #913)` #### Graphql - upload graphql schemas to GCS bucket `(PR #1245)` #### Internal/Requestclient - have HTTP middleware populate all response headers with observed X-Forwarded-For and calculated IP for debugging purposes `(PR #524)` - All of Sourcegraph's HTTP responses now contain two new headers for easier debugging purposes. - `Observed-X-Forwarded-For`: echos the `X-Forwarded-For` header that we observed on the user's incoming request - `Observed-Calculated-IP-From-Forwarded-For`: indicates the IP address that we derived from the user's `X-Forwarded-For` header #### Local - use pending spinner for build waiting in cloud ephemeral `(PR #1039)` - add format for displaying env `(PR #918)` #### Monitoring - set decimals to 1 for standard heatmap `(PR #1361)` #### Monolithsams - load SAMS provider and creds from env `(PR #1024)` #### Msp - package 'auditlog' `(PR #1223)` #### Msp/Pg - updated o11y for pool acquire, add overrides for pgxpool.Config `(PR #1375)` #### Search - (new web ui) Show loading feedback for hovercards `(PR #1239)` - (new web ui) Add ability so switch search scope in fuzzy finder `(PR #1201)` - (new web ui) Make view modes available when opening a file at a commit `(PR #1090)` - (new web ui) Render relative images in rich text documents `(PR #841)` #### Sg - make workspaces endpoint configurable `(PR #998)` - implement show-env flag `(PR #883)` #### Site Admin - site config 'telemetry: \{ disableLocalEventLogs \}' to disable event_logs `(PR #1275)` - Long-term local retention of user telemetry as 'event logs' can now be disabled entirely via the `telemetry: { disableLocalEventLogs }` site configuration. #### Sub_repo_perms - add conditional logging for seeing if sub_repo_permisisons are working `(PR #673)` - The sub repository permissions implementation now emits logs that describe the rules that were evaluated for a given request whenever tracing is enabled. (We limit these logs for only when tracing is enabled since they can be quite verbose). #### Telemetry - Log estimated LLM cost telemetry (CODY-4007) `(PR #1312)` - Adds cost estimates to the ModelConfiguration returned by `.api/llm/supported-models.json` - Adds `llmTokenUsageCostEstimate` telemetry value with estimates of each requests LLM cost in pennies - Add check for PGDATASOURCE `(PR #1281)` - Add source.server.server_client.user_agent to telemetry payload `(PR #1120)` - Add the sourcegraph API client user-agent to telemetry payload types under `source.server.server_client.user_agent`. - check for external dbs `(PR #1083)` - propagate new x-sourcegraph-api-client-* headers to request clients `(PR #1025)` - Propagates new X-Sourcegraph-API-Client-Name and X-Sourcegraph-API-Client-Version headers to request clients #### Telemetry-Gateway - improve logging on processing done `(PR #1252)` #### Telemetrygateway - implement publishusermetadata RPC `(PR #1095)` - spec PublishInstanceUserMetadata and pubsub format `(PR #1053)` #### Telemetrygatewayexporter - log export duration, use better duration buckets `(PR #1305)` #### Tenant/Reconciler - full membership reconcile `(PR #953)` - handle tenant-exists, new-tenant, and error combination paths `(PR #895)` #### Worker - delete legacy event_logs exporter `(PR #859)` #### Worker/Telemetrygatewayexporter - opt-in user metadata exporter `(PR #1096)` #### Workspaces - notify user state updates `(PR #1316)` - allow join-by-email to be provided on creation `(PR #1280)` - add management GetWorkspace that allows view-by-email-domain `(PR #1277)` - guard against excessive join-workspaces `(PR #1251)` - restrict memberships/admins before allowing workspace creation `(PR #1212)` - join by email domain POC `(PR #1162)` - configure join by email domains `(PR #1158)` - only recently seen instances are candidates for hosting workspace `(PR #1031)` - ban 'default' as a workspace name `(PR #992)` - forbid 'src-'-prefix workspace names `(PR #920)` - refactor workspace states with reconcile and dormancy `(PR #819)` #### Workspaces/Management - always return roles `(PR #1358)` - provide workspace URI `(PR #1055)` #### Workspacesreconciler - add WORKSPACESRECONCILER_INSTANCE_STATE_OVERRIDE and 'AT_CAPACITY' state `(PR #1297)` - global periodic reconciler `(PR #997)` #### Others - surface result precision in the explore panel `(PR #1359)` - more complete search backend events `(PR #1257)` - add embedded file snippet page `(PR #1196)` - Added embeddable page for file snippets - add embedded file snippet component `(PR #1122)` - add search aggregations to svelte webapp `(PR #1093)` ### Fix #### Api-Docs - Added OpenAPI Urls to static page info `(PR #1379)` #### Batch Changes - enable request splitting by default `(PR #1229)` - fix(batches): enable request splitting by default - handle spec being nil for suffix salt `(PR #1228)` - fix(batches): handle spec being nil for suffix salt - enable GQL request splitting via BATCH_CHANGES_REQUEST_SPLITTING `(PR #1150)` - fix(batches): enable GQL request splitting via BATCH_CHANGES_REQUEST_SPLITTING - display "Deleted Namespace" instead of throwing an error `(PR #778)` - fix(batches): display "Deleted Namespace" instead of throwing an error #### Ci - remove dependsOn key for PG16 step `(PR #1295)` - disable db test task temporarily `(PR #1292)` - generate coreos iptable BUILD.bazel file `(PR #1230)` - cap branch names in image tags `(PR #1103)` #### Code Monitor - fail monitors with missing/unverified primary email address `(PR #938)` - fix(code-monitor): fail monitors with missing/unverified primary email address #### Code Intelligence - Add more limits in auto-indexing inference code `(PR #1170)` - Introduces new limits for auto-indexing inference to reduce the risk of continuously growing auto-indexing queues. - The number of jobs spawned per round of auto-indexing inference per repo is capped (default: 100) to reduce risk of clogging of auto-indexing queues. Excess jobs will be discarded. - The number of paths inspected for a single round of auto-indexing inference per repo is capped (default: 500) to reduce risk of timeouts. Excess paths will be discarded. - Handle annotated tag hashes passed as 'commit' for uploads `(PR #1135)` - Fixes handling of SCIP uploads when the hash passed to the `-commit` flag of `src-cli` corresponds to the hash of an annotated tag instead of the hash of a commit. Previously, these uploads were not accessible for code navigation. - Propagate error collector to fix retention tab GraphQL API call `(PR #847)` - Fixes a bug where the retention tab for precise indexes would show a nil pointer exception instead of retention information. #### Code Nav - Trigger hovers for all programming languages `(PR #1076)` - Fixes a bug where hovers were not triggered for less mainstream languages like F#, Standard ML, Visual Basic, Pkl, Hack, MATLAB etc. #### Cody - convert nil message content parts for OpenAI compatability `(PR #1467)` - guard against completion usage missing (CODY-4135) `(PR #1218)` - API telemetry `(PR #1026)` - reset usage when rate limit value or interval decreased `(PR #1015)` - fix CodyLLMConfiguration resolver `(PR #839)` #### Codyapi - Restrict audit log retrieval to site admins only `(PR #1285)` - Add usage to completions/chat (CODY-3498) `(PR #1131)` - Added token usage information to `.api/llm/chat/completions` #### Completions - clear out usage information on the completions API when version < 5 (CODY-4114) `(PR #1153)` #### Dev - Correctly propagate error key-value pairs `(PR #1258)` - Fixes a bug where logs and traces were sometimes missing key-value pairs recorded alongside errors. - fix sg db reset-pg PGUSER overwrite `(PR #1220)` - fix secrets deadlock `(PR #1032)` - fix workspaces client in local dev `(PR #1028)` - (new web ui) Properly initialize local dev defaults `(PR #961)` - remove removed table from MT migration `(PR #910)` - report warning if workspace creation failed `(PR #909)` - fix workspaces flakey test `(PR #862)` #### Frontend - place requestclient as one of the first middleware `(PR #1215)` #### Local - move env into correct grouping `(PR #1332)` - specify default database when checking psql version in `sg setup` `(PR #924)` - fix issue with sg start monitoring ignoring dockerCommands `(PR #848)` #### Mt-Router - prevent infinite oauth redirect `(PR #1118)` #### Release - rename generated changelog file `(PR #1136)` - Add stitched migration graph override (#935) `(PR #941)` - NA #### Search - disable hybrid search with index:no `(PR #1462)` - `index:no` will now avoid the index completely. Previously it would still consult the index via a process called hybrid search. Search jobs always uses `index:no`, so if you notice a performance problem please reach out to Sourcegraph support. Setting `SRC_DISABLE_RESPECT_INDEX_FIELD` environment variable on the frontend and worker pods will disable this new behaviour in 5.9.x only.Stacked on `(PR #1456)` Closes [https://linear.app/sourcegraph/issue/SPLF-663/disable-hybrid-search-for-search-jobs](https://linear.app/sourcegraph/issue/SPLF-663/disable-hybrid-search-for-search-jobs) Backport 7aced46a7bc3526695a77e492ee69ad2cfa7bb17 from #1460 - (new web ui) Render submodules differently in file trees `(PR #1377)` - Fix document highlights in certain situations `(PR #1343)` - (new web ui) Fix relative links to folders `(PR #1331)` - (new web ui) Fix file tree sidebar not staying at top level directory `(PR #1328)` - (new web ui) Show informative message when repo has no README or description `(PR #1240)` - (new web ui) Fix linkifying files `(PR #1236)` - (new web ui) Make blob view readonly `(PR #1234)` - Prevents default browser shortcuts from modifying the file content locally. - (new web ui) Prevent uncaught error when navigating back to file page `(PR #1199)` - (new web ui) Show helpful message for root commit/change list page `(PR #1138)` - (new web ui) Do not show loading spinner for empty commit ranges on compare page `(PR #1126)` - (new web ui) Fix search aggregation styles `(PR #1125)` - exclude content filters from phrase boosting `(PR #1038)` - This fixes a bug where we would apply a phrase boost if a `content:` filter was specified with keyword search enabled. This led to inconsistent behavior (regexp vs keyword search) and it also rendered the `content:` filter ineffective, because we ran a general text search instead of a just a content search. - (new web ui) 'File not found' when quickly navigating between files `(PR #959)` - (new web ui) Blame view not visible for files that use `\r` as line separators `(PR #929)` - (new web ui) Show settings link to site admins when repo error occurs `(PR #817)` #### Sg - workaround dangling dev resources `(PR #1048)` #### Source - correct Name() documentation for gitserver's ReadDirIterator `(PR #1278)` - The documentation for gitserver's ReadDir method has been clarified to reflect that the return iterator's Name() method returns the full path of the file, as opposed to just the basename. - multiple GitHub external accounts to the same URL now refresh correctly `(PR #1260)` - When there are multiple auth providers configured that point to the same GitHub URL, as can be the case when using private GitHub Apps, user external account tokens will now refresh correctly. - clarify exclude docs in github connection schema to say that individual expressions within block are `and`-ed together `(PR #1249)` - The documentation for the "exclude" section in the github code host connection schema has been clarified to explain that each block is OR'd together, and the expressions within each block are AND'd together. - Fix Azure Devops OnPrem connection editing and repo name `(PR #1184)` - The sync of a GitHub repositoryQuery failing will no longer cause repos to be deleted `(PR #1177)` - GitHub code host connections using `repositoryQuery` will no longer delete repositories if the sync fails for reasons like a GitHub outage or a token expiring. #### Sourcegraphaccounts - use native openidconnect provider `(PR #1030)` #### Telemetry - only log Cody API events to a remote data store, do n… `(PR #1304)` #### Telemetry-Gateway - fix configuration `(PR #1129)` #### Tenant/Reconciler - avoid illegal state transitions `(PR #1133)` - double-check assigned instance ID `(PR #1092)` - try to audit log after tenant context creation `(PR #1051)` #### Workspaces - build full redirect_to URL `(PR #1315)` - apply 'secure headers' to SPA `(PR #1313)` #### Others - copy changes to prompt settings `(PR #1286)` - remove call to possibly nil error `(PR #973)` ### Chore #### Ci - add TAG_DB_TEST to all go_tests that depends on dbtest `(PR #1288)` - add test task in workflows for dbtest to run on postgres 16 agents `(PR #1287)` - use bazel 7.4.0 `(PR #1284)` - nix - update pg-utils for patch renames `(PR #1172)` - Move //client/svelte:e2e_test to Integration/E2E_test step `(PR #1148)` - upgrade platform rules `(PR #1020)` - move rustfmt flags to ci bazelrc `(PR #1017)` - upgrade rules_ts and rules_js `(PR #1006)` - upgrade aspect rules swc `(PR #988)` - update rules rust v0.52.2 `(PR #985)` - set test label prefix for backcompat tests `(PR #984)` - upgrade rules_buf `(PR #974)` - skip check if author is sg teammate `(PR #969)` - bazel skylib 1.7.1 `(PR #936)` - Upgrade rules_go, gazelle, buildifier_prebuilt & rules_proto `(PR #791)` #### Code Intelligence - Remove unused parameter `(PR #1204)` - Rename flag -update -> -update-jobs-snapshots `(PR #1203)` - Use HTTPError type in uploadhandler code paths `(PR #1174)` - Remove unused parameters `(PR #1166)` - Introduce new FileContentsMap type for clarity `(PR #828)` - Use consistent casing for op strings `(PR #789)` - Clarify state transitions in GetUsages `(PR #755)` #### Database - remove residual event_logs export stuff `(PR #864)` - drop product_licenses and product_subscriptions `(PR #264)` #### Database - OOB migration for setting non-null columns via page `(PR #885)` - An out of band migration is introduced to set slowly set the value of a new column on all tables. If you have a large postgres database for Sourcegraph (1tb+) please ensure you deploy 5.9 instead of doing a multi-version upgrade past it. #### Dev - Use clearer names in health server initialization `(PR #1383)` - Make syntactic-code-intel-worker config uniform `(PR #1382)` - Enable metrics for precise-code-intel-worker in dev `(PR #1365)` - Merge fileutil package into fsext `(PR #1351)` - Migrate gitserver APIs from fs.FileInfo to fsext.FileInfo `(PR #1318)` - Introduce new package with FileInfo type `(PR #1317)` - Document footguns around escaping trace data writers `(PR #1291)` - Rename errors.ErrCollector -> errors.Collector `(PR #1265)` - Introduce new o11y-friendly RichError interface `(PR #1264)` - Replace WithErrors -> With for simplicity `(PR #1261)` - Generalize 'observation.With' for custom errors `(PR #1233)` #### Gitserver - Inline one-liner for error checking `(PR #1108)` #### Msp - upgrade openfga dependency `(PR #1357)` #### Mt-Router - disable proxy for s2 `(PR #1186)` - use bazel to run generator `(PR #1065)` - setup sentry for stage environment `(PR #1064)` - add scripts to interact with local kv `(PR #1056)` #### Search - (new web ui) Enable new web UI by default `(PR #1373)` - fix description for KUBERNETES_JOB_STEP_IMAGE `(PR #1360)` - Remove all non-single job pod code from Executors on Kubernetes. `(PR #1163)` - The environment variable `KUBERNETES_SINGLE_JOB_STEP_IMAGE` is now `KUBERNETES_JOB_STEP_IMAGE`. - Both environment variables are read, with preference given to `KUBERNETES_JOB_STEP_IMAGE`, to preserve backward compatibility, but reading of `KUBERNETES_SINGLE_JOB_STEP_IMAGE` may be removed in a future version. - (new web ui) Improve search input CSS `(PR #962)` #### Security - Update rules_apko and fix issues with sg wolfi v2 `(PR #901)` - Build containers using latest version of apko and rules_apko #### Telemetry - report token usage per request to telemetry `(PR #1165)` - Added LLM token usage telemetry #### Telemetrygatewayexporter - bump default TELEMETRY_GATEWAY_EXPORTER_EXPORT_INTERVAL `(PR #1303)` #### Telemetrytest - add working example `(PR #1274)` #### Others - fix storybook `(PR #1335)` - add searchSource to new search events `(PR #1306)` - make core-services internal/telemetry codeowners `(PR #1272)` - upgrade Mocha from 8.3.4 to ^10 `(PR #1246)` - move web app into child layout group to make room for embedded pages `(PR #1128)` - run prettier `(PR #906)` - Upgrade hermetic cc toolchain `(PR #844)` - upgrade rules_oci `(PR #818)` ### Test #### Others - implement structure for e2e tests `(PR #108)` ### Refactor #### Cody-Gateway - support max_completion_tokens for o1 models `(PR #947)` - refactor(cody-gateway): support max_completion_tokens for o1 models #### Search - (new web ui) Update folder page table styling `(PR #1221)` #### Others - move all business logic out of context resolvers `(PR #821)` ### Reverts - revert filtering out deprecated models on server `(PR #1276)` ### Uncategorized #### Others - [Backport 5.9.x] oob: Run without tenant iterator for older versions `(PR #1429)` - Release: Prep stitched migration graph for release (#1388) `(PR #1389)` - n/a - Move cody.serverSideContext out of experimentalFeatures in site config `(PR #1385)` - bugfix: add key to search result file header `(PR #1374)` - gitserver: Parse LastChanged, LastFetched as nulltime `(PR #1372)` - add code llama 7B model for ab test `(PR #1371)` - adding code llama 7B for completions - Hide auto submit checkbox and add promoted badge `(PR #1367)` - Enable reranker by default if Gateway is enabled `(PR #1366)` - Cody Chat: the context engine now uses the reranker by default everywhere where Cody Gateway is enabled. - db: Set default permissions to RLS user as well `(PR #1362)` - Remove promote-to-public dependency on bazel-push-images step `(PR #1356)` - release: Only fail SBOM step if all uploads fail `(PR #1355)` - source: Fix code host connection editor validation `(PR #1354)` - bugfix: fix symbol tree hover selector `(PR #1353)` - dev: Exclude generated code from prettier `(PR #1341)` - Prompt library: fix input description for prompt name `(PR #1337)` - workspaces: Various mini fixes and a landing page `(PR #1336)` - tenant: Fix gRPC in local dev `(PR #1334)` - Reapply "worker: Fix configuration error reporting" `(PR #1311)` - Search: document choice for ZoektScoreBoost `(PR #1310)` - bugfix: escape file paths `(PR #1308)` - Change clickable elements to buttons `(PR #1298)` - Allow users to insert chips according to cursor position `(PR #1296)` - Change prompt creation flow feature flag name `(PR #1294)` - Pass Context to scip-syntax invocation to propagate cancellation `(PR #1290)` - gomod: bump Zoekt for metrics improvement `(PR #1276)` - Redis: rename RedisWrapper `(PR #1273)` - connectutil: UnexpectedError handler `(PR #1271)` - Add recommended flag to Prompt Templates `(PR #1268)` - Adds ability to mark prompts as recommended and then sort the recommended prompts at the top. - bugfix: remove possibility of infinite recursion from the symbol tree `(PR #1256)` - Update cody web to 0.10.0 `(PR #1254)` - bugfix: use short OID for file popover `(PR #1242)` - Remove outdated install instructions for sg `(PR #1227)` - site: Fix missing unredaction in site config `(PR #1226)` - Update the sg docs link `(PR #1225)` - multi-tenant: support synchronized user sign-out `(PR #1222)` - sg: Fix db reset with default local settings `(PR #1217)` - db: Improve error message for failed version update `(PR #1216)` - Only push final images on specific default runtypes `(PR #1211)` - OpenaI completions response type fixing for gpt-3.5-turbo-instruct and gpt-4o-mini `(PR #1207)` - sg: Always run with lower privileges in dev `(PR #1197)` - tenant: Deactivate OOB migrations `(PR #1192)` - Update Enterprise footer link on dotcom `(PR #1191)` - bugfix: escape spaces in repo filter names `(PR #1187)` - Fixed a bug that would cause filters added from the search sidebar to not be correctly escaped - Attempt to fix flaky database test `(PR #1181)` - chore/search - Remove runner.Spec.Image and use command.Spec.Image instead `(PR #1161)` - dev: Disable otel in MT dev `(PR #1157)` - bug(release): remove semver check for release branch in `sg backport` `(PR #1156)` - Make GetCodyContextAlternatives usable for evals `(PR #1152)` - multi-tenant: list workspaces for the authenticated user `(PR #1146)` - saml: Prevent logspam from context cancel `(PR #1143)` - sg: Update localdev migration `(PR #1132)` - tenant: Exclude product subscription tables from OOB migrator `(PR #1124)` - Add prompt mode `(PR #1123)` - Adds mode (CHAT, EDIT, INSERT) to prompt. - gitserver: Clarify annotated tags behavior in ResolveRevision `(PR #1107)` - Rate limit: rename GlobalLimiter to DistributedLimiter `(PR #1100)` - Rate limit: make GlobalLimiter tenant-aware `(PR #1099)` - saml: Fix nil panic `(PR #1098)` - tenant: Disable migrator for ranking tables `(PR #1097)` - Rate limit: avoid using KeyValue within GlobalLimiter `(PR #1082)` - Rate limit: simplify inMemoryLimiter `(PR #1081)` - tenant: Use frozen schema for OOB migration `(PR #1077)` - Make user emails soft-deletable `(PR #1071)` - Fix prompt duplication name `(PR #1067)` - sg: Add no-open flag to workspaces create `(PR #1057)` - Creating/Editing Prompts Re-design `(PR #1054)` - The prompt creation/edit page has been redesigned. - GraphQL: remove anonymous rate limiter `(PR #1052)` - oob: Make out of band migration runner tenant-aware `(PR #1047)` - Fix the CTA to point to chat `(PR #1044)` - Fix bug where text pushed buttons out of the container `(PR #1043)` - dev: Implement wrangler router provider `(PR #1035)` - router: Ensure HTTPS protocol on auth redirect `(PR #1034)` - workspaces: Fix race condition registering state listener `(PR #1033)` - dev: Introduce devDNS helper to resolve testdomains `(PR #1029)` - Add ability to duplicate existing prompts `(PR #1022)` - Users can now duplicate existing prompts. - GraphQL: simplify rate limit interface `(PR #1021)` - Add autoSubmit & includeViewerDrafts to Cody prompts `(PR #1003)` - Adds options to set prompts to "Auto Submit", which would automatically execute the prompts in one-click. - vsce: patch release v2.2.19 `(PR #1002)` - workspacesreconciler: fix grpc tls transport `(PR #1000)` - tenant: Move externalhttp to separate package `(PR #996)` - goroutine: reenable recording when multitenancy is enabled `(PR #995)` - Rename globaldbtenant to servicetenant `(PR #994)` - ci/mt-router: add bazel build `(PR #990)` - Search: populate rev in select repo `(PR #989)` - Search: correct has.commit.after query example `(PR #987)` - mt-router: import repo `(PR #986)` - tenant: add mt-router to local dev `(PR #968)` - tenant: Remove tenant auth redirect in monolith `(PR #967)` - Do not fail if link parsing fails in relative fix processing `(PR #966)` - dev/msp: improve tfc creation error message `(PR #964)` - goroutine: remove unused support for concurrency `(PR #963)` - ci: Bump backcompat test target to 5.8.0 `(PR #954)` - tenant: Mark tenant as initialized in db `(PR #950)` - bug(release): workspace cash time dance `(PR #948)` - tenant: Fix missing tenant in auth check `(PR #933)` - db: Use non-superuser in DB tests `(PR #930)` - db: Migrator can provision RLS user permissions `(PR #919)` - ci: Bump backcompat target to 5.7 `(PR #916)` - sg: Add default tenant to hosts `(PR #915)` - remove "Don't commit private code yet" from PR template `(PR #908)` - "Prompt Library" in navbar (capitalize the L for consistency) `(PR #907)` - Blob View: Ensure copy button copies full path and not displayed path `(PR #903)` - Fixes a bug where certain copy path buttons were only copying the visible path and not the full path of a file. - sg: Fix reference to deleted table in localdev MT migration `(PR #898)` - tenant: Separate store package and create tenant1, tenant2 via workspaces `(PR #897)` - Tenant: skip some global Prometheus metrics `(PR #892)` - sg: Fix startup of workspaces service `(PR #891)` - ci: do not run executors e2e for eph `(PR #886)` - Perforce IP enforcement integration test `(PR #876)` - goroutine: Make iterator required `(PR #875)` - dev/msp: add project id validation `(PR #874)` - db: Drop unused user_public_repos table `(PR #873)` - Deprecate long-running OOB migrations `(PR #872)` - lib/cloudapi: add support for multi tenant mode `(PR #871)` - event_logs: add new `aggregatedMetrics` ping `(PR #869)` - Redis: refactor rcache interface `(PR #860)` - Add extra reranker metrics to Gateway events `(PR #838)` - Sourcegraph teammate approval GH action `(PR #824)` - Redis: remove KEYS call in completions token usage `(PR #820)` - tenant: Properly initialize RBAC `(PR #754)` - sg: Provision RLS user during setup `(PR #749)` - tenant: Add database migration to enable RLS policies `(PR #743)` - tenant: Add workspace ID and display name `(PR #741)` - tenant: Check that all tables have RLS policy set `(PR #734)` - tenant: Simplify dev migration `(PR #726)` - db: Mark tenant_id columns as non-nullable `(PR #707)` - feature: add internal/tracelog: a log.Logger that only logs if tracing is enabled `(PR #634)` - Added a new `internal/tracelog` package that provides a conditional logger for tracing. This logger only logs when tracing is enabled, improving performance by reducing unnecessary logging. - Hackathon: SBOMs feat. bazel `(PR #566)` - feature(security): Publish SBOMs for Sourcegraph releases - tenant: Unique constraint migration `(PR #430)` - security: Auto-update package lockfiles for Sourcegraph base images `(PR #246)` - (feature): site-config: add ipParseCacheSize to schema for enforce IP restrictions schema `(PR #220)` - Added a new `ipParseCacheSize` configuration option for sub-repo permissions to control the caching of Perforce "Host" to IP address translations. - feature/source: implement core logic for parsing / evaluating Perforce IP addresses for sub repo permissions `(PR #46)` - For the Perforce IP permissions implementation, this PR introduces machinery that implements the ability to parse the [IP address expressions from the perforce protections table](https://www.perforce.com/manuals/p4sag/Content/P4SAG/protections.set.html#IP_address) and compare them against the user's IP address (that's advertised from the incoming X-FORWARDED-FOR header.Namely, this PR: - Introduced parsePerforceIPString, which parses Perforce IP strings (e.g., CIDR expressions, specific IP addresses) into an ipMatcher for IP validation. - Implemented multiple ipMatcher types, including: - addrMatcher for exact IP matches. - cidrMatcher for checking IPs within a CIDR range. - alwaysTrueMatcher for wildcard * expressions. - Added toggleableIPMatcher, which either enables or disables IP enforcement based on site configuration settings. - Created matcherCache for caching recent IP string to ipMatcher translations, improving efficiency. - Updated NewRequestClientIPSource to properly derive IP from the x-forwarded-for header. - feature/site-config: add site configuration setting for enforcing IP restrictions `(PR #45)` - Added enforceIPRestrictions setting to the SubRepoPermissions section in site configuration, allowing IP-based enforcement using the X-FORWARDED-FOR header.Updated JSON schema to require SubRepoPermissions to be enabled when enforceIPRestrictions is enabled.Added validation in Perforce external service configuration to ensure IgnoreRulesWithHost and enforceIPRestrictions cannot be enabled simultaneously.Updated internal implementation to associate each Perforce rule with an IPMatcher for IP-based rule enforcement. - feature/plumbing: sub_repo_perms: do pumbling to thread comparing IP addresses alongside paths `(PR #23)` - ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - check for external dbs (#1083) `(PR #1121)` - bug(release): workspace cash time dance (#948) `(PR #949)` {/* RSS={"version":"v5.9.0", "releasedAt": "2024-11-04"} */} # 5.8 Patch 1 ## v5.8.1579 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.8.1579) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.8.1579) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.8.1579) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.8.1579) ### Features #### Telemetry - check for external dbs (#1083) `(PR #1121)` ### Fix #### Search - Fix Apollo related error in Safari `(PR #1016)` #### Others - Fix OOB migration for batch changes table `(PR #1113)` ### Chore #### Security - upgrade src-cli version to address CVE `(PR #1117)` - Upgrade src-cli version to 5.8.1 to address CVE-2024-24788, CVE-2024-24790, CVE-2024-34156 Backport b8da20f6fa148f30fe97d9267a536bd5a84502f1 from #1112 ### Reverts There were no reverts for this release ### Uncategorized #### Others - Backport 566 to 5.8.x: SBOMs with Bazel `(PR #1089)` - feature(security): Publish SBOMs for Sourcegraph releases - [Backport 5.8.x] Update src-cli MinimumVersion from 5.5.0 to 5.8.1 `(PR #1087)` - chore(release): Update minimum supported version of src-cli to 5.8.1 Backport 8f039bdcb5425071dd6e4dfddfb2cb436e124b05 from #1079 {/* RSS={"version":"sourcegraph 5 Release 8 Patch 1", "releasedAt": "2024-10-16"} */} # 5.8 Patch 0 ## v5.8.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.8.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.8.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.8.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.8.0) ### Features #### Accessrequests - Allow to file another request when original one has been processed `(PR #416)` #### Appliance - refactor install flow, status, state, stage `(PR #352)` #### Batch Changes - verbose error logging for batch syncer with BATCH_CHANGES_SYNCER_VERBOSE_ERROR_LOGGING `(PR #639)` - feat(batches): verbose error logging for batch syncer with BATCH_CHANGES_SYNCER_VERBOSE_ERROR_LOGGING - add experimental feature to add a fork name suffix to avoid name collisions `(PR #230)` - feat(batches): add experimental feature to add a fork name suffix to avoid name collisions #### Ci - enable workflows telemetry `(PR #774)` - enable aspect workflows ci telemetry - convert onconflict gen to bazel `(PR #486)` - generate `constraints.go` using bazel for onconflict linter #### Search - (new web ui) Prefill search input with selected text when pressing '/' `(PR #577)` #### Code Intelligence - Updates the autoindexing images for TypeScript and Ruby `(PR #805)` - TypeScript: Fixes references to object properties in various places - Ruby: Fixes references to `Opus::` in Ruby tests - Syntactic indexing go evaluation suite and fix tests on CI in general `(PR #482)` #### Cody - update public OpenAPI spec `(PR #796)` - add basic support for server-rendered prompts `(PR #723)` - `/.api/completions/stream` endpoint now accepts `"file"` and `"repo"` parts alongside `"text"` and `"image_url"` - add vision support `(PR #546)``/.api/completions/stream` now supports vision using the OpenAI-compatible base64 encoding of images. Example `"content": [{"type": "image_url", "image_url": { "url": "data:image/png;base64,{{IMAGE_BASE64}}" } }]`. Requires the query parameter `api-version=3` or higher. - document internal APIs with TypeSpec/OpenAPI `(PR #505)` #### Cody-Gateway - log requestinteraction in events `(PR #814)` #### Database - bestEffortForce will kill blocking transactions in migrator `(PR #781)` - DB Migrator is given the ability to automatically run pg_terminate_backend on transactions blocking a migration. This is done best effort and is opt-in per migration. #### Dev - (new web UI) Make it easier to run tests without proxying `(PR #798)` - add obvious 'target service' notice to `sg msp` commands `(PR #725)` #### Local - add cody-gateway version endpoints `(PR #685)` - add cody-gateway environments for subcommand `live` - sg - install pgvector `(PR #520)` - mac: install pgvector from sourcegraph/pgvector-12 - ubuntu: install postgresql-12-pgvector #### Msp - make databasetest shared `(PR #393)` #### Msp/Databaseutil - make 'upsert' package shared `(PR #394)` #### Release - remove test from promotion ci during release pipeline `(PR #495)` - Remove upgradetest from the release promotion ci - Stop releases from going out if there's a PR with the release-blocker label `(PR #472)` - Allow PRs to block a release from going out 😈 - use releaseregistry for release banner [REL-145] `(PR #429)` - implement using the release-registry for the banner #### Search - bump Zoekt for ranking and memory improvements `(PR #816)` - Reduce peak memory required for Zoekt indexing - Improve search ranking by using repo freshness as a scoring signal - (new web ui) Add split view support to commit page `(PR #775)` - enable similarity search by default `(PR #772)` - With this change we rank repository search results by similarity. Before, repository search results were ordered by star count instead. This affects suggestions and repository search results. To disable this feature and return to the previous behavior, set `{ "experimentalFeatures": { "disableOrderBySimilarity": true}}` in global settings. - (new web ui) Add /cody/dashboard page `(PR #764)` - (new web ui) Add account connection modal `(PR #731)` - (new web ui) Image previews `(PR #623)` - respect match order for search.results.repositories resolver `(PR #575)` - The GraphQL endpoint `search.results.repositories` now returns the list of repositories in the order of the matches we found. Before, repositories were sorted by id. - remove fzf star tiebreaker for repo suggestions `(PR #541)` - preserve ranking for repo suggestions `(PR #447)` - (Svelte) open documentation links in new tabs `(PR #401)` - Open documentation links in a new tab `(PR #359)` #### Source - add ssh auth support for more code hosts `(PR #615)` - BitBucket Cloud, BitBucket Server, GitLab, Gerrit, Gitolite, AWS CodeCommit Azure DevOps code host connections now support configuring SSH key authentication from the UI instead of mounting from disk. - add support for ssh auth to github `(PR #597)` - GitHub and generic Git code host connections now support configuring SSH key authentication from the UI instead of mounting from disk. - Support Azure Devops Server (onPrem) with NTLM authentication `(PR #217)` #### Tenant - allow configuring host instance id `(PR #826)` - add initial Workspaces reconciler `(PR #594)` #### Wolfi - update server + postgresql-12 images `(PR #519)` - add pgvector to server and postgresql-12 images - add pgvector-12 package `(PR #513)` - build and add pgvector extension #### Workspaces - implement integrations listworkspaces `(PR #794)` - implement management listworkspaces `(PR #793)` - delete workspace RPC `(PR #729)` - add DB list workspaces `(PR #728)` - add destroy state internally `(PR #644)` - init database schemas, add Workspaces store handler `(PR #395)` - add and demo notifications SDK `(PR #356)` #### Others - add reranker support to Cody Gateway `(PR #670)` - Embeddings: v2 `(PR #507)` - Introduce a new experimental embeddings index and context retriever. - make scip-syntax process multiple languages in a single invocation `(PR #364)` - add OpenAI o1 models and early-access models support to Cody Gateway `(PR #323)` - [feat(code gateway): add support for OpenAI o1 models and early-access models handling.](feat: add OpenAI o1 models and early-access models support to Cody Gateway) - implements pagination for syntactic usages `(PR #310)` ### Fix #### Batch Changes - stamp the executor binary with version information `(PR #665)` - override `internal/version.version` with `x_defs` at build time in executor - disabled "select all" checkbox if all nodes are already disabled `(PR #483)` - fix(batches): disabled "select all" checkbox if all nodes are already disabled #### Ci - add runfile initialization to upgradetest file `(PR #890)` - use generated json in migrations filegroup `(PR #802)` #### Search - (new web ui) Show correct document highlights when codegraph data is available `(PR #620)` - 'Save search' action on search results page does not navigate to the saved search creation page `(PR #549)` #### Code Intelligence - Correctly escape special characters in repo names and identifiers `(PR #710)` - The new usagesForSymbol API correctly searches repos whose names contain spaces or other special characters. - Use multiple language: filters for search-based usages in case of ambiguity `(PR #708)` - cleanup button title `(PR #581)` - Fetch tags for scip-go auto-indexing jobs `(PR #371)` - Go cross-repo navigation for tagged versions should work better when using scip-go for auto-indexing. Navigation based on SCIP indexes generated using scip-go in CI or cron jobs should be unaffected. #### Cody - return client-side model config via API `(PR #713)` - Disable ModelAPIEnabled for Dotcom `(PR #678)` - `modelsAPIEnabled` is always false for dotcom - allow accuracy category in JSON site config `(PR #641)` - use "balanced" instead of "accuracy" category for SOTA models `(PR #640)` - allow empty `finish_reason` in `/.api/llm/chat/completions` `(PR #539)` - The `/.api/llm/chat/completions` endpoint will now return an empty string `""` for `finish_reason` instead of the string `"unknown_please_report_bug()"`. #### Database - use native UUID in telemetry export queue `(PR #669)` #### Database - correctly find CreateIndexConcurrentlyPhases in migrator `(PR #809)` - INFO logs for migrations that create index concurrently will always correctly report the phase we are in. Previously we sometimes would report a phase of -1. #### Dev - use 9002 for pubsubemulator, simplify shutdown `(PR #780)` - give pubsub pings a more generous timeout locally `(PR #732)` - use key value for PGDSN in SAMS, EP `(PR #689)` #### Graph - Prevent duplicate results when performing find references `(PR #497)` #### Local - add no-xattrs when running schema descriptions target locally `(PR #905)` - sg - return the error when checking for remote branch/commits `(PR #485)` - dump more information out about the branch if it is out of sync #### Release - remove embeddings from promotion script (#360) `(PR #361)` - remove embeddings in promotion script #### Sams-Notifications - make subscriber tenant-aware `(PR #668)` #### Search - (new web UI) Fix cody dashboard background colors in dark mode `(PR #845)` - (new web ui) Fix list styles in rich text documents `(PR #835)` - (new web ui) Fix styling of rich text documents `(PR #834)` - (new web ui) Show added lines content `(PR #832)` - fix client-side query validation for rev: filters `(PR #810)` - We have updated the client-side query validation to allow combining `rev:` filters with query-based search contexts. - (new web ui) Clicking 'Code search' in then navbar of the old UI does not redirect to the new UI `(PR #761)` - (new web ui) Use a Map to group symbol names `(PR #721)` - VSCode Search extension: Update bug-reporting URL `(PR #693)` - VSCode Search extension: fix and improve proxy settings `(PR #679)` - in search jobs, don't time out fetches `(PR #666)` - For very large repositories, search jobs could time out while fetching the repository. Now, search jobs can fetch and search over repositories, even if they take a long time to fetch. - (new web ui) Use CodeGraph data to validate hover occurence `(PR #656)` - (new web ui) User menu feature parity `(PR #628)` - add index for search jobs janitor `(PR #624)` - We added a new database index to speed up a janitor job which is run as part of Search Jobs. Before, the janitor job might have significantly delayed migrations during an upgrade. - (new web ui) Respect 'experimentalFeatures.structuralSearch' setting `(PR #621)` - VSCode Search extension forgetting endpoint URL and PAT `(PR #560)` - fix logo links in the VSCode Search extension `(PR #547)` - Update help router for local development `(PR #271)` #### Sg - Config.GetEnv uses GetEnv for os.Expand `(PR #380)` #### Sg/Msp - make embed template fmt-compliant, add docstring `(PR #412)` #### Telemetry - ensure telemetry export only occurs once at a time `(PR #565)` - Fix an issue where duplicate telemetry can be exported when the `worker` service is scaled horizontally #### Tenant - prevent race condition in MockEnforceTenant `(PR #837)` - stop Iterate if it breaks `(PR #387)` #### Test - make workspaces waitforupdate test more reliable `(PR #813)` #### Others - make rerank metric name distinguishable `(PR #846)` - Use correct label in splitting metric in embeddings indexing `(PR #771)` - Add rerank API token variable to sg.config.yaml `(PR #716)` - adjust formatting when using unix sockets `(PR #653)` - fix PGDATASOURCE format when using unix sockets - move deletion inside nil check `(PR #556)` - incrementally updating embeddings index `(PR #555)` - Decrease parallelism in embeddings indexing `(PR #543)` - Filter out empty context items in resolver `(PR #537)` - VIP user access to allowed models in Cody Gateway `(PR #528)` - properly escape email in URL query `(PR #426)` - use preferred mermaid APIs `(PR #397)` - Fixes a bug that can cause errors when rendering many mermaid diagrams on a page. ### Chore #### All - use constraint names in ON CONFLICT statements `(PR #473)` #### Batch Changes - add description for env var `(PR #652)` #### Ci - Remove stale CODENOTIFY entries `(PR #439)` - bump Go to 1.23.1 `(PR #391)` - update gomod lint `(PR #382)` - remove lint that checks for promotheus/common 0.32.1 since we are using 0.48 - upgrade golang.org/x/tools to 0.24 `(PR #373)` - address printf linter flagged issues - add annotation for no merge base `(PR #345)` - post an annotation if there is no merge base #### Code Intelligence - Bump autoindexing image SHAs `(PR #831)` - Upgrades default auto-indexing images to the latest versions (1) scip-go to v0.1.21 (2) scip-typescript to v0.3.14 - Initialize test to consistent state `(PR #825)` - Unify GetUsages logic at Service level `(PR #752)` - Unify local phase usage extraction logic `(PR #748)` - Document code nav logic & limitations `(PR #742)` - Factor out & document package mentions code `(PR #740)` - Bump autoindexing image SHAs `(PR #681)` - Upgrades the default scip-go auto-indexing image to v0.1.20 - Log number of paths in auto-inference logic `(PR #635)` - Add context to timeout error for commit listing `(PR #607)` - Clarify doc comment for NewCanonicalDocument `(PR #480)` - Document scip.Document and range canonicalization code `(PR #459)` - Split inverted ranges extraction code & add comments `(PR #458)` - Use UploadRelPath instead of string `(PR #438)` - Bump auto-indexing image SHAs `(PR #403)` - Bumps default auto-indexing scip-go image to use Go 1.23.1 and scip-go v0.1.19 #### Cody - add HTTP record/replay test case for AWS Bedrock backend `(PR #452)` - add HTTP record/replay test case for Anthropic LLM backend `(PR #448)` - add HTTP record/replay test case for Azure OpenAI `(PR #446)` - add HTTP record/replay test case for OpenAI LLM backend `(PR #445)` - add HTTP record/replay test case for Fireworks LLM backend `(PR #441)` - add HTTP record/replay test case for Google LLM backend `(PR #410)` #### Database - set app.current_tenant outside of multitenant `(PR #502)` #### Database - remove unused redis_key_value table `(PR #688)` - update oobmigration min version to 4.0 `(PR #540)` - getRepositoriesForIndexScanQuery uses constraint `(PR #534)` - handle failed transactions in setTenant `(PR #533)` - use new constraints for on conflict `(PR #510)` - constraint for unique indexes used in on conflict `(PR #504)` #### Dev - Bump Go version to 1.23.2 `(PR #830)` #### Frontend - sync.Once to sync.OnceValue in service connections `(PR #376)` #### Gomod - update zoekt's dependencies `(PR #462)` #### Local - Fix ill-formed go.mod file `(PR #434)` - update sg installation docs `(PR #390)` #### Release - prepare stitch graph for 5.8 `(PR #852)` - Backport 6b58d4b62bba8f558c097fa97a751e51b178c537 from #850 #### Release - clarify backport error `(PR #784)` #### Reranker - clean up resolvers, improve perf, add more useful spans `(PR #776)` #### Search - (new web ui) Add telemetry for opt-out/in `(PR #766)` - remove codeintel ranking code `(PR #719)` - remove cursor based repo pagination `(PR #663)` - VSCode Search extension: remove "SOURCEGRAPH SEARCH" stutter in favor of "Info" `(PR #559)` - update wording from "Sourcegraph extension" to "Sourcegraph Search extension" `(PR #558)` #### Semgrep - add upload artifact step `(PR #616)` #### Sg - remove enforce-tenant-id --disable `(PR #705)` #### Tenant - restructure tenant package into internal subpackages `(PR #587)` #### Trace - prevent parallel calls to ConfigureStaticTracerProvider `(PR #467)` #### Others - enable reranker by default `(PR #804)` - Reranker for context retrieval is turned on by default - disable IDF jobs `(PR #783)` - Clean up visible uploads initialization `(PR #739)` - Rename gatherLocations -> gatherUsages `(PR #737)` - Cleanup metadata generation code in Gateway `(PR #714)` - Remove unused endpoints from 969 prototype `(PR #712)` - trigger changelog audit on label event `(PR #562)` ### Refactor #### Svelte - Introduce extensible GraphQL store `(PR #309)` #### Others - move cody context business logic outside of resolvers `(PR #647)` - remove search mode `(PR #629)` - rename NonLocal -> Global in scip_strict parser `(PR #366)` ### Reverts - Revert "pgdsn: Allow to fall back to default variables and overwrite … `(PR #369)` ### Uncategorized #### Others - bug(release): workspace cash time dance (#948) `(PR #949)` - [Backport 5.8.x] tenant: Improve OOB migration from learnings `(PR #939)` - [Backport 5.8.x] Revert "migrator: Backfill IDs from overrides into right schema only" `(PR #914)` - [Backport 5.8.x] migrator: Backfill IDs from overrides into right schema only `(PR #894)` - [Backport 5.8.x] Revert "fix(migration-graph): add no op migration to backfill overrides" `(PR #888)` - [Backport 5.8.x] Update lockfiles with newer version of apko `(PR #882)` - Backport 7f2c3bacf6778fef5f2ef444db2ebd873903c5e6 from #881 - [Backport 5.8.x] Revert "Update rules_apko and fix issues with `sg wolfi` (#696)" `(PR #880)` - [Backport 5.8.x] db: Bump date for schema migrations stitch date `(PR #878)` - tenant: OOB migrator covers more tables `(PR #842)` - tenant: Default to ID 1 for inserts `(PR #840)` - migrator: Correctly render indexing progress `(PR #812)` - adding code qwen 2p5 and deepseek long prompt optimized model `(PR #811)` - adding code qwen 2p5 and deepseek long prompt optimized model `(PR #811)` - security: Update docker dind to latest release `(PR #808)` - saml: Record requests `(PR #788)` - saml: Return error instead of appending to it `(PR #787)` - Add password for sourcegraph-rls `(PR #786)` - cmd/workspaces: setup routes during ws creation `(PR #782)` - db: Fix missing globaldbtenant `(PR #779)` - trace: Fix span pollution in authenticateByCookie `(PR #753)` - sg: Make sure sourcegraph_rls user also has permissions on future tables `(PR #750)` - tenant: Fix license check missing tenant `(PR #747)` - migration: Skip CREATE TABLE if possible `(PR #746)` - tenant: Fix more tenant-less contexts `(PR #745)` - tenant: Mark tenants tables as data tables `(PR #738)` - feat(Cody Reranker): clean up site config and add license-based auth for Cody Gateway `(PR #724)` - sg: Fix go generate `(PR #722)` - tenant/db: Safer ordering of migration statements `(PR #718)` - gitserver: Fix some missing tenant contexts `(PR #717)` - refactor(cody gateway): update model list for autocompletes `(PR #711)` - db: Add tenant_id to last remaining columns `(PR #709)` - db: Add OOB migration to backfill tenant ID `(PR #706)` - tenant: pass correct context to SetCloneStatus `(PR #701)` - sg: Reject empty workspace names `(PR #700)` - sg: Fix enforce-tenant-id after redis_key_value was dropped `(PR #697)` - Update rules_apko and fix issues with `sg wolfi` `(PR #696)` - Redis: don't check tenant for system commands `(PR #695)` - tenant: only skip goroutine recording if tenancy is enabled `(PR #694)` - Search jobs: set high timeout to protect against stuck jobs `(PR #692)` - tenant: fix remaining goroutine recorder errors `(PR #691)` - Reapply "feat(cody): add vision support (#546)" (#686) `(PR #687)` - Add detailed intent-score pairs to chat intent response `(PR #682)` - Jsm/disable model api `(PR #680)` - Site admin: simplify goroutine recording `(PR #677)` - Update client/vscode/CHANGELOG.md for PR #560 `(PR #676)` - tenant: Mapper returns more precise error `(PR #675)` - tenant: add missing IteratorFactory `(PR #674)` - tenant: Make migrations on startup pass in local dev `(PR #667)` - msp: report error when PGDSN does not have expected template variable `(PR #664)` - final ranker config for context v2 `(PR #659)` - Changing the ranker configuration -- number of items fetched from zoekt - sg: Make enforce-tenant-id idempotent again `(PR #655)` - refactor(cody gateway): add deprecated models back to dotcom model list `(PR #649)` - gomod: bump Zoekt for memory debugging `(PR #646)` - Dev: ensure multi-tenant migration has been run `(PR #645)` - refactor(cody gateway): update dotcom models list `(PR #643)` - Cody Gateway: update default model list for dotcom. - Bump Cody Web to 0.9.0 version `(PR #642)` - sg cloud eph deploy: --wait flag `(PR #637)` - executors: Check for rows affected instead of running into unique constraint error `(PR #632)` - Symbols: hide scary error messages from users `(PR #631)` - Add postgres as datasource for Grafana `(PR #627)` - add time to first token for upstream as header `(PR #618)` - workspaces: implement `managementv1.UpdateWorkspaceMembership` RPC `(PR #613)` - ci: add cloud ephemeral pipeline `(PR #611)` - add sourcegraph ranker `(PR #610)` - workspaces: implement GetWorkspaceMembership rpc `(PR #609)` - workspaces: implement `ReportInstanceState` RPC `(PR #604)` - workspaces: implement `ListWorkspaceMemberships` RPC `(PR #603)` - tenant: Add method to create a new tenant in database `(PR #593)` - workspaces: support []iam.Role in WorkspaceMembership `(PR #590)` - Cody Web: bump cody web to 0.8.3 `(PR #589)` - Cody context: fix bug in 'archived' change `(PR #588)` - workspaces: Add WorkspaceState to GetWorkspace rpc `(PR #585)` - tenant: Add support for reading tenant by hostname from database instead of hard-coded `(PR #580)` - workspaces: implement user `CreateWorkspace` API `(PR #574)` - workspaces: implement GetWorkspace RPC `(PR #573)` - gomod: bump Zoekt for indexing memory optimization (again) `(PR #572)` - use direct routing by default if present in the backend `(PR #571)` - workspaces: database get/upsert instances `(PR #568)` - workspaces: implement `ReportWorkspaceState` RPC `(PR #564)` - gomod: bump Zoekt for indexing memory optimization `(PR #557)` - Bump Cody Web to 0.8.2 version `(PR #545)` - clean up rerankers for Cody Context `(PR #544)` - sg(tenant): Add migration for constraints to local dev `(PR #542)` - rockskip: use full ctx from emitIndexRequest `(PR #532)` - Add billing metadata for core search, batch, and insights events `(PR #529)` - Cody context: support archived and forked repos `(PR #527)` - vsce: patch release v2.2.18 `(PR #526)` - fix context v2 zoekt subqueries `(PR #523)` - Repo-updater: continue start-up if hydration fails `(PR #521)` - Cody Web: bump cody web to 0.8.1 `(PR #518)` - cody-gateway: do not PING Redis too often `(PR #517)` - rockskip: Remove another duplicative BTREE index `(PR #516)` - rockskip: Remove duplicative BTREE index `(PR #515)` - db(tenant): lock between setTenant and exec to ensure session variable is set atomically `(PR #512)` - perf: reduce allocations in `evalKeywordExpansions` `(PR #506)` - local/nix: add pgvector extension `(PR #503)` - enable pgvector in nix managed postgres db - redispool: allow call sites to custmoize their `TestOnBorrow` and `Dial` `(PR #499)` - cody-gateway: wait for Redis connection `(PR #498)` - cody-gateway: set `MaxActive` for Redis `(PR #496)` - Bump Cody Web to 0.8.0 version `(PR #492)` - Recorder: remove RegistrationDone method `(PR #489)` - Repo-updater: add tenancy `(PR #479)` - tenant: Basic support in worker `(PR #476)` - Cody context: return matched ranges of chunks `(PR #474)` - add(cody): `api-version=2` for incremental streaming LLM responses `(PR #470)` - The `/.api/completions/stream` endpoint now accepts an `api-version=2` query parameter that returns incremental text text responses when using `"stream": true` to improve performance and reduce bandwidth. - Remove Neovim from Cody dashboard `(PR #469)` - Fix flaky test by bringing down memory utilization of POS filter `(PR #468)` - msp/iam: fixup checks for `ErrNoRows` `(PR #465)` - gomod: bump Zoekt for zoekt-git-index profiling `(PR #453)` - worker: Make resetter a periodic goroutine `(PR #450)` - gomod: bump Zoekt for index optimization `(PR #449)` - http: Add context to more requests `(PR #437)` - conf: Remove alias for ExternalURL `(PR #436)` - frontend: Drop unused orgs_open_beta_stats table `(PR #435)` - msp/iam: do not close connection pool on startup `(PR #433)` - Filter out terms based on POS and expand Zoekt queries `(PR #432)` - authn: Create providers on the fly with current request context `(PR #424)` - tenant: Use request context when creating OIDC provider `(PR #422)` - redis: Add optional tenant isolation `(PR #421)` - tenant: Add context to LogBackendEvent `(PR #420)` - Remove debug log statement `(PR #418)` - minor doc change `(PR #413)` - sg: Use custom site-config for multitenant runset `(PR #405)` - Retrieve and display change log during upgrades. `(PR #400)` - [Appliance] Retrieve live changelog and display information about the release to be upgraded. - Svelte: fix text wrapping for file popover `(PR #399)` - Fixed a bug in the web app rewrite where long paths would cause file popovers to wrap - Svelte: fix loading for ref panel `(PR #398)` - Fix loading behavior for the reference panel in the web app rewrite - gomod: bump Zoekt for index optimization `(PR #389)` - Svelte: SymbolTree followups `(PR #388)` - repo-updater: hack so it uses tenant 1 for now `(PR #386)` - gitserver: inherit tenant for repoUpdateOrClone `(PR #385)` - Chore: close rows `(PR #379)` - database: use keyword value format if connecting via unix socket `(PR #378)` - frontend: always use DSN from ServiceConnections `(PR #375)` - Reapply "pgdsn: Allow to fall back to default variables and overwrite..." `(PR #374)` - postgresdsn: support PGHOST as a filepath `(PR #372)` - release: specifiy download directory for changelog `(PR #365)` - specify download directory for changelog - frontend: Don't double-close readiness channel during auto upgrades `(PR #358)` - workspaces: initial IAM schema and implement `iam.Store` `(PR #353)` - enterprise-portal: implement `iam.Store` and add tests `(PR #351)` - enterprise-portal: create `internal/iam` package and run schema tests in CI `(PR #350)` - tenant: Add tenants 1 and 2 in localdev `(PR #340)` - sg: Introduce first multitenant runset `(PR #335)` - pgdsn: Allow to fall back to default variables and overwrite frontend `(PR #332)` - Remove k8s utils dependency `(PR #320)` - msp/iam: fixup migration PG 12 compatibility and sanity test migrations `(PR #301)` - Tree-sitter based chunker for embeddings indexing `(PR #298)` - Context: return multiple chunks per file from Zoekt results `(PR #294)` - We can improve recall by fetching multiple chunks per file from Zoekt results by turning on the `cody-reranker` feature flag. - add(cody): `api-version=2` incremental streaming LLM response `(PR #293)` - The `/.api/completions/stream` endpoint now accepts an `api-version=2` query parameter that returns incremental text text responses when using `"stream": true` to improve performance and reduce bandwidth. - Context: improve ranker integration + loosen the tap `(PR #291)` - Ranker for chat context is now available behind `use-reranker` feature flag. - Hook Upgrade page to Release Registry API `(PR #276)` - Move IDF repository stats into Postgres and compute them with the background worker `(PR #270)` - Svelte: add symbol tree `(PR #209)` - Adds a symbol tree to file page in the experimental webapp - Redis: respect context when connecting `(PR #194)` - Appliance Admin UI `(PR #168)` - [Appliance]: Adds the upgrade path for the Appliance Admin UX ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - remove the other embedding reference `(PR #362)` - n/a {/* RSS={"version":"v5.8.0", "releasedAt": "2024-10-08"} */} # 5.7 Patch 1 ## v5.7.2474 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.7.2474) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.7.2474) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.7.2474) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.7.2474) ### Fix #### Batch Changes - workaround for a bug in GitHub `(PR #584)` - fix(batches): workaround for a bug in GitHub Backport aad3a04f8c93561a61c404e69132e70a22d0acba from #576 #### Release - remove the other embedding reference `(PR #362)` - n/a #### Search - remove query expansion `(PR #586)` - This fixes a bug where we added "readme" too often to the context. Backport 28ff196a663f537c6cb6340f976a91431509a90e from #582 ### Reverts There were no reverts for this release ### Uncategorized #### Others - [Backport 5.7.x] Search: allow queries with only lang filters `(PR #583)` {/* RSS={"version":"v5.7.2474", "releasedAt": "2024-09-18"} */} # 5.7 Patch 0 ## v5.7.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.7.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.7.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.7.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.7.0) ### Features #### Appliance - enable frontend form and stub out, no backend routes yet `(PR #80)` #### Batch Changes - Add a container registry deny list `(PR #109)` - Add a container registry deny list to complement the allow list. - Configure in site config via `"batchChanges.containerRegistryDenylist"`. - Mutually exclusive with `"batchChanges.containerRegistryAllowlist"`. - add support for registry allowlist `(PR #105)` - Add support to configure container registry allowlist for containers use from batch changes via `batchChanges.containerRegistryAllowlist` in Site Configuration. #### Cody - add `/.api/cody/context` API `(PR #66)` - New `POST /.api/cody/context` REST endpoint to retrieve a list of relevant source locations given a natural language query. #### Dotcom - add account ID in subscriptions list view `(PR #192)` - forward license check to Enterprise Portal `(PR #19)` #### Enterpriseportal - use file-based migrations with `goose` `(PR #216)` - add Salesforce Account ID `(PR #176)` - internal instances record detected instance `(PR #139)` - return unknown license as result `(PR #134)` #### Licensecheck - check against Enterprise Portal directly `(PR #22)` #### Msp/Runtime - standardised migrations `(PR #242)` - first-class redis support `(PR #241)` #### Releases - scoped releases `(PR #33)` - feat(release): scoped releases #### Sg - MSP database migrations with `goose` `(PR #215)` #### Site Admin - monitoring/telemetry: add v1 teestore write alerts and v2 export queue write alerts `(PR #321)` #### Svelte - Add repository sync status indicator to search results `(PR #260)` - Sentry: Ignore errors from third party scripts `(PR #171)` - Add status notifications `(PR #141)` - Add support for indent-based code folding `(PR #75)` #### Telemetry/Sensitivemetadataallowlist - allow string list and nulls `(PR #27)` #### Others - Syntactic support for go `(PR #328)` ### Fix #### Batch Changes - omit headRepositoryId if empty `(PR #200)` - avoid "Name already exists on this account" from creating fork by fetching the repo when the error happens `(PR #159)` - fix(batches): avoid "Name already exists on this account" from creating fork by fetching the repo when the error happens #### Code Intelligence - ensure syntactic worker marks itself as "ready" on startup `(PR #341)` #### Code Nav - Return ALL references in the same file as the definition `(PR #240)` #### Cody - correctly parse queries containing 'or' `(PR #267)` - Fixes a regression in Cody context where questions containing the word 'or' could return noisy or no results. - use reverse proxy for Gemini API `(PR #208)` - address critical bug from code review `(PR #179)` - return valid `finish_reason` in `/.api/llm/chat/completions` `(PR #154)` - LLM API `/.api/chat/completions` now returns OpenAI-compatible `finish_reason`. - fix error handling in LLM API `(PR #153)` - LLM API endpoints (`/.api/llm`) now return JSON-encoded HTTP bodies for non-200 status codes. - use `testdata` instead of `golly-recordings` directory name `(PR #152)` - give names to LLM API handlers `(PR #151)` - allow `Bearer TOKEN` header for all LLM APIs `(PR #150)` - For compatibility with OpenAI clients, it's possible to use `Bearer TOKEN` header with all API endpoints that start with the prefix `/.api/llm`. - deepseek-coder-v2-lite-base model name mapping for dotcom users `(PR #135)` #### Cody-Gateway - ignore schema errors on otel init `(PR #237)` #### Enterpriseportal - normalize instance domain on create subscription `(PR #163)` - add subscription ID to trace, other diagnostics improvements `(PR #130)` #### Enterpriseportal/E2e - fix test case for check license `(PR #162)` #### Frontend - Do not sign-out users when accessing a file path containing /login `(PR #57)` #### Local - check for rogue files and folders in svelte routes `(PR #337)` - prevent `web-sveltekit` commands from running if there are untracked files under src/routes - expand _after_ accumulating the whole env `(PR #257)` #### Oobmigration - remove migrations targeting licenses/subscriptions `(PR #263)` #### Repo-Updater - add WARN level logs every time we sync a code host `(PR #44)` - repo-updater now emits logs that log the result of every code host sync. #### Sams-Notifications - mockrequire.Values incorrectly used `(PR #315)` #### Search - skip if git diff not found in hybrid `(PR #333)` - When searching an unindexed commit we would consult indexed commits for speeding up results. If our index contained a commit that no longer existed in git we would error out due to a regression in v5.4.5099. This is now fixed. - add "Create batch change" back to Actions dropdown in search results `(PR #143)` #### Sg - make start commands cancel fn be sync.OnceFunc `(PR #319)` - the cancel funcs used by sg commands are now wrapped in `sync.OnceFunc` to prevent duplicate execution - add deprecation notice to sg wolfi update-hashes `(PR #289)` - sg: fix panic when using `wolfi update-hashes` - sg: add deprecation notice for `wolfi update-hashes` - check if we are ephemeral before getting lease time `(PR #256)` - sg - fix panic in Cloud Ephemeral listing when listing instances that are not Ephemeral - clamp deployment name consistently in cloud ephemeral `(PR #117)` - ensure deployment / instance names are clamped in all places for cloud ephemeral - implement env priority to improve env var ordering `(PR #31)` #### Svelte - Preserve history panel scroll position after selecting an entry `(PR #251)` - Update existing query filters when including suggested filters `(PR #115)` - Remove 'Code Ownership' top navigation `(PR #87)` - Update main navigation to match React app `(PR #74)` - Fix regex generation for routes that contain parameters `(PR #73)` - Fix Bazel production build `(PR #43)` - Workaround for handling client-side redirections in production `(PR #14)` #### Others - Switch to larger runner for scip-go jobs `(PR #221)` - add deepseek virtual model string `(PR #211)` - set webRoot to /client/web in launch.json `(PR #83)` - Speed up auto-index job expiration query `(PR #3)` ### Chore #### Dotcom - fix typo in subscriptions page `(PR #195)` - delete subscriptions, licensing, and cody gateway usage `(PR #21)` #### Dotcom/Subscriptions - minor UX tweaks `(PR #175)` #### Embedding - delete cmd/embeddings `(PR #181)` #### Enterpriseportal - declare required scopes in schema and use schema-based enforcement `(PR #305)` - add Cody Access override case to manual E2E tests `(PR #224)` - improve formatting of duplicate usage message `(PR #177)` - remove dotcomdb connection and testing infra `(PR #20)` #### Gomod - update for a bunch of CVEs `(PR #343)` #### Local - stop using deprecated `docker-compose` command `(PR #206)` #### Pubsub - upgrade to disable OpenTelemetry tracing `(PR #210)` #### Pubsubemulator - init tool `(PR #272)` #### Release - simplify changelog download in release `(PR #227)` - simplify `changelog` cli download by using `gh` cli #### Search - Tell EditorConfig to stop messing with snapshot files `(PR #275)` - Remove Beta label from code monitors webhooks option. `(PR #274)` #### Search-Jobs - deprecate experimental site setting `(PR #122)` - The site setting `experimentalFeatures.searchJobs` is not read anymore. To disable Search Jobs, set `DISABLE_SEARCH_JOBS=true` for the "frontend" and "worker" services. - remove EXPERIMENTAL from gql API `(PR #116)` - remove beta badge `(PR #114)` #### Svelte - Upgrade dependencies and cleanup configs `(PR #279)` - Fix type import `(PR #277)` - Reduce build log noise `(PR #252)` - Ingore 'RepoNotFoundError's in Sentry `(PR #113)` #### Tenant - Iterate does not enforce no tenant unlike Inherit `(PR #334)` #### Tooling - bump Go to 1.23.0 `(PR #126)` #### Wofli - update images `(PR #290)` - update images to use latest p4-fusion binary #### Workspaces - define initial Workspaces proto schemas `(PR #262)` - stub service and directory `(PR #244)` #### Others - fix onUserRolesChanged `has SiteAdmin role` test name `(PR #314)` - update github.com/openfga/openfga to v1.6.0 `(PR #295)` - updates Rust toolchain to 1.80.1 `(PR #287)` - Re-enable SCIP uploads to Demo `(PR #222)` - create github action for changelog audit `(PR #198)` - undo unneeded upgrades `(PR #164)` - upgrade sourcegraph-accounts-sdk-go version `(PR #160)` - Simplify semaphore-based code using conc.Iterator `(PR #146)` - Bump autoindexing image SHAs `(PR #131)` - migrate httpserver to use sg/log `(PR #112)` - update httpserver to use sourcegraph/log instead of log15 - Updates tree-sitter version `(PR #93)` - Delete a bunch of unused LSIF-related code `(PR #77)` - clean up CODENOTIFY for Joe `(PR #28)` ### Refactor #### Svelte - Make repo page integration test setups reusable `(PR #249)` - Refactor temporary settings to remove Apollo dependency `(PR #156)` - Lazy load mermaid `(PR #16)` ### Reverts - revert reverse proxy usage to access Gemini API `(PR #236)` ### Uncategorized #### Others - Bump Cody Web to 0.7.7 version `(PR #347)` - bug: fix slice init length `(PR #339)` - Add migration to create sourcegraph_rls user in local dev `(PR #331)` - Add tenant1 and tenant2 hostnames to caddy setup `(PR #330)` - Deglobalize SiteID `(PR #329)` - gomod: bump zoekt for indexing observability improvements `(PR #327)` - searcher: check for zoekt empty repo commit in hybrid search `(PR #326)` - conf: do not log missing tenant `(PR #318)` - database: introduce globaldbtenant package `(PR #317)` - database: rm unused Transact, Done, ShareableStore from ConfStore `(PR #316)` - [perforce] Store label cache file in .p4home `(PR #308)` - Convert trivial chunk/batching functions to use slices.Chunk `(PR #307)` - Bump cody web to 0.7.6 `(PR #304)` - handle error case where anthropic api returns an empty response `(PR #303)` - msp/iam: use runtime standardized migrations mechanism `(PR #300)` - frontend: update permissions runs per tenant `(PR #299)` - tenant: avoid FromContext logging in Inherit `(PR #297)` - validation: pass in ctx for validateAuthzProviders `(PR #296)` - siteadmin: Make recoverUsers idempotent `(PR #292)` - The recoverUsers endpoint failed with a spurious error when some of the given users were already active. It is now idempotent. - Remove (old friend) storm project `(PR #286)` - all: skip slow tests when -short `(PR #284)` - licensing: fix flaky uses of MockGetConfiguredProductLicenseInfo `(PR #283)` - gitserver: fix RemoveBadRefs on darwin `(PR #280)` - Cody Web: Remove old cody web logic `(PR #273)` - Move package `(PR #269)` - add unit test for idf index `(PR #268)` - Worker: fix flake in repo syncer test `(PR #266)` - clean unused flag `(PR #265)` - Bump own and repos test timeouts to long `(PR #258)` - Upgrade SCIM package to allow Microsoft Entra string values `(PR #253)` - add(cody): support for Sonnet 3.5 "fast edit" model `(PR #250)` - Enable route outside Site Admin into Appliance service. `(PR #247)` - add common access token for direct routing `(PR #245)` - Redis: pass context through remaining methods `(PR #239)` - Bump Cody Web to 0.7.3 for react version `(PR #238)` - dev: remove compare-hash.sh `(PR #234)` - doc: update search links for monorepo to be on s2 `(PR #233)` - change the default model from starcoder to deepseek `(PR #232)` - database: capture missing tenant for queries `(PR #231)` - goroutine: support tenants `(PR #229)` - Rearrange auth provider middlewares `(PR #228)` - Add option to cache label data with p4-fusion `(PR #225)` - Perforce connections now support a `cacheLabels` option to cache Perforce label data from the server, speeding up consecutive syncs on systems with a large number of labels. - lib/cloudapi: introduce features config `(PR #223)` - lib/cloudapi: add auth pkg `(PR #214)` - shortcut noop `(PR #213)` - dev/msp: expose more runtime values to gotmpl `(PR #212)` - worker: add OnUserRolesUpdated SAMS notification handler `(PR #204)` - tenant: use marshal method instead of strconv `(PR #203)` - [fix] Perforce auth provider panics when only IP is provided `(PR #199)` - Redis: pass context to hash and ttl methods `(PR #196)` - Redis: introduce KeyValue.Info() `(PR #193)` - Respect context in Stop methods `(PR #191)` - telemetry: wait for v1 writes in tests on teestore `(PR #190)` - tenant: factor out marshalling `(PR #189)` - Allow AWS tokens in the repository `(PR #188)` - - tenant: prevent parallel test runs when mocking enforcement `(PR #187)` - Configure and activate Admin UI `(PR #186)` - [Appliance] Activate appliance updates on Code Search admin UI - sg: skip dev-private check if OFFLINE set `(PR #185)` - Updating owner tag `(PR #183)` - security: Ensure sourcegraph will run with uid randomisation `(PR #182)` - tenant: add context to gitserver's filesystem interface `(PR #178)` - change re-ranking method from public to private `(PR #173)` - Web: encode file path for blame `(PR #172)` - Fixes an issue that would cause blame view to fail on files that contain some special characters. - Fix main lint `(PR #169)` - [Fix] code linting - Redis: add context to httpcache and rcache `(PR #167)` - fixing the limit text for autocompletes `(PR #166)` - Bug: Fix file/directory popover regression `(PR #165)` - Fix File and directory popovers in the file tree when code search is scoped to a perforce depot. - ci/srcgql-compat: fix workflow `(PR #161)` - guardrails: temporary cache for incident `(PR #158)` - security: Remove root from some containers, and make it clearer which containers run as root `(PR #157)` - Update site.schema.json `(PR #155)` - all: update OWNERS and CODENOTIFY to match new team names `(PR #148)` - migrations: remove read on pg_attribute for tenant_id `(PR #147)` - Cody Web: Update cody web to 0.7.1 `(PR #144)` - dev/cloud-relay: add msp delivery target for rollout `(PR #142)` - Cody Web: fix cody web in svelte safari `(PR #138)` - Instrument request latency in Cody Gateway `(PR #136)` - dev/cloud-relay: import repo `(PR #132)` - all: upgrade staticcheck and unparam `(PR #128)` - Cody Web: Update cody web to 0.6.1 (svelte and react) `(PR #127)` - ci/cloud-gql-compat: only report error on remote workflow failure `(PR #125)` - add perforce support for git references table and labels `(PR #124)` - Code Search now supports labels for Perforce Depots - iterator: add Map function `(PR #123)` - symbols: skip rockskipintegration on dev if missing binaries `(PR #121)` - syntactic-indexing: skip tests on dev if scip-syntax is missing `(PR #120)` - keyring: t.Parallel safe MockDefault `(PR #119)` - appliance: inject os.Getenv to ensure clean environment `(PR #118)` - db: add event_logs_export_allowlist and own_signal_configurations to DataTables `(PR #111)` - expand special case handlers for context endpoint `(PR #110)` - More context improvements `(PR #104)` - adding cohere reRanker in the cody context `(PR #102)` - Don't use markdown header symbols in graphql docs `(PR #99)` - appliance: check ShouldRunSetupEnvTests in integrationtest `(PR #97)` - Fix hardcoded version number in security release approval message `(PR #96)` - blobstore: support tenant isolation `(PR #94)` - Make syntactic indexing policies non exclusive to precise indexing `(PR #92)` - Add --build flag to `sg cloud ephemeral upgrade` `(PR #91)` - Turn off minification for cody web worker `(PR #90)` - Redis: add context arg for list methods `(PR #89)` - Basic custom context handler `(PR #86)` - security: Auto-update package lockfiles for Sourcegraph base images `(PR #85)` - React: Bump Cody Web to 0.5.1 `(PR #79)` - lib/cloudapi: restructure pkg to reduce nesting `(PR #68)` - nix flake update to go 1.23 `(PR #62)` - nix: local is a string for GOTOOLCHAIN `(PR #61)` - sg CLI: Use correct pipeline when retrieving annotations `(PR #60)` - security: Auto-update package lockfiles for Sourcegraph base images `(PR #56)` - nix: set GOTOOLCHAIN=local `(PR #55)` - Search: improve indexing delay dashboards `(PR #54)` - telemetry: always best-effort write to v1 store `(PR #53)` - database: limit concurrent event log inserts `(PR #52)` - Only commits in policy commitmap `(PR #49)` - lib/cloudapi: import cloud-api proto def `(PR #40)` - ctags/6.1.0 package update `(PR #38)` - redis_exporter/1.62.0 package update `(PR #37)` - docker-client/27.1.2 package update `(PR #36)` - p4-fusion/1.13 package update `(PR #35)` - jaeger/1.60.0 package update `(PR #34)` - [Stream API]: Add external_service_type field to the SearchedRepo type `(PR #32)` - Searched repo, commit, path, symbol and file match responses will now include external service type. - Directory mentions: extract and test buildKeywordQuery `(PR #30)` - lib/background: fix flaky test of monitor routines with context cancel `(PR #29)` - direct route for fireworks models `(PR #26)` - repos: use passed in ctx for SystemsInfo `(PR #18)` - Removing featureflag for expanded audit logs `(PR #15)` - More auditlogs for sensitive admin actions will be automatically logged. - Perforce UI Elements: Add perforce UI elements to history panel `(PR #12)` - Add typescript parser for SCIP symbols `(PR #10)` - migrations: run squash targetting v5.3.0 `(PR #9)` ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - Support SAST Scanning with both GHAS and Custom post processing scrip… `(PR #67)` - sast scans are reported without any issues - added better GHAS check (#64537) `(PR #65)` - chore(security): Fix GHAS check as non-zero exit code {/* RSS={"version":"v5.7.0", "releasedAt": "2024-09-04"} */} # 5.6 Patch 2 ## v5.6.2535 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.6.2535) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.6.2535) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.6.2535) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.6.2535) {/* RSS={"version":"v5.6.2535", "releasedAt": "2024-08-22"} */} ### Chore #### Security - security: added better GHAS check (#64537) `(PR #65)` - chore(security): Fix GHAS check as non-zero exit code ### Uncategorized - Support SAST Scanning with both GHAS and Custom post processing scrip… `(PR #67)` - sast scans are reported without any issues - [Backport 5.6.x] fix(search): fix query parsing bug around quoted phrases #59 `(PR #70)` - [Backport 5.6.x] fix(batches): fix broken forking workflow `(PR #81)`fix(batches): fix broken forking workflow Backport f833c4a3bf2210c127ffbf1146be69e1f461a449 from #48 - [Backport 5.6.x] svelte: add slash to path scope `(PR #98)` - Fixes a bug in the new web app that causes incorrect links to be generated for collapsed file names Backport 23dad06bb2af1e7eb6a2f3847ad7f2c76c2a89a5 from #95 - [Backport 5.6.x] feat(cody): add deepseek-coder-v2-lite-base support `(PR #103)` Backport f71fe081aa43ca40fef66c067c8eaf49d62d491e from #4 - backporting #106 `(PR #107)` # 5.6 Patch 1 ## v5.6.185 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.6.185) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.6.185) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.6.185) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.6.185) {/* RSS={"version":"v5.6.185", "releasedAt": "2024-08-08"} */} ### Uncategorized - [Backport 5.6.x] Changing azureUseDeprecatedCompletionsAPIForOldModels to default to true [#64371](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64371) Backport 3b16059588e5eff69e00ed56a489ac8560a70d8e from #64347 - [Backport 5.6.x] Fix Cody Web CSS [#64373](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64373) - Make Cody Web styles more accessible. Backport 2dd38b3ffd828a1596249c2780ca91bf4bce4bdd from #64370 # 5.6 Patch 0 ## v5.6.0 - [sourcegraph](https://github.com/sourcegraph/sourcegraph/releases/tag/v5.6.0) - [docker-compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/releases/tag/v5.6.0) - [helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/releases/tag/v5.6.0) - [kustomize](https://github.com/sourcegraph/deploy-sourcegraph-k8s/releases/tag/v5.6.0) {/* RSS={"version":"v5.6.0", "releasedAt": "2024-08-07"} */} ### Feature #### Codenav - codenav: Add symbol support for the Hack language [#64015](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64015) #### Frontend - frontend: do not embed frontend assets anymore [#63946](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63946) - frontend: assets are no longer bundled with binary through `go:embed`. Instead assets are now added to the frontend container at `assets-dist`. #### Local - local: sg tail [#64146](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64146) - Adds a new `sg tail` command that provides a better UI to tail and filter log messages from `sg start --tail`. #### Appliance - appliance: implement re-direct on all unknown endpoints [#64059](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64059) - feat(appliance): implement re-direct on all unknown endpoints - appliance: Adopt Frontend Service + Ingress [#63893](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63893) - feat(appliance): Appliance adopts Frontend's `Ingress` + `Service` - appliance: Merge unstructured objects from helm serialization and appliance cfg defaults [#64021](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64021) - feat/appliance: Include existing objects when constructing Frontend's `Service` & `Ingress` - appliance: self-update [#63780](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63780) - Appliance can automatically self-update up to 2 minor revisions beyond the currently-deployed sourcegraph version. - appliance: introduce mock up database configuration step in install flow [#64162](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64162) - appliance: self-update can update multiple deployments [#64132](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64132) - Appliance: Frontend Pulls Version Info from RelReg [#64089](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64089) - feat(appliance): frontend pulls versions from relreg - appliance: Change site-admin updates button to point to Appliance based on env var [#64167](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64167) - feat(appliance): change update endpoint based on env var - misc: add type to storybook #### Enterpriseportal - enterpriseportal: db layer for cody gateway access [#63737](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63737) - enterpriseportal: support DevOnly in list subscriptions [#63837](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63837) - enterpriseportal: db layer for subscription licenses [#63792](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63792) - enterpriseportal: db layer for subscription conditions [#63812](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63812) - enterpriseportal: ignore context cancellation error in GetCodyGatewayUsage [#64016](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64016) #### Search - search: remove smart search logic [#64215](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64215)Smart search is no longer supported in the Sourcegraph backend. Old searches that specify 'smart search' mode will be run in the default 'precise' mode. If your query now doesn't behave as expected, you can update it to use the new `patterntype:keyword`. - search: update Zoekt [#64238](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64238) - added support for all Apex language extensions - shard merging for Zoekt is now enabled by default. This reduces MEM requirements for Zoekt webserver and improves performance for some queries. See our [documentation](https://sourcegraph.com/docs/admin/search#shard-merging) for more information. - search: Add support to all Apex language extensions [#64194](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64194) - search: Enable improved symbol parsing for large repos (when using Rockskip) [#63988](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63988) #### Svelte - svelte: Improve commit page layout on mobile [#63920](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63920) - svelte: Change branch and tags page design, including mobile [#63914](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63914) - svelte: Add support for creating search jobs from search results [#64308](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64308) - svelte: Improve small screeen behavior [#63859](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63859) - svelte: Add compare page [#63850](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63850) - svelte: Add search query syntax introduction [#63753](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63753) - svelte: Add 'y' shortcut to navigate to permalink [#63719](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63719) #### Dotcom - dotcom: use Enterprise Portal for Cody Gateway usage [#63653](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63653) #### Build - build: Add exhaustruct linter (codeintel POC) [#63965](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63965) #### Others - Add support for precise usagesForSymbol [#64126](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64126) - Adds support for precise code navigation to the experimental `usagesForSymbol` API, which can be used to implement a reference panel or similar functionality. - order search filters alphabetically [#63976](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63976) - show current email during password reset and auto-populate text-box after successful completion [#59645](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/59645) #### Bazel - bazel: read binary version info from accompanying files in OCI images instead of stamping //internal/version [#63977](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63977) #### Sg - sg: prototype 'sg start sourcegraph-accounts' [#63894](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63894) - sg: add 'sg sams client create' [#63885](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63885) - `sg sams client create` can now be used to create IdP clients for SAMS. - sg: support correct completions on 'sg start -cmd' [#63861](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63861) - Completions for `sg start -cmd` now offer valid suggestions. - sg: report user os information via analytics [#64280](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64280) - sg: do not persist external secrets [#63890](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63890) - sg: allow sg commands to default to local-dev SAMS-dev credentials [#63883](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63883) - `sg` commands requiring SAMS client credentials now load shared SAMS-dev client credentials by default. #### Cody - cody: Refactor completions API to use new modelconfig (support more models) [#63797](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63797)Update the Cody APIs for chat or code completions to use the "new style" model configuration. This allows for great flexibility in configuring LLM providers and exposing new models, but also allows Cody Enterprise users to select different models for chats.This will warrant a longer, more detailed changelog entry for the patch release next week. As this unlocks many other exciting features. - cody: add circuit breaker to handle timed-out requests and rate limit hits [#64133](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64133) #### Requestclient - requestclient: propagate original User-Agent as X-Forwarded-For-User-Agent [#64113](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64113) ### Fix #### Appliance - appliance: don't include is_development builds in list of versions [#64138](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64138) - fix(appliance): don't allow installation of development builds - appliance: Make Appliance URL envvars strings [#64227](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64227) - fix(appliance): make environment variables strings to be passed around #### Own - own: Prevent infinite UI update loop in own pages [#64312](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64312) #### Docs - docs: update quickstart guide links [#64202](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64202) #### Cody - cody: use client-provided timeout for completions requests [#63875](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63875) - Use the provided timeout from request parameters if available; otherwise use the default maximum request duration (8 minutes) - cody: allow pre-release versions for clients [#63913](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63913) - cody: remove client check for context filters [#63855](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63855) #### Search - search: correctly handle select:symbol.enum [#64170](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64170)Fix a bug in `select:symbol.enum` filters where they returned no results #### Bazel - bazel: surface error message when gazelle cant process glob expression [#64214](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64214) #### Search_jobs - search_jobs: prevent job state flip-flopping between 'queued' and 'processing' [#64098](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64098) - search_jobs: remove trailing `*` from URL [#63821](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63821) - search_jobs: progress reporting [#64287](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64287) - Show detailed progress only while job is in status "processing" - Remove dependency of download links on job state - search_jobs: fail validation for repo searches [#64300](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64300) - search_jobs: flickering placeholder component [#64009](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64009) #### Enterpriseportal - enterpriseportal: drop old gorm fk constraints [#63864](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63864) #### Svelte - svelte: Properly redirect to cody marketing page [#64331](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64331) - svelte: Make /cody/dashboard work with the new web app [#64295](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64295) - svelte: Show correct line numbers in unified diff [#63778](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63778) - svelte: Fix and cleanup compare page [#63928](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63928) - svelte: Update top-level route list [#64272](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64272) - svelte: Ctrl+backspace in fuzzy finder [#63804](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63804) - svelte: respect default pattern type in toggles [#63795](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63795) - svelte: Better preloading in file tree [#64327](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64327) - svelte: Center file tree loading indicator [#64309](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64309) #### Ci - ci: reduce push_all concurrency even further due to ratelimits [#64111](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64111) - ci: check command out for error when git fails [#63993](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63993) - ci: reduce push_all concurrency due to ratelimits [#64106](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64106) - ci: only emit bazel execlog artifact for 'test' commands [#63916](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63916) #### Release - release: check for marker in container files instead of binary [#64205](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64205) - release: check contiainer directory `/assets-dist` for marker instead of frontend binary #### Sg - sg: cloud ephemeral - do no trigger builds on main-dry-run [#64190](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64190) - sg: deny deployment of `main-dry-run` branches on Cloud Ephemeral. - sg: better err msg for when we fail to insert to bigquery [#63873](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63873) - sg: provide a better error message when we fail to insert into bigquery - sg: stop puslishing to bigquery if we get 3 errors in a row - sg: do not try to publish analytics when it is disabled [#63800](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63800) - sg - only start the analytics background publisher when analytics are enabled - sg: return different error types depending on secret failure [#63779](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63779) - sg: provide suggestions we fail to get local gcp account email address [#64325](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64325)sg - provide steps a user can follow if we fail to get the local gcp email address - sg: acknowledge command execution state to avoid recursion when executing short running commands [#64181](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64181) #### Batches - batches: switch github app installation handling from redirect flow to webhooks [#64036](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64036) - When installing a GitHub app for batch changes, the instance now waits for a callback from GitHub to complete the installation to avoid issues from eventual consistency. - batches: don't request unnecessary info that's likely to cause GH errors [#64299](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64299) - fix(batches): improve GitHub Apps integration reliability by simplifying the data requested from GitHub - batches: show warning instead of error when the changeset status is not FAILED [#64243](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64243) - Batch changes that are still retrying now show a warning instead of an error. #### Others - Try workaround for bad index choice when updating execution logs [#64328](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64328) - block URLs without a hostname [#64248](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64248) - uses the same base64 for decoding we use for encoding the UsageCursor [#64290](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64290) - Don't propagate un-translated source ranges [#64263](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64263) - Handle sub-repo permissions in CodeGraphData API [#64241](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64241) - Fixes incorrect highlighting for comments at the start of a file [#64235](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64235)Fixes incorrect syntax highlighting when a comment is present at the start of a file. - connection pending alert and alert content alignment [#64120](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64120) - set timeout for web-sveltekit/unit_tests to moderate [#63879](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63879) - Add Exists method to dbworker Store to avoid COUNT(*) [#64297](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64297) - Prefer SCIP uploads over LSIF uploads [#64217](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64217)Fixes a bug where old LSIF uploads would also be used for code navigation even when newer SCIP uploads were available for the same language, potentially leading to duplicate results in the reference panel. With this change, scip-go uploads shadow the uploads for lsif-go, and similarly for other indexers following the scip-X/lsif-X naming convention. - Synchronize access to reads of fields in retry test [#63967](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63967) - add extra check for code intelligence inference [#64083](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64083) - De-dup and concurrent-ify file content requests & splitting [#64169](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64169) - Handle potential nil reference properly [#64265](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64265) - add commit signing filter to `credentialForGitHubAppExists` [#64128](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64128) - make invalid token error message visible while adding external services [#60876](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/60876) #### Telemetry - telemetry: silence invalid events that we already know about [#64084](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64084) ### Chore #### Others - Mark flaky web-sveltekit tests as manual [#63874](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63874) - Frontend does not need disk [#64273](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64273) - Make return type more obvious [#63651](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63651) - Update main occurrence extraction code to allow for symbol-based matching [#64082](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64082) - Rename Index -> AutoIndexJob [#63955](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63955) - Reduce frequency of COUNT(*) on lsif_indexes [#64288](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64288) - Bump version of sourcegraph/log library [#64233](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64233) - Remove cmd/frontend/external/app [#64054](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64054) - Remove redis init side-effect of app.NewHandler [#64062](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64062) - Don't pass nil context [#64055](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64055) - Move codenav types to lower-level package [#64141](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64141) - Replace 'dumps' terminology in comments [#63775](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63775) - Change some APIs to use symbols instead of monikers [#64029](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64029) - Rename uploadstore packages for clarity [#63931](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63931) - Remove incorrectly logged warning [#64267](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64267) - Use binary search over symbols array [#64240](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64240) - De-duplicate CTE for visible uploads [#64232](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64232) - Remove unused loghandlers package [#64067](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64067) - move internal/conf/validation to cmd/frontend [#64064](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64064) - Init userpasswd provider where we initialize every other authn provider [#64061](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64061) - remove flaky flag from svelte e2e_test [#64123](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64123) - Mark flaky test as manual [#63968](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63968) - Factor out sub-query for locating nearest uploads [#64210](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64210) - Remove global externalURL watcher [#64058](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64058) - re-enable e2e tests for web-sveltekit [#63910](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63910) - Replace QueuedCount -> CountByState with bitset parameter [#64302](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64302) - Deglobalize oneclickexporter instance [#64066](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64066) - Make location fetching queries more uniform [#64026](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64026) - Document tech debt wrt multiple doc traversals [#64006](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64006) - Unify LsifStore.*SymbolUsages APIs into one [#64076](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64076) - Add docs for RepoStore methods [#64283](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64283) - Rename URI -> DocumentPath [#63979](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63979) - Remove unused TTL in object.Storage config [#63947](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63947) - Move cmd/frontend/webhooks to cmd/frontend/internal [#64157](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64157) - Rename type Bytes -> Size [#64183](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64183) - Unconditionally call endObservation [#64150](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64150) - move internal/highlight to cmd/frontend [#64065](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64065) - Bubble precise Usages instead of Locations [#64118](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64118) - Switch over to fake RepoStore in codenav tests [#64284](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64284) - move internal/suspiciousnames to cmd/frontend/internal [#64071](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64071) - Simplify license routines [#64068](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64068) - Use Option type and rename API [#63820](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63820) - Bump autoindexing image SHAs [#63801](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63801) - Move and clean up test code for syntactic usages [#64318](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64318) - Remove unnecessary _ imports [#64158](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64158) - remove cmd/frontend/external redirection package [#64070](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64070) - Consolidate mocks for dbworker/store.Store type [#64294](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64294) - Consolidate mocks for uploads's Store type [#64286](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64286) - move cmd/frontend/oneclickexport to cmd/frontend/internal/oneclickexport [#64069](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64069) - Move authn into cmd/frontend [#63648](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63648)GitLab code host connections were [able to sync permissions by mapping Sourcegraph users to GitLab users via the username property of an external OIDC or SAML provider](https://sourcegraph.com/docs/admin/code_hosts/gitlab#administrator-sudo-level-access-token) that is shared across Sourcegraph and GitLab. This integration stopped working a long time ago, and it has been removed in this release. - Replace calls to deprecated ioutil.TempFile [#64177](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64177) #### Svelte - svelte: Add manual entries for repo sub pages to development proxy [#64313](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64313) - svelte: Disable tests which time out [#63844](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63844) - svelte: Refactor infinity query implementation [#63824](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63824) - svelte: fix test by removing duplicate aria-label [#63942](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63942) - svelte: Commit/diff style and behavior tweaks [#63785](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63785) - svelte: Refactor repo loaders [#63828](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63828) - svelte: Clean up dependencies [#63777](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63777) #### Enterpriseportal - enterpriseportal: rewrite subscriptions API tests to be table-driven [#63831](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63831) - enterpriseportal: simplify display_name constraint [#63835](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63835) #### Telemetrygateway - telemetrygateway: gracefully handle sams introspectToken cancelation [#63809](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63809) #### Bazel - bazel: re-enable remote caching of Copy{File,Directory,ToDirectory} actions [#64153](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64153) - bazel: emit json profile for image push jobs [#64188](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64188) - bazel: rework push_all to improve concurrency by avoiding bazel server lock (round 2) [#64079](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64079) - bazel: emit json profile for image push jobs (properly) [#64189](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64189) - bazel: disable stamping on rust_binary targets [#64007](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64007) #### Config - config: clarify env var already registered panic [#63784](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63784) - When conflicting env var are detected, print the two to ease debugging. #### Executors - executors: Native Kubernetes Executors default to use single job pod [#64088](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64088) #### Codeintel - codeintel: Derive TargetPathWithoutRoot dynamically [#63986](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63986) - codeintel: Move mock generation near interface package [#64000](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64000) - codeintel: Simplify code using upload filtering [#63997](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63997) - codeintel: Pass UsageKind instead of raw column names [#64003](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64003) - codeintel: replaces lsp.Range uses with scip.Range [#64178](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64178) - codeintel: Rename local variables for clarity [#63983](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63983) - codeintel: Move RequestState construction to separate func [#63998](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63998) - codeintel: Rename uploads/../Store -> codegraph/../DataStore [#64001](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64001) #### Search - search: update search API call sites to set the version explicitly [#63782](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63782) - search: update logging of search durations [#64269](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64269) #### Local - local: clear ambiguity in between sg version|live [#64122](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64122) - `sg version` explicitly mentions that it's the CLI version that's printed out, not any instance version. - local: use //cmd/frontend:frontend_nobundle for bazel commandsets [#64085](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64085) #### Search_jobs - search_jobs: add janitor job [#64186](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64186)The new background job drastically reduces the size of the `exhaustive_*` tables and improves performance of the Search Jobs GQL API. - search_jobs: improve description on main page [#63992](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63992) - search_jobs: remove label "admin" from contact card [#63823](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63823) #### Cody - cody: allow setting "cody.contextFilters" in site config without feature flag [#63881](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63881) #### Frontend - frontend: use explicit cache for admin analytics [#64077](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64077) #### Worker - worker: move aggregated user stats job to worker [#64033](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64033) - worker: disable jobs based on ENVs [#63853](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63853) - worker: move event_logs janitor routines to worker [#63981](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63981) - worker: move llm token counter to worker [#64008](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64008) - worker: move refreshAnalyticsCache to worker [#64041](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64041) #### Log - log: remove use of log15 in ghe-feeder [#64131](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64131) #### Ci - ci: emit execlog for image push jobs [#64130](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64130) #### Sg - sg: remove 'sg telemetry' and related docs [#63763](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63763) - `sg`: the deprecated `sg telemetry` command for allowlisting export of V1 telemetry from Cloud instances has been removed. Use telemetry V2 instead. - sg: clean up help formatting [#63860](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63860) ### Ci #### Others - add cloud controller gql compat test [#64092](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64092) - automatic retry push images job at least 1 [#64145](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64145) ### Perf #### Others - Find syntactic matches concurrently [#63937](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63937) ### Refactor #### Github - github: Have a dedicated PublicRepository type [#63607](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63607) #### Codeintel - codeintel: Extracts a MappedIndex abstraction over uploads [#63781](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63781) #### Others - steps the usage cursor provenance state in a single place [#64321](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64321) - handles Cursor uniformly over all usage provenances [#64319](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64319) - renames usage cursor and adds fields for future syntactic cursor [#64208](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64208) #### Svelte - svelte: Reduce logo complexity [#64274](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64274) ### Reverts - Revert "Cody: add support for neovim, cody-cli, eclipse, and visualstudio clients [#63854](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63854) - Revert "chore(ci): post instructions for PR sections in a comment" [#64176](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64187) ### Uncategorized - feat(code insights): language stats speed improvements by using archive loading [#62946](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62946) - Language stats queries now request one archive from gitserver instead of individual file requests. This leads to a huge performance improvement. Even extra large repositories like chromium are now able to compute within one minute. Previously they timed out. - various improvements to saved searches [#63539](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63539) - Improved the saved searches feature, which lets you save search queries to easily reuse them later and share them with other people in an organization. - Added the ability to transfer ownership of a saved search to a user's organizations or from an organization to a user's account. - Removed a long-deprecated and ineffective settings `search.savedQueries` field. You can manage saved searches in a user's or organization's profile area (e.g., at `/user/searches`). - Correctly re-map source ranges in new SCIP-based APIs [#63630](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63630) - Move internal/session into cmd/frontend/internal [#63649](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63649) - subrepo: More explicitly define supported hosts [#63650](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63650) - licensecheck: Make proper goroutine [#63655](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63655) - Remove old reference to env var that no longer exists [#63656](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63656) - schema: Remove unused extension schema file [#63657](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63657) - dotcom: Remove dotcom on-by-default Cloudflare trust mode [#63658](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63658) - webhooks: Polish UI components [#63664](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63664) - webhooks: Deterministically match webhook events to repos [#63668](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63668) - gating: Add individual switches for disabling tools features [#63686](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63686) - Svelte: implement new reference panel against new Usages API [#63724](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63724) - Usages API: implement surroundingContent [#63730](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63730) - authz: Drop requirement for installing authz providers in every service [#63743](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63743) - make pagination hooks store filter & query params in URL, not just pagination params [#63744](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63744) - Update comment and decode bytes instead [#63754](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63754) - Svelte: some unrelated cleanups [#63757](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63757) - fix/internal/txemail: add timeout for SMTP connection establishment [#63759](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63759) - Instead of waiting forever, we wait at most 30 seconds before giving up when trying to connect to the configured mail server when sending an email. - feat/graphql/access_tokens: send access token creation/deletion emails in background and create special message for dial errors [#63760](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63760) - When creating or deleting an access token, we no longer wait for the email to be sent before returning to the caller. Instead, we now send it in the background. - Add more Completions handler tests [#63761](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63761)NA - Search: make 'exclude tests' more general [#63762](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63762) - Minor refactoring, fixes [#63766](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63766)NA - Svelte: add more general shrinkable path [#63770](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63770) - feature/db/sub_repo_perms: add IPs column to sub repo perms [#63771](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63771) - The sub_repo_permissions table now has an ips column to store the associated IP address associated with each path rule. - security: Auto-update package lockfiles for Sourcegraph base images [#63776](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63776) - gateway: Don't panic because of duplicate env var registration [#63787](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63787) - RFC 969 API boilerplate [#63789](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63789) - Structural search: fix precise lang filtering [#63791](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63791) - feature: update `sg release cut` to automate stitch graph gen and release branch creation [#63794](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63794) - Wolfi image for Sourcegraph Frontend [#63798](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63798) - fix(nix/p4-fusion): update p4-fusion helix-api hashes [#63805](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63805) - Move Cody Web to beta [#63806](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63806) - feat/lib/telemetrygateway: expose simple Dial [#63810](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63810) - internal/database/sub_repo_permissions: modify store to be able to insert ip based permissions [#63811](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63811)The sub_repositorypermissions database store can now save and retrieve the IP addresses associated with each path rule. - Several fixes around merging modelconfig, and the current Cody Gateway data [#63814](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63814)NA - Svelte: optimize `observeIntersection` [#63816](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63816) - change model identifier for finetuned deepseek model [#63817](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63817) - Syntactic indexing non local refs java [#63822](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63822) - feat/sg/msp: helpful error on cloudsqlproxy port conflict [#63830](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63830) - feat/sg/enterprise: add 'sg enterprise set-name' [#63832](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63832) - updated error messaging for blocked requests due to abuse [#63836](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63836) - gitserver: Add option to allow setting custom context line count [#63840](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63840) - misc saved searches followups [#63841](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63841) - gitserver: Add OctopusMergeBase RPC method [#63842](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63842) - pr-auditor: use pr-auditor from devx-service [#63847](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63847) - Cody: add access token callback pages for CLI, Eclipse and VS [#63849](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63849) - Cody: add support for neovim, cody-cli, eclipse, and visualstudio clients [#63851](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63851) - Fix HTTP 406 error when using the Neovim Cody plugin with Enterprise instances - chore/lib/telemetrygateway: fixup Dial helper [#63862](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63862) - Blame: fix some issues with the stream [#63865](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63865) - Fixed an issue with blame view that can cause retry loops and error pages that block interaction with the rest of the UI - docs: Add alternate names and links in GraphQL docs [#63867](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63867) - show saved searches in new global navbar [#63868](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63868) - factor out PatternConstrainedInput [#63869](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63869) - Add configuration for Intent Detection API [#63871](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63871) - Prompt Library [#63872](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63872) - The Prompt Library lets you create, share, and browse chat prompts for use with Cody. Prompts are owned by users or organizations, and site admins can make prompts public so that all users on the instance can see and use them. To use a prompt from your Prompt Library in Cody, select it in the Prompts dropdown in the Cody chat message field. - Integrate Cohere re-ranking API [#63877](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63877) - Special oauth containers [#63880](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63880) - Feature: db connection pinger and validator [#63884](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63884) - Update CodyLLMConfiguration GraphQL object to be modelconfig aware [#63886](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63886)NA - sg: check for nil multiError [#63889](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63889) - Search: add regex support to `repo:has.meta()` [#63891](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63891) - `repo:has.meta()` predicate now supports regex patterns for keys and values - Fixes re: Cody Pro x Sourcegraph-supplied models [#63892](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63892)NA - cody-gateway: handle missing Google response [#63895](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63895)cody-gateway: log missing Google response as warning - Svelte: fix css selector [#63896](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63896) - self hosted models [#63899](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63899)Cody Enterprise: added a new configuration for self-hosting models. Reach out to support if you would like to use this feature as it is in early access. - Adds unit tests for syntactic usages [#63900](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63900) - [sg] Make rfc command use private RFCs by default [#63902](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63902) - Unify naming of used/ignored context [#63903](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63903) - track usage stats for saved searches in UTC day increments [#63904](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63904) - query Repository.id to support Apollo Client caching [#63905](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63905) - withAuthenticatedUser: use react-router-dom hooks & add test [#63906](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63906) - show org name not displayName in most places [#63907](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63907) - The user menu and other filter menus now show the names of organizations, not their "display names", to avoid ambiguity. For example, these menus will now show `abc-corp` not `ABC Corp` (if the latter was the `abc-corp`'s display name). - add saved search visibility, draft, and timestamps [#63909](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63909) - Saved searches can now be made public (by site admins), which means all users can view them. This is a great way to share useful search queries with all users of a Sourcegraph instance. - Saved searches can be marked as a "draft", which is a gentle indicator that other people shouldn't use it yet. - fix(build-tracker): Failed back-compat doesn't count towards branch-locking quota [#63911](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63911) - sg: enable alerting by default for production projects [#63912](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63912) - Add separate shadow value for hovercards [#63918](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63918) - GraphQL: improve query cost violation message [#63921](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63921) - fix/frontend/httpapi: improve request reader [#63923](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63923) - saved searches & prompt library fixes [#63930](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63930) - remove "organizations aren't supported" page on dotcom [#63932](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63932) - prevent orgs from being named "global" on dotcom [#63933](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63933) - allow non-site admins to list their orgs' members on dotcom [#63934](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63934) - show "Copied" indicator when copying an access token [#63936](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63936) - codeintel: GitTreeTranslator rewrite [#63938](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63938) - repoupdater: Make batches init jobs dependent on batches.IsEnabled [#63939](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63939) - [update] Remove sleep in goroutine for webhook handlers [#63940](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63940) - support getting other orgs on dotcom from the GraphQL API [#63941](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63941) - misc improvements to graphqlbackend [#63943](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63943) - explicitly check viewer access to settings in GraphQL API [#63945](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63945) - use the viewerSettings GraphQL API instead of the 5y+-deprecated viewerConfiguration API [#63949](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63949) - upgrade vitest to latest [#63951](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63951) - Add counter for traced requests to Fireworks [#63953](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63953) - Remove references to modelconfig.sourcegraph.pollingInterval [#63956](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63956)NA - fix/database/sub_repo_perms: don't mark TestSubRepoPermsStore_GetByUserWithIPs as Parallel [#63958](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63958) - A race condition in the sub_repo_permissions database store test suite has been fixed. - Svelte rollout: add toggles for svelte-enabled pages [#63960](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63960) - fix saved searches and prompts list page for anon users [#63961](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63961) - various OrgArea fixes [#63962](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63962) - allow site admins to list org members & view user/org settings on dotcom [#63963](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63963) - Svelte: Fix Safari 17.3 groupBy usage [#63964](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63964) - finish removing chromatic [#63966](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63966) - cody: correct link to emacs-cody [#63974](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63974) - Implement server-side single-repo context fetching for RFC 969 [#63980](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63980) - [fix] Fix being unable to add batch changes credentials when rate limited [#63984](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63984) - Fixed an issue where, when Sourcegraph is applying rate limits, batch change credentials could not be added. Sourcegraph now waits a maximum of 10 seconds to update credentials, and if it times out, it saves the credentials regardless and displays a warning to the user. - fix incorrect URL (/new) on saved search and prompt library pages [#63995](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63995) - feature/worker/permission syncer: perforce: sync HOST field using IP addresses [#64010](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64010) - The perforce permissions syncer has been updated to save the IP address associated with each sub_repository_permissions rule. - Bring back post-sign-up route to the backend router [#64011](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64011) - authz: Compute providers on the fly [#64012](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64012) - feat/frontend/dotcom: add toggles for various online license checks [#64013](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64013) - Update the legacy link to sg doc [#64017](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64017) - Update the outdated link to #dev-experience to #discuss-dev-infra [#64018](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64018) - Maintenance Splash Page [#64019](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64019) - codeintel: returns surroundingContent from search result [#64022](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64022) - codeintel: runs occurrence and symbol search in parallel [#64023](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64023) - codeintel: allows batch retrieval of SCIP documents [#64024](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64024) - codeintel: fetches diffs from gitserver in batches [#64025](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64025) - Removes the old GitTreeTranslator API [#64027](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64027) - Remove dead collaborators invite code [#64039](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64039) - Make cody gateway usage worker a periodic routine [#64040](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64040) - Unpin openjdk-11 version in blobstore package [#64045](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64045) - bug: update version consts in updatecheck handler [#64052](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64052) - cleanup: Move azure openai provider config validation to right place [#64056](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64056) - security: Auto-update package lockfiles for Sourcegraph base images [#64060](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64060) - auth: Fix Found page response when redis is down [#64063](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64063) - codeintel: Adds a batch api for fetching multiple documents to MappedIndex [#64073](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64073) - Syntactic indexing policy toggle: UI and supporting APIs (with backcompat) [#64075](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64075) - In site-admin APIs for updating code intelligence policies: - field `indexingEnabled` is renamed to `preciseIndexingEnabled` - a required `syntacticIndexingEnabled` is added (only takes effect if experimental feature is enabled) - field `forIndexing` is renamed to `forPreciseIndexing` - codeintel: Speed up syntactic and search-based usages using batch APIs [#64078](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64078) - scip-syntax: uses `.starts_with` to check reference capture [#64081](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64081) - feat/worker/permission syncing: make sub repo permissions re-insertion fall back to original paths if ips not added yet [#64086](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64086) - Enable p4-fusion by default for Perforce code host connections [#64101](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64101) - For Perforce code host connections, `p4-fusion` is now always enabled and the option for the much slower and unreliable `git p4` no longer exists. - gerrit: Add support for repositoryPathPattern [#64102](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64102)Added support for the `repositoryPathPattern` setting for Gerrit code host connections. - msp: use BUILDKITE_BUILD_CREATOR as fallback [#64104](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64104) - msp: remove old author variable [#64107](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64107) - Blob search: Fix incorrect icons in the blob search bar [#64108](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64108) - gomod: update zoekt for guardrails perf experiment [#64109](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64109) - Svelte Navigation: hide teams when own is not enabled [#64110](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64110) - search-blitz: adjust limit for snippetAttribution to match gateway [#64119](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64119) - observability: Adds useful data to traces from gosyntect.Highlight [#64121](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64121) - scip-syntax: Simplifies to two visibilities [#64124](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64124) - gomod: update zoekt to include improvement to experiment [#64125](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64125) - Support detecting search and edit intent [#64129](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64129) - SvelteKit: Add 'Tools' Menu item back to global navigation [#64134](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64134) - Svelte: do not show path section if empty [#64135](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64135) - SvelteKit: fix issue where clicking link with no href refreshed the page [#64136](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64136) - fix/internal/requestclient: read all instances of x-forwarded-for header, not just the first [#64137](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64137) - bug: parse v in target versions [#64139](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64139) - codeintel: document that pagination for usages might return extra results [#64142](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64142) - bug: fix default version [#64143](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64143) - chore(syntax-highlighter): Some cleanup for locals detection [#64144](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64144) - Bump cody web to most recent package @sourcegraph/cody-web [#64149](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64149) - docs: Specify matching behavior for usagesForSymbol(range:) [#64151](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64151) - Svelte: Bump cody web to most recent package @sourcegraph/cody-web [#64152](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64152) - Nit: adds space between tools menu item and dropdown icon [#64154](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64154) - frontend: Remove global conf server variable [#64155](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64155) - frontend: Consolidate remaining registry packages [#64156](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64156) - Add unit test for modelconfig converting starcoder completion model [#64160](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64160)NA - Relax modelconfig name restrictions [#64161](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64161)NA. - Svelte: add welcome introduction when enabling svelte for the first time [#64163](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64163) - replace modelOverridesRecommendedSettings with selfHostedModels [#64164](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64164)Improved configuration functionality for Cody Enterprise with Self-hosted models. - fix autocomplete regression in `main` ("various" provider issue) [#64165](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64165)N/A - Expose ranker relevance score in GraphQL API [#64172](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64172) - Policy patch - leave fields unchanged if they're missing from request [#64174](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64174) - docs: Weaken guarantees for Usage cursor [#64185](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64185) - Code intel: respect provenance when getting usages [#64193](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64193) - Bump @sourcegraph/cody-web to 0.3.2 [#64195](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64195) - Don't block `frontend` initialization with invalid modelconfig [#64200](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64200)NA - security: Auto-update package lockfiles for Sourcegraph base images [#64204](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64204) - search: apply phrase boosting to more queries [#64207](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64207) - sg cloud eph: simplify status [#64209](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64209) - Styling updates throughout [#64221](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64221) - Svelte: welcome banner followups [#64222](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64222) - Cody web: add server-side fetching for URL mentions [#64223](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64223) - Bump @sourcegraph/cody-web to 0.3.4 [#64224](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64224) - Chore: remove enablePreciseOccurrences feature flag [#64229](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64229) - Web: fix git blame for files that have `/stream/` in their path [#64230](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64230) - Fixed an issue where blame view would error when the file contains the path element `/stream/` - codeintel: make usage-range non-optional [#64236](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64236) - ephemerals: fix feature flag name [#64237](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64237) - Reapply "soap: Fix auto-redirect to IdP when SOAP is enabled" (#64234) [#64244](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64244) - gitserver: RawDiff checks if commits exist [#64245](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64245)Fixes a bug where a force push on HEAD of a repository might lead to our unindexed search failing until the indexed search had updated. - servicecatalog: remove searcher dep on database [#64247](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64247) - Chore: remove non-null assertions [#64249](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64249) - Svelte: fix welcome banner flashing on reload [#64251](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64251) - Cody Web: Update Cody Web to 0.3.6 [React version] [#64254](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64254) - Svelte: make closing the welcome overlay more obvious [#64256](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64256) - gomod: update zoekt for shard scanning improvement [#64264](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64264) - Update p4-fusion-sg wolfi-package [#64266](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64266) - Return 'sourcegraph' as the CodyLLMConfigurationResolver.Provider [#64276](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64276)NA - Svelte: remove site admin gate on code intel preview [#64277](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64277) - Improving Azure errors for customer containers [#64278](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64278) - Update the default Sourcegraph-supplied LLM models [#64281](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64281)NA? - Enable SCIP based APIs by default [#64285](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64285) - Update wolfi hashes [#64289](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64289) - searcher: fix benchmarks [#64292](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64292) - Search: re-add support for 'lucky' patterntype [#64293](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64293) - Update Cody Web to 0.3.7 [#64296](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64296) - Search: boost matches on quoted terms [#64298](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64298) - Return model IDs from GraphQL, not model Names [#64307](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64307)NA - Svelte: more welcome banner behavior updates [#64311](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64311) - Fix Cody Web Svelte Sidebar [#64320](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64320) - Center align Cody logo in Cody Web Sidebar [#64324](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64324) - upgrade Cody Web, always create a new chat [#64334](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64334) - Svelte: enable toggle by default [#64340](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64340) ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - [Backport-5.5.x]: Move Cody Web to beta (#63806) [#63808](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63808) - Backport: Blame: fix some issues with the stream (#63865) [#63929](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63929) - security: Auto-update package lockfiles for Sourcegraph base images [#64035](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64035) - security: Bump openjdk-11 version in blobstore image [#64047](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64047) - appliance: backport all recent appliance changes [#64182](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64182) - Backport all recent appliance changes. The appliance is still pre-release. - cherry-pick 856e41e with resolved conflicts [#64228](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64228) # v5.5.3956 {/* RSS={"version":"v5.5.3956", "releasedAt": "2024-08-02"} */} ### Reverts ### Uncategorized - [Backport-5.5.x]: Move Cody Web to beta (#63806) [#63808](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63808) - [Backport 5.5.x] fix(batches): the baseURL for github instance is now updated when creating a GitHub app [#63833](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63833) Backport 1c40c9e5bccd4f6265945bd3449b70a648022e60 from #63803 - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.5 [#63856](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63856) - Backport 63870 to 5.5.x [#63882](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63882) - Adds an experimental feature `commitGraphUpdates` to control how upload visibility is calculated. - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.7 (#63863) [#63901](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63901) - Backport: Blame: fix some issues with the stream (#63865) [#63929](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63929) - [Backport 5.5.x] [fix] Only trigger externalAcctSignup event when a new user is created [#63975](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63975) - Fixed an issue where the `http-header` auth would cause a massive amount of event logs spam Backport cd6595196177b3d307a4e8f76222c6d8c5c9b23f from #63843 - [Backport 5.5.x] Publish images for all commits on release branches [#63987](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63987) Backport b7242d280f37a4b9effebb52ac4301e59635d629 from #63985 - [Backport 5.5.x] [logging] Only record events if a new user was created [#64005](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64005) Backport 777c7a089956f1ad9c494ab55e8660bbdd781259 from #64004 - [Backport 5.5.x] Integrate security release approval into release pipeline [#64030](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64030) Backport 9dd901f3c957cf5bf83aa6ac41fc3c6b2744cfd3 from #63990 - security: Auto-update package lockfiles for Sourcegraph base images [#64035](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64035) - [Backport 5.5.x] fix(source): Fix issue where worker would crash if a Bitbucket Cloud token couldn''t be refreshed [#64037](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64037) - Fixed an issue where a Bitbucket Cloud OAuth token failing to refresh would crash the `worker` service. Backport bc036ad2bafc9a09d80646d30d26335359a28fd1 from #64028 - security: Bump openjdk-11 version in blobstore image [#64047](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64047) - [Backport 5.5.x] ci: make internal+promote release higher priority in runtypes [#64050](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64050) Backport 0309564f9362ea24e248aa5189d66f89826ccecf from #64049 - [Backport 5.5.x] fix: Fix Chrome stack overflow during highlighting [#64074](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64074) - Fixes a Chrome-specific stack overflow when highlighting large files. Backport 2644e242447ac355a415abec7af5cfb8d9849e75 from #64072 - Backport 5ce2eea to 5.5.x [#64166](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64166) - security: Auto-update package lockfiles for Sourcegraph base images [#64180](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64180) - [Backport 5.5.x] fix(appliance): cache authorization status [#64219](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64219) Backport 156aa5a0adec1bc7a1f2142878761d8993dd4c43 from #64213 - [Backport 5.5.x] fix(appliance): reliably redirect to site-admin post-install [#64220](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64220) Backport e54407d9f50ed11f1a7c27edbb5c42966070f236 from #64216 - cherry-pick 856e41e with resolved conflicts [#64228](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64228) ### Untracked The following PRs were merged onto the previous release branch but could not be automatically mapped to a corresponding commit in this release: - [Backport 5.5.x] release/bug: generate a new stitched migration graph [#63769](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63769) Backport cb19d6f0a98f7ecce65629bd117c34a8dc1db8e2 from #63764 - [Backport 5.5.x] Context: return lines around symbol match [#63788](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63788) - [Backport 5.5.x] fix/alertmanager: downgrade prometheus/common to fix generated config [#63793](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63793) - Fix Prometheus Alertmanager configuration failing to apply `observability.alerts` from site config Backport ffa873f3adb18e2c5807ca752115a70fcbc493c8 from #63790 - [Backport-5.5.x]: Move Cody Web to beta (#63806) [#63808](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63808) - [Backport 5.5.x] fix(batches): the baseURL for github instance is now updated when creating a GitHub app [#63833](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63833) Backport 1c40c9e5bccd4f6265945bd3449b70a648022e60 from #63803 - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.5 [#63856](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63856) - Backport 63870 to 5.5.x [#63882](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63882) - Adds an experimental feature `commitGraphUpdates` to control how upload visibility is calculated. - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.7 (#63863) [#63901](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63901) - Backport: Blame: fix some issues with the stream (#63865) [#63929](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63929) - [Backport 5.5.x] [fix] Only trigger externalAcctSignup event when a new user is created [#63975](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63975) - Fixed an issue where the `http-header` auth would cause a massive amount of event logs spam Backport cd6595196177b3d307a4e8f76222c6d8c5c9b23f from #63843 - [Backport 5.5.x] Publish images for all commits on release branches [#63987](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63987) Backport b7242d280f37a4b9effebb52ac4301e59635d629 from #63985 - [Backport 5.5.x] [logging] Only record events if a new user was created [#64005](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64005) Backport 777c7a089956f1ad9c494ab55e8660bbdd781259 from #64004 - [Backport 5.5.x] Integrate security release approval into release pipeline [#64030](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64030) Backport 9dd901f3c957cf5bf83aa6ac41fc3c6b2744cfd3 from #63990 - security: Auto-update package lockfiles for Sourcegraph base images [#64035](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64035) - [Backport 5.5.x] fix(source): Fix issue where worker would crash if a Bitbucket Cloud token couldn''t be refreshed [#64037](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64037) - Fixed an issue where a Bitbucket Cloud OAuth token failing to refresh would crash the `worker` service. Backport bc036ad2bafc9a09d80646d30d26335359a28fd1 from #64028 - security: Bump openjdk-11 version in blobstore image [#64047](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64047) - [Backport 5.5.x] ci: make internal+promote release higher priority in runtypes [#64050](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64050) Backport 0309564f9362ea24e248aa5189d66f89826ccecf from #64049 - [Backport 5.5.x] fix: Fix Chrome stack overflow during highlighting [#64074](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64074) - Fixes a Chrome-specific stack overflow when highlighting large files. Backport 2644e242447ac355a415abec7af5cfb8d9849e75 from #64072 - Backport 5ce2eea to 5.5.x [#64166](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64166) - security: Auto-update package lockfiles for Sourcegraph base images [#64180](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64180) # v5.5.3738 {/* RSS={"version":"v5.5.3738", "releasedAt": "2024-07-31"} */} ### Feat - appliance: backport all recent appliance changes [#64182](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64182) - Backport all recent appliance changes. The appliance is still pre-release. ### Reverts ### Uncategorized - [Backport 5.5.x] fix: Fix Chrome stack overflow during highlighting [#64074](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64074) - Fixes a Chrome-specific stack overflow when highlighting large files. Backport 2644e242447ac355a415abec7af5cfb8d9849e75 from #64072 - Backport 5ce2eea to 5.5.x [#64166](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64166) # v5.5.2463 {/* RSS={"version":"v5.5.2463", "releasedAt": "2024-07-24"} */} ### Uncategorized - Backport: Blame: fix some issues with the stream (#63865) [#63929](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63929) - [Backport 5.5.x] [fix] Only trigger externalAcctSignup event when a new user is created [#63975](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63975) - Fixed an issue where the `http-header` auth would cause a massive amount of event logs spam Backport cd6595196177b3d307a4e8f76222c6d8c5c9b23f from #63843 - [Backport 5.5.x] Publish images for all commits on release branches [#63987](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63987) Backport b7242d280f37a4b9effebb52ac4301e59635d629 from #63985 - [Backport 5.5.x] [logging] Only record events if a new user was created [#64005](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64005) Backport 777c7a089956f1ad9c494ab55e8660bbdd781259 from #64004 - [Backport 5.5.x] Integrate security release approval into release pipeline [#64030](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64030) Backport 9dd901f3c957cf5bf83aa6ac41fc3c6b2744cfd3 from #63990 - security: Auto-update package lockfiles for Sourcegraph base images [#64035](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64035) - [Backport 5.5.x] fix(source): Fix issue where worker would crash if a Bitbucket Cloud token couldn''t be refreshed [#64037](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64037) - Fixed an issue where a Bitbucket Cloud OAuth token failing to refresh would crash the `worker` service. Backport bc036ad2bafc9a09d80646d30d26335359a28fd1 from #64028 - security: Bump openjdk-11 version in blobstore image [#64047](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64047) - [Backport 5.5.x] ci: make internal+promote release higher priority in runtypes [#64050](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/64050) Backport 0309564f9362ea24e248aa5189d66f89826ccecf from #64049 # v5.5.1337 {/* RSS={"version":"v5.5.1337", "releasedAt": "2024-07-18"} */} ### Uncategorized - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.7 (#63863) [#63901](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63901) # v5.5.1220 {/* RSS={"version":"v5.5.1220", "releasedAt": "2024-07-17"} */} ### Uncategorized - [Backport-5.5.x]: Move Cody Web to beta (#63806) [#63808](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63808) - [Backport 5.5.x] fix(batches): the baseURL for github instance is now updated when creating a GitHub app [#63833](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63833) Backport 1c40c9e5bccd4f6265945bd3449b70a648022e60 from #63803 - [Backport 5.5.x] Upgrade cody web experimental package to 0.2.5 [#63856](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63856) - Backport 63870 to 5.5.x [#63882](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63882) - Adds an experimental feature `commitGraphUpdates` to control how upload visibility is calculated. # v5.5.160 {/* RSS={"version":"v5.5.160", "releasedAt": "2024-07-11"} */} ### Uncategorized - [Backport 5.5.x] Context: return lines around symbol match [#63788](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63788) - [Backport 5.5.x] fix/alertmanager: downgrade prometheus/common to fix generated config [#63793](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63793) - Fix Prometheus Alertmanager configuration failing to apply `observability.alerts` from site config Backport ffa873f3adb18e2c5807ca752115a70fcbc493c8 from #63790 # v5.5.0 {/* RSS={"version":"v5.5.0", "releasedAt": "2024-07-11"} */} ### Chore - Change errors.HasType to respect multi-errors [#63024](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63024) - codenav: Resolve repo and commit in common code [#63072](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63072) - graph: Add changelog entry for Python scip-ctags fix (second attempt) [#63106](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63106) - search: Add test case covering hack lang detection behavior [#63136](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63136) - Add test case for coverage hack lang detection - msp: document gRPC notes in spec docstrings [#63140](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63140) - Fix lint error (unparam) [#63151](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63151) - Validate driver type immediately [#63177](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63177) - appliance: remove references to embeddings [#63185](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63185) - Remove references to embeddings from (still unreleased) appliance. - security: update dependencies [#63197](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63197) - ci: conditionally stamp genrules [#63204](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63204) - Avoid invalidating cache in stamped genrules on dev builds. - schema: Add implementation status for codeGraphData [#63219](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63219) - Add GitBlobResolver and GitTreeResolver for readability [#63223](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63223) - Remove dead code for Rust crates [#63224](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63224) - bazel: bump to 7.2.0 [#63226](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63226) - changelog: advise contributors of new process [#63243](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63243) - Advise contributors of new changelog process. - svelte: Migrate all icons to Lucide/custom icons [#63246](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63246) - Add binary search function that returns range [#63248](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63248) - Move deduplicateBy to collections package [#63249](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63249) - codeintel: Use internal language detection package for insights [#63254](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63254) - Code clean up to use common language detection mechanism in more places - remove broken link in README [#63256](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63256) - Remove unused code paths in lsifstore package [#63259](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63259) - Add more tests for GetLanguages API [#63260](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63260) - Simplify location uniquing [#63263](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63263) - Add specialized function for sorting primitive sets [#63269](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63269) - Bump go-enry and Zoekt to handle new languages [#63281](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63281) - Updates the `lang:` filter to add support for languages such as Mojo, Roc, EdgeQL etc. - ci: remove buildchecker sunday summary posts [#63289](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63289) - Maintain consistency between languages functions [#63292](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63292) - local: remove docsite from dotcom commandset [#63314](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63314) - deps: upgrade grpc, prometheus/common [#63328](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63328) - deps: upgrade alertmanager package dependency, improve logs and tests [#63329](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63329) - Add more docs for occurrences GraphQL API [#63338](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63338) - svelte: Simplify development for dotcom [#63341](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63341) - svelte: Remove stub logger [#63342](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63342) - plg: migrate invoices list to react-query [#63343](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63343) - local: simplify 'sg db' inline help [#63344](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63344) - ci: instrument push_all.sh commands in honeycomb [#63350](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63350) - ci: mark web-sveltekit:e2e_test as flaky [#63351](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63351) - svelte: Update fuzzy finder designs [#63354](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63354) - Fix inaccurate error message [#63361](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63361) - remove obsolete tracking code for Cody App downloads [#63364](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63364) - centralize logic for disabling Batch Changes on dotcom [#63370](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63370) - Add SymbolUsageKind to GraphQL API [#63371](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63371) - Add doc comment for DiffOptions.Paths [#63385](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63385) - deps: replace internal/slices [#63386](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63386) - Add a collections library to dependencies. - Refactor and document GitTreeTranslator [#63390](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63390) - batches: remove visibility options from create batch changes page [#63393](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63393) - remove visibility options from create batch change page - enterpriseportal: only use 'revoke' verb for licenses [#63407](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63407) - bazel: bump rules_js to address permissions denied warning [#63419](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63419) - ci: emit compact executon log in CI [#63420](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63420) - batches: remove beta badge from batch changes [#63423](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63423) - Remove Beta badge from Batch Changes pages. - enterpriseportal: split database package [#63425](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63425) - enterpriseportal: properly close DB handle [#63426](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63426) - codeintel: Differentiate between paths relative to upload root vs repo root [#63437](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63437) - batches: remove beta badge from Batch Changes page [#63441](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63441) - the Beta badge is now removed from Batch Changes - plg: add useEmbeddedUI site config param [#63442](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63442) - svelte: Properly route to revision agnostic pages [#63444](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63444) - enterpriseportal: tweak maybeMigrate tracing [#63448](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63448) - ci: emit compact executon log in CI for test + build commands only [#63451](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63451) - enterpriseportal: propagate context to migration database context [#63455](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63455) - svelte: Hide cody nav entries and upsell banner when cody isn't enabled [#63463](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63463) - Add collection type - OrderedSet [#63469](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63469) - bazel: don't stamp yq rule for wolfi base images [#63470](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63470) - bazel: add client/backstage-frontend to bazelignore [#63471](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63471) - svelte: Upgrade SvelteKit [#63490](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63490) - enterpriseportal: rename customer admin role in API [#63501](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63501) - enterpriseportal: add test for iam_model [#63503](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63503) - codygatewayevents: extract into standalone package for reuse, split up internal/codygateway [#63528](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63528) - local: add dotcom-cody-e2e commandset [#63548](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63548) - linearhooks: use MSP rollouts [#63556](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63556) - analytics: remove Cody characters events from inclusion in pin… [#63557](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63557) - search: VSCode Search extension: Remove signup link for sourcegraph.com [#63558](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63558) - Remove links to create an account on sourcegraph.com because it no longer hosts private code. - search: VSCode Search extension: Remove url and token from configuration [#63559](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63559) - Remove access token and URL from extension settings because they are managed in the extension now. - preserve format imposed by bazel [#63561](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63561) - Add feature flag for new SCIP-based GraphQL APIs [#63565](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63565) - Simplify path trimming logic in perm checking [#63574](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63574) - Set scipBasedAPIs to off by default [#63575](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63575) - Use api.RepoID and api.CommitID in more places [#63596](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63596) - local: sg warns about opposite default value on dev builds [#63612](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63612) - local: make sg handle empty secret file gracefully [#63614](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63614) - local: simplify sg teammate [#63667](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63667) - svelte: Cleanup dependencies [#63691](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63691) - drop isGitHubApp field from batch changes credentials [#63709](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63709) - reword headline from tokens to credentials [#63714](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63714) - redis: set max active redis connections to 1000 [#63718](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63718) - redis-pool: set max active clients to 1000 - security: Updated dind image to 27-0-3 [#63725](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63725) - Upgraded dind to 27.0.3 to patch CVE-2024-24790 vulnerability - svelte: Update to latest cody web version [#63732](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63732) - svelte: Use MDI icons for seach input pattern type toggles [#63733](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63733) - svelte: Update cody web version [#63747](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63747) - add changelog entry for Batch Changes - GitHub apps integration [#63756](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63756) - Batch Changes: GitHub apps can now be added as a credential for authentication and interacting with changesets. [#31533](https://github.com/sourcegraph/sourcegraph-public-snapshot/issues/31533) ### Feat - ci: Adds playwright tests for sveltekit to bazel [#62560](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62560) - search: Add Syntax Highlighting for Hack Language [#62770](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62770) - search: Add Syntax Highlighting for Magik language [#62919](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62919) - Added syntax highlighting for the Magik programming language. - msp: allow enablement of logical replication features for Datastream [#63092](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63092) - MSP services can now configure `postgreSQL.logicalReplication` to enable Data Analytics team to replicate selected database tables into BigQuery. - search: Support Magik language file filter in search [#63110](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63110) - Added Magik language to language filters (`lang:magik`) - sg: add command to generate a dotcom user gateway access token [#63125](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63125) - appliance: deploy frontend [#63158](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63158) - Appliance (still unreleased) can deploy frontend. - appliance: deploy searcher [#63191](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63191) - Appliance (as yet unreleased) can deploy Searcher. - gitserver: don't log memoryObservation error if it occured b/c context cancellation [#63210](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63210) - Reduce logspam in the gitserver command functionality by ignoring memory observation errors if they occurred due to external context cancellation. - plg: Add new Checkout flow that uses Stripe's `createToken` API [#63213](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63213) - gitserver: avoid logspam from deadline exceeded memory tracking errors [#63215](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63215) - In the gitserver new command logic, logspam from the memory observer when the context error is deadline exceeded will no longer occur. - plg: Add seats [#63227](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63227) - Search: Add icon for the Hack language [#63233](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63233) - Adds icon for the Hack language - plg: Apply designs to Cody Pro pages [#63244](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63244) - plg: Use react-query for team management [#63267](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63267) - ci: Trigger security scanner from release pipeline [#63280](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63280) - Added security scanner to the release pipeline - plg: remove accept invite page [#63290](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63290) - enterpriseportal: UpdateCodyGatewayAccess RPC definition [#63307](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63307) - enterpriseportal: CreateEnterpriseSubscription RPC definition [#63308](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63308) - enterpriseportal: add Salesforce metadata at subscription level [#63317](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63317) - sg: command to add default site-admin with predefined access token [#63320](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63320) - enterpriseportal: CreateEnterpriseSubscriptionLicense RPC defininition [#63323](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63323) - enterpriseportal: ArchiveEnterpriseSubscription RPC definition [#63330](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63330) - enterpriseportal: RevokeEnterpriseSubscriptionLicense RPC definition [#63331](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63331) - Add id for CodeGraphData [#63337](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63337) - codeintel: Add precise auto-inferencing for dotnet [#63348](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63348) - Enable automatic precise indexing of .NET projects - plg: Update Cody Pro badge deck [#63352](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63352) - appliance: appliance docker container [#63357](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63357) - feat(appliance): create docker container - plg: Tweak invite co-workers flow [#63374](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63374) - plg: Invite users on Cody Dashboard [#63375](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63375) - plg: require confirmation before removing user or revoking admin [#63388](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63388) - svelte: Make fuzzy finder matching more reliable [#63397](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63397) - Add 'search all' tab - Support multi-word search - Support regular expression patterns - Fix matching reliability - plg: remove seats from subscription [#63408](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63408) - sg: add 'sg enterprise' commands for Cody Analytics [#63414](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63414) - enterpriseportal: validate and normalize instance domains [#63415](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63415) - appliance: local developer mode [#63417](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63417) - Local developer mode for appliance config authors. - enterpriseportal: use UUID type for subscription ID [#63452](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63452) - enterpriseportal: initialize subscriptions tables [#63453](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63453) - enterpriseportal: init licenses tables [#63454](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63454) - enterpriseportal: init Cody Gateway Access table [#63457](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63457) - dotcom: show subscription UUID in Enterprise Portal format [#63482](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63482) - sg: add -auto-approve option for 'sg enterprise' updates [#63500](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63500) - enterpriseportal: make UpdateEnterpriseSubscriptionMembership authoritative [#63502](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63502) - codeintel: Add scip-ctags support for Magik [#63504](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63504) - Add symbol browsing support for the Magik language - enterpriseportal: define GetCodyGatewayUsage RPC, use uint64 for rate limits [#63531](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63531) - remove experimental label from batches merge changesets action [#63542](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63542) - enterpriseportal: implement GetCodyGatewayUsage RPC [#63555](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63555) - search: Make search aware of perforce changelist id mapping [#63563](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63563) - For perforce depots, support searching within a specific changelist by specifying a ref like `context:global repo:^repo/name$@changelist/83854` - introduce database fields for github apps - batch changes integration, and update database layer [#63577](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63577) - sg: sqlite-backed local store for sg analytics [#63578](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63578) - search: remove keyword toggle [#63584](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63584)The keyword search toggle has been removed from the search results page. [Keyword search](https://sourcegraph.com/docs/code-search/queries#keyword-search-default) is now enabled by default for all searches in the Sourcegraph web app. - sg: one-time oauth login to persist user email for analytics [#63603](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63603) - cody: Expose Sg modelconfig data via HTTP REST API [#63604](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63604)Sourcegraph instances how expose an HTTP endpoint that authenticated users can call to get a list of LLM models supported by the Sourcegraph instance. In the future this will be used to allow Cody users to select the LLM model dynamically, based on what is currently available. - batches: use "keyword" as default pattern type [#63613](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63613) - The new (optional) field "version" of batch specs determines how the spec is processed. This allows us to introduce new features while maintaining backward compatability. - A new version `2` is introduced. Batch specs specifying `version: 2` will use keyword search as the default pattern type to determine repos/workspaces. Batch specs with `version: 1` or without version field keep using pattern type "standard". - svelte: Make diff headers on commit page sticky [#63615](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63615) - implement functionality to create credential GitHub apps [#63635](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63635) - svelte: Add Cody chat sidebar [#63638](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63638) - dotcom: add Enterprise Portal auth proxy [#63652](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63652) - svelte: Add cody button to repo home page [#63684](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63684) - dotcom: remove per-user Enterprise subscriptions UI [#63698](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63698) - enterpriseportal: database layer for subscriptions upsert [#63703](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63703) - svelte: Add reblame support to blame column [#63727](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63727) - Source: Properly render multi-line changelist messages from Perforce [#63728](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63728) - Properly render multi-line perforce changelist descriptions ### Fix - appliance: use version for image tags [#63075](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63075) - Appliance uses requested version as image tag, instead of requiring sha256 digests. - sg: fix cloud eph suggested commands [#63093](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63093) - fix suggested cloud ephemeral commands - show duration till expiry for cloud ephemeral - release: remove generate-notes from github release creation [#63121](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63121) - remove `generate-notes` cli flag when promoting releases - push only a single tag - fix token name used in changelog generation - search: Properly handle URLs with file paths that contain route segments [#63123](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63123) - SCIM: don't allow SCIM users to change fields [#63130](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63130) - highlighting: Update JSX/TSX highlighting to more properly label tag delimiters [#63138](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63138) - Update highlighting of JSX/TSX Tags to correctly label delimiters - highlighting: Improve highlighting for Magik language [#63155](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63155) - Correctly identify null and symbols in Magik language syntax highlighting - search: Contributors page errors with empty date string [#63182](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63182) - tests: Clean up mocks after test [#63201](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63201) - local: disable bazel remote cache [#63203](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63203) - search: Copy text from read-only code host configuration input [#63239](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63239) - plg: Fix "Remove team member" feature [#63241](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63241) - svelte: scrolling search input [#63261](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63261) - search: VSCode Search extension: remove auth provider [#63262](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63262) - Remove interaction between the Sourcegraph Search extension and the Accounts menu. - search: Better diagnostic message for invalid and incomplete select: filter value [#63266](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63266) - Show useful valid values when an invalid `select:` value is entered - Do not render empty hover tooltips - search: Improve syntax highlighting of search history entries [#63271](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63271) - search: Ignore *lock keys for keyboard shortcut matching [#63272](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63272) - svelte: Add trailing slash to group and directory suggestions [#63273](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63273) - Source: Fix documentation URLs for code hosts help pages [#63274](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63274) - Fix in-product documentation links for code hosts to point to updated docs location - ci: remove broken glob [#63277](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63277) - Don't mark references in import statements as definitions [#63284](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63284) - Fixes a bug where import statements in TypeScript code showed up in `type:symbol` search. - plg: banner styles [#63287](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63287) - svelte: Fix icon color in search sidebar [#63288](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63288) - svelte: Open correct file from preview panel line number [#63309](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63309) - svelte: Reference panel width [#63310](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63310) - svelte: Fix reference panel loading/error state [#63316](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63316) - svelte: Properly scope global CSS selector [#63332](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63332) - svelte: Preserve selected lines in codehost URL [#63334](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63334) - Line selection is preserved when navigating to GitHub or GitLab external URLs - File actions are now available in the inline 'at commit' view - File icon is now rendered in the file header for the inline diff view - svelte: History suggestions should show immediately when clicking the history button [#63335](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63335) - batches: disallow retry on deleted changesets [#63336](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63336) - Disallow auto-retry when a changeset is deleted. - svelte: Data/code preloading doesn't work when using panels [#63339](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63339) - svelte: Use correct symbol icon color [#63355](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63355) - api: only allow a user or site admin to view that user's usage stats [#63365](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63365) - client: restore paths for extension bundles [#63402](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63402) - sg: fix mangled log output from `sg start` and `sg run` [#63405](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63405) - enterpriseportal: ListEnterpriseSubscriptions fixes [#63412](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63412) - svelte: Properly rounded corner for file view hover cards [#63446](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63446) - analytics: fix broken v1 codeintel event logging [#63449](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63449) - plg: ensure invite flow is enabled only for embedded UI [#63466](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63466) - Check (uploadID, path) pairs in bulk [#63485](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63485) - search: remove "lucky" from default pattern types [#63486](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63486) - Removed experimental pattern type "lucky" from the list of supported default pattern types. - sg: reduce max interrupt count and os.Exit always [#63516](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63516) - sg - Always os.Exit once shutdown hooks have completed - sg - Reduce max intterupt count from 5 to 2 to hard exit - batches: remove leading and trailing spaces from batch changes credentials [#63517](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63517) - Whitespaces in Batch Changes credentials are trimmed before being saved to the database, this prevents 401 errors when using the token to construct an authenticated push URL. - search: VSCode Search extension: bring back matched lines in search results. [#63524](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63524) - sg: fix 'sg enterprise' per-command flags [#63527](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63527) - sg: conditionally show protips [#63541](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63541) - sg - conditionally show protips when running `sg bazel` - search: Token decoration in keyword-enabled query input [#63543](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63543) - svelte: Reference layout shift while loading data [#63546](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63546) - batches: fix zero division error resulting in wrong stats computation [#63547](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63547) - enterpriseportal: forcibly run gorm-incompatible migration in local dev [#63549](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63549) - telemetrygateway: reduce context cancellation error reports [#63551](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63551) - search: VSCode Search extension: hide file preview link [#63552](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63552) - svelte: Fix unplugin icons usage in storybook [#63594](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63594) - ci: panic using correct err [#63599](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63599) - ci - use correct err value to panic on - svelte: Remove rogue console.log statement [#63600](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63600) - search: Don't show inline cody widget when new cody web is enabled [#63608](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63608) - actions: update pinned SHA for `pnpm/action-setup` action [#63632](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63632) - batches: display failure alert depending on github app kind [#63633](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63633) - svelte: Render correct error page [#63663](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63663) - svelte: Use 'pointer' pointer for cody button [#63665](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63665) - svelte: Respect cody ignore settings [#63677](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63677) - svelte: Fixes excessive 'the hotkey ... has already been registered' messages [#63679](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63679) - batches: fix broken credential validator [#63687](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63687) - svelte: Properly load/serve version.json [#63688](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63688) - codygateway: tweak enterprise-portal dial options [#63692](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63692) - batches: fix broken `ghauth` import [#63693](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63693) - svelte: Update cody web [#63710](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63710) - better alignemnt of github credentials and check success notice [#63717](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63717) - show success notice in the correct area [#63721](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63721) - svelte: Prefill search home page query input with (default) context filter [#63740](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63740) - remove watch path that's gone [#63746](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63746) - batches: enable check for creating source as non credential [#63751](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63751) - build: update wolfi image lock for otel [#63755](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63755) - fix(build): update wolfi lock for otel-collector ### Refactor - cody: Reshape the `CompletionsClient` interface [#63358](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63358)NA, just some under the hood refactoring that shouldn't impact any functionality. ### Test - cody: Add unit tests for the Completions API [#63434](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63434)NA. Just trivial changes and adding more tests. ### Reverts ### Uncategorized - gitserver: Sunset Exec endpoint [#62774](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62774) - gitserver: Cleanup CreateCommitFromPatch [#62781](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62781) - [React]: Add initial usage of the new web worker-based cody web chat [#62792](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62792) - gitserver: Framework to support integration testing against gitserver [#62801](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62801) - feat/internal/memcmd: add internal/memcmd package to allow for memory tracking of exec.Cmd processes [#62803](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62803)This feature adds a package that allows us to track the memory usage of commands invoked via exec.Cmd. - feat(search/svelte): Add context specific suggestions to repo search input [#62880](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62880) - feat/cody-gateway: use Enterprise Portal for actor/productsubscriptions [#62934](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/62934) - Reimplement license checks [#63068](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63068) - Svelte: inject into primary `app.html` [#63088](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63088) - Syntactic Indexing: add TAR archive indexing mode to scip-syntax CLI [#63097](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63097) - Add Support for Counting Tokens for Azure Code and Update in Redis [#63100](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63100) - enterprise-portal: update RPC for subscription domain and members [#63105](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63105) - Cody Gateway embeddings: powering with generated metadata - take 2 [#63112](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63112) - fix(Cody Gateway): add model field to Google completion request [#63113](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63113) - feat/cmd/gitserver: add memory tracking for both linux and macos [#63114](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63114)Adds a new experimental feature to enable track of `git` command memory invocations when the `GITSERVER_MEMORY_OBSERVATION_ENABLED` environment variable is true (off by default). - feat/sg-msp-pg: add suggestion to check msp-ops page on perms error [#63118](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63118) - `sg msp pg connect` will tell you about your service's generated Notion page if you run into a permissions-looking error during command setup, where there is guidance about the required Entitle requests. - Svelte: add sentry [#63126](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63126) - sg: deny cloud ephemeral builds from main [#63127](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63127) - deny cloud ephemeral deployments triggered from 'main' - svelte: Add bottom panel close button [#63128](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63128) - Added bottom panel close button - Added 'text' variant to Button component - Added 'actions' slot to Tabs component - Added Button component stories - svelte: Migrate repo sidebar toggle button to use lucide icon [#63129](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63129) - bug: update hard coded consts [#63133](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63133) - tmp process: update release consts to 5.4.5099 - Reapply "gitserver(client): Reintroduce 500 maximum connections limit" [#63134](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63134) - scim: Fix user updates when SCIM was previously enabled [#63135](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63135) - enterprise-portal: rename "scope" to "permission" for query RPC [#63137](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63137) - enterprise-portal: init database schema and handler store [#63139](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63139) - Svelte: allow popovers to have external targets [#63141](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63141) - feat/enterprise-portal: rudimentary audit logging [#63142](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63142) - build: fixup custom eslint test rule after bump to rules_js 2 [#63143](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63143) - Remove references to 'rate-limits-exceeded-for-testing' feature flag [#63144](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63144) - security: Auto-update package lockfiles for Sourcegraph base images [#63145](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63145) - Svelte: fix tests [#63146](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63146) - gitserver: Remove comment about error checking [#63147](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63147) - Adds stubs for usage connection resolver [#63156](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63156) - feat/enterprise-portal: return all attributes, even when access is disabled [#63159](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63159) - webhooks: Update payload testdata and type for Bitbucket Server push events [#63161](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63161) - fix/enterprise-portal: ignore empty hashes for Cody Gateway access tokens [#63162](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63162) - feat(cody-gateway): add Google Gemini stable models to allowed models [#63163](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63163) - feat/msp/runtime: PG_QUERY_LOGGING=true for local dev query logging [#63164](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63164) - MSP runtime users can now set `PG_QUERY_LOGGING=true` to dump queries and arguments from database interactions at `DEBUG` level in local dev. - msp: encode commit_message as base64 [#63165](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63165) - Cody Gateway: Add support for Google non-streaming endpoint [#63166](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63166) - Svelte: add Cody upsell banner [#63167](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63167) - chore/cody-gateway: instrument removeUnseenTokens [#63169](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63169) - Svelte: add footer links for dotcom [#63170](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63170) - chore/otel-collector: upgrade to v0.103.0, remove jaegerexporter [#63171](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63171) - OpenTelemetry Collector: Upgraded OpenTelemetry Collector to v0.103.0 - OpenTelemetry Collector: The [deprecated ](https://github.com/open-telemetry/opentelemetry-specification/pull/2858). Users of `exporter: { jaeger: ... }` in the OpenTelemetry Collector should use `exporter: { otlp/jaeger: ... }` to send traces directly to Jaeger via its OTLP receiver. - Users of the default Jaeger configurations now need to provide `JAEGER_OTLP_GRPC_PORT` as well as the existing `JAEGER_HOST` configuration. - Cody Gateway: handle streams with trailing newline in Gemini response [#63172](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63172) - enterprise-portal: implement basic MSP IAM and RPCs [#63173](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63173) - Fix: auth issues with Sourcegraph VSCode extension [#63175](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63175) - Entering the URL and access token in the UI now works - no more manual editing of `settings.json` - Adds a search client to the codenav service [#63180](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63180) - feat(search/svelte): Support more file icons [#63181](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63181) - dotcom: fix issue with dotcom emails [#63183](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63183) - fix(search/svelte): Hide diff view when closing bottom panel [#63184](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63184) - Extend instructions for running CG locally [#63186](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63186) - enterprise-portal: temporarily disable local DB migrate [#63187](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63187) - SSC: Fix "Make admin" and "Revoke admin" button actions [#63188](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63188)fix(plg): fixed "Make admin" and "Revoke admin" button actions - Resolve syntactic symbol at request range [#63189](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63189) - SSC: Fix checkout links [#63190](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63190)fix(plg): make upgrade links point to the right pages for Teams & Invites - [Svelte]: Fix standard click-based popover flow [#63192](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63192) - Fix: querying event logs breaks when "id" column value > int32 [#63193](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63193) - Address "value out of range" errors when querying the event logs - sg: cloud eph - improve missing tag/version message [#63195](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63195) - sg - improve messaging when an image is missing from Cloud ephemeral registry - Adds function to find candidate occurrences via search [#63196](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63196) - webhooks: Add support for secrets for Bitbucket Cloud [#63198](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63198) - context: detect if README is required [#63199](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63199) - sg: cloud eph - set max deployment name [#63202](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63202) - sg - set a max length for cloud ephemeral deployment names - fix/internal/memcmd: fix goroutine leak in linux observer [#63206](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63206)A goroutine leak in the experimental linux memory observation logic has been fixed. - feat/internal/memcmd: ignore context cancellation errors from Stop() [#63208](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63208) - Slightly improve logspam from Linux memory observation logic by ignoring context cancellation errors that occur when the user explicitly stopped the observer. - Use 8B version of llama3 in metadata generation [#63212](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63212) - fix/internal/memcmd: close the explicit stop channel before cancelling context [#63214](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63214)This PR fixes a logspam bug in the linux memory observer that was due to do slightly faulty synchronizzation logic. - internal: make adding EventsStore middleware easier [#63216](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63216) - Codenav: use new occurrences API for symbol definitions [#63217](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63217) - Svelte: remove v1 telemetry [#63220](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63220) - Svelte: use Inter font for --font-family-base [#63221](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63221) - Proof-of-concept for Intent detector API [#63228](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63228) - Add unit test for saml requests with multiple certs [#63229](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63229) - chore(search/svelte): Remove dependencies on barrel files to speed up dev build [#63230](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63230) - PLG: Allow users who are already on a team accept invites [#63231](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63231) - Svelte: use Roboto Mono as monospace font [#63247](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63247) - Chore: disable flaky tests [#63251](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63251) - Svelte: implement keyboard shortcut design [#63253](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63253) - Svelte: add repo header dropdown menu [#63257](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63257) - fix(cody-gateway): Improve prompt and request validation for gemini [#63258](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63258) - Filters candidate matches against syntactic SCIP documents [#63268](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63268) - PLG: encode URL search params [#63275](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63275) - Chore: update goldmark [#63276](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63276) - Cody Gateway: add gemini model to code completion list [#63278](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63278) - Adding Anthropic messages API support to the Google provider through Google vertex [#63282](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63282) - adding deepseek and lang specific mixtral for completions ab experiment [#63283](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63283) - Wraps up syntactic usages in resolvers [#63285](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63285) - fix(cody-gateway): Disable flagging Google requests [#63295](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63295) - Svelte: fix sidebar icon alignment [#63296](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63296) - fix/graphql/database: make count of failed user permissions syncs ignore soft deleted users [#63297](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63297) - The failed user permission sync count on the permission dashboard now properly ignores syncs from deleted users (which is the expected behavior). - fix/graphql/database: fix repo permission sync count to ignore soft deleted repositories [#63298](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63298) - The failed repository permission sync count on the permission dashboard now properly ignores syncs from deleted repository (which is the expected behavior). - feature/internal/database: add test to ensure that not found errors fulfiill errcode.NotFound [#63299](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63299) - Added unit tests to ensure that the database userNotFound and RepositoryNotFound error types fulfuill the errcode.NotFound interface. - Context: simplify file chunk conversion [#63301](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63301) - fix/frontend/graphql: log and add trace events for all non-not-found errors that occur when fetching permission syncs [#63302](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63302) - Our graphqlAPI now logs and traces any non-not-found errors that occur when fetching permission sync jobs (as opposed to being silently swallowed). - feat(cody gateway): code completion support for Google Gemini Flash models [#63303](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63303)feat(cody gateway): code completion support for Google Gemini Flash models - fix(cody-gateway): Fix Google flagging configuration [#63305](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63305) - fix(cody-gateway): streaming google endpoint [#63306](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63306) - syntax-highlighter: Use camino to make handling utf8 paths nicer [#63311](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63311) - Retry 404 errors from Triton [#63315](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63315) - Minor: update license wording [#63318](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63318) - Svelte: repo header followups [#63319](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63319) - dotcom: Remove on-demand cloning of repositories [#63321](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63321)Dotcom no longer clones repos on demand. - Chore: remove search console [#63322](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63322) - wip: Introduce `cody-gateway-config` tool for generating model configuration [#63324](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63324)NA, this is an initial step. A later PR will elaborate on the exciting new feature this is enabling. - V2-telemetry: Simplify sensitive metadata allowlist to accept feature only [#63325](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63325) - Search: surface pattern type in query input [#63326](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63326) - code monitors: respect default pattern type [#63333](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63333) - Use math/rand/v2 [#63346](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63346) - Cody pro icon was squashed in the upgrade banner [#63356](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63356) - Refactor the 'getModel' callbacks into their own file [#63359](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63359)NA - fix/msp/postgresqlroles: wait for databases to be provisioned [#63362](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63362) - MSP Cloud SQL: Fix race condition between database creation and role grants for the read-only operator access user - skip highlighting large lockfiles on all instances, not just dotcom [#63366](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63366) - Syntax highlighting is disabled on lockfiles (such as `package-lock.json`) because it is CPU-intensive on these large files and very rarely desirable. - allow repo access by default on dotcom [#63367](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63367) - clearer access tokens allow check on dotcom [#63368](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63368) - nix: use go1.22.4 [#63372](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63372) - remove extraneous Cody onboarding steps [#63373](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63373) - Publish images from patch release branches [#63379](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63379) - plg: Make page headers the same style [#63380](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63380) - Improve InviteUsers interface [#63383](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63383) - Cody Gateway: New Claude 3.5 Sonnet model [#63395](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63395)feature(plg): new Claude 3.5 Sonnet model support for Cody Pro users - Search: expose path matches on FileMatch [#63396](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63396) - Exposed the matched ranges of a file path via the GraphQL API - Svelte: Make the byline in the fuzzy finder items bigger [#63398](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63398) - msp: add `GetFloat` to runtime `Env` [#63399](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63399) - fix(cody-gateway): model id for claude 3.5 sonnet [#63400](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63400) - fix(cody-gateway): getAPIURL before transformBody [#63406](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63406) - Search: always respect default pattern type [#63410](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63410) - feat(cody-gateway): add support for Gemini models with context cache [#63413](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63413) - Rename intent API (add chat reference, make the name more idiomatic) [#63416](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63416) - Add language ID to private metadata for v2 codeintel events (for in p… [#63421](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63421) - lib: downgrade GORM to 1.25.6 [#63427](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63427) - "Cody" in navbar not "Cody AI" [#63429](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63429) - In the navbar, Cody is now just "Cody" not "Cody AI". - remove Cody "upsells"—and all Cody links if Cody is disabled [#63430](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63430) - When Cody is disabled in site config (with `"cody.enabled": false`), all links and UI elements about Cody are hidden from all users. Previously, when Cody was disabled, users would see some links informing them about Cody. - remove disabled web UI code for embeddings [#63432](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63432) - remove rule warning about React props spreading [#63433](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63433) - support fast, simple `sg start single-program-experimental-blame-sqs` for local dev [#63435](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63435) - config: Various fixes and updating the naming rules for ModelConfig resource IDs [#63436](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63436) - remove unused CODY_APP esbuild config and entrypoint [#63438](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63438) - remove old and unused Cody search page [#63439](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63439) - remove Code Search upsell from Cody page [#63440](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63440) - scip-syntax: adds strict SCIP symbol parsing and formatting [#63443](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63443) - fix(code hosts): Use more deterministic API endpoints for GitHub code host connections [#63445](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63445) - The `"internal"` repositoryQuery for GitHub code host connections now use a more deterministic API that's less susceptible to missing repositories - The `"public"` repositoryQuery for GitHub code host connections now make additional requests to fetch missing repository details, like topics. This fixes an issue where repos added by the `"public"` repositoryQuery would have missing repo details - add back /post-sign-up [#63456](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63456) - Add v2 telemetry infrastructure to browser extensions and native inte… [#63458](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63458) - allow more models to be used in Cody Free [#63459](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63459) - Gateway: forward X-Fireworks-Genie header from client [#63460](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63460) - Search-based usages for new codenav API [#63464](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63464) - chore(code-search): disable codemonitoring dotcom (jscontext) [#63465](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63465) - notebooks: store default pattern type per notebook [#63472](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63472) - Chore: refactoring occurrence indexing [#63473](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63473) - Update free tier limits [#63474](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63474) - Svelte: add debug view for code intel occurrences [#63475](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63475) - Chore: fix repo stars alignment [#63476](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63476) - omit go:embed of big assets from `sg start single-program-experimental-blame-sqs` [#63477](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63477) - fix chopped-off tooltips in code monitor query input [#63478](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63478) - Fixed an issue when creating or editing a code monitor that obscured helpful tooltips in the query editor. - add React key to fragments in code monitoring logs [#63479](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63479) - remove beta labels for code monitoring Slack notifs & logs [#63480](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63480) - Code monitoring Slack notifications, previously in beta, are now GA. This feature lets you post matching code changes to a Slack channel. - Code monitoring logs, previously in beta, are now GA. This feature lets you see the status of and activity related to code monitors to troubleshoot issues with finding results and performing configured actions. - shorter PR template [#63481](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63481) - cloud: add feature flags to show no edit warning [#63484](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63484) - saved searches: use default pattern type [#63487](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63487) - search: fix regexp toggle if regexp is default [#63489](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63489) - Fix azure completions api [#63491](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63491) - Enable new Cody Web by default [#63493](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63493) - msp: split contract into JobContract and ServiceContract [#63494](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63494) - Svelte: improve contrast for file tree guide line [#63495](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63495) - fix/internal/observation: make ErrCollector type threadsafe [#63496](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63496) - Fixed a threadsafety issue in the internal/observation.ErrCollector type - Fix initial context for Cody Web on the repository page [#63497](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63497) - Cody Web: Fix Cody page for signed out users [#63498](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63498) - cloud: update feature flag warning severity [#63499](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63499)n/a - Svelte: rev picker design updates and addition to commits page [#63506](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63506) - oops, fix Cody Web enablement [#63508](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63508) - fix Cody nav link for unauthed dotcom users [#63510](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63510) - looser eslint rules [#63511](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63511) - remove unused CTAs [#63512](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63512) - misc wording and UI tweaks to search contexts pages [#63513](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63513) - make Cody and Code Search global navbar items one-click [#63514](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63514) - Code Search and Cody now are one-click links in the global navbar. Other features are in the new "Tools" menu: search contexts, code monitors, search jobs, and notebooks. Your Cody dashboard is linked from your user menu (in the top right). - Bump `cody-web-experimental` package version [#63525](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63525) - sg: generate github action subscription matrix dynamically [#63526](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63526) - backend: Introduce a basic utils package for appliance sourcegraph upgrades [#63529](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63529) - link to Cody chat on the web from the Cody manage page [#63530](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63530) - feature: Data types for encoding LLM Model config via Sourcegraph site config [#63533](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63533) - release: resource def jaeger [#63534](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63534) - release: resource def grafana [#63535](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63535) - scip-syntax: implements parallel processing for workspace and tar commands [#63536](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63536) - add LazyQueryInputFormControl, remove duplicated common pattern [#63537](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63537) - fetch User.id to suppress GraphQL cache warning [#63538](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63538) - fix(sg/bazel-do): use ci.sourcegraph.bazelrc with bazel-do [#63545](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63545) - sg - ensure bazel-do invocations use the ci sourcegraph bazelrc - (chore)analytics: consistent naming of web code copied events [#63550](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63550) - update config for workflows 5.10 [#63554](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63554) - chore(search) VSCode Search extension: Update README and CHANGELOG [#63562](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63562) - perf(scip-syntax): uses the same parse tree for globals and locals [#63564](https://github.com/sourcegraph/sourcegraph-public-snapshot/pull/63564) - make ` # Sourcegraph Releases

This page displays the release plan of all Sourcegraph versions, including deprecation schedules, links to relevant release notes, and installation links.

Sourcegraph releases new features and bug fixes via feature and patch releases regularly. We support the two most recent major releases of Sourcegraph ([more details here](https://www.notion.so/Sourcegraph-Releases-eee2a5384b0a4555adb51b439ddde35f?pvs=21)). See the link to the corresponding release notes for more information on each release. For more information about the release process, please see our [Sourcegraph releases process documentation](https://www.notion.so/Sourcegraph-Releases-eee2a5384b0a4555adb51b439ddde35f?pvs=21). ## Supported Releases Currently supported versions of Sourcegraph: | **Release** | **General Availability Date** | **Supported** | **Release Notes** | **Install** | |--------------|-------------------------------|---------------|--------------------------------------------------------------------|------------------------------------------------------| | 6.1 Patch 4 | March 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v614020) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.1 Patch 3 | March 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v612889) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.1 Patch 2 | February 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v611295) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.1 Patch 1 | February 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v61376) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.1 Patch 0 | February 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v610) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.0 Patch 1 | February 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v602687) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 6.0 Patch 0 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v600) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 5 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5116271) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 4 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5114013) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 3 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5114013) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 2 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5113601) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 1 | January 2025 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5112732) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.11 Patch 0 | December 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5110) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.10 Patch 3 | December 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5103940) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.10 Patch 2 | December 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5102832) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.10 Patch 1 | December 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5101164) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.10 Patch 0 | November 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5100) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.9 Patch 3 | November 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v591590) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.9 Patch 2 | November 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v59347) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.9 Patch 1 | November 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5945) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.9 Patch 0 | October 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v590) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.8 Patch 1 | October 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v581579) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.8 Patch 0 | October 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v580) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.7 Patch 1 | September 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v572474) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.7 Patch 0 | September 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v570) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.6 Patch 2 | August 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v562535) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.6 Patch 1 | August 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v56185) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.6 | August 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v560) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.5 | July 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v553956) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.4 | May 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v547765) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.3 | February 2024 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v5312303) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.2 | October 2023 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v527) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.1 | June 2023 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v519) | [Install](https://sourcegraph.com/docs/admin/deploy) | | 5.0 | March 2023 | ✅ | [Notes](https://sourcegraph.com/docs/technical-changelog#v506) | [Install](https://sourcegraph.com/docs/admin/deploy) | ## Deprecated Releases These versions fall outside the release lifecycle and are not supported anymore: | **Release** | **General Availability Date** | **Supported** | **Release Notes** | |-------------|-------------------------------|---------------|-------------------------------------------------------------------------------------------------| | 4.5 | February 2023 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v451) | | 4.4 | January 2023 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v442) | | 4.3 | December 2022 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v431) | | 4.2 | November 2022 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v421) | | 4.1 | October 2022 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v413) | | 4.0 | September 2022 | ❌ | [Notes](https://sourcegraph.com/docs/technical-changelog#v401) | | 3.43 | August 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3432) | | 3.42 | July 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3422) | | 3.41 | June 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3422) | | 3.40 | May 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3402) | | 3.39 | April 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3391) | | 3.38 | March 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3391) | | 3.37 | February 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3391) | | 3.36 | January 2022 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3363) | | 3.35 | December 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3352) | | 3.34 | November 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3352) | | 3.33 | October 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3332) | | 3.32 | September 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3321) | | 3.31 | August 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3321) | | 3.30 | July 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3321) | | 3.29 | June 2021 | ❌ | [Notes](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/main/CHANGELOG.md#3321) |
# Legacy Versions

This page displays the docs for legacy Sourcegraph versions less than 5.1

- [6.1](https://6.1.sourcegraph.com) - [6.0](https://6.0.sourcegraph.com) - [5.11](https://5.11.sourcegraph.com/docs) - [5.10](https://5.10.sourcegraph.com/) - [5.9](https://5.9.sourcegraph.com/) - [5.8](https://5.8.sourcegraph.com/) - [5.7](https://5.7.sourcegraph.com/) - [5.6](https://5.6.sourcegraph.com/) - [5.5](https://5.5.sourcegraph.com/) - [5.4](https://5.4.sourcegraph.com/docs) - [5.3](https://5.3.sourcegraph.com/) - [5.2](https://5.2.sourcegraph.com/) - [5.1](https://docs.sourcegraph.com/@5.1/) - [5.0](https://docs.sourcegraph.com/@5.0/) - [4.5](https://docs.sourcegraph.com/@4.5/) - [4.4](https://docs.sourcegraph.com/@4.4/) - [4.3](https://docs.sourcegraph.com/@4.3/) - [4.2](https://docs.sourcegraph.com/@4.2/) - [4.1](https://docs.sourcegraph.com/@4.1/) - [4.0](https://docs.sourcegraph.com/@4.0/) - [3.43](https://docs.sourcegraph.com/@3.43/) - [3.41](https://docs.sourcegraph.com/@3.41/) - [3.40](https://docs.sourcegraph.com/@3.40/) - [3.39](https://docs.sourcegraph.com/@3.39/) - [3.38](https://docs.sourcegraph.com/@3.38/) - [3.37](https://docs.sourcegraph.com/@3.37/) - [3.36](https://docs.sourcegraph.com/@3.36/) - [3.35](https://docs.sourcegraph.com/@3.35/) - [3.34](https://docs.sourcegraph.com/@3.34/) - [3.32](https://docs.sourcegraph.com/@3.32/) - [3.31](https://docs.sourcegraph.com/@3.31/) - [3.30](https://docs.sourcegraph.com/@3.30/) - [3.29](https://docs.sourcegraph.com/@3.29/) - [3.28](https://docs.sourcegraph.com/@3.28/) - [3.27](https://docs.sourcegraph.com/@3.27/) - [3.26](https://docs.sourcegraph.com/@3.26/) - [3.25](https://docs.sourcegraph.com/@3.25/) - [3.24](https://docs.sourcegraph.com/@3.24/) - [3.23](https://docs.sourcegraph.com/@3.23/) - [3.22](https://docs.sourcegraph.com/@3.22/) - [3.21](https://docs.sourcegraph.com/@3.21/)
Sourcegraph is a Code Intelligence platform that deeply understands your code, no matter how large or where it’s hosted, to power modern developer experiences. - **Cody**: Use Cody our AI code assistant to read, write, and understand your entire codebase faster - **Code search:** Search through all of your repositories across all branches and all code hosts - **Code intelligence:** Navigate code, find references, see code owners, trace history, and more - **Fix & refactor:** Roll out and track large-scale changes and migrations across repos at once ## Quickstart ## Main Features Some of the main Sourcegraph features include: | **Feature** | **Description** | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | **Cody** | Cody is a free AI coding assistant that writes, fixes, and maintains your code | | **Code Navigation** | Jump-to-definition, find references, and other IDE-like code browsing features on any branch, commit, or PR/code review | | **Code Insights** | Reveal high-level information about your codebase at its current state and over time, to track migrations, version usage, vulnerability remediation, ownership, and more | | **Batch Changes** | Make large-scale code changes across many repositories and codehosts | | **Integrations** | With code hosts, code review tools, editors, web browsers, etc. | | **Notebooks** | Pair code and markdown to create powerful live and persistent documentation | ## What's New Stay in sync and get the latest news on Sourcegraph products, technologies, and culture. [Read the blog →](https://sourcegraph.com/blog) ## Join our Community If you have questions about anything related to Sourcegraph, you're always welcome to ask our in our [Sourcegraph community forum](https://community.sourcegraph.com), [Discord](https://discord.gg/s2qDtYGnAE), and [X](https://twitter.com/sourcegraph). # Sourcegraph Tutorials

Explore to learn more about Sourcegaph tutorials and guides.

## Find Your Way Around Sourcegraph | Topic | Content Type | Description | | ---------------------------------------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [Sourcegraph 101](/getting-started/) | Explanation | What is Sourcegraph? Who should use it? Why do I need it? What does it do? | | [High Level Product Demo](https://www.youtube.com/watch?v=Kk1ea2-l8Hk) | Explanation (video) | A short 3-minute video describing what Sourcegraph is and how it can be useful. | | [Navigating the Sourcegraph UI](https://www.youtube.com/watch?v=6K7e74a7aC4) | Tutorial (video) | Take a look at how you can read code, find references, troubleshoot errors, gain insight, and make changes on a massive scale in Sourcegraph. | ## Get Started Searching | Topic | Content Type | Description | | -------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Three Types of Code Search](https://www.youtube.com/watch?v=-EGn_-2d9CQ) | Tutorial (video) | Code search is a vital tool for developers. It's great for digging up answers to questions from your own codebase, but it's even better for exploring and understanding code. This video will show you the types of code search we have on Sourcegraph. | | [Understanding Code Search Results](https://www.youtube.com/watch?v=oMWdYfG6-DQ) | Tutorial (video) | In this video, you'll understand the search results page and how to scope, export, save, and link to search results. | | [Basic Code Search Filters](https://www.youtube.com/watch?v=h1Kw0Wd9qZ4) | Tutorial (video) | In this video, you'll learn how to use Sourcegraph's code search filters and how they work. Filters are a great way to narrow down or search for specific code. This video covers language, repo, branch, file, and negative filters. | | [Search Query Syntax](/code-search/queries) | Reference | This page describes search pattern syntax and filters available for code search | ## More Advanced Searching | Topic | Content Type | Description | | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Search Subexpressions](/code-search/working/search_subexpressions) | Tutorial | Search subexpressions combine groups of filters like `repo:` and operators like `AND` & `OR`. Compared to basic examples, search subexpressions allow more sophisticated queries. | | [Regular Expression Search Deep Dive](https://about.sourcegraph.com/blog/how-to-search-with-sourcegraph-using-regular-expression-patterns) | Tutorial | Regular expressions, often shortened as regex, help you find code that matches a pattern (including classes of characters like letters, numbers and whitespace), and can restrict the results to anchors like the start of a line, the end of a line, or word boundary. | | [Structural Search Tutorial ](https://about.sourcegraph.com/blog/how-to-search-with-sourcegraph-using-structural-patterns) | Tutorial | Structural search helps you search code for syntactical code patterns like function calls, arguments, `if...else` statements, and `try...catch` statements. It's useful for finding nested and recursive patterns as well as multi-line blocks of code. | | [Structural Search Tutorial ](https://youtu.be/GnubTdnilbc) | Tutorial (video) | Structural search helps you search code for syntactical code patterns like function calls, arguments, `if...else` statements, and `try...catch` statements. It's useful for finding nested and recursive patterns as well as multi-line blocks of code. | ## Cody | Topic | Content Type | Description | | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Product Tour is VSCode](https://www.youtube.com/watch?v=OTIYXUwAQtI&t=6s) | Tutorial (video) | A video tutorial walkthrough of Cody in VSCode. | |[Cody Admin Training](https://www.youtube.com/watch?v=_Xwr7YlfTt0) | Tutorial (video) | A video tutorial explaining Cody administrative functionality.| |[Cody Tutorial in VS Code](/cody/use-cases/vsc-tutorial) | Tutorial (written) | A single documentation page with animated .gifs, demonstrating Cody features in VS Code | ## Code Navigation | Topic | Content Type | Description | | ----------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------- | | [Introduction to Code Navigation](/code-search/code-navigation/) | Explanation | There are 2 types of code navigation that Sourcegraph supports: search-based and precise. | | [Code Navigation Features](/code-search/code-navigation/features) | Explanation | An overview of Code Navigation features, such as "find references", "go to definition", and "find implementations". | ## Code Insights | Topic | Content Type | Description | | ------------------------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------- | | [Code Insights Overview](https://www.youtube.com/watch?v=HdQIFuUzGFI) | Explanation (video) | Learn about common Code Insights use cases and see how to create an insight. | | [Quickstart Guide](/code_insights/quickstart) | Tutorial | Get started and create your first code insight in 5 minutes or less. | | [Common Use Cases](/code_insights/references/common_use_cases) | Reference | A list of common use cases for Code Insights and example data series queries you could use. | ## Batch Changes | Topic | Content Type | Description | | ----------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | [Introduction to Batch Changes](/batch-changes/) | Explanation | A basic introduction to the concepts, processes, and supported environments behind Batch Changes | | [Get Started With Batch Changes](https://www.youtube.com/watch?v=GKyHYqH6ggY) | Tutorial (video) | Learn how you can quickly use Sourcegraph Batch Changes to automate small and large-scale code changes server-side. | | [Batch Changes Quickstart Guide](/batch-changes/quickstart) | Tutorial | Get started and create your first batch change in 10 minutes or less. This guide follows the local (CLI) method of running batch changes. | | [Getting Started Running Batch Changes Server-Side](/batch-changes/server-side) | How-To-Guide | Follow this guide to learn how to run batch changes server-side. | ## The Sourcegraph API | Topic | Content Type | Description | | ---------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [GraphQL API](/api/graphql/) | Reference | The Sourcegraph GraphQL API is a rich API that exposes data related to the code available on a Sourcegraph instance. | | [GraphQL Examples](/api/graphql/managing-search-contexts-with-api) | Reference | This page demonstrates a few example GraphQL queries for the Sourcegraph GraphQL API. | | [Streaming API](/api/stream_api/) | Reference | With the Stream API you can consume search results and related metadata as a stream of events. The Sourcegraph UI calls the Stream API for all interactive searches. Compared to our GraphQL API, it offers shorter times to first results and supports running exhaustive searches returning a large volume of results without putting pressure on the backend. | ## Search Notebooks | Topic | Content Type | Description | | --------------------------------------------------------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------- | | [Search Notebooks Quickstart Guide](/notebooks/quickstart) | Tutorial | Notebooks enable powerful live–and persistent–documentation, shareable with your organization or the world. | ## Customizing Your Sourcegraph User Environment | Topic | Content Type | Description | | ------------------------------------------------------------------------------------------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Using Sourcegraph with your IDE](/integration/editor) | How-To-Guide | Sourcegraph’s editor integrations allow you search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. We have built-in integrations with VS Code and JetBrains. | | [Using the Sourcegraph Browser Extension](/integration/browser_extension/) | How-To-Guide | The open-source Sourcegraph browser extension adds code navigation to files and diffs on GitHub, GitHub Enterprise, GitLab, Phabricator, Bitbucket Server and Bitbucket Data Center. | | [Using the Sourcegraph CLI](/cli/quickstart) | How-To-Guide | `src` is a command line interface to Sourcegraph that allows you to search code from your terminal, create and apply batch changes, and manage and administrate repositories, users, and more. | | [Saving Searches](/code-search/working/saved_searches) | How-To-Guide | Saved searches let you save and describe search queries so you can easily find and use them again later. You can create a saved search for anything, including diffs and commits across all branches of your repositories. | | [Search Contexts](/code-search/working/search_contexts) | How-To-Guide | Search contexts help you search the code you care about on Sourcegraph. A search context represents a set of repositories at specific revisions on a Sourcegraph instance that will be targeted by search queries by default. | ## Developer Use Cases | Topic | Content Type | Description | | ------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | [Writing Faster Code with Code Search and Cody](https://www.youtube.com/watch?v=vHyTgqGL41U) | Tutorial (video) | A video tutorial of how Sourcegraph can help you write code faster. | | [Generate Unit Tests](https://www.youtube.com/watch?v=FsiQMory2jI) | Tutorial (video) | A video tutorial of how to write unit tests with Cody. | | [Understand scope and impact of a code change](https://www.youtube.com/watch?v=gafdZDhSrws) | Tutorial (video) | A video tutorial of how to understand the scope and impact of a change you're considering to your codebase. |
# Sourcegraph Accounts [Sourcegraph Accounts](https://accounts.sourcegraph.com) is the centralized accounts system for all of the Sourcegraph-operated services, it provides Single Sign-On (SSO) experience for our users. The system is designed to be and operated with high-security standards to protect Personally Identifiable Information (PII), secure third-party credentials storage, abuse mitigation, and gated infrastructure access. ## FAQs ### Do Sourcegraph Enterprise users use Sourcegraph Accounts? No, Sourcegraph Enterprise users (both on Cloud and on-prem) **do not** use Sourcegraph Accounts. They continue using the SSO capability built into the Sourcegraph application. ### Do users need to recreate accounts if they previously had accounts on Sourcegraph.com? No, all of the existing Sourcegraph.com user accounts have been migrated to Sourcegraph Accounts, users should be able to use the same password (if had set) and social sign-in options (Google, GitHub, and GitLab) to sign in to Sourcegraph Accounts and get access to the same account on Sourcegraph.com. Users who had attempted to create an account but never verified their primary emails on Sourcegraph.com were not migrated. ### How to change, set or reset passwords? 1. Make sure to stay signed out on https://accounts.sourcegraph.com. 1. Visit https://accounts.sourcegraph.com/reset-password to complete the password reset. 1. Upon successful password reset, the current session is automatically signed in. ### How to delete accounts or unlink social sign-ins? Please contact Sourcegraph Support via emailing at `support@sourcegraph.com` using your primary email (shown in the https://accounts.sourcegraph.com when signed in). ### How to learn more about the technical details? For Sourcegraph teammates and whoever is interested in, please refer to [Sourcegraph Handbook](https://handbook.sourcegraph.com/departments/engineering/teams/core-services/sams/) for more technical details. ### What is Cloudflare Turnstile? [Cloudflare Turnstile](https://www.cloudflare.com/products/turnstile/) is used for application-level DDoS protection to ensure uninterrupted experience for regular users. # SLAs and Premium Support

This document explains the Sourcegraph's default contractual Service Level Agreements and Premium Support Offerings.

## Service Level Agreements (SLAs) Our service level agreements (SLAs) are designed for products that are generally available and exclude [beta and experimental features](/admin/beta_and_experimental_features). SLA response times indicate how quickly we aim to provide an initial response to your inquiries or concerns. Our team will resolve all issues as quickly as possible. However, it's important to understand that SLA times differ from guaranteed resolution times. While we always strive to respond to your issues as quickly as possible, our SLAs are specifically applicable from Monday through Friday. The following policy applies to both our cloud-based (managed instance) and on-premise/self-hosted Sourcegraph customers: ## For enterprise plans | Severity level | Description | Response time | Support availability | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | -------------------- | | 0 | Emergency: Total loss of service or security-related issue (includes POCs) | Within two business hours of identifying the issue | 24x5 (Monday-Friday) | | 1 | Severe impact: Service significantly limited for 60%+ of users; core features are unavailable or extremely slowed down with no acceptable workaround | Within four business hours of identifying the issue | 24x5 (Monday-Friday) | | 2 | Medium impact: Core features are unavailable or somewhat slowed; workaround exists | Within eight business hours of identifying the issue | 24x5 (Monday-Friday) | | 3 | Minimal impact: Questions or clarifications regarding features, documentation, or deployments | Within two business days of identifying the issue | 24x5 (Monday-Friday) | >NOTE: Premium support with enhanced SLAs can be added to your Enterprise plans as an add-on. Our business hours, defined as Sunday 2 PM PST to Friday 5 PM PST, align with our 24x5 support coverage. ### For Enterprise Starter & Cody Pro plans | **Severity level** | **Description** | **Response time** | **Support availability** | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------------- | | 0 | Emergency: Total loss of service or security-related issue | Within one business day of identifying the issue | 8 AM to 5 PM PST (Monday-Friday) | | 1 | Severe impact: Billing issues, login issues | Within one business day of identifying the issue |8 AM to 5 PM PST (Monday-Friday) | | 2 | Medium impact: Core features are unavailable or somewhat slowed; workaround exists | Within two business days of identifying the issue | 8 AM to 5 PM PST (Monday-Friday) | | 3 | Minimal impact: Questions or clarifications regarding features, documentation, or deployments | Within three business days of identifying the issue | 8 AM to 5 PM PST (Monday-Friday) | Cody Free users are not eligible for email Support but can get assistance through our Community Discord. ### Minimum Supported Version for Self-Hosted Instances We support the current major version of the Software and the immediately preceding major version (N minus 1). In situations where a customer is either reluctant or unable to upgrade their product, or if there is no definite timeline for an upgrade, it's important to note that this may significantly impact the level of support we can offer. While we will continue to provide basic support and answer general product questions, our ability to assist in troubleshooting or resolving issues will be limited. This is particularly true for problems that are already addressed in newer versions of our product. Should an issue be definitively resolved by an upgrade, we will inform the customer that upgrading is the necessary course of action. Unfortunately, in such cases, we will be unable to extend further support until the upgrade is completed. In instances where the root cause of a problem is uncertain, but an upgrade could potentially resolve the issue (code host issues and several improvements have been done during the last few releases or we need to bring this issue to Engineering), we will advise to upgrade to N-1 version of our product before continuing to troubleshoot. NOTE: This approach is only for customers that are past the N-1 versions. If within these parameters we may continue to advise to upgrade but will do so with a better understanding of the issue and the probability of it working. ## Sourcegraph cloud SLA (managed instance) >NOTE: Effective: November 14, 2022 — Sourcegraph gives customers a 99.5% uptime commitment on the Business and Enterprise plans. ### Downtime Downtime is the total number of minutes when the Sourcegraph Cloud instance was unavailable during a calendar month. Sourcegraph calculates unavailability using server monitoring software to assess server-side error rates, ping test outcomes, web server evaluations, TCP port examinations, and website tests. It's important to note that, due to the single-tenant architecture of Sourcegraph Cloud, downtime is measured individually for each customer. The following items are not considered as part of downtime: - Slowness or other performance issues specific to individual Sourcegraph features - Issues that are linked to external applications or third-party services, including authentication providers and code hosts - Any products or features labeled as experimental or in beta - External network problems beyond our reasonable control, including connectivity issues involving the client's Internet Service Provider (ISP), Cloudflare, or Google Cloud Platform - Maintenance activities are conducted during Scheduled Downtime. ### Scheduled downtime Scheduled downtime is occasionally required to maintain the proper functioning of your Sourcegraph Cloud instance. In case of such a scheduled downtime, we will provide you with a minimum of 48 hours' advance notice. Please note that the total scheduled downtime will be at most 10 hours in a quarter. ### Uptime commitment Uptime is the percentage of total possible minutes Sourcegraph was available during a calendar month. Our commitment is to maintain at least 99.5% uptime. You can calculate your uptime by using the following formula: ``` [(total minutes in month - Downtime) / total minutes in month] > 99.5% ``` ### Sev 0 - Emergency support scope #### What constitutes a Sev 0 - Emergency? A Severity 0 - Emergency is defined by the following criteria: - The Sourcegraph instance is entirely unavailable or unresponsive for all users. This means the service is inaccessible, and users cannot use any features - Sourcegraph's web user interface displays 4XX or 5XX HTTP error codes on every page. These errors indicate a fundamental problem with the service - All users are unable to log in to the Sourcegraph instance. Authentication is not functioning, preventing user access - A security-related incident poses a significant risk or exposure to the system or data. This may include vulnerabilities, breaches, or other security issues that demand immediate attention to protect the instance and its users #### What is not a Sev 0 - Emergency? A Severity 0 - Emergency typically does not include the following situations: - If only one user is experiencing login issues while most users can still access the system - Performance is slower than usual - Any issues with repository synchronization >NOTE: Custom support agreements apply to Enterprise Plus and Elite customers. Please consult your contract for details regarding custom service-level agreements. ## Sourcegraph Premium Support ### Benefits of Premium Support Purchasing Premium Support provides several of the following services beyond those provided by Sourcegraph's enterprise or enterprise starter support models: - Accelerated Service Level Agreements (SLAs) - Accelerated triaging and queue priority lead to reduced times to resolution. - Elevated Support Expertise - Two named, dedicated senior support engineers possessing deep knowledge and understanding of your specific organization’s setup and tech stack with the ability to assist in the resolution of issues that arise. - Heightened Support via Slack - Faster response times and closer collaboration through direct access to Sourcegraph experts with closer connection to end users and administrators. - More Proactive Collaboration - Hands-on technical guidance to ensure successful migrations, upgrades, and maintenance; early access to new features; quarterly insights reports. ### Premium Support SLAs Premium Support SLAs give customers access to our Support team 24x7 for Severity 0 and 1 issues that critically impact your instance and ability to use Sourcegraph. First response times remain the same according to our SLAs. However, Emergency and Severe Impact issues are supported 24x7 with Premium Support (versus 24x5 without Premium Support). This service is provided for all GA products Sourcegraph offers, not for any [Experimental or Beta features](/admin/beta_and_experimental_features). >NOTE: This package includes access to Slack Support ### Dedicated Support Access to named senior support engineers who will have knowledge of your infrastructure and can help reduce the time needed to triage, diagnose, and resolve an issue in your instance. >NOTE: This package includes access to Slack Support ### Slack Support Slack Support provides access to creating tickets directly from Slack, allowing customers to resolve tickets directly from a familiar interface and allowing for greater collaboration between Support and customers.
# Sourcegraph Pricing Plan Comparison

This page lists a detailed comparison of the features available in each plan.

| **Features** | **Free** | **Enterprise Starter** | **Enterprise** | | -------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | **AI** | | | | | Autocomplete | Unlimited | Unlimited | Unlimited | | Chat messages and prompts | 200/month | Increased limits | Unlimited | | Code context and personalization | Local codebase | Remote codebase (GitHub only) | Remote, enterprise-scale codebases | | Integrated search results | - | ✓ | ✓ | | Prompt Library | ✓ | ✓ | ✓ | | Bring your own LLM Key | - | - | Self-Hosted only | | Auto-edit | - | Beta | Beta | | Aentic chat experience | - | Experimental | Experimental | | **Code Search** | | | | | Code Search | - | ✓ | ✓ | | Code Navigation | - | ✓ | ✓ | | Code Insights | - | - | ✓ | | Code Monitoring | - | - | ✓ | | Batch Changes | - | - | ✓ | | **Deployment** | | | | | Cloud deployment | Multi-tenant | Multi-tenant | Single tenant | | Self hosted option | - | - | ✓ | | Private workspace | - | ✓ | ✓ | | **Admin and Security** | | | | | SSO/SAML | Basic (GH/GL/Google) | Basic (GH/GL/Google) | ✓ | | Role-based access control | - | - | ✓ | | Analytics | - | Basic | ✓ | | Audit logs | - | - | ✓ | | Guardrails | - | - | Beta | | Indexed code | - | Private | Private | | Context Filters | - | - | ✓ | | **Compatibility** | | | | | Code hosts | Local codebase | GitHub | All major codehosts | | IDEs | VS Code, JetBrains IDEs, Visual Studio (Experimental) | VS Code, JetBrains IDEs, Visual Studio (Experimental) | VS Code, JetBrains IDEs, Visual Studio (Experimental) | | Human languages | Many human languages, dependent on the LLM used | Many human languages, dependent on the LLM used | Many human languages, dependent on the LLM used | | Programming languages | All popular programming languages | All popular programming languages | All popular programming languages | | **Support** | | | | | Support level | Community support | Community support | Enterprise support | | Dedicated TA support | - | - | Add-on | | Premium support | - | - | Add-on |
# FAQs

Learn about some of the most commonly asked questions about Sourcegraph.

## What's the difference between Free, Enterprise Starter, and Enterprise plans? Free is best for individuals working on hobby projects. Enterprise Starter is for growing organizations who want Sourcegraph's AI & search experience hosted on our cloud. Enterprise is for organizations that want AI and search across the SDLC with enterprise-level security, scalability, and flexible deployment. ## How are autocompletions counted for the Cody Free plan? Cody autocompletions are counted based on the number of suggestions served to the user in their IDE as ghost text. This includes all suggestions on whether or not the user accepts them. ## How does Sourcegraph's context and personalization work? Cody can retrieve codebase context to personalize responses in several ways. For Free and Pro users, context is retrieved from their local repositories. The Enterprise Starter and Enterprise plans use Sourcegraph's search backend to retrieve context. This method pulls context from a team's full codebase at any scale. ## What forms of support are available for paid plans? Email and web portal support is available to both Enterprise Starter and Enterprise customers, and you can [read more about our SLAs](/sla). Premium support with enhanced SLAs is also available as an add-on for Enterprise customers. ## Can I upgrade or downgrade my plan? Users can upgrade or downgrade between Free and Pro within their account settings anytime. For Pro users, upgrading to Enterprise Starter is also possible, but doing so currently does not cancel your subscription, and you must cancel it yourself. To upgrade to Enterprise, please [contact our Sales team](https://sourcegraph.com/contact/request-info). ## What's the difference between "flexible LLM options" and "bring your own LLM key"? Flexible LLM options: Users can select from multiple options to use for chat. Bring your own LLM key: Enterprise customers can optionally provide their own LLM API key for supported LLMs (including for LLM services such as Azure OpenAI and Amazon Bedrock). In this scenario, customers pay for their own LLM consumption, and we will provide a pricing discount with your plan. ## Does Sourcegraph use my code to improve the models used by other people? For Enterprise and Enterprise Starter customers, Sourcegraph will not train on your company's data unless your instance admin enables fine-tuning, which would customize an existing model exclusively for your use. For Free and Pro users, Sourcegraph may use your data to fine-tune the model you are accessing unless you disable this feature. ## Can Sourcegraph be run fully self-hosted? Sourcegraph requires cloud-based services to power its AI features. For customers looking for a fully self-hosted or air-gapped solution, please [contact us](https://sourcegraph.com/contact/request-info). ## Is an annual contract required for any of the plans? Pro and Enterprise Starter plans are billed monthly and can be paid with a credit card. ## How are active users counted and billed? This only applies to Enterprise contracts. Pro and Enterprise Starter users pay for a seat every month, regardless of usage. ‍A billable user is one who is signed in to their Enterprise account and actively interacts with the product (e.g., they see suggested autocompletions, run commands or chat with Cody, start new discussions, clear chat history, or copy text from chats, change settings, and more). Simply having Cody installed is not enough to be considered a billable user. ## How are active users calculated for Sourcegraph Code Search and Code Intelligence Platform? A billable active Code Search or Code Intelligence Platform user is signed into and accesses Sourcegraph. This includes but is not limited to: - Visiting the Sourcegraph web application or using a browser extension, editor extension, or other client while signed in - Conducting a search in the Sourcegraph UI or extension - Hovering and navigating code in the Sourcegraph UI or extension - Viewing a file or repository in Sourcegraph - Creating, viewing, or receiving a code monitor - Creating, viewing, modifying, or applying a batch change - Creating, viewing, or modifying a code insight - Creating, viewing, or modifying a search notebook ## How is this measured in the product? A user who has accessed a Sourcegraph product is counted as active once they complete an action that represents usage reflected above. User counts and usage metrics are in [Sourcegraph Analytics](../analytics). ## Is my data secure when connected to Code Search? Sourcegraph has security and reliability controls built for the most demanding enterprises. To learn more, see our [Security page](https://sourcegraph.netlify.app/security). ## What if I want AI or Code Search Enterprise only? You can purchase Enterprise plans for AI or Code Search only. [Contact us](https://sourcegraph.com/contact/request-info) to learn more. ## Which code hosts is the Enterprise Starter plan compatible with? The Enterprise Starter plan is currently compatible with GitHub. Its limit for indexing is 100 repositories for search and context. ## What are the limits of the Enterprise starter plan? The Enterprise Starter plan supports up to 50 developers and, alongside a limit of 100 repositories for search and context, also includes 5Gb of storage. Adding additional seats gives you 1GB of additional storage per seat, for a maximum total of 10GB. ## Billing FAQs for Enterprise Starter ## How do I cancel subscription renewal? In the **Workspace settings > Billing** page, you can cancel the subscription and continue having access to your workspace until the end of your current billing period (that is indicated in the UI). ## How do I cancel subscription and delete my workspace immediately? On the **Workspace settings > General settings** page, you can delete your workspace. This will immediately remove access and cancel your subscription. ## How is the subscription renewal dates determined? Your subscription renewals are scheduled to happen on the same day of the month. On shorter months (e.g., day 31 on April, which only has 30 days), the last day of the month will be the subscription renewal day instead. ## How do I pay my invoice if my subscription is past due? After updating or resolving your payment method issue that occurred during the automatic subscription renewal, you may do one of the following to pay the invoice for your past-due subscription: 1. Wait for our system to re-attempt the charge for the invoice. It usually takes up to 24 hours. If it does not happen after 24 hours, please contact [Support](support@sourcegraph.com) to resolve the issue. 1. In the **Workspace settings > Billing** page, click the **View invoices** button, which takes you to the Stripe Customer Portal. Then, pay the invoice there. Our system will reconcile your payment within 24 hours. If it does not reconcile after 24 hours, please contact [Support](support@sourcegraph.com) to resolve the issue. 1. Contact [Support](support@sourcegraph.com) to request re-attempt the charge for the invoice using the payment method on file. ## Are there any refunds for the subscription? We don't offer refunds, but if you have any queries regarding the Enterprise Starter, please write to support@sourcegraph.com, and we'll help resolve the issue.
# Sourcegraph Pricing Plans

Sourcegraph offers three different pricing plans based on your needs.

# Free

Learn about the Sourcegraph's Free plan and the features included.

Sourcegraph's Free plan is designed for hobbyists, and light usage is aimed at users with personal projects and small-scale applications. It offers an AI editor assistant with a generous set of features for individual users, like autocompletion and multiple LLM choices for chat. ## Features The Free plan includes the following features: | **AI features** | **Compatibility** | **Deployment** | **Admin/Security** | **Support** | | ----------------------------------------------------------------------------- | --------------------------------------------------- | ------------------ | ------------------------------------------ | ---------------------- | | Reasonable use autocomplete limits | VS Code, JetBrains IDEs, and Visual Studio | Multi-tenant Cloud | SSO/SAML with basic GitHub, GitLab, Google | Community support only | | Reasonable use chat messages and prompts per month | All popular coding languages | - | - | - | | Multiple LLM selection (Claude 3.5 Sonnet, Gemini 1.5 Pro and Flash) | Natural language search | - | - | - | ## Pricing and billing cycle There is no billing cycle, as it's free to use and supports one user per account. If you exceed your daily limits, you will have to wait until the end of the month to use the feature again. You can upgrade to our Enterprise Starter plan for more advanced features and usage limits. ## Free vs. Enterprise Starter comparison The Enterprise Starter plan provides extended usage limits and advanced features compared to the Free plan. Here's a side-by-side comparison of the two: | **Feature** | **Free** | **Enterprise Starter** | | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Description** | - AI editor assistant for hobbyists or light usage | - AI and search for growing organizations hosted on our cloud | | **Price** | - $0/month
- 1 user | - $19/user/month
- Up to 50 devs | | **AI features** | - Autocompletions
- 200 chat messages and prompts per month
- Multiple LLM choices for chat | - Code autocomplete and chat
- More powerful LLMs for chat (GPT-4o, Claude 3 Opus)
- Integrated search results | | **Code Search features** | N/A | - Code Search
- Symbol Search | | **Deployment types** | - Multi-tenant Coud | - Multi-tenant Cloud
- Private Workspace
- Privately indexed code (100 repos) | | **Compatibility** | - VS Code, JetBrains IDEs, and Visual Studio
- All popular coding languages
Natural language search
- All major code hosts | - VS Code, JetBrains IDEs, and Visual Studio
- All popular coding languages
Natural language search
- Code hosted on GitHub | | **Support** | - Community support only | - 9x5 Support | ## Moving to Enterprise Starter plan From your Sourcegraph dashboard, you can upgrade to the Enterprise Starter by clicking the **Create workspace for my team** button. Enter your workspace name and URL, and choose the number of seats. You can start with a single seat and add more later from the **Users** settings section. Click the **Create workspace** button to navigate to the payment page. Here, you can view your subscription details and enter your payment details for a successful transaction.
# Enterprise

Learn about the Sourcegraph's Enterprise plan and the features included.

Sourcegraph offers multiple Enterprise plan options, including Enterprise Dedicated Cloud (default) and Enterprise Self Hosted (on-request) for organizations and enterprises that need AI and search with enterprise-level security, scalability, and flexibility. ## Features breakdown Here's a detailed breakdown of features included in the different Enterprise plan options. | **Feature** | **Enterprise Dedicated Cloud** | **Enterprise Self Hosted** | | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Description** | - AI and search with enterprise-level security, scalability, and flexibility | - AI and search with enterprise-level security, scalability, and flexibility | | **Price** | - $59/user/month
- 25+ devs | - $59/user/month
- Contact Sales | | **AI features** | - Everything in Enterprise Starter | - Everything in Enterprise Starter
- Bring your own LLM key | | **Code Search features** | - Everything in Enterprise Starter, plus:
- Batch Changes
- Code Insights
- Code Navigation | - Everything in Enterprise Starter, plus:
- Batch Changes
- Code Insights
- Code Navigation | | **Deployment types** | - Single-tenant Coud | - Self- Hosted | | **Compatibility** | - Everything in Enterprise Starter, plus:
- Enterprise admin and security features
- All major code hosts
- Guardrails
- Context Filters | - Everything in Enterprise Starter, plus:
- Enterprise admin and security features
- All major code hosts
- Guardrails
- Context Filters | | **Support** | - 24x5 support with options like:
- TA support
- Premium Support Offerings
- Forward Deployed Engineer (FDE) | - Enterprise support with options like:
- Dedicated TA support
- Premium Support Offerings
- Forward Deployed Engineer (FDE) |
# Enterprise Starter

Learn about the Enterprise Starter plan tailored for individuals and teams wanting private code indexing and search to leverage the Sourcegraph platform better.

The Enterprise Starter plan offers a multi-tenant Sourcegraph instance designed for individuals and teams. It provides the core features of a traditional Sourcegraph instance but with a simplified management experience. This plan provides a fully managed version of Sourcegraph (AI + code search with integrated search results, with privately indexed code) through a self-serve flow. ## Team seats The Enterprise Starter plan is priced at **$19 per month per seat**. You can add or remove team members at any time. Existing Cody Pro users can also sign up for the Enterprise Starter by paying $19 per seat. However, their Cody Pro subscription will neither be upgraded nor canceled. Instead, they will have two live subscriptions. ## Enterprise Starter team roles The Enterprise Starter plan includes the following team-level roles: - **Admin**: Has full access to the workspace, including the ability to manage repos, users, billing, and settings - **Member**: Can access repositories in the workspace and use the supported features ## Billing Workspaces on the Enterprise Starter plan are billed monthly based on the number of team seats purchased. In case of overdue or failing payment, there is a grace period during which the workspace admins will receive a daily notification to complete the transaction. If you fail to make the payment after the grace period, your workspace will be deleted, and you will not be able to recover your data. Please also see [Billing FAQs](billing-faqs.mdx) for more FAQs, including how to downgrade Enterprise Starter. ## Features supported The Enterprise Starter plan supports a variety of AI and search-based features like: | **AI features** | **Code Search** | **Management** | **Support** | | -------------------------------------- | ------------------------------ | --------------------------------------------------------- | ------------------------- | | Code autocompletions and chat messages | Indexed Code Search | Simplified admin experience with UI-based repo-management | Support with limited SLAs | | Powerful LLM models for chat | Indexed Symbol Search | User management | - | | Integrated search results | Searched based code-navigation | GitHub code host integration | - | | Cody integration | - | - | - | ## Limits Sourcegraph Enterprise Starter offers the following limits: - Max 50 users per workspace - Max 100 repos per workspace - Starts with 5 GB of storage - 1 GB storage per seat added - 10 GB max total storage ## Workspace settings After creating a new workspace, you can switch views between your personal and workspace accounts. You can configure different **Workspace settings**. These include options for: - **General Settings**: Helps you configure how your workspace is described or accessed with options like workspace name, URL, and deleting the workspace - **Users**: Manage permissions, assign seats, or invite new users - **Billing**: Manage your monthly billing cycle for all your purchased seats - **Repository Management**: Add, remove, and view the status of your connected repositories - **User settings**: Navigates you to your personal account's settings ![workspace-settings](https://storage.googleapis.com/sourcegraph-assets/Docs/workspace-settings-125.jpg) ## Getting started with workspace A workspace admin can invite new members to their workspace using their team member's email address. Once the team member accepts the invitation, they will be added to the workspace and assigned the member role. Next, the member is asked to connect and authorize the code host (GitHub) to access the private repositories indexed in your Sourcegraph account. If you skip this step, the member won't be able to access any of the private repositories they have access to. However, they can still use the public search via the Sourcegraph code search bar. ![member-authorization](https://storage.googleapis.com/sourcegraph-assets/Docs/member-authorization.jpg) ## Repository Management From the Repository Management settings, workspace admins can configure various settings for connecting code hosts and indexing repositories in their workspace. You can index up to 100 repos per workspace. ![repo-management](https://storage.googleapis.com/sourcegraph-assets/Docs/repo-management.jpg) From here, you can: - Use the public code search to add and index open source repos in your workspace - Add multiple organizations to index private repos When you add a new organization, you must authorize access and permission for all repositories or selected ones. To index a repository from your organization, - Click and select it from the repository list - Next, from the search bar, type the repo name you are looking for - Click it to add the repository to your workspace - The status of the repos will change to **TO BE ADDED** in the right sidebar with a **Save Changes** button - Next, the repo gets a **QUEUED** status, and it takes some time to process - Finally, it gets indexed with a **CLONED** status As you add more repos, you get logs for the number of repos added, storage used, and their status. To remove any repo from your workspace, click the repo name that changes the repo status **TO BE REMOVED**. Click the **Save Changes** button to confirm it. ![repo-list](https://storage.googleapis.com/sourcegraph-assets/Docs/repo-list.jpg)
# Code ownership This feature is in beta. Code ownership is aimed at helping find the right person and team to contact, for any question, at any time. We are starting out with code ownership, ownership inference and assignments and are exploring ways to help you find someone to answer _every_ question. ## Enabling code ownership Code ownership is enabled by default. If you like to disable it from being shown in the UI, you can create the feature flag `enable-ownership-panels` and set it to `false`: - Go to **Site-admin > Feature flags** - If the feature flag `enable-ownership-panels` doesn't yet exist, click **Create feature flag** - Under **Name**, put `enable-ownership-panels` - For **Type** select **Boolean** - And set **Value** to **False** - Click **Create flag** ## Concepts **Owner**: An owner is defined as a person or a team in Sourcegraph. A _person_ can be: - a Sourcegraph user which we were able to resolve from the `CODEOWNERS` handle or email, in which case we link to their profile. - an unknown user for which we were unable to resolve a profile, in which case we will return the `CODEOWNERS` data we have. A _team_ is a group of Sourcegraph users represented by a common handle, which is a new feature that we added. [Read more about how to manage teams in Sourcegraph](/admin/teams/). ## Code ownership Code ownership is set in 2 different ways: - [The `CODEOWNERS` format](/own/codeowners_format) - [Assigned ownership](/own/assigned_ownership) ## Limitations - Code ownership support has been released as an MVP for 5.0. In the future of the product we intend to infer ownership beyond `CODEOWNERS` data. - The feature has not been fully validated to work well on large repositories or large `CODEOWNERS` rulesets. This is a future area of improvement, but please contact us if you run into issues. ## Browsing ownership The ownership information is available for browsing once ownership data is available through [a `CODEOWNERS` file](#code-ownership). When displaying a source file, there is a bar above the file contents. - On the left-hand side, it displays the most recent change to the file. - On the right-hand side it displays the code ownership bar with at most 2 file owners. Any additional number of owners is also displayed. ![File view showing code ownership bar on the right hand side above the file contents](https://storage.googleapis.com/sourcegraph-assets/docs/own/blob-view.png) After clicking on the code ownership bar, a bottom panel appears listing all the owners. ![File view with the ownership tab selected in the bottom panel](https://storage.googleapis.com/sourcegraph-assets/docs/own/blob-view-panel.png) There is always a single rule in a `CODEOWNERS` file that determines ownership (if any). Each owner listed in the bottom panel has a description found by clicking the collapsible arrow: _Owner is associated with a rule in a `CODEOWNERS` file_. Clicking this description links to the line containing the responsible rule in the `CODEOWNERS` file. If any email information has been found for the owner, clicking the mail icon will start an email to them. ## Ownership search ### Searching for files with owners Code ownership is a first-class citizen in search. Ownership can be either a query input or a search result: - `file:has.owner(user@example.com)` keeps only the search results associated with given user (here referred to by e-mail). - `-file:has.owner(@username)` removes all results owned by specific user (here referred to by name). Ownership predicate can also be used without parameters: -`file:has.owner()` will only include files with an owner assigned to them. -`-file:has.owner()` will only include files without an owner. When performing a search the `select:file.owners` predicate will return the owners for the result of that search. For instance one can find all the owners of TypeScript files in a given repository by using `repo:^github\.com/sourcegraph/sourcegraph$ lang:TypeScript select:file.owners`. ### Find commits in given release for given owner To find all commits between versions `5.0` and `5.1` made by `sourcegraph/own` team, the following query could be used: `repo:^github\.com/sourcegraph/sourcegraph$@5.1:^5.0 type:commit file:has.owner(sourcegraph/own)` Same query can be run for any owner (a person or a team). ## Further reading In order to learn more please check out our references: - [CODEOWNERS format](/own/codeowners_format) - Guide to using the CODEOWNERS file format to define ownership - [Configuration](/own/configuration_reference) - Full list of ownership configuration options # Configuration reference ## Ownership signals and background compute Ownership signals are used to guide the assignment of ownership. These are: * **Recent contributors signal** counts files modified by commits in the last 90 days. * **Recent views signal** counts file views within Sourcegraph in the last 90 days. Both of these signals are computed by background tasks. The values of signals are aggregated and bubble up the file tree. That is, for the Ownership data displayed `/a/` directory, all descendant file signals contribute. For instance contributions and views of `/a/b/c.go`. The **Site admin > Code graph > Ownership signals** page allows enabling and disabling each signal individually. These need to be explicitly enabled by site admin in order for signals to surface in the UI. ![Site admin ownership configuration page](https://sourcegraphstatic.com/own-signals-configuration-dark.png) ### Repository filtering In some cases ownership signals need to be disabled for specified repositories: * Ownership signals are not desired for certain repositories. * Computing signals is expensive due to size of some repositories. **Exclude repositories** section under each signal in **Site admin > Code graph > Ownership signals** allows to match repositories to exclude from computing ownership signals. Materialized list of excluded repositories is displayed for feedback. ![Site admin ownership configuration page](https://sourcegraphstatic.com/own-signals-exclude-dark.png) ## Analytics In order to measure how many files have owners, Sourcegraph exposes analytics through **Site admin > Analytics > Own**. These present percentage of files that have: * Any ownership associated, * assigned ownership (through the UI), * ownership via matching rule in CODEOWNERS file. Analytics data is computed periodically. The background process for computing analytics data has to be enabled explicitly through **Site admin > Code graph > Ownership signals**. This is because the process can become computationally expensive. ## Assigned ownership access control In order to grant users the ability to assign ownership, please use [ownership permission](/admin/access_control/ownership) in role-based access control. This is a coarse-grained permission, allowing users to assign ownership throughout the instance. At this point there is no finer-grained ownership assigning access control. ## Disabling ownership in the UI Ownership data is displayed in various places in Code search user interface, among others: * in a card on repository and directory pages, * in a top bar on file page. If needed, the visibility of ownership data embedded in Code search UI can be disabled by creating a boolean feature flag `enable-ownership-panels` and setting its value to `false`. # Codeowners ingestion This feature is in beta. Code ownership allows you to surface ownership data using `CODEOWNERS` files. This is done automatically if there is a committed `CODEOWNERS` file in your repository at any of the following locations: ```md CODEOWNERS .github/CODEOWNERS .gitlab/CODEOWNERS docs/CODEOWNERS ``` However, it might be you do not want to have a `CODEOWNERS` file committed to your repository (for example, to avoid automatic review requests), or you would like to overwrite the existing one. Sourcegraph provides a UI and CLI to ingest a `CODEOWNERS` file per-repository, that overrides any existing committed file. You can ingest one `CODEOWNERS` file per repository. At this time the same ingested `CODEOWNERS` file applies to all revisions. ## Ingesting a file through the UI Navigating to any repository page, clicking the Ownership button will surface information about any ingested `CODEOWNERS` file, and will allow you to upload or update an existing one. ![Codeowners ingestion UI on sourcegraph/sourcegraph](https://storage.googleapis.com/sourcegraph-assets/docs/images/own/codeowners_ingestion_ui.png) ## Ingesting a file with src-cli There is the option to ingest data with the Sourcegraph [src-cli](/cli/quickstart). The CLI provides `add`, `update`, `delete`, and `list` functionality. ```bash 'src codeowners' is a tool that manages ingested code ownership data in a Sourcegraph instance. Usage: src codeowners command [command options] The commands are: get returns the codeowners file for a repository, if exists create create a codeowners file update update a codeowners file delete delete a codeowners file Use "src codeowners [command] -h" for more information about a command. ``` The input file can be written inline or passed in. ## Limitations - Uploaded `CODEOWNERS` files must use either Sourcegraph usernames or email addresses for correct user matching to occur. `CODEOWNERS` files committed to the repo should use either usernames of the codehost the repo is on (e.g. GitHub) or email addresses. - The file should respect `CODEOWNERS` formatting for code ownership to surface useful information. No formatting validation is done at upload time. - Only site admins can add, update or delete a `CODEOWNERS` file through the ingestion API. - Ingested `CODEOWNERS` files are limited to a size of 10Mb if uploaded through the client. # The CODEOWNERS format Code ownership is defined as a strict ruleset. Files can be assigned to owners. To define rulesets for code ownership, we make use of the `CODEOWNERS` format. `CODEOWNERS` files contain a sequence of matching rules - a glob pattern and zero or more owners. **A repository has at most one `CODEOWNERS` file.** ## Specifying Owner information Owners can be defined by a username/team name or an email address. Using email addresses is generally recommended, as email addresses are most likely the same across different platforms, and are independent of a user having registered yet. In Sourcegraph, a user can add multiple email addresses to their profile. All of those would match to the same user. For committed `CODEOWNERS` files, the usernames are usually the username **on the code host**, so they don't necessarily match with the Sourcegraph username. This is a known limitation, and in the future, we will provide ways to map external code host names to Sourcegraph users. For now, you can search for a user by their code host username, or switch to using emails in the `CODEOWNERS` files, which will work across both Sourcegraph and the code host. ## File format The following snippet shows an example of a valid `CODEOWNERS` file. ``` *.txt @text-team # this is a comment explaining why Alice owns this /build/logs/ alice@sourcegraph.com /cmd/**/test @qa-team @user ``` - Asterisk `*` is a wildcard that matches N tokens in a path segment. **Example**: `doc/*/own` will match `doc/ref/own` and `doc/tutorial/own`, but not `doc/a/b/own` - Double `**` asterisk matches any sub-path. **Example**: `doc/**/own` will match `doc/ref/own` and `doc/a/b/own` - Starting a pattern with `/` anchors matches at the repository root. **Example**: `/docs/*` matches `/docs/a` and `/docs/b` but not `/src/docs/a`. - Trailing slash `/` matches any file within the directory tree (so it is equivalent to trailing `/**`). **Example**: `docs/` matches `/testing/docs/foo` and `/docs/foo/bar`, but does not match `/docs` or `/testing/docs`. The rules are considered independently and in order. Rules farther down the file take precedence. Only **one** rule matches. So for instance for `/build/logs/log-1.txt` the owner will only be `alice@sourcegraph.com` and not `@text-team` since the `/build/logs/` rule will take precedence over `*.txt` rule. ## Limitations - GitLab allows sections in `CODEOWNERS` files, these are not yet supported and section markers are ignored - [Code Owners for Bitbucket](https://marketplace.atlassian.com/apps/1218598/code-owners-for-bitbucket?tab=overview&hosting=cloud) inline defined groups are not yet supported To configure ownership in Sourcegraph, you have two options: ## Committing a `CODEOWNERS` file to your repositories > Use this approach if you prefer versioned ownership data. You can simply commit a `CODEOWNERS` file at any of the following locations for it to be picked up automatically by code ownership: ``` CODEOWNERS .github/CODEOWNERS .gitlab/CODEOWNERS docs/CODEOWNERS ``` Searches at specific commits will return any `CODEOWNERS` data that exists at that specific commit. ## Uploading a `CODEOWNERS` file to Sourcegraph > Use this approach if you don't want to commit `CODEOWNERS` files to your repos, or if you have an existing system that tracks ownership data and want to sync that data with Sourcegraph. Read more on how to [manually ingest `CODEOWNERS` data](/own/codeowners_ingestion) into your Sourcegraph instance. The [docs](/own/codeowners_ingestion) detail how to use the UI or `src-cli` to upload `CODEOWNERS` files to Sourcegraph. # Assigned ownership Owners (both users and teams) can be manually assigned. Assignment can be done on a repository, directory or a file level. Assigned ownership propagates in a top-down manner: e.g. - If an owner is assigned to the repository, they will be considered an owner for all files and directories of this repository. - If an owner is assigned to some directory (e.g. `repo-name/src/abc`) within the repo, they will be considered an owner for all the directories and files within `repo-name/src/abc`, but not for any other directories and files higher up in the hierarchy. - If an owner is assigned to some file (e.g. `repo-name/src/abc/a.go`) within the repo, they will be considered an owner only for this file. ## Who can assign ownership Only site admins can assign ownership by default. For other users, [RBAC should be used](/admin/access_control/ownership) to grant assign ownership right. [More](/admin/access_control) about RBAC in Sourcegraph. ## How to assign ownership ### Repository level ownership Go to the repository page and click "Ownership" button. ![Repository page with Ownership button selected](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-ownership-1-dark.png) 1. Click "Add owner" button, the modal window will open. 2. Activate "New owner" panel. 3. Search for the user/team to assign ownership to. 4. Click "Add owner" button on the modal window. ![Add repository owner](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-2-dark.png) Owner is assigned successfully. ![Repository owner added](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-3-dark.png) ### Directory level ownership Go to any directory view (in our example it is `cmd/gitserver/internal`) and click "Show more" on Own panel. ![Repository page with Ownership button selected](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-dir-1-dark.png) 1. Click "Add owner" button, the modal window will open. 2. Activate "New owner" panel. 3. Search for the user/team to assign ownership to. 4. Click "Add owner" button on the modal window. ![Add repository owner](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-2-dark.png) Owner is assigned successfully. ![Repository owner added](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-3-dark.png) ### File level ownership Go to the blob view of any file (in our example it is `cmd/gitserver/internal/cleanup.go`). 1. Click on the Own bar in the top-right corner. 2. Click "Add owner" button in the bottom-right corner of an opened Ownership tab. 3. Activate "New owner" panel. 4. Search for the user/team to assign ownership to. 5. Click "Add owner" button on the modal window. ![Add repository owner](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-dir-2-dark.png) Owner is assigned successfully. ![Repository owner added](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-dir-3-dark.png) ## How to remove an assigned owner ### Repository and directory level Go to the repository page and click "Ownership" button **or** Go to any directory view and click "Show more" on Own panel. Click on "Remove ownership" button. ![Repository/directory owner removed](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-remove-repo-1-dark.png) ### File level Go to the blob view of any file and to the Ownership tab. Click on "Remove ownership" button. ![File owner removed](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-remove-file-1-dark.png) ### Note on removing assigned owners Owners can be removed only at the same level they were initially assigned. For example: - If an owner is assigned to the repository, they should be removed from the repository level. They cannot be removed from any directory/file within this repo, even though they are considered owners of these directories/files. - If an owner is assigned to some directory within the repo, they should be removed from the same directory. They cannot be removed from any subdirectory/file below this directory, even though they are considered owners of these subdirectories/files. - If an owner is assigned to some file within the repo, they should be removed from the same file. **"Remove ownership" buttons are disabled and the tooltip is shown when a user is attempting to remove an owner from the different place from where this owner has been assigned.** ![Remove ownership disabled tooltip](https://storage.googleapis.com/sourcegraph-assets/docs/own/assigned-owners-cannot-remove-dark.png) # Quickstart for Notebooks In this guide, you'll create your first Notebook ## The Notebooks interface The Notebooks interface will be familiar if you've ever used Jupyter or iPython notebooks before. ![A new notebook](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_ui_overview) ### Run all blocks The Run all blocks button allows you to render all the blocks in the Notebook with one click. You'll want to get in the habit of using this button every time you start reading a Notebook. ![The Run all blocks button](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_run_all.jpeg) ### Autosave Notebooks are automatically saved so you'll never lose your work. ![null](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_autosave.jpeg) ### Supported block types Like Jupyter notebooks, Sourcegraph Notebooks support Markdown. They also support two special block types: Query and Code. #### Query blocks Query blocks allow you to enter any valid Sourcegraph query and view the results right inside the notebook. The query block input supports the same typeahead functionality as the main Sourcegraph search bar. ![](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_query_block) #### Markdown blocks Markdown blocks support all the Markdown features you'd expect, including rendering images and syntax highlighting. #### Code blocks Code blocks are another special block type that allow you show a file range from any file on Sourcegraph. You can use the interface to fill in the range you want, or just select a code block and paste in a valid Sourcegraph URL to have the inputs auto-filled. ![](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_code_block.mp4) # Create a new Notebook - Navigate to [https://sourcegraph.com/notebooks](https://sourcegraph.com/notebooks) and click "Create notebook". - Click on the name to edit and rename the Notebook "React components" - Create a Markdown block and enter the text below. ``` # React class components React class components are no longer the preferred style of component creation. Today, functional components are the standard. Below are some examples of class components in the Sourcegraph codebase. ``` - Click the render button, or press Cmd+Return to render the block - Next, create a query block and enter the following query to find some examples of class components in the Sourcegraph codebase. ``` repo:^github\.com/sourcegraph/sourcegraph$ lang:TypeScript extends React ``` - Render the block with Cmd+Return - Next, let's find some recent commits that include class components. - Click the "duplicate" button to duplicate the block and modify the query to return commits that added our search phrase. ``` repo:^github\.com/sourcegraph/sourcegraph$ lang:TypeScript extends React type:diff select:commit.diff.added ``` - Your Notebook should now look like [this](https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MTE4). - **Optional:** share you notebook by clicking "Private" at the top right of the screen and select "Public" to share your Notebook with the community! # Sharing Notebooks Notebooks support the following sharing scheme. ## User namespace ### Private Notebooks This is the default permissions level for all new notebook. Only the creator can view and edit the notebook. ## Sourcegraph organization namespace Find out more about Sourcegraph organizations and how to create and configure them on the [organizations docs page](/admin/organizations). ### Private organization Notebooks Only organization members can view and edit the notebook. ### Public organization Notebooks In self-hosted and managed Sourcegraph instances, everyone who has access to the instance can view the notebook. On [Sourcegraph.com](https://sourcegraph.com), anyone can view the Notebook. In both cases, only members of the owning Sourcegraph organization can edit the Notebook. ![](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebook_sharing.gif) # Embedding Notebooks A notebook can be embedded using a standard iframe element. In order for the iframe to load, the user must be logged into Sourcegraph. The notebook embedding URL is an authenticated endpoint. ## Domain considerations Certain browsers (i.e. Safari and Firefox) block cross-domain cookies from being sent in iframe requests. This will prevent an embedded notebook from being displayed, even when a user is logged into Sourcegraph from the same browser. To ensure that notebook embedding requests will be permitted to load for all of your logged-in Sourcegraph users, the Sourcegraph instance must be hosted on the same domain as the page that loads the iframe element. For Cloud customers, see [Custom Domains](/cloud/#custom-domains). ## How to embed To create the embedding URL, copy the notebook URL (e.g. `https://your-sourcegraph-instance.com/notebooks/notebook-id`), and add the `/embed` prefix directly before the `/notebooks` segment: ``` https://{your-sourcegraph-instance.com}/embed/notebooks/{notebook-id} ``` Once you have the embedding URL, create an iframe element and use the embedding URL as the `src` attribute value. See example iframe below: ```html ``` ## Security We recommend using the `sandbox` attribute to apply extra security restrictions to the iframe. Notebooks require three exceptions: `allow-scripts` allows executing Javascript scripts, `allow-same-origin` allows access to local storage and cookies, and `allow-popups` allows opening links in a separate tab. ## Enable embedding notebooks on private instances Embedding is disabled by default on private instances. A site-admin can enable embedding by running the following GraphQL mutation in the API console, located at `https://{your-sourcegraph-instance.com}/api/console`: ```graphql mutation { createFeatureFlag(name: "enable-embed-route", value: true) { ... on FeatureFlagBoolean { name value } } } ``` # Notebooks Notebooks enable powerful live–and persistent–documentation, shareable with your organization or the world. As of release 3.39, Notebooks are Generally Available (GA). If you're a Sourcegraph enterprise user and are on version 3.39 or later, you'll find Notebooks in the header navigation, or by going to `https:///notebooks`. Inspired by Jupyter Notebooks and powered by Markdown and Sourcegraph's code search, Notebooks let you and your team create living documentation that interacts directly with your code. You can leverage Notebooks to onboard a new teammate, document known vulnerabilities, a common pattern in your codebase, or useful Sourcegraph queries. ![](https://storage.googleapis.com/sourcegraph-assets/docs/images/notebooks/notebooks_home.gif) Notebooks have powerful content creation features, like multiple block types, each with their own unique capabilities. If you're familiar with Jupyter Notebooks, then you already understand the blocks concept. You can add as many of each block as you want to a Sourcegraph notebook. ## Notebook types Notebooks can be created in two ways. Through the web interface or via special Markdown files with the special `.snb` extension. To view file-based notebooks you must view the files in the file view on sourcegraph.com or on your Sourcegraph instance. ### Web-based notebooks The simplest way to get started with Notebooks is to create one using the web interface. Notebooks created this way have the advantage of being interactive, letting you see the content of your blocks in realtime as you create your notebook. You can also create web-based notebooks by importing plain Markdown files and then augmenting them with Sourcegraph notebook block types in the web interface. A new notebook will automatically be created when you import a standard markdown file. From there, you can modify it however you like in the web interface. Web-based notebooks are automatically saved as they're edited. There is currently no version control, version history, or versioning system. ### File-based notebooks Alternatively, you can create notebooks using text files with the `.snb` file extension. These files are rendered specially by Sourcegraph (either on sourcegraph.com or within your Sourcegraph instance) to display notebook blocks alongside standard Markdown blocks. Whenever you view a `.snb` file on Sourcegraph, you'll see a "Run all blocks" button near the top of the notebook, which will execute all the notebook blocks at once. Markdown and file blocks are rendered by default. File-based notebooks have the advantage of living anywhere you store text files. The disadvantage comes during composition, as you won't be able to see the contents of your blocks while you create your notebook. ### Combined approaches #### Compose online and export to disk If you prefer to keep your notebooks in your repos but want to compose them on the web, you can get the best of both worlds by composing your notebooks on your sourcegraph instance and then exporting them to your repositories on disk. #### Embed notebooks anywhere Sourcegraph notebooks can be [embedded](/notebooks/notebook-embedding) anywhere that allows iframes. Notebooks hosted on sourcegraph.com can be embedded anywhere. Notebooks hosted on your private instance are subject to your organization's security policies, but can generally be viewed by any user with access to your instance as long as they're logged in. ## Notebook blocks The currently supported block types are: - Query - File - Symbol - Markdown [Read more about block types](/notebooks/blocks). ## Searching notebooks Notebooks created through the web interface are full text searchable from the `/notebooks` page. Each tab has its own search box and each search box is scoped to that tab. The exception is the Explore tab, which searches all notebooks you have access to. Searches will match on notebook titles and any text in blocks. For example any text in Markdown blocks and any of the query text in file, symbol, and search query blocks. Searching through results in symbol, file, and query block types is not supported because they are dynamic in nature. ## Enabling Notebooks in older versions of Sourcegraph In versions older than 3.39 (beginning in 3.36) Notebooks are behind an experimental feature flag. If you're running versions 3.36-3.38 and want to try out Notebooks, enable them in global settings: ``` "experimentalFeatures": { "showSearchNotebook": true } ``` ## Explanations - [Sharing notebooks](/notebooks/notebook-sharing) - [Embedding notebooks](/notebooks/notebook-embedding) - [Block types](/notebooks/blocks) Blocks are the compositional units of a notebook. You can interleave the various block types in a notebook to create rich, powerful documentation. There are four supported block types. # Block types ## Markdown blocks Markdown blocks support standard Markdown formatting, enabling you to create headings, lists, code blocks, and more. They are the foundational block type for providing additional context to the specialized block types described below. ## Query blocks Query blocks support the full Sourcegraph search query language, allowing you to use our full [search syntax](/code-search/queries), including any of our types, filters, patterns, and predicates, to display the most relevant results. > Note: Notebook block searches don't use your Sourcegraph instance's default search configuration. For example you'll need to explicitly specify things like `patterntype:regexp` or `context:sourcegraph` even if your user or global settings have a configured default for these values. ## Symbol blocks With symbol blocks, you can identify the symbol you want to highlight. Symbol blocks are special. As long as the symbol definition stays within the file you selected when you created the block, you don't need to update it when the file changes. Symbol blocks "follow" the symbol around the file and so always display its current location. Symbol blocks provide some UI affordances to make it easier to find symbols, such as a default `type:symbol` in the query, as well as a purpose-built typeahead specialized for symbol selection. ## File blocks File blocks are similar to symbol blocks in that they are some special affordances to make them easier to create. You can add an entire file the file block, or you can select a line range of a file. File ranges are great for embedding code snippets into a notebook or highlighting important files. File blocks are editable so you can modify a full file to only show a line range from it, or remove the line range to show an entire file. If you're viewing a file in Sourcegraph search, you can also copy the URL and paste it directly into a file block or the command palette. If you have a line range selected it will be preserved on paste. # Phabricator integration with Sourcegraph > ⚠️ NOTE: Sourcegraph support of Phabricator is limited, and not expected to evolve due to the [announced](https://admin.phacility.com/phame/post/view/11/phacility_is_winding_down_operations/) cease of support for Phabricator. This Phabricator integration does not support listing and mirroring Phabricator repositories (as it does for repositories on other code hosts). It is intended for use when your repositories are hosted somewhere else (such as GitHub), and Phabricator mirrors repositories from that code host. If your repositories are hosted on Phabricator, you must follow the steps in "[Other Git repository hosts](/admin/code_hosts/other)" to add the repositories so that they are mirrored to Sourcegraph in addition to the steps outlined here to power the integration. Sourcegraph does not currently support using the repository permissions you've set in Phabricator for repositories hosted on Phabricator. Feature | Supported? ------- | ---------- [Repository syncing and mirroring](/admin/code_hosts/phabricator#repository-linking-and-syncing) | ❌ [Repository association](/admin/code_hosts/phabricator#repository-linking-and-syncing) | ✅ [Repository permission syncing](/admin/permissions/syncing) | ❌ [User authentication](/admin/auth/) | ❌ [Browser extension](#browser-extension) | ✅ [Native extension](/admin/code_hosts/phabricator#native-extension) | ✅ ## Repository association Site admins can [associate Phabricator repositories with Sourcegraph](/admin/code_hosts/phabricator#repository-syncing-and-linking). ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) supports Phabricator. When installed in your web browser, it adds hover tooltips, go-to-definition, find-references, and code search to files and diffs viewed on Phabricator. 1. Install the [Sourcegraph browser extension](/integration/browser_extension). 1. [Configure the browser extension](/integration/browser_extension#configuring-the-sourcegraph-instance-to-use) to use your Sourcegraph instance. 1. To allow the browser extension to work on your Phabricator instance: - Navigate to any page on Phabricator. - Right-click the Sourcegraph icon in the browser extension toolbar. - Click "Enable Sourcegraph on this domain". - Click "Allow" in the permissions request popup. 1. Visit any file or diff on Phabricator. Hover over code or click the "View file" and "View repository" buttons. > NOTE: Site admins can also install the [native Phabricator extension](/admin/code_hosts/phabricator#native-extension) to avoid needing each user to install the browser extension. # Open in Editor With a click of a button, you can jump from any file in Sourcegraph to your preferred editor. It only takes a minute to set up. ## Get started If you haven’t used the feature, find the button on the right side of your screen: When you click it, a small popup appears where you’ll need to set two things: a projects path and your editor. - The **projects path** is the folder where you store your projects. Enter any Linux, Windows, or macOS absolute path. - Example: If your projects path is `/home/username/projects`, one of your repos is https://github.com/sourcegraph/sourcegraph/, and you want to open `README` in the root folder of the repo, then the feature will look for the file at `/home/username/project/sourcegraph/README`. - Then choose your **preferred editor** from the list. We support VS Code, Atom, Sublime Text, and JetBrains IDEs ( AppCode, CLion, GoLand, IntelliJ IDEA, PhpStorm, PyCharm, Rider, RubyMine, WebStorm, and all new IDEs that JetBrains releases). If you use a different editor, check out “Advanced config” below. Once you click **Save**, the icon will you’ll be able to jump to your editor from any file in Sourcegraph. ## Advanced config If you want to dig deeper, there are a bunch of optional settings to play with. Click your name at the top-right, select Settings, and add the `"openInEditor": {}` key to your user setting JSON. - **editorIds:** an array of short names of an editor (“vscode”, “idea”, “sublime”, “pycharm”, etc.) or “custom”. This is what you set in the dropdown when you first set up the feature. - Note that the initial setup UI only allows you to select one editor, but if you use multiple editors, you can manually add more. Each of them will have an icon on your toolbar. - **custom.urlPattern:** If you set editorId to “custom” then this must be set, too. Use the placeholders “%file”, “%line”, and “%col” to mark where the file path, line number, and column number must be inserted. Example URL pattern for IntelliJ IDEA: `idea://open?file=%file&line=%line&column=%col` - **projectPaths.default**: This is what you set in the form when you first set up the feature: The absolute path on your computer where your git repositories live. All git repos to open have to be cloned under this path with their original names. `/Users/yourusername/src` is a valid absolute path, `~/src` is not. Works both with and without a trailing slash. - **projectPaths.linux**: Overwrites the default path on Linux. Handy if you use different environments. Works both with and without a trailing slash. - **projectPaths.mac**: Overwrites the default path on macOS. Works both with and without a trailing slash. - **projectPaths.windows**: Overwrites the default path on Windows. Works both with and without a trailing backslash. - **replacements**: Key-value pairs. Each key will be replaced by the corresponding value in the final URL. Keys are regular expressions, values can contain backreferences ($1, $2, ...). - **jetbrains.forceApi**: Forces using protocol handlers (like `idea://open?file=...`) or the built-in REST API (`http://localhost:63342/api/file...`). If omitted, **protocol handlers** are used if available, otherwise the built-in REST API is used. - **vscode.isProjectPathUNCPath**: Indicates that the given projects path is a UNC (Universal Naming Convention) path. - **vscode.useInsiders**: If set, files will open in VS Code Insiders rather than VS Code. - **vscode.useSSH**: If set, files will open on a remote server via SSH. This requires vscode.remoteHostForSSH to be specified and VS Code extension “Remote Development by Microsoft” installed in your VS Code. - **vscode.remoteHostForSSH**: The remote host as `USER@HOSTNAME`. This needs you to install the extension called “Remote Development by Microsoft” in your VS Code. Just save your settings and enjoy being totally advanced! 😎 ## Examples ### IntelliJ IDEA on macOS To open repository files in your Documents directory: ```json { "openInEditor": { "editorIds": ["idea"], "projectPaths.default": "/Users/USERNAME/Documents" } } ``` ### JetBrains IDEs on Windows **Note:** We talk about IntelliJ here, but it’s similar for all JetBrains IDEs. The `idea://` protocol handler does not always work on Windows. If it fails for you, a workaround is to use IntelliJ’s built-in REST API to open files directly from a URL with some extra configuration steps. Add this to your Sourcegraph _User settings_: ```json { "openInEditor": { ... "jetbrains.forceApi": "builtInServer" } } ``` Then open IntelliJ settings, go to `Build, Execution, Deployment` | `Debugger` | `Built-in Server`, and enable `Allow unsigned requests`. This allows Sourcegraph to make requests to the built-in server, as stated in JetBrains’ [docs](https://www.jetbrains.com/help/idea/php-built-in-web-server.html#configuring-built-in-web-server). **Note:** with this workaround, “Open in Editor” will only work if your IDE is running. ### VS Code on macOS To open repository files in your Documents directory: ```json { "openInEditor": { "editorIds": ["vscode"], "projectPaths.default": "/Users/USERNAME/Documents" } } ``` ### VS Code on Windows To open repository files in your Documents directory: ```json { "openInEditor": { "editorIds": ["vscode"], "projectPaths.default": "C:\Users\USERNAME\Documents" } } ``` ### VS Code on WSL To open repository files in your Home directory: ```json { "openInEditor": { "editorIds": ["vscode"], "projectPaths.default": "//wsl$/Ubuntu-18.04/home" } } ``` ### VS Code Insider on Mac ```json { "openInEditor": { ... "vscode.useInsiders": true } } ``` ### VS Code with different base paths configured for different platforms Uses the assigned path for the detected Operating System when available: ```json { "openInEditor": { "editorIds": ["vscode"], // basePath is required as the default path when no Operating System is detected "projectPaths.default": "/Users/USERNAME/Documents/", "projectPaths.windows": "/C:/Users/USERNAME/folder/", "projectPaths.mac": "/Users/USERNAME/folder/", "projectPaths.linux": "/home/USERNAME/folder/" } } ``` ### Replacement Example 1: Open Remote folders with VS Code on Mac by removing file names **This requires VS Code extension [Remote Development by Microsoft](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) to work.** To open directory where the repository files reside in a remote server: ```json { "openInEditor": { "editorIds": ["custom"], "projectPaths.default": "/Users/USERNAME/Documents/", // Replaces USER@HOSTNAME as appropriate. "custom.urlPattern": "vscode://vscode-remote/ssh-remote+USER@HOSTNAME%file", //removes file name as the vscode-remote protocol handler only supports directory-opening "replacements": { "\/[^\/]*$": "" } } } ``` ### Replacement Example 2: Add string to final file path Adds `sourcegraph-` in front of the string that matches the `(?<=Documents\/)(.*[\\\/])` RegExp pattern, which is the string after `Documents/` and before the final slash. ```json { "openInEditor": { "editorIds": ["vscode"], "projectPaths.default": "/Users/USERNAME/Documents/", "replacements": { "(?<=Documents\/)(.*[\\\/])": "sourcegraph-$1" } // vscode://file//Users/USERNAME/Documents/REPO-NAME/package.json => vscode://file//Users/USERNAME/Documents/sourcegraph-REPO-NAME/package.json } } ``` ### Replacement Example 3: Remove string from the final file path Removes `sourcegraph-` from the final URL. ```json { "openInEditor": { "editorIds": ["vscode"], "projectPaths.default": "/Users/USERNAME/Documents/", "replacements": { "sourcegraph-": "" } // vscode://file//Users/USERNAME/Documents/sourcegraph-REST-OF_REPO-NAME/package.json => vscode://file//Users/USERNAME/Documents/REST-OF_REPO-NAME/package.json } } ``` # Firefox Migration from self-hosted to Add-ons Store We've recently migrated from hosting the Sourcegraph Firefox extension ourselves to hosting it in the Firefox add-ons store, to improve the update process. If you previously installed the Firefox extension from our website, the first time you update it you'll need to reinstall the extension from the Firefox store, which can be done in two quick steps: First, remove your current Sourcegraph extension by right-clicking the Sourcegraph logo and selecting "Remove Extension" from the dropdown. Second, navigate to the [Sourcegraph extension page](https://addons.mozilla.org/en-US/firefox/addon/sourcegraph-for-firefox/) on the Firefox add-ons store and install the latest Sourcegraph extension. Future updates will be distributed through the Firefox store and won't require a re-install. # Integrations Sourcegraph integrates with your other tools to help you search, navigate, and review your code. - [GraphQL API](/api/graphql/): create custom tools using Sourcegraph data - [Browser extension](/integration/browser_extension/): go-to-definitions and hovers in your code host and code reviews - Code hosts - [GitHub](/integration/github) - [GitLab](/integration/gitlab) - [Bitbucket Cloud](/integration/bitbucket_cloud) - [Bitbucket Server / Bitbucket Data Center](/integration/bitbucket_server) - [Package repository hosts](/admin/code_hosts/package-repos) - [JVM dependencies](/integration/jvm) - [npm dependencies](/integration/npm) - [Python dependencies](/integration/python) - [Go dependencies](/integration/go) - [Ruby dependencies](/integration/ruby) - [Rust dependencies](/integration/rust) - [Other Git repository hosts](/admin/code_hosts/other) - [Editor plugins](/integration/editor): jump to Sourcegraph from your editor - [Open in Editor](/integration/open_in_editor): jump to your editor from Sourcegraph - [Search shortcuts](/integration/browser_extension/how-tos/browser_search_engine): quickly search from your browser - Launcher extensions - [Sourcegraph for Raycast](https://www.raycast.com/bobheadxi/sourcegraph) (unofficial): search code, browse notebooks, and manage batch changes from the Raycast launcher - IDE Extensions - [JetBrains](/integration/jetbrains) - [Manual testing](/integration/jetbrains/manual_testing) - [VS Code](/integration/vscode) ![GitHub pull request integration](https://storage.googleapis.com/sourcegraph-assets/code-graph/docs/github-pr.png) # Go dependencies integration with Sourcegraph You can use Sourcegraph with Go modules from any Go module proxy, including open source code from proxy.golang.org or a private proxy such as [Athens](https://github.com/gomods/athens). This integration makes it possible to search and navigate through the source code of published Go modules (for example, [`gorilla/mux@v1.8.0`](https://sourcegraph.com/go/github.com/gorilla/mux@v1.8.0)). Feature | Supported? ------- | ---------- [Repository syncing](#repository-syncing) | ✅ [Repository permissions](#repository-syncing) | ❌ [Multiple Go repositories code hosts](#multiple-go-dependencies-code-hosts) | ❌ ## Setup See the "[Go dependencies](/admin/code_hosts/go)" documentation. ## Repository syncing Site admins can [add Go packages to Sourcegraph](/admin/code_hosts/go#repository-syncing). ## Repository permissions ⚠️ Go dependency repositories are visible by all users of the Sourcegraph instance. ## Multiple Go dependencies code hosts ⚠️ It's only possible to create one Ruby dependency code host for each Sourcegraph instance. See the issue [sourcegraph#32461](https://github.com/sourcegraph/sourcegraph/issues/32461) for more details about this limitation. # Sourcegraph extensions on Gitpod You can use our Sourcegraph IDE extensions in your [Gitpod](https://gitpod.io/) workspace. ### Installation guide Our IDE extensions work with the following IDEs supported by Gitpod. #### Gitpod VS Code Desktop 1. Open the `Extensions view` by clicking on the Extensions icon in the [Activity Bar](https://code.visualstudio.com/api/ux-guidelines/overview#activity-bar) on the side of your Gitpod VS Code workspace 2. Search and install our [Sourcegraph](https://open-vsx.org/extension/sourcegraph/sourcegraph) #### Gitpod VS Code for the Web 1. Open the `Extensions view` by clicking on the Extensions icon in the [Activity Bar](https://code.visualstudio.com/api/ux-guidelines/overview#activity-bar) on the side of your Gitpod VS Code for the Web workspace 2. Search and install our [Sourcegraph](https://open-vsx.org/extension/sourcegraph/sourcegraph) #### Gitpod JetBrains IDEs 1. Follow the instructions in [Gitpod's JetBrains IDE support docs](https://www.gitpod.io/docs/ides-and-editors/jetbrains-gateway#jetbrains-ide-support) to setup your workspace. 2. In your Gitpod JetBrains IDE workspace, select `Preferences` 3. Select `Plugins: on host` 4. Search and install `Sourcegraph` # Gitolite integration with Sourcegraph You can use Sourcegraph with [Gitolite](http://gitolite.com/). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/gitolite#repository-syncing) | ✅ [Browser extension](#browser-extension) | ❌ ## Repository syncing Site admins can [sync Gitolite repositories to Sourcegraph](/admin/code_hosts/gitolite#repository-syncing). ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) does not support Gitolite because Gitolite has no web interface. If your Gitolite repositories are also available on another code host (such as GitHub or Phabricator), you can use the browser extension with those services. # GitLab integration with Sourcegraph You can use Sourcegraph with [GitLab.com](https://gitlab.com) and GitLab CE/EE. Read a high-level overview of how Sourcegraph and GitLab work together in our [GitLab solution brief](https://about.sourcegraph.com/guides/sourcegraph-gitlab-solution-brief.pdf). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/gitlab#repository-syncing) | ✅ [Repository permissions](/admin/code_hosts/gitlab#repository-permissions) | ✅ [User authentication](/admin/code_hosts/gitlab#user-authentication) | ✅ [GitLab UI native integration](#gitlab-ui-native-integration) | ✅ [Browser extension](#browser-extension) | ✅ ## Repository syncing Site admins can [add GitLab repositories to Sourcegraph](/admin/code_hosts/gitlab#repository-syncing). ## Repository permissions Site admins can [configure Sourcegraph to respect GitLab repository access permissions](/admin/code_hosts/gitlab#repository-permissions). ## User authentication Site admins can [configure Sourcegraph to allow users to sign in via GitLab](/admin/code_hosts/gitlab#user-authentication). ## GitLab UI native integration GitLab instances can be configured to show Sourcegraph code navigation natively. See the [GitLab integration docs](/admin/code_hosts/gitlab#native-integration) for how to enable this on your GitLab instance. ![GitLab native integration](img/gitlab-code-intel.gif) ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) supports GitLab. When installed in your web browser, it adds hover tooltips, go-to-definition, find-references, and code search to files and merge requests viewed on GitLab. 1. Install the [Sourcegraph browser extension](/integration/browser_extension). 1. [Configure the browser extension](/integration/browser_extension#configuring-the-sourcegraph-instance-to-use) to use your Sourcegraph instance. - You can also use [`https://sourcegraph.com`](https://sourcegraph.com) for public code from GitLab.com only. 1. To allow the browser extension to work on your GitLab instance: - Navigate to any page on GitLab. - Right-click the Sourcegraph icon in the browser extension toolbar. - Click "Enable Sourcegraph on this domain". - Click "Allow" in the permissions request popup. 1. Visit any file or merge request on GitLab. Hover over code or click the "View file" and "View repository" buttons. # GitHub integration with Sourcegraph You can use Sourcegraph with [GitHub.com](https://github.com) and [GitHub Enterprise](https://enterprise.github.com). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/github#selecting-repositories-to-sync) | ✅ [Repository permissions](/admin/code_hosts/github#repository-permissions) | ✅ [User authentication](/admin/code_hosts/github#user-authentication) | ✅ [Browser extension](#browser-extension) | ✅ ## Repository syncing Site admins can [add GitHub repositories to Sourcegraph](/admin/code_hosts/github#selecting-repositories-to-sync). ## Repository permissions Site admins can [configure Sourcegraph to respect GitHub repository access permissions](/admin/code_hosts/github#repository-permissions). ## User authentication Site admins can [configure Sourcegraph to allow users to sign in via GitHub](/admin/code_hosts/github#user-authentication). ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) supports GitHub. When installed in your web browser, it adds hover tooltips, go-to-definition, find-references, and code search to files and pull requests viewed on GitHub and GitHub Enterprise. 1. Install the [Sourcegraph browser extension](/integration/browser_extension). 1. [Configure the browser extension](/integration/browser_extension#configuring-the-sourcegraph-instance-to-use) to use your Sourcegraph instance. - You can also use [`https://sourcegraph.com`](https://sourcegraph.com) for public code only. 1. GitHub Enterprise only: Click the Sourcegraph icon in the browser toolbar to open the settings page. If a permissions notice is displayed, click **Grant permissions** to allow the browser extension to work on your GitHub Enterprise instance. 1. Visit any file or pull request on GitHub. Hover over code or click the "View file" and "View repository" buttons. # Editor integrations Sourcegraph's editor integrations allow you search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. Get up to speed quickly, learn best practices and, find code to re-use all while maintaining your flow using our editor integrations. We currently have integrations with these editors: - [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.sourcegraph) - [JetBrains IDEs (IntelliJ, PyCharm, GoLand, etc.)](https://plugins.jetbrains.com/plugin/9682-sourcegraph) - [Gitpod](https://open-vsx.org/extension/sourcegraph/sourcegraph) ## References - [Installation guide for Gitpod](/integration/gitpod) - [Sourcegraph on Open VSX Registry](https://open-vsx.org/extension/sourcegraph/sourcegraph) # Bitbucket Server / Bitbucket Data Center integration with Sourcegraph You can use Sourcegraph with Git repositories hosted on [Bitbucket Server](https://www.atlassian.com/software/bitbucket/server) (and the [Bitbucket Data Center](https://www.atlassian.com/enterprise/data-center/bitbucket) deployment option). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/bitbucket_server) | ✅ [Webhooks](/admin/code_hosts/bitbucket_server#webhooks) | ✅ [Repository permissions](/admin/code_hosts/bitbucket_server#repository-permissions) | ✅ [Sourcegraph Bitbucket Server plugin](#sourcegraph-bitbucket-server-plugin) | ✅ [Browser extension](#browser-extension) | ✅ ## Repository syncing Site admins can [add Bitbucket Server / Bitbucket Data Center repositories to Sourcegraph](/admin/code_hosts/bitbucket_server). ## Repository permissions Site admins can [configure Sourcegraph to respect Bitbucket Server / Bitbucket Data Center's repository access permissions](/admin/code_hosts/bitbucket_server#repository-permissions). ## Sourcegraph Bitbucket Plugin We recommend installing the Sourcegraph Bitbucket plugin which adds the following features to your Bitbucket Server / Bitbucket Data Center instance: - **Native code navigation**: users don't need to install the [Sourcegraph browser extension](#browser-extension) to get hover tooltips, go-to-definition, find-references, and code search while browsing files and viewing pull requests on Bitbucket Server / Bitbucket Data Center. - **Fast permission syncing** between Sourcegraph and Bitbucket Server / Bitbucket Data Center - **Webhooks with configurable scope**, which are used by and highly recommended for usage with [batch changes](/batch-changes/) ![Bitbucket Server / Bitbucket Data Center code navigation](https://sourcegraphstatic.com/bitbucket-code-intel-pr-short.gif) ### Installation and requirements Install the Sourcegraph plugin for Bitbucket from the [Atlassian Marketplace](https://marketplace.atlassian.com/apps/1231975/sourcegraph-for-bitbucket?tab=overview&hosting=datacenter) or see the [bitbucket-server-plugin](https://github.com/sourcegraph/bitbucket-server-plugin) repository for instructions on how to manually install the plugin on your Bitbucket Server / Bitbucket Data Center instance. For the Bitbucket Server plugin to then communicate with the Sourcegraph instance, the Sourcegraph site configuration must be updated to include the [`corsOrigin` property](/admin/config/site_config) with the Bitbucket Server / Bitbucket Data Center URL ```json { // ... "corsOrigin": "https://my-bitbucket.example.com" // ... } ``` #### I am seeing Content Security Policy violations, what should I do? If you have a Content Security Policy (CSP) setup in place and have encountered issues, you may need to adjust the CSP for our Bitbucket Server plugin. To ensure the proper functioning of our Bitbucket Server plugin, add your Sourcegraph instance URL to the following CSP directives: - `script-src` - `style-src` - `connect-src` - `frame-src` Here's an example of how to add your Sourcegraph instance URL to the required CSP directives. In this case, the instance URL is `example.com`. Make sure not to remove any existing values in the directives; just append the Sourcegraph URL. ``` script-src 'self' 'unsafe-inline' example.com; style-src 'self' 'unsafe-inline' example.com; connect-src 'self' example.com; frame-src 'self' example.com; ``` It is not ideal to include `unsafe-inline` here for `script-src`, but it is the recommended approach from Bitbucket. This is a [known issue](https://community.developer.atlassian.com/t/bitbucket-connect-library-uses-eval-preveting-to-use-csp-without-unsafe-inline-as-required/60522) with Bitbucket that is unrelated to our plugin. By following these steps, you should be able to resolve the CSP violations for our Bitbucket Server plugin. If you have any questions or need further assistance, please feel free to reach out to our support team. ### Updating In order to update the plugin, follow the same steps as for installing it, which are described in the [bitbucket-server-plugin](https://github.com/sourcegraph/bitbucket-server-plugin) repository. When the Sourcegraph instance connected to the Bitbucket Server plugin is updated, so will the code that's fetched by the plugin to enable native code navigation. No manual steps required. (See the [Technical Details](#technical-details) section on how this works.) ### Native code navigation Once the plugin is installed and the **Sourcegraph URL** is set under **Administration > Add-ons > Sourcegraph**, native code navigation is enabled when browsing code or pull requests on your Bitbucket Server / Bitbucket Data Center instance. To disable native code navigation, simply set **Sourcegraph URL** to an empty value. Note that this will also disable [Webhooks](#webhooks)! ### Webhooks Once the plugin is installed, go to **Administration > Add-ons > Sourcegraph** to see a list of all configured webhooks and to create a new one. To configure a webhook, follow [these steps](/admin/code_hosts/bitbucket_server#webhooks). Disabling the webhook is as easy as removing the `"webhooks"` property from the `"plugin"` section and deleting the webhook pointing to your Sourcegraph instance under **Administration > Add-ons > Sourcegraph**. > NOTE: Version 1.3.3 or higher of the plugin is required for Build Status support. ### Fast permission syncing The plugin also supports an optional method of faster ACL permissions syncing that aims to improve the speed of fetching a user's permissions from Bitbucket (which can reduce the time a user has to wait to run a search if their permissions data has expired). You can enable this feature when [configuring the connection to your Bitbucket Server / Bitbucket Data Center instance on Sourcegraph](/admin/code_hosts/bitbucket_server#repository-permissions). For more information on when permissions are fetched, how long they're cached and how to configure that behavior, see our documentation on [Repository permissions](/admin/permissions/). The speed improvements are most important on larger Bitbucket Server / Bitbucket Data Center instances with thousands of repositories. When connected to these instances, Sourcegraph would have to make many wasteful requests to fetch permission data if the plugin is not installed. To learn how and why this works, read the [through technical details of fast permission syncing](#technical-details) below. ### Technical Details This section provides some technical insight into the Bitbucket Server plugin to make it easier to users to decide whether or not to install it on their Bitbucket Server / Bitbucket Data Center instance. You can find the full source code for the plugin at [github.com/sourcegraph/bitbucket-server-plugin](https://github.com/sourcegraph/bitbucket-server-plugin/). #### Native code navigation The Bitbucket Server plugin provides **native code navigation** without users having to install the [Sourcegraph browser extension](/integration/browser_extension). It does that by fetching the required JavaScript code from the configured Sourcegraph instance and injecting it into the HTML that the Bitbucket Server / Bitbucket Data Center instance serves. See the [`sourcegraph-bitbucket.js`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/resources/js/sourcegraph-bitbucket.js) file for how it does that. The code that's injected is the code of the [Sourcegraph browser extension](#browser-extension). It is hosted by your Sourcegraph instance in this case and adds the same code navigation functionality to all files and pull requests viewed on Bitbucket Server / Bitbucket Data Center. The code only talks to the Sourcegraph instance that's configured in the Bitbucket Server plugin configuration. It doesn't add any more load to the Bitbucker Server instance. No private code, private repository names, usernames, or any other specific data is sent somewhere else. The code will send usage information to the connected private Sourcegraph instance only, so that the site admins can see usage statistics. If it failed to load or talk to the Sourcegraph instance, messages are logged to the browser console. When the Sourcegraph instance is updated to a newer version, the embedded browser extension code that provides the native code navigation may also be updated. #### Webhooks Bitbucket Server / Bitbucket Data Center natively only [provides **per-repository** webhooks](https://confluence.atlassian.com/bitbucketserver/managing-webhooks-in-bitbucket-server-938025878.html). Sourcegraph's Bitbucket Server / Bitbucket Data Center adds support for webhooks with a **configurable scope**. Each webhook can be configured to listen to specific events **globally**, per **project** or per **repository**. The motivation behind this added functionality is to more efficiently react to updates to Bitbucket Server / Bitbucket Data Center pull requests when using [batch changes](/batch-changes/) by requiring only a single webhook to receive events for hundreds or thousands of pull requests across projects and repositories. The plugin adds a `/webhook` endpoint that accepts `GET`, `POST` and `DELETE` HTTP request to list, create and delete webhooks respectively. The full URL for this endpoint would be something like `https://your-bbs-instance.example.com/rest/sourcegraph-admin/1.0/webhook`. See the [webhooks README](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/java/com/sourcegraph/webhook/README) for detailed information on which payloads this endpoint accepts. Once the plugin is installed it registers an asynchronous listener (see [`WebhookListener.java`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/java/com/sourcegraph/webhook/WebhookListener.java)) that listens to `PullRequestEvent`s and `BuildStatusEvent`s. When an event is dispatched to the listener it checks whether a webhook has been registered for the scope and type of the event and if so, it enqueues the sending of a request to the webhook's endpoint in a thread pool. (See [`WebhookListener.handle`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/java/com/sourcegraph/webhook/WebhookListener.java#L62-L76) and [`Dispatcher.java`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/java/com/sourcegraph/webhook/Dispatcher.java).) In order to persist the configured webhooks across restarts of the Bitbucket Server / Bitbucket Data Center instance the plugin uses the [Active Objects ORM](https://developer.atlassian.com/server/framework/atlassian-sdk/active-objects/) of the Atlassian SDK. It registers two Active Objects: [`WebhookEntity` and `EventEntity`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/94e4be96b57286429cc543205164586af03e9b9b/src/main/resources/atlassian-plugin.xml#L10-L14). If Sourcegraph is configured to make use of the Bitbucket Server plugin webhooks (which is done by setting the [`"plugin.webhooks"` property in the Bitbucket Server / Bitbucket Data Center configuration](/admin/code_hosts/bitbucket_server#webhooks)), it sends a request to the Bitbucket Server / Bitbucket Data Center instance, every minute, to make sure that a webhook on the Bitbucket Server / Bitbucket Data Center instance exists and points to the Sourcegraph instance. #### Fast permission syncing When Sourcegraph is configured to use [Bitbucket Server / Bitbucket Data Center's repository permissions](/admin/code_hosts/bitbucket_server#repository-permissions) to control access to repositories on Sourcegraph, it needs to fetch permissions for each user. The Bitbucket Server / Bitbucket Data Center REST API only provides **paginated** endpoints to fetch either the list of repositories a given user has access to, or the list of users that have access to a given repository. Both endpoints return the **full representation of the entities**. Since Sourcegraph is only interested in the IDs of either repositories or users (those are already synced to its database) the Bitbucket Server plugins adds two REST endpoints that only return IDs to provide a more efficient way of fetching permission data: - `/permissions/repositories?user=&permission=`
Returns **a list of repository IDs** the given `user` has access to on the given `permission` level. - `/permissions/users?repository=&permission=`
Returns **a list of user IDs** that have access to the given `repository` on the given `permission` level. The lists returned by both endpoints are encoded as [Roaring Bitmaps](https://roaringbitmap.org/). Since only a single request is required to fetch the complete list of desired IDs and the response contains only IDs, encoded in an efficient binary format, these two endpoints make the fetching of permissions roughly **eight times faster** (measured on an instance with 10000 repositories) than using Bitbucket Server / Bitbucket Data Center's REST API. The feature is opt-in on Sourcegraph's side but the endpoints are enabled by default on Bitbucket Server / Bitbucket Data Center, which makes it easy to load-test and benchmark the endpoints with a single request. For example, in order to fetch all the repository IDs a single user has access to: ``` curl 'https://bitbucket.example.com/rest/sourcegraph-admin/1.0/permissions/repositories?user=USERNAME&permission=read' -X GET -H 'Authorization: Bearer YOUR_TOKEN' --output /dev/null ``` In our tests we could see that using these endpoints reduces the overall load on the instance, because instead of doing `/1000` requests that take 600-900ms each, Sourcegraph would only do a single request that takes 1000-1500ms. Bitbucket Server / Bitbucket Data Center admins can further increase the performance of these endpoints by increasing the [`page.max.repositories` property in the Bitbucket Server / Bitbucket Data Center configuration](https://confluence.atlassian.com/bitbucketserver/bitbucket-server-config-properties-776640155.html#BitbucketServerconfigproperties-Paging), but you should check your other Bitbucket Server plugins will not be adversely affected by increasing this. The plugin uses `RepositoryService`, `UserManager`, `UserService` and `SecurityService` provided by the Atlassian SDK to fetch users or repositories from Bitbucket Server / Bitbucket Data Center's database. You can see the full code for these two endpoints in [`PermissionRouter.java`](https://github.com/sourcegraph/bitbucket-server-plugin/blob/master/src/main/java/com/sourcegraph/permission/PermissionRouter.java) ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) supports Bitbucket Server / Bitbucket Data Center. When installed in your web browser, it adds hover tooltips, go-to-definition, find-references, and code search to files and pull requests viewed on Bitbucket Server / Bitbucket Data Center. 1. Install the [Sourcegraph browser extension](/integration/browser_extension). 1. [Configure the browser extension](/integration/browser_extension#configuring-the-sourcegraph-instance-to-use) to use your Sourcegraph instance. 1. To allow the browser extension to work on your Bitbucket Server / Bitbucket Data Center instance: - Navigate to any page on Bitbucket Server / Bitbucket Data Center. - Right-click the Sourcegraph icon in the browser extension toolbar. - Click "Enable Sourcegraph on this domain". - Click "Allow" in the permissions request popup. 1. Visit any file or pull request on Bitbucket Server / Bitbucket Data Center. Hover over code or click the "View file" and "View repository" buttons.
# Bitbucket Cloud integration with Sourcegraph You can use Sourcegraph with Git repositories hosted on [Bitbucket Cloud](https://bitbucket.org). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/bitbucket_cloud) | ✅ [Repository permissions](/admin/code_hosts/bitbucket_cloud#repository-permissions) | ✅ Browser extension | ✅ Native extension | ❌ Not supported on Bitbucket.org ## Repository syncing Site admins can [add Bitbucket Cloud repositories to Sourcegraph](/admin/code_hosts/bitbucket_cloud). ## User authorization Site admins can [add Bitbucket Cloud as an authentication provider to Sourcegraph](/admin/auth#bitbucket-cloud). This will allow users to sign into Sourcegraph using their Bitbucket Cloud accounts. Site admins can then also [enable repository permissions](/admin/code_hosts/bitbucket_cloud#repository-permissions) on their Bitbucket Cloud code host connections. # AWS CodeCommit integration with Sourcegraph You can use Sourcegraph with Git repositories hosted on [AWS CodeCommit](https://aws.amazon.com/codecommit/). Feature | Supported? ------- | ---------- [Repository syncing](/admin/code_hosts/aws_codecommit) | ✅ [Browser extension](/integration/browser_extension) | ❌ ## Repository syncing Site admins can [add AWS CodeCommit repositories to Sourcegraph](/admin/code_hosts/aws_codecommit). ## Browser extension The [Sourcegraph browser extension](/integration/browser_extension) does not yet support AWS CodeCommit. This means that you won't get hovers, go-to-definition, and find-references from Sourcegraph when viewing your code on AWS CodeCommit's web interface. # VS Code extension - [See user docs](/cody/clients/install-vscode) # JetBrains plugin manual test cases ## Overview All these test scripts are written in a way so that humans can perform it, but also an E2E testing tool can run it eventually. Each of these test cases should be run either right after starting the IDE and opening a project, _or_ after closing and reopening a project, to make sure we have a clean state. ### Test case format anatomy * The numbered items are the steps to perform in order. * The indented bullets are assertions. ### Performing a test manually If a red error notification appears at the bottom right of the IDE, that means we have a problem. Same if any of the assertions fail. If there is a problem, we should either investigate right away (typically, if a developer does the manual testing), or create an issue with the error message / specifying which test case failed, and any additional helpful context. ### Operating systems We test on macOS by default, but we should also test on Windows and Linux more often. We have three test instances to test the plugin on a Linux server, an Ubuntu Desktop machine, and on Windows Server. They are all on GCP, [here](https://console.cloud.google.com/compute/instances?cloudshell=true&project=david-veszelovszki-temp-env). - For the Windows instance, follow [this guide](https://www.snel.com/support/how-to-connect-to-your-server-via-rdp-on-macos/) to connect, then use the login/password you find in 1Password by the name "GCP: JetBrains plugin testing Windows". ## Test cases ### Website-related features #### Preparation **Perforce** testing is slightly tricky because we don’t currently have a lot of Perforce code hosts added to any of our Sourcegraph instances. Try this: * Use [https://cse-k8s.sgdev.org/](https://cse-k8s.sgdev.org/) as your Sourcegraph URL * Generate an access token for yourself for CSE-K8S (admin user in 1Password), set that * Set up a Perforce client * Set `perforce-tests.sgdev.org:1666` for the port. User is “admin”, password is in 1Password. * Make sure your connection work, and _actually connect_ in P4V (connection didn’t work without this step in IntelliJ for me) * Create a workspace for yourself (delete an old one if you bump into the 20-workspace limit), and include the `test-large-depot` depot * In the JetBrains plugin settings, set the replacement string to `perforce-tests.sgdev.org:,perforce.beatrix.com:app/,.perforce,/patch/core.perforce`. * At this point, your files should open properly in your browser. #### Search Selection and Open/Copy features 1. Open a project with a file that’s under Git version control 2. Right click on editor | Sourcegraph | Search Selection on Sourcegraph Web * Make sure it searches the current selection in all repos 3. Right click on editor | Sourcegraph | Search Selection in Repository on Sourcegraph Web * Make sure it searches the current selection in the current repo 4. Right click on editor | Sourcegraph | Open Selection in Sourcegraph Web * Make sure it opens the right file on the web 5. Copy Sourcegraph File Link * Make sure it copies the right URL (should be good if the previous point worked because they share the logic.) 6. Repeat it with a Perforce repo. #### “Open Revision Diff in Sourcegraph Web” 1. Open a project that has files under Git version control 2. Open Version Control (⌘9) | Log 3. Right click on a commit and choose Open Revision Diff in Sourcegraph Web 4. Make sure the right page opens on the Sourcegraph instance set up in the plugin settings 5. (Would be cool to also test this each time with a project that has files from multiple repositories.) 6. Repeat the process with a project that has files under Perforce version control. ### Find with Sourcegraph #### Popup opens, loads, and closes Why: To make sure the popup is discoverable and generally works 1. Press the shortcut for the popup * The popup should become active * The popup should be in the “loading” state 2. Wait until the “loading” state is gone * It should not take more than ~five seconds 3. Close the popup with ESC * The popup should become hidden 4. Open “Find Action” (⌘⇧A) and search for “find with sourcegraph” and select the first result * The popup should become active * The popup should not be in the “loading” state 5. Click the header of the IDE main window * The popup should become hidden 6. In the main menu, choose Edit | Find | Find on Sourcegraph… * The popup should become active #### Browser doesn’t disappear after a few opens Why: After opening and closing the "Find on Sourcegraph" popup four-five times on Mac, the browser disappears if _circumstances are not right_. This bug should be fixed, but it may reappear if we mess something up. 1. Open popup with the shortcut * The popup should become active 2. Wait until the “loading” state is gone 3. Close the popup with ESC 4. Open popup with the shortcut * The popup should become active, and the browser should be visible 5. Repeat 3–4 at least five times. #### Search results are displayed and navigation works Why: To make sure that the most basic functionality of the popup works 1. Open the popup with the shortcut 2. Wait for the browser content to load 3. Type “repo:^github\.com/sourcegraph/sourcegraph file:index.ts” * It should type into the input box * The content should be exactly the same as what was typed 4. Press Enter 5. Wait for the search results and preview to load * The result list and the preview box should populate 6. Press `↓` key 7. Wait for the search results and preview to load * The preview should be different from the previous one 8. Press `⌥Enter` * The popup should close * A new editor tab should open * The content of the new tab should be the same as the last preview 9. Open the popup with the shortcut 10. Press ⌘A, type “repo:^github\.com/sourcegraph/sourcegraph” and press Enter 11. Wait for the search results to load * The result list should update * The preview state should be “No preview available” 12. Press ⌥Enter * The popup should close * A browser should open (if automated: an “open browser” trigger should be sent) #### Server connection success/failure is recognized This test needs a valid access token that can be generated at https://sourcegraph.com/users/{username}/settings/tokens * Open Settings with `⌘`, * Go to Tools | Sourcegraph * Set the URL to “[https://sourcegraph.com](https://sourcegraph.com)” * Set the access token to a valid one * Press Enter to save settings * Open the popup with the shortcut * Wait for the browser content to load. * The search box should be visible * Close the popup with ESC * Open Settings with ⌘, * Type “TEST” after the end of the valid access token. * Press Enter to save settings * Open the popup with the shortcut * The search box should not be visible, an error message should appear * The preview should be saying “No preview available” * Close the popup with ESC * Open Settings with ⌘, * Remove “TEST” to again have the valid access token. * Press Enter to save settings * Open the popup with the shortcut * The search box should be visible again. # JetBrains plugin - See user docs at [jetbrains/README](https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/tree/README) - See dev docs at [jetbrains/CONTRIBUTING](https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/tree/CONTRIBUTING) - [Manual test cases](/integration/jetbrains/manual_testing) # Quickstart for Browser Extensions Get started with our Browser Extension in 5 minutes or less ## Installation Use one of the following links to install the Sourcegraph Browser Extension for your favourite browser. - Install Sourcegraph for Chrome - Install Sourcegraph for Safari - Install Sourcegraph for Firefox >NOTE: If you were using our self-hosted version of Firefox Extension and are looking to upgrade, please check our [migration guide](/integration/migrating_firefox_extension). ## Configure to use your Sourcegraph instance By default, the browser extension communicates with [sourcegraph.com](https://sourcegraph.com), which has only public code. To use the browser extension with your private repositories, you need to set up a private Sourcegraph instance and connect the extension to it. Follow these instructions: 1. [Install Sourcegraph](/admin/install). Skip this step if you already have a private Sourcegraph instance. 2. Click the Sourcegraph extension icon in the browser toolbar on the browser tab for your private Sourcegraph instance then open the settings page. 3. Enter the URL (including the protocol) of your Sourcegraph instance (such as `https://sourcegraph.example.com`) 4. Make sure the connection status shows "Looks good!" ## Grant permissions for your code host - [GitHub.com](https://github.com/) - no action required. - GitHub Enterprise, GitLab, Bitbucket Server, Bitbucket Data and Phabricator - you need to grant the extension permissions first. To grant these permissions: 1. Navigate to any page on your code host. 2. Right-click the Sourcegraph icon in the browser extension toolbar. 3. Click "Enable Sourcegraph on this domain". 4. Click "Allow" in the permissions request popup. # Browser Extensions

Bring the power of Sourcegraph to your code host

The Sourcegraph browser extension adds code navigation to files and diffs on GitHub, GitHub Enterprise, GitLab, Phabricator, Bitbucket Server and Bitbucket Data Center. - Install Sourcegraph for Chrome - Install Sourcegraph for Safari - Install Sourcegraph for Firefox ## Recommended ## How-tos - [Install across all Google Workspace users](/integration/browser_extension/how-tos/google_workspace) - [Add browser search engine shortcuts](/integration/browser_extension/how-tos/browser_search_engine) - [Troubleshoot common issues](/integration/browser_extension/how-tos/troubleshooting) ## References - [Privacy](/integration/browser_extension/references/privacy)
# Privacy Sourcegraph integrations will only connect to Sourcegraph.com as required to provide code navigation or other functionality on public code. As a result, no private code, private repository names, usernames, or any other specific data is sent to Sourcegraph.com. If connected to a **private, self-hosted Sourcegraph instance**, Sourcegraph integrations never send any logs, pings, usage statistics, or telemetry to Sourcegraph.com. They will send notifications of usage to that private Sourcegraph instance only. This allows the site admins to see usage statistics. If connected to the **public Sourcegraph.com instance**, Sourcegraph integrations will send notifications of usage on public repositories to Sourcegraph.com. The browser extension also does not store sensitive data locally. The information stored is restricted to: - AnonymousUid - Feature flags - Client settings - Enable/disable status - Sourcegraph URL # References The following is a list of reference documents for Browser Extensions: - [Features](/integration/browser_extension/references/features) - [Privacy](/integration/browser_extension/references/privacy) # Features ## Code navigation When you hover your mouse over code in files, diffs, pull requests, etc., the Sourcegraph extension displays a tooltip with: - Documentation and the type signature for the hovered token - **Go to definition** button - **Find references** button ## Search shortcut in URL location bar The Sourcegraph extension adds a search engine shortcut to your web browser that performs a search on your Sourcegraph instance. After you've installed it (see above), use the search shortcut it provides to perform a search: 1. Place cursor in the URL location bar, then type src Tab. 2. Start typing your search query. 3. Select an instant search suggestion or press Enter to see all results. To install this search engine shortcut manually, and for more information, see "[Browser search engine shortcuts](/integration/browser_extension/how-tos/browser_search_engine)". # Troubleshooting Below are the most common issues and how to resolve them. ## No code navigation or buttons ("View repository", "View file", etc.) are displayed on the code host ![Browser extension not working on code host](https://sourcegraphstatic.com/BrowserExtensionNotWorkingCodeHost.gif) Try the following: 1. Click the Sourcegraph extension icon in the browser toolbar to open the settings page. - Ensure that the Sourcegraph URL is correct. It must point to your own Sourcegraph instance to work on private code. - Check whether any permissions must be granted. If so, the settings page will offer you to "grant the Sourcegraph browser extension additional permissions". 1. On some code hosts, you need to be signed in (to the code host) to use the browser extension. Try signing in. ## The *Enable Sourcegraph on this domain* option is not available In rare cases, Chrome can get into the state where the option to **Enable Sourcegraph on this domain** is not available when right-clicking on the extension icon. One fix we've observed is to toggle the site access from on, to off, then on again (see below). ![Toggle site access for browser extension](https://sourcegraphstatic.com/ToggleSiteAccess.gif) If that still doesn't work, viewing the console and network activity of the extension is the next step. ## Viewing browser extension console and network activity in Chrome and Safari If you are still experiencing issues, the next step is to inspect the browser extension console output and network activity, often revealing subtle configuration errors. ![Chrome extension console and network activity](https://sourcegraphstatic.com/ChromeExtensionConsoleNetworkActivity.gif) In Chrome: 1. Right click the Sourcegraph browser extension icon 2. Select Manage Extensions 3. Under Inspect Views select background page, this will open a dev console to the extension background page 4. In the developer console select the network tab In Safari: 1. Ensure you have access to the develop tab by selecting Safari > Preferences > Advanced, at the bottom of the preference UI check the box labelled `Show Develop menu in menu bar` 2. In Develop select Web Extension Background Pages > Sourcegraph 3. Select the Network tab If that still doesn't help, take a screenshot of the console and network activity and attach it [to a new issue](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=&template=bug_report&title=Browser%20extension%20-%20) so we can investigate further. ## Unable to connect to `http://...` Ensure the URL is correct and you are logged in Since `v3.14.0+`, the Sourcegraph browser extension can only authenticate with Sourcegraph instances that have [HTTPS](/admin/tls_ssl) configured. Previously, the Sourcegraph browser extension was able to authenticate with instances that hadn't enabled tls / ssl. However, modern web browsers have started to adopt and implement [an IETF proposal](https://web.dev/samesite-cookies-explained/) that removes the deprecated logic that allowed this behavior. Please configure [HTTPS](/admin/tls_ssl) in order to continue using the browser extension with your private instance. ## `The string did not match the expected pattern` error in Safari The above validation error occurs in Safari when the browser tries to parse a non-JSON text as JSON. Communication between the graphql server & browser extension is always assumed to be JSON. However, when a proxy/saml is used with Sourcegraph, sometimes the proxy can send text/html instead. If you see this error displayed beneath the Url field of the sourcegraph extension, make sure that your current browser session is not in private mode. # How-tos The following is a list of how-to documents for Browser Extensions: - [Install across all Google Workspace users](/integration/browser_extension/how-tos/google_workspace) - [Troubleshooting](/integration/browser_extension/how-tos/troubleshooting) - [Add browser search engine shortcuts](/integration/browser_extension/how-tos/browser_search_engine) # Google Workspace and Chrome Enterprise integration > NOTE: Company-wide deployment via Google Workspace is a [paid upgrade](https://about.sourcegraph.com/pricing) You can install and preconfigure the Sourcegraph Chrome extension for all members of a Google Workspace organization or organizational unit, so that they can get code navigation on files and diffs. By default, the browser extension only has access to github.com. Access to additional sites is granted by the user, on a site-by-site basis. The Sourcegraph browser extension is open source and never sends any logs, pings, usage statistics or telemetry to Sourcegraph.com. Read more about browser extension privacy [here](/integration/browser_extension/references/privacy). ## Automatically install with Google Workspace Using the Google Admin Console, you can [automatically install](https://support.google.com/chrome/a/answer/6306504?hl=en) the Sourcegraph browser extension for all users in your organization. To do so: 1. Visit the Google Admin Console [Chrome management](https://admin.google.com/u/2/ac/chrome/apps/user) page, and click "Apps and extensions". 2. Select the desired organizational unit in the left-hand menu. 3. Click the **+** button to add an extension, select "Add Chrome app or extension by ID", and paste in the ID of the Sourcegraph browser extension: `dgjhfomjieaadpoljlnidmbgkdffpack`. 4. In "Installation Policy", select "Force install". 5. In the "Policy for extensions" field, fill in a JSON value containing the URL of your self-hosted Sourcegraph instance: ``` { "sourcegraphURL": { "Value": "https://sourcegraph.example.com" } } ``` 6. Click "Save". The Sourcegraph browser extension will then be rolled out to all managed browsers in your organization, preconfigured to point to your self-hosted Sourcegraph instance. The roll-out may take some time. Users will need to have valid accounts and be signed in to your Sourcegraph instance for the browser extension to provide code navigation. Users may also need to grant additional permissions to the Sourcegraph browser extension in order for it to provide code navigation on your code host. To check if Sourcegraph is properly configured, navigate to any page on your code host, and click the Sourcegraph icon in the browser toolbar. The popup will prompt you to grant additional permissions if needed: grant_permissions Users can disable Sourcegraph at any time by using the toggle in the extension settings: disable_extension # Browser search engine shortcuts You can add Sourcegraph as a browser search engine to quickly search Sourcegraph from your browser's location bar when you type a special shortcut, such as `src`. This is one of the most common ways to initiate a search on Sourcegraph. ![](https://sourcegraphstatic.com/SearchShortcut2.gif) --- ## Adding Sourcegraph as a browser search engine ### With the Sourcegraph browser extension (recommended) The easiest way is to install the [Sourcegraph browser extension](/integration/browser_extension/quickstart), which automatically configures the location bar `src` shortcut to search Sourcegraph. ### Google Chrome 1. Perform a code search on the Sourcegraph instance you want to add as a search engine. 1. Copy the URL of the search results page. 1. Go to `chrome://settings`. Under **Search engine**, click **Manage search engines**. Next to **Other search engines**, click **ADD**. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/AddButton.png) 1. In the **Add search engine** form, paste the URL you copied (in step 1) in the **URL with %s in place of query** field. Insert the string `%s` into the URL's `?q=` query parameter (and remove any parts of the query that you don't want to keep). 2. Fill in the keyword field with the keyboard shortcut you want for searching on Sourcegraph. In this example, it's set to s. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/Replace.png) 5.Click **ADD**. To use the shortcut, focus in the browser address bar, type in the keyword you chose (such as src), and press Tab. Now type your Sourcegraph code search query and hit enter. You'll be taken to the search results page on your Sourcegraph instance. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/KeyboardShortcut.png) For more information on setting Chrome search engines, [see Chrome's help page](https://support.google.com/chrome/answer/95426?co=GENIE.Platform%3DDesktop&hl=en). ### Firefox To add Sourcegraph as a search engine in Firefox: 1. Visit https://sourcegraph.com/search (or your own Sourcegraph instance) 2. Click the three dots in the URL bar and choose **Add Search Engine**: ![image](https://storage.googleapis.com/sourcegraph-assets/Docs/84444295-4e2b8180-abf6-11ea-8f96-61312ab40278.png) 3. You may then search using your URL bar and select `Sourcegraph` from the list of search engines: ![image](https://user-images.githubusercontent.com/3173176/84446118-b4fe6a00-abf9-11ea-9627-7ffc16abafca.png) To configure a shortcut (keyword) for quicker access: 1. In the URL bar, enter about:preferences#search 1. Scroll down to **One-Click Search Engines**, double-click the **Keyword** cell for **Sourcegraph** and type in a shortcut (such as src). To use the search engine, type `src` `Tab` in the URL bar, then type your Sourcegraph search query. Pressing `Enter` will then go right to Sourcegraph! See "[Add or remove a search engine in Firefox](https://support.mozilla.org/en-US/kb/add-or-remove-search-engine-firefox)" for more information. ### Other web browsers Consult your web browser's documentation or settings page for information on how to add custom search engines. Most web browsers support this feature. # How to videos

Short, consumable videos to help you get started with Sourcegraph.

## [Code Search]()
# Cody ### Getting started with Cody | Topic | Description | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [Cody Web - Overview](https://www.loom.com/share/0989de19eafc44be9208f2ece9b2d901?sid=fa5965de-b844-406d-801a-bcf86f24913c?sid=bf56d3a2-e640-40ba-8cf0-d684ef9317f4) | Intro to the Cody web feature. | [Cody IDE - Overview](https://www.loom.com/share/44976666510f477da4d140273bd7615a?sid=bf56d3a2-e640-40ba-8cf0-d684ef9317f4) | Intro to the Cody extension in an IDE. | [Cody IDE - Chat](https://www.loom.com/share/a8c9403e10144f65a7413509c5f03f9c) | Intro to Cody chat in an IDE. | [Cody IDE - Autocomplete](https://www.loom.com/share/d1270097c6c148148bdbaf9a2f7bfe7e) | Intro to Cody autocomplete in an IDE. | [Cody IDE - Commands](https://www.loom.com/share/528b7b0ac36f4fbf8adb1cdba84f40da?sid=2d4e0354-5746-4beb-8848-bda547aa0110) | Intro to Cody commands in an IDE. ### Identifying Code AI Use Cases | Topic | Description | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [LLM Fundamentals](https://www.loom.com/share/379a3c6f9a2140cd8c5c8569ee7908e1?sid=c144e439-45a3-49fc-8034-8935fb23758e) | LLM basics and how they impact coding assistants. | [Cody Context Retrieval](https://www.loom.com/share/4bf1c37ccd8f425286618eaecce5d2ba?sid=629b5a84-2e48-4036-b89b-128a8155bdb3) | Demystifying Cody context retrieval. | [Task Categorization](https://www.loom.com/share/ab876ae8bed14ab889640e8f938d5ac7?sid=88c864e2-7fbb-4bc8-b213-5805eda9a1e5) | Introducing a task categorization framework to help you use coding assistants effectively. | [Cody Use Cases in the Developer Workflow](https://www.loom.com/share/d99d64ade19a447eaf512fa158d19092?sid=929c3811-4472-41c8-9568-20d10fb0efa5) | Thinking about how to use Cody in the typical developer workflow. # Code Search Full [search query syntax](/code-search/queries). ### Introduction | Topic | Description | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [Intro to Sourcegraph Search Types](https://www.loom.com/share/e5e97ea303ab408e99478f34052cfe1b?sid=49bd4515-d4d0-466b-be10-f40df13ce081) | Navigating the Code Search web app and the Keyword, Literal, Regex, and Structural search. | | [Search Results Page Overview](https://www.loom.com/share/c713baea045c40bdba9bc2f524ae4387?sid=8f6e3242-032c-40ec-9fa8-2006ad3c30f9) | Navigating the search results page. | | [Intro to Search Filters](https://www.loom.com/share/f48295092e7f4a9b874bfd8f81595a87?sid=dd05c740-be70-4374-b890-219a48c8d9f2) | An overview of the most commonly-used search filters such as Language, Repo, and File. | | [Search Types](https://www.loom.com/share/2484f5b47fec47c68369399a26a18150?sid=52b5df3f-35d4-4ea0-b009-cd64946d1d38) | Searching against Code, Repo, Path, Symbol, Commit, and Diff data. | | [Code Navigation](https://www.loom.com/share/a354ee1d87524239a8322d4c9c3131e9?sid=ce08dd70-4489-4cdc-b067-d470a505ce41) | Finding defintions and references, and an explanation of precise versus search-based [code navigation](/code-search/code-navigation). | | [Saving Searches](https://www.loom.com/share/5728c5fc9ac14a11aa9ca875c6eaa406?sid=eb6112d7-5f3e-45fb-ae89-a990355f0ab8) | [Saving](/code-search/working/saved_searches) commonly-used searches. | | [Search Contexts](https://www.loom.com/share/0b2ebb0a96154a87bad3c3c451f2ffcd?sid=dd211b02-6d7b-4c52-86fd-bebccc4a63d9) | Intro to [Search Contexts](/code-search/working/search_contexts.mdx) and how to manage them. | ### Advanced Searches | Topic | Description | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [Non-default branches, revisions, and tags](https://www.loom.com/share/2a812f39bc5548b19ff2e05e819485ec?sid=7bccac65-4354-4177-8dca-d22bff2480ff) | Intro to [Revision search](/code-search/queries/language#revision) and how to search for specific branches, revisions, and tags. | | [Commit messages](https://www.loom.com/share/2221265f062b4092bca6a69270fac84e?sid=b0d17c04-f01d-43dd-a690-a740b1bde4b0) | Searching `type:commit` messages. | | [Diffs](https://www.loom.com/share/daf8a5dcb5ea4ee0b41cddad7331f433?sid=a86b047f-f516-4c85-be1f-1dab5fd6d76d) | Searching `type:diff` . | | [Added or removed code](https://www.loom.com/share/ccb7ce60010749989978dd717faded8a?sid=7e610fe0-4914-4476-8596-2ef330701b10) | Combining `type:diff` with `select:commit.diff.(added OR removed)` . | | [By author](https://www.loom.com/share/5dfaa523713b4fa49526533abb0a9391?sid=6ca791e0-157b-486e-acb6-4584592c29c4) | Using the `author: ` filter. | | [Time-boxing searches](https://www.loom.com/share/104a5abfb3b74663b4b2f140d24bab3f?sid=5479b164-d6cb-4268-a959-00dbf01d8178) | Using the `before:` and `after:` filters. | | [Boolean operators](https://www.loom.com/share/0e762571a0334ceabf41c6bb4732642b?sid=34ecfad8-7a83-4c21-914b-3a90a0c3b9e2) | Using `AND`, `OR`, and `NOT` operators. | | [Functions and other symbols](https://www.loom.com/share/88755bf5490947a080e88a5fea040323?sid=9f815a7f-881f-4f0c-a55b-6e4b95699a0a) | Using `type:symbol` filter. | | [Advanced symbol search](https://www.loom.com/share/b8a1456c460442d3b42db1f2c783dd63?sid=a191fc76-34bf-4f71-89ee-6905235c8f47) | Combining the `select:symbol.(symbol_type)` and `type:symbol` filters. | | [Selecting metadata](https://www.loom.com/share/acb42f0611c14bb19dd24b28ac84ec2e?sid=2cf9ce6f-2862-4176-80b4-f66eb0e30277) | Using `select:` filter to return data other than the type of data searched against, e.g. returning all repos than contain a certain function. | | [Advanced repo search](https://www.loom.com/share/99e3f27c060b41d793e470a95c6f67bf?sid=8662effe-6e74-47c1-86aa-bef9e505a9a1) | Using [`repo:has.(...)`](/code-search/queries/language#built-in-repo-predicate) filters. | | [Excluding stale repos](https://www.loom.com/share/7c602971543546538c475a698e23871e?sid=ccd38787-eb5e-4e96-a7ac-255d699b8ed3) | Using `repo:has.commit.after(...)` filter. | ### Batch Changes and Code Insights | Topic | Description | | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | [Batch Changes](https://www.loom.com/share/475d300b96c4404ba62edc8063499a05?sid=79e1fdb4-65ca-46d9-bfe9-d80257db831c) | Intro to managing [Batch Changes](/batch-changes) and the [batch spec](/batch-changes/batch-spec-yaml-reference) file. | | [Code Insights](https://www.loom.com/share/7066ac1ef33a41638793ac8f468b8ab8?sid=35b001df-84f8-4221-90c4-2ba46e03b9fc) | Intro to [Code Insights](/code_insights). | | [Code Monitoring](https://www.loom.com/share/99b8302e832a4341bc98916219fe8418?sid=261fc431-67e7-4df2-9cfa-306bcf003911) | Intro to [Code Monitoring](/code_monitoring). | # Sourcegraph Tour Sourcegraph is a code search and intelligence tool for developers. It lets you search and explore your organization's code on the web, with integrations into your existing tools. Let's tour Sourcegraph to see how it helps with everyday developer tasks. ## Code review: Gain context on changed code A developer reviewing a pull request or diff might need to understand the changed code to see whether it'll have any negative impacts or if other necessary changes were accidentally omitted. Using Sourcegraph makes you a more effective code reviewer because code navigation makes it much easier to drill down into the implementation (to verify the correctness of the change) and enumerate call sites (to verify completeness of the change). ### Requirements - A [Sourcegraph Cloud](/cloud/) instance, or [deploy and configure Sourcegraph](/admin/deploy/) and add repositories - Install the integration for your code host/review tool ### Workflow 1. Visit a pull request or code review in your web browser. 2. Hover over source code in the diff (in added, unchanged, or deleted code) to see hover tooltips with documentation and **Go to definition** and **Find references** actions. 3. Use these actions while reviewing the diff, such as to ensure that all call sites of a modified function are updated to account for any new assumptions or behavior. To try this on an open-source pull request, install the browser extension and visit [gorilla/websocket#342](https://github.com/gorilla/websocket/pull/342/files). Use **Find references** to see all cases in which the newly added `AllowClientContextTakeover` is used. ## Example code: Learn how a particular function should be called A developer adding a new feature needs to know how I should call a particular function. Viewing cross-references (internal and external) on Sourcegraph is a great way to learn how to use a function or library because it shows you how it's _actually_ being used, not just what the (possibly outdated or incomplete) documentation might suggest. ### Requirements - [Deploy and configure Sourcegraph](/admin/deploy/) and add repositories - Install the browser extension and editor plugin for a faster way to initiate searches (optional) ### Workflow 1. Search on Sourcegraph for the name of the function you're trying to call. If you've installed any integrations, use those to initiate the search; otherwise, use the search box on the homepage of your organization's internal Sourcegraph instance. 1. Find and click on a search result for the function you're looking for. (If needed, narrow your search using the suggested search filters below the search box or by [adding your filters](/code-search/queries).) 1. Click on the function's name in the code file (if it's not already highlighted). 1. Click **Find references** to see how the function is called. 1. Click through to various function call sites and use the after-line blame's authorship and recency information to gauge the quality of the call site as an example. To try this on an open-source repository, start by searching for [repo:dgrijalva/jwt-go parsewithclaims](https://sourcegraph.com/search?q=repo:dgrijalva/jwt-go+parsewithclaims) and follow the steps above to view internal and external references for the [`ParseWithClaims`](https://sourcegraph.com/github.com/dgrijalva/jwt-go/-/blob/token.go#L92:6$references) function. ## Explore/read code: Understand what a function does and how it works As a new developer on a project, I need to understand the implementation details of a certain part of the code. Navigating your code with code navigation on Sourcegraph is a great way to understand code better because it works across all of your repositories (and all versions) without additional configuration, and it lets you share links with teammates if you need to ask specific questions about pieces of code. ### Requirements - [Deploy and configure Sourcegraph](/admin/deploy/) and add repositories - Install the browser extension and editor plugin for a faster way to initiate searches (optional) ### Workflow 1. Search on Sourcegraph to locate the part of the code you're interested in. If you've installed any integrations, use those to initiate the search; otherwise, use the search box on the homepage of your organization's internal Sourcegraph instance. 1. Find and click on a relevant search result or search suggestion. (If needed, narrow your search using the suggested search filters below the search box or by [adding your filters](/code-search/queries).) 1. Read through the code, click on a token, and then **Go to definition** to navigate to its definition as needed. 1. If you have unanswered questions, use the blame information to determine who wrote the code, and send them a Sourcegraph link to the relevant code along with your specific questions. Using an Open Source repo, you can follow the steps above to navigate to the implementation of the [`getLocation`](https://sourcegraph.com/github.com/Microsoft/node-jsonc-parser@e31983089c88114c7cc17f8c729feb493295c69d/-/blob/src/impl/parser.ts#L26:17) function. From there, keep drilling down depth-first until you get to the [`createScanner`](https://sourcegraph.com/github.com/Microsoft/node-jsonc-parser@e31983089c88114c7cc17f8c729feb493295c69d/-/blob/src/impl/scanner.ts#L13:17) function. Explicitly, this involves reading `getLocation` until you reach the first new function, `visit`; then finding the implementation of `visit` via "get references" and reading `visit` until you reach the first new function, `createScanner`. ## Debug issues: See what changed related to a function call that's erroring in production As a developer responsible for a service running in production, I need to respond to a crash report with a stack trace by quickly identifying and fixing the problem. Diff search on Sourcegraph is a great starting point for your investigation into what broke, because it shows you all recent changes that match your query. ### Requirements - [Deploy and configure Sourcegraph](/admin/deploy/) and add repositories - Install the browser extension and editor plugin for a faster way to initiate searches (optional) ### Workflow 1. Perform a diff search on Sourcegraph with the name of the function that the stack trace originates from, such as `type:diff myCrashingFunctionName`. If you've installed any integrations, use those to initiate the search; otherwise, use the search box on the homepage of your organization's internal Sourcegraph instance. 1. Scroll through the search results, which show you all commits (and diffs) that match the function name, newest first. (If needed, narrow the diff search by [adding search filters](/code-search/queries).) 1. Find and click on a relevant search result. On the search results page, clicking on the commit message brings you to the diff (with code navigation), and clicking on the code in the commit diff brings you to the full file at the revision before or after the commit. 1. Use **Go to definition** and **Find references** to understand the implementation changes and callers # Getting Started

This page will help you learn and understand about Sourcegraph and how to use it.

## What is Sourcegraph? Sourcegraph is a Code Intelligence platform that deeply understands your code, no matter how large or where it's hosted, to power modern developer experiences. ## Who should use Sourcegraph? In addition to the [companies listed on about.sourcegraph.com](https://about.sourcegraph.com), companies with a few hundred developers up to those with more than 40,000 use Sourcegraph daily. More specifically, Sourcegraph is great for all developers except: - those on smaller teams with a small amount of code - those who rarely search, read, or review code ## Why do I need Code Search? Facebook and Google provide their employees with an in-house Sourcegraph-like code search and intelligence tool. A [published research paper from Google](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43835.pdf) and a [Google developer survey](https://docs.google.com/document/d/1LQxLk4E3lrb3fIsVKlANu_pUjnILteoWMMNiJQmqNVU/edit#heading=h.xxziwxixfqq3) showed that 98% of developers surveyed consider their Sourcegraph-like internal tool to be critical. Developers use it on average for 5.3 sessions each day. (Facebook's and Google's in-house tools are unavailable to other companies; use Sourcegraph instead.) ## What do I use Sourcegraph for? Sourcegraph helps you: - Find example code - Explore/read code (including during a code review) - Debug issues - Locate a specific piece of code - Determine the impact of changes - And more! Sourcegraph makes it easier for you and everyone else in your organization to perform these tasks. ## What does Sourcegraph do? Sourcegraph's main features are: - [Code navigation](#code-navigation): jump-to-definition, find references, and other smart, IDE-like code browsing features on any branch, commit, or PR/code review - [Code search](#code-search): fast, up-to-date, and scalable, with regexp support on any branch or commit without an indexing delay (and diff search) - [Notebooks](#notebooks): pair code and markdown to create powerful live and persistent documentation - [Cody](#cody): read and write code with the help of a context-aware AI code assistant - [Code Insights](#code-insights): reveal high-level information about your codebase at its current state and over time to track migrations, version usage, vulnerability remediation, ownership, and anything else you can search in Sourcegraph - [Batch Changes](#batch-changes): make large-scale code changes across many repositories and code hosts - [Integrations](#integrations) with code hosts, code review tools, editors, web browsers, etc. ## How do I start using Sourcegraph? 1. [Deploy and Configure Sourcegraph](/admin/deploy/) inside your organization on your internal code if nobody else has yet 1. Install and configure the [web browser code host integrations](/integration/browser_extension) (recommended) 1. Start searching and browsing code on Sourcegraph by visiting the URL of your organization's internal Sourcegraph instance 1. [Personalize Sourcegraph](/getting-started/personalization/) with themes, quick links, and badges! You can also try [Sourcegraph.com](https://sourcegraph.com/search), a public Sourcegraph instance for use on open-source code only. ## How is Sourcegraph licensed? Sourcegraph Enterprise is Sourcegraph's primary offering and includes all code intelligence platform features. Sourcegraph Enterprise is the best solution for enterprises who want to use Sourcegraph with their organization's code. Sourcegraph extensions are also OSS licensed (Apache 2), such as: - [Sourcegraph browser extension](https://github.com/sourcegraph/sourcegraph/tree/master/client/browser) - [Sourcegraph Jetbrains extension](https://github.com/sourcegraph/sourcegraph/tree/main/client/jetbrains) ## How is Sourcegraph different from the GitHub code search? - [See how GitHub code search compares to Sourcegraph](/getting-started/github-vs-sourcegraph) ## Code Search Sourcegraph code search is fast, works across all your repositories at any commit, and has minimal indexing delay. Code search also includes advanced features, including: - [Powerful, flexible query syntax](/code-search/queries) - [Commit diff search](/code-search/features#commit-diff-search) - [Commit message search](/code-search/features#commit-message-search) - [Saved search scopes](/code-search/features#search-scopes) - [Search contexts to search across a set of repositories at specific revisions](/code-search/features#search-contexts) - [Saved search monitoring](/code_monitoring/) Read the [code search documentation](/code-search/) to learn more and discover the complete feature set. Here's a video to help you get started: - [How to Search commits and diffs with Sourcegraph](https://youtu.be/w-RrDz9hyGI) - [Search Examples](https://sourcegraph.github.io/sourcegraph-search-examples/) ## Code Navigation Sourcegraph gives your development team cross-repository IDE-like features on your code: - Hover tooltips - Go-to-definition - Find references - Symbol search Sourcegraph gives you code navigation in: - **code files in Sourcegraph's web UI** ![Hover tooltip](https://storage.googleapis.com/sourcegraph-assets/code-graph/docs/hover-tooltip.png) - **diffs in your code review tool**, via [integrations](/integration/) ![GitHub pull request integration](https://storage.googleapis.com/sourcegraph-assets/code-graph/docs/github-pr.png) - **code files on your code host**, via [integrations](/integration/) ![GitHub file integration](https://storage.googleapis.com/sourcegraph-assets/code-graph/docs/github-file.png) Please read the [code navigation documentation](/code-search/code-navigation/) to learn more and to set it up. ## Cody Cody is an AI code assistant that uses Sourcegraph code search, the code graph, and LLMs to provide context-aware answers about your codebase. Cody can explain code, refactor code, and write code, all within the context of your existing codebase. [Learn more about Cody](/cody/overview/). ## Notebooks GA in version 3.39 or later Increase dev collaboration and self-service through live documentation covering best practices, shared code, and processes. Read the [Notebooks documentation](/notebooks/) to learn more, and check out these [publicly available notebooks](https://sourcegraph.com/notebooks?_ga=2.9922293.1906238367.1667257632-528424761.1615652680&_gl=1*1xalma3*_ga*NTI4NDI0NzYxLjE2MTU2NTI2ODA.*_ga_E82CCDYYS1*MTY2NzI1NzYzMi41NS4xLjE2NjcyNjA3NjIuMC4wLjA.). ## Batch Changes Batch Changes is an Enterprise feature. Automate changes to your codebase. Reduce effort, reduce errors, and enable developers to focus on high-value work. Read the [batch changes documentation](/batch-changes/) to learn more, including helpful how-to guides. Want a video tutorial? Check out this [batch change tutorial](https://www.youtube.com/watch?v=eOmiyXIWTCw) ## Code Insights Code Insights is an Enterprise feature. Sourcegraph lets you understand and analyze code trends by visualizing how the codebase changes. Measure and act on engineering goals such as migration and component deprecation. Read the [code insights documentation](/code_insights/) to learn more, including helpful how-to guides. ## Integrations Sourcegraph allows you to get code navigation and code search on code files and code review diffs in your code host and review tool or from your IDE. ### IDE integration Sourcegraph's editor integrations allow you to search and navigate across all of your repositories without ever leaving your IDE or checking them out locally. Learn more about how to set them up [here](/integration/editor). ### Browser extension Our browser extension directly adds code navigation within your code hosts (GitHub, GitLab, Bitbucket, and Phabricator) via Chrome, Safari, and Firefox browsers. Learn more about how to set up the browser extension [here](/integration/browser_extension/).
# GitHub code search vs. Sourcegraph GitHub code search is the next iteration of GitHub’s native code search and navigation functionality that can be used to search code stored in GitHub. It’s currently in beta preview. Sourcegraph is a code intelligence platform that makes codebases intelligible by semantically indexing and analyzing all of an organization’s code, providing developers and engineering leaders with a complete understanding of their codebase. In addition to universal code search across every code host, Sourcegraph has features to help developers find code, understand and answer questions about code, and fix code faster. ## Which is best for you? **Who should use GitHub code search?** If you’re brand new to code search and you simply want to try it out, start with GitHub code search across your own code. If you have a small codebase hosted exclusively in GitHub, GitHub's native code search will likely be sufficient as you get started with code search. **Who should use Sourcegraph?** As your codebase grows in complexity, the value of code search quickly increases. Sourcegraph may be a good fit for your team if: * You have a large number of repositories or a large and complex monorepo * You host code across multiple code hosts (or you don’t have any code in GitHub) If you frequently rely on your editor’s “go to definition” and “find references” features, you’ll also be able to take advantage of Sourcegraph's precise code navigation. Only Sourcegraph's offering features IDE-level accuracy and works across repositories. If you're brand new to code search and you want to try it, visit [Sourcegraph.com](https://sourcegraph.com/search) to search across open source repositories. For a high-level overview of how Sourcegraph compares to GitHub code search, see this [document](https://storage.googleapis.com/sourcegraph-assets/docs/PDFs/Sourcegraph%20vs.%20GitHub%20code%20search%20chart.pdf). ## Searching code ### Code host integrations GitHub code search can only be used to search across code that is stored in GitHub. Organizations with code stored in multiple code hosts cannot use GitHub code search to search across their entire codebase. Sourcegraph integrates with multiple code hosts to provide universal code search across all of your organization’s code, no matter where it’s stored. Sourcegraph has out-of-the-box [integrations](/integration) with: * GitHub * GitLab * Bitbucket Cloud and Bitbucket Server / Bitbucket Data Center * Perforce You can also integrate Sourcegraph with other Git-based code hosts using [these](/admin/code_hosts/other) instructions or use the [Sourcegraph CLI (src)](/admin/code_hosts/src_serve_git) to load local repositories without a code host into Sourcegraph. Sourcegraph is continuously adding [Tier 1](/admin/code_hosts) support for additional code hosts.
GitHub Sourcegraph
GitHub
GitLab
Bitbucket Cloud
Bitbucket Server / Bitbucket Data Center
Perforce
Any Git-based code host
### Searching repositories, branches, and forks GitHub allows you to search indexed code, but not all code is indexed. GitHub’s current limitations on indexed code are: * Files over 350 KiB and empty files are excluded * Only UTF-8 encoded files are included * All code inside very large repositories may not be indexed * Vendored and generated code is excluded (as determined by [Enry](https://github.com/go-enry/go-enry)) With GitHub, only the default **branch** is searchable (though GitHub is planning to support branch search in the future). **Forks** are included in the index but are subject to the same limitations as other repositories, so not all forks are indexed. You may need to include the fork filter to retrieve results for the fork repos, but an admin can adjust global settings to include forks in search query results automatically. GitHub code search supports searching across issues, pull requests, and discussions. In addition to searching your private code, GitHub has indexed over 7 million public GitHub repositories which are also searchable. Sourcegraph allows you to search both indexed and unindexed code. Sourcegraph’s [current limitations](/admin/search) on indexed code are: * Files larger than 1 MB are excluded unless you explicitly specify them in [search.largeFiles](/admin/config/site_config#search-largeFile) to be indexed and searched regardless of size * Binary files are excluded * Files other than UTF-8 are excluded With Sourcegraph, typically, the latest code on the default **branch** of each repository is indexed (usually the master or main), but Sourcegraph can also index other non-default branches, such as long-running branches like release branches. If you’re searching outside of indexed branches, you can use unindexed search. You should expect slightly slower results when searching unindexed code. In addition to searching your organization’s private code, you can use Sourcegraph.com to search across 2.8 million public repositories from multiple code hosts. | **Features** | **GitHub** | **Sourcegraph** | | ---------------------------------------------------- | ----------------------- | --------------------------------------- | | Search across all repositories and forks | ✓ with limitations | ✓ with limitations | | Search across files larger than 350 KiB | ✗ | ✓ (Using the search.largeFiles keyword) | | Search across all branches | Only the default branch | ✓ | | Number of open source repositories indexed | 7 million | 2.8 million | | Search across issues, pull requests, and discussions | ✓ | ✗ | ### Search syntax Sourcegraph offers [structural search](/code-search/types/structural), and GitHub code search does not offer this search method. Structural search lets you match richer syntax patterns, specifically in code and structured data formats like JSON. Sourcegraph offers structural search on indexed code and uses [Comby syntax](https://comby.dev/docs/syntax-reference) for structural matching of code blocks or nested expressions. For example, the `fmt.Sprintf` function is a popular print function in Go. [Here](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/about%24+fmt.Sprintf%28...%29&patternType=structural&_ga=2.204781593.827352295.1667227568-1057140468.1661198534&_gac=1.118615675.1665776224.CjwKCAjwkaSaBhA4EiwALBgQaJCOc6GlhIDQyg6HQScgfSBQpoFTUf7T_NNqEX5JaobtCS08GUEJuRoCIlIQAvD_BwE&_gl=1*1r2u5zs*_ga*MTA1NzE0MDQ2OC4xNjYxMTk4NTM0*_ga_E82CCDYYS1*MTY2NzUwODExNC4xMTQuMS4xNjY3NTA5NjUyLjAuMC4w) is a pattern that matches all of the arguments in `fmt.Sprintf` in our code using structural search compared to the [search](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/about%24+fmt.Sprintf%28...%29&patternType=regexp) using regex. Both GitHub code search and Sourcegraph support regular expression and keyword search. [Regular expression](/code-search/queries#standard-search) helps you find code that matches a pattern (including classes of characters like letters, numbers, and whitespace) and can restrict the results to anchors like the start of a line, the end of a line, or word boundary. Keyword search matches on individual terms, supporting both literal searches and flexible keyword-style queries. GitHub’s search syntax can be found [here](https://cs.github.com/about/syntax), and Sourcegraph’s search syntax can be found [here](/code-search/queries). Regardless of the type of search method you use, GitHub’s search is line-oriented, and Sourcegraph supports multi-line search. This means that Sourcegraph’s search queries can find results that cross multiple lines. For example, here is an [example](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/Parsely/pykafka%24+Not+leader+for+partition&patternType=regexp&_ga=2.114069518.827352295.1667227568-1057140468.1661198534&_gac=1.47310293.1665776224.CjwKCAjwkaSaBhA4EiwALBgQaJCOc6GlhIDQyg6HQScgfSBQpoFTUf7T_NNqEX5JaobtCS08GUEJuRoCIlIQAvD_BwE&_gl=1*zwylx9*_ga*MTA1NzE0MDQ2OC4xNjYxMTk4NTM0*_ga_E82CCDYYS1*MTY2NzU3NDA3OC4xMTcuMS4xNjY3NTc2NjIyLjAuMC4w) of matching multiple text strings in a file using regex, and here is a second explicit multi-line search [example](https://sourcegraph.com/search?q=context:global+app.terraform.io/example_corp+%5Cn+version+%3D%28.*%290.9.%5Cd+lang:Terraform&patternType=regexp) for terraform module verisions. ### Commit diff search and commit message search Commit diff and commit message searches help you see how your codebase has changed over time. With Sourcegraph, you can search within [commit diffs](/code-search/features#commit-diff-search) to find changes to particular functions, classes, or specific areas of the codebase, and you can search over [commit messages](/code-search/features#commit-message-search) and narrow down searches with additional filters such as author or time. GitHub code search does not offer commit diff search or commit message search. ### Symbol search Symbol search makes it easier to find specific functions, variables, and more by filtering searches for symbol results. Symbol results also allow you to jump directly to symbols by name. Both GitHub code search and Sourcegraph support symbol searching. GitHub supports symbol search in 10 languages, including C#, Python, Go, Java, JavaScript, TypeScript, PHP, Protocol Buffers, Ruby, and Rust. Sourcegraph’s [symbol search](/code_navigation/explanations/features#symbol-search) is available for more than [75 languages](https://about.sourcegraph.com/blog/introducing-sourcegraph-server-2-6). | **Features** | **GitHub** | **Sourcegraph** | | --------------------------------------- | -------------------------------------------------------------------------------------------------- | --------------- | | Structural search | ✗ | ✓ | | Keyword search | ✓ | ✓ | | Regular expression search | ✓ | ✓ | | Multi-line search support | ✗ | ✓ | | Commit diff and commit message searches | ✗ | ✓ | | Symbol search | 10 languages (C#, Python, Go, Java, JavaScript, TypeScript, PHP, Protocol Buffers, Ruby, and Rust) | 75+ languages | ### Search results and result types **Search results** GitHub only returns the first 10 pages of search results. You cannot currently go past the 10th page or retrieve all search results. Sourcegraph can retrieve all search results. By default, Sourcegraph returns 500 search results, but this number can be increased by increasing the ‘count’ value. Sourcegraph can display a maximum of 1,500 results, but all matches can be fetched using the [src CLI](/cli/quickstart), the [Stream API](/api/stream_api), or [GraphQL API](/api/graphql). You can also export the results via CSV. GitHub code search includes suggestions, completions, and the ability to save your searches. Sourcegraph offers suggestions through search query examples and [saved searches](/code-search/working/saved_searches#creating-saved-searches). GitHub code search returns a list of repositories and files. Sourcegraph results can include repositories, files, diffs, commits, and symbols; however, you must use the ‘type’ filter to return anything outside of repositories and files. **Ranking** Both GitHub and Sourcegraph display the most relevant search results first using a variety of heuristics. GitHub analyzes how many matches are in the file, the quality of the matches, the kind of file, whether the searches match symbols, and the number of repository stars as inputs for ranking results. Sourcegraph uses a repository’s number of stars to [rank](https://docs-legacy.sourcegraph.com/dev/background-information/architecture/indexed-ranking) the most important repositories first There are several other heuristic signals that help to make sure that the most important documents are searched first, including: * Up rank files with a lot of symbols * Up rank small files * Up rank short names * Up rank branch count * Down rank generated code * Down rank vendored code * Down rank test code When submitting a search query, the quality of a match is scored based on language-specific heuristics (Java classes rank higher than variables), word boundaries, and symbol ranges. The score that is received at the time of the query is combined with the index time rank and the repository’s priority to determine the final ranking. [Sourcegraph.com](https://sourcegraph.com/search) (Sourcegraph's public instance for searching open source code) utilizes an algorithm inspired by Google PageRank to measure code reuse and return the most relevant search results first. This new ranking algorithm will be implemented for Sourcegraph customer instances (self-hosted and Cloud) in the future. | **Features** | **GitHub** | **Sourcegraph** | | ----------------------------------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Comprehensive search results | ✗ (Limited to 10 pages of results) | ✓ (500 search results are returned by default, but this number can be increased by increasing the ‘count’ value. A maximum of 1,500 results can be displayed, and more matches can be fetched using the src CLI, the Stream API, or GraphQL API.) | | Ranking based on a variety of heuristics including usage of code, files, and repositories | ✓ | ✓ | ### Search aggregations To help you understand and refine search results, Sourcegraph’s search results also include visual search aggregation charts. These charts help you answer unique questions about the overall results set that individual search results cannot, like how many different versions of a library or package are present in your code, which repositories in a given library are most used, and more. They can also help you quickly refine your search by seeing which files, repositories, authors, or capture group returned the most results, and then clicking a result in the chart to add a filter to your query. You can group your search results by location (repository or file), author, or arbitrary capture group pattern. Example search aggregations can be found [here](/code_insights/references/search_aggregations_use_cases). GitHub code search does not currently offer this functionality. ### Search filters and contexts **Filters** Code search filters help you refine and narrow search query results to be more relevant. Both GitHub code search and Sourcegraph include filters. GitHub code search includes filters such as language, repository, path, and file size. GitHub automatically suggests filters to apply to your search based on your search history and information about you, such as your organization. GitHub also offers auto-complete using filters to complete a code search query. Sourcegraph filters reduce the scope of search query results by language, repository, path, author, message, content, timeframe, visibility, and more. Sourcegraph offers auto-completion on filters in the search query. **Search contexts** Search contexts are an alternative way to narrow down the scope of your search to the code you care about. Search contexts are available with both GitHub and Sourcegraph. You can create custom search contexts to be simple or advanced with GitHub. Simple search contexts are things such as repository or organization name, and advanced search contexts can mix multiple attributes, including languages. GitHub’s search contexts allow for more personalization than Sourcegraph. With Sourcegraph, a [search context](/code-search/working/search_contexts) represents the body of code that will be searched. Search contexts can be private to the user who creates it or shared with other users on the same Sourcegraph instance. [Query-based ](/code-search/working/search_contexts#beta-query-based-search-contexts)search contexts (beta) are an additional way to create search contexts based on variables like repository, rev, file, lang, case, fork, and visibility. Both [OR] and [AND] expressions are allowed to help further narrow the scope of query-based search contexts. | **Features** | **GitHub** | **Sourcegraph** | | --------------- | ----------------------- | ------------------------------------ | | Filters | ✓ | ✓ | | Search contexts | ✓ (Simple and advanced) | ✓ (Repository-based and query-based) | ## Understanding and navigating code **Code navigation** helps you explore code in depth. It includes features such as “Go to definition” and “Find references,” which let you quickly move between files to understand code. ### Search-based code navigation Both GitHub and Sourcegraph offer out-of-the-box, search-based code navigation. This version of code navigation uses search-based heuristics to find references and definitions across a codebase without any setup required. It is powerful and convenient, but it can sometimes present inaccurate results. For example, it can return false positive references for symbols with common names. It is limited to returning definitions and references within a single repository (it won’t track references across multiple repositories). GitHub’s [search-based code navigation](https://docs.github.com/en/repositories/working-with-files/using-files/navigating-code-on-github) officially supports 10 languages according to the documentation, but more languages are supported in the latest beta preview. Sourcegraph’s [search-based code navigation](/code_navigation/explanations/search_based_code_navigation) supports 40 languages. | **Features** | **GitHub** | **Sourcegraph** | | ------------------------ | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Technical implementation | Heuristic-based | Heuristic-based | | Language support | 10 languages (C#, CodeQL, Elixir, Go, Java, JavaScript,TypeScript, PHP, Python, Ruby) | 40 languages (The full list of supported languages can be found [here](/code_navigation/explanations/search_based_code_navigation)) | | Setup | No setup required | No setup required | | Accuracy | Moderate (some false positives) | Moderate (some false positives) | | Cross-repository | ✗ | ✗ | ### Precise code navigation GitHub and Sourcegraph both offer precise code navigation as well. Despite having the same name, the two versions of precise code navigation are very different in terms of the underlying technology and accuracy they provide. Only Sourcegraph’s precise code navigation is 100% accurate. GitHub’s [precise code navigation](https://docs.github.com/en/repositories/working-with-files/using-files/navigating-code-on-github#precise-and-search-based-navigation) is an improved form of heuristic-based code navigation which uses syntax trees to offer higher accuracy for references and definitions and cross-repository navigation. It is more accurate than GitHub’s search-based code navigation, but it can still present inaccuracies. It is available out-of-the-box on GitHub and is automatically used over search-based code navigation when available. It is supported for 1 language, Python. Sourcegraph’s [precise code navigation](/code_navigation/explanations/precise_code_navigation) is not heuristic-based. Instead, it uses [SCIP and LSIF](/code_navigation/references/indexers) data to deliver precomputed code navigation, meaning that it is fast and compiler-accurate. It is the only 100% accurate solution for code navigation between Sourcegraph’s and GitHub’s offerings. Because precise code navigation uses code graph (SCIP) data, it is not susceptible to false positives or other potential errors (such as those caused by symbols with the same name). It also supports cross-repository navigation, which shows symbol usage across repositories and [transitive dependencies](/code_navigation/explanations/features#beta-dependency-navigation). It also has a unique feature, “Find implementations,” which allows you to navigate to a symbol’s interface definition or find all the places an interface is being implemented. Sourcegraph’s precise code navigation is opt-in and requires you to upload code graph data ([LSIF or SCIP](/code_navigation/references/indexers)) to Sourcegraph. This data can be automatically generated and uploaded to Sourcegraph via [auto-indexing](/code_navigation/explanations/auto_indexing). For repositories without SCIP or LSIF data, Sourcegraph automatically falls back to search-based code navigation. Sourcegraph’s precise code navigation [supports 11 languages](/code_navigation/references/indexers). | **Features** | **GitHub** | **Sourcegraph** | | ------------------------ | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | Technical implementation | Heuristic-based | SCIP-based (code graph data) | | Accuracy | High (some false positives) | Perfect (compiler-accurate) | | Language support | 1 language (Python) | 11 languages (Go, TypeScript, JavaScript, C, C++, Java, Scala, Kotlin, Rust, Python, Ruby) | | Setup | No setup required | Opt-in (Must set up LSIF/SCIP indexing. [Auto-indexing](/code_navigation/explanations/auto_indexing) available.) | | Cross-repository | ✓ | ✓ | ## Codebase insights and analytics GitHub and Sourcegraph have offerings that are called “insights,” but they differ. Generally, insights can be split into two categories: ### Codebase insights GitHub does not offer comprehensive insights that account for the content of the code itself. Rather, GitHub’s insights are based primarily on GitHub’s product-level data. GitHub offers [dependency insights](https://docs.github.com/en/enterprise-cloud@latest/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-dependency-insights-in-your-enterprise) that show all the packages your organization’s repositories depend on, e.g. aggregated information about security advisories and licenses. [Sourcegraph’s Code Insights](/code_insights) is based on codebase-level data: aggregation of lines, patterns, and other search targets in the codebase. It reveals high-level information about the entire codebase, accounting for all of your repositories and code hosts. With Code Insights, you can track anything that can be expressed with a Sourcegraph search query and turn it into customizable dashboards. Code Insights can be used to track migrations, package use, version adoption, code smells, vulnerability remediation, codebase size, and more. ### App activity insights With [insights for Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/viewing-insights-from-your-project/about-insights-for-projects) in GitHub, you can view, create, and customize charts that are built from the project’s data. [Organization activity insights](https://docs.github.com/en/enterprise-cloud@latest/organizations/collaborating-with-groups-in-organizations/viewing-insights-for-your-organization) help you understand how members of the organization are using GitHub, e.g. issue and pull request activity, top languages used, and cumulative information about where members spend their time. Sourcegraph offers [in-product analytics](/admin/analytics) to help Sourcegraph administrators understand user engagement across the various Sourcegraph features, identify power users, and convey value to engineering leaders. | **Features** | **GitHub** | **Sourcegraph** | | ------------------------------------------ | -------------------------------------------------------------------------------------------------- | --------------- | | Codebase insights | ✗ (Offers dependency insights. Does not offer customizable insights about the content of the code) | ✓ | | App activity and project activity insights | ✓ | ✓ | ## Large-scale code changes GitHub does not offer a way to automate arbitrary large-scale code changes. For repositories where [Dependabot security updates](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates) are enabled, when GitHub Enterprise Cloud detects a vulnerable dependency in the default branch, Dependabot creates a pull request to fix it. With Sourcegraph’s [Batch Changes](/batch-changes), you can make any large-scale code change across many repositories and code hosts. You can create pull requests on all affected repositories and [track the progress](/batch-changes/tracking-existing-changesets) until they are all merged. You can also preview the changes and update them at any time. Batch Changes is often used to make the following types of changes: updating API callsites after a library upgrade, updating configuration files, changing boilerplate code, renaming symbols, patching critical security issues, and more. | **Features** | **GitHub** | **Sourcegraph** | | ------------------------ | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Large-scale code changes | [Automatic Dependabot updates](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates) are possible, but there is no support for applying arbitrary large-scale changes | You can apply arbitrary code changes across many repositories and code hosts by running any codemod tool, using a template, or writing your own; You can manage and track the resulting PRs until they are merged | | Completeness | Dependency upgrades only; in GitHub only | Any code change across multiple code hosts | ## Integrations and API ### Integrations Both GitHub and Sourcegraph offer integrations to help optimize your workflow. GitHub’s owned integrations are built and managed by GitHub, and they have a marketplace with nearly a thousand third-party applications spanning across categories such as code quality, code review, IDEs, monitoring, security, and more. These integrations are available for GitHub overall, but there aren’t any integrations related to GitHub code search. For example, the [VS Code integration](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) allows you to review and manage pull requests, but it does not let you use GitHub code search in VS Code. Sourcegraph’s [editor integrations](/integration/editor) let you search and navigate across all of your repositories from all your code hosts and across all GitHub instances and organizations without leaving your IDE. Sourcegraph currently integrates with VS Code, JetBrains IDEs, and Gitpod. You can also add Sourcegraph to your preferred [browser](/integration/browser_extension/how-tos/browser_search_engine) to quickly search across your entire codebase from within your browser. ### API GitHub has a REST API for web clients, but it is not yet documented. On the other hand, Sourcegraph offers different APIs that help you access code-related data available on a Sourcegraph instance. The [GraphQL API](/api/graphql) accesses data stored and computed by Sourcegraph. This API can [fetch](/api/graphql/examples) file contents without cloning a repository or search for a new API and determine all of the repositories that haven’t migrated to it yet. The [Stream API](/api/stream_api) supports consuming search results as a stream of events and it can be used to [search](/api/stream_api#example-curl) over all indexed repositories. Lastly, use the [interactive API explorer](https://sourcegraph.com/api/console#%7B%22query%22%3A%22%23%20Type%20queries%20here%2C%20with%20completion%2C%20validation%2C%20and%20hovers.%5Cn%23%5Cn%23%20Here's%20an%20example%20query%20to%20get%20you%20started%3A%5Cn%5Cnquery%20%7B%5Cn%20%20currentUser%20%7B%5Cn%20%20%20%20username%5Cn%20%20%7D%5Cn%20%20repositories%28first%3A%201%29%20%7B%5Cn%20%20%20%20nodes%20%7B%5Cn%20%20%20%20%20%20name%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22%7D) to build and test your API queries. | **Features** | **GitHub** | **Sourcegraph** | |---------------------------------------------|-----------------------------------------------------------|---------------------------------------------------------------| | Code search integrations and extensions | ✗ (GitHub built and marketplace with integrations, but no code search integration or extensions) | ✓ (Editor integrations and browser extensions) | | API | ✗ | ✓ (GraphQL API and Stream API) | ## Alerting GitHub and Sourcegraph offer alerting on code in different forms. GitHub offers [code scanning](https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository), which allows you to set up CodeQL or third-party analysis to run over code and generate alerts. CodeQL is a flexible code analysis tool used to query code and return arbitrary data. Code scanning is applied at the repository level and can be used to alert on both merged code and pull requests. Individuals can then personally configure notifications for when code scanning workflows are completed on a given repository. Notifications can go through email, the GitHub web interface, or GitHub Mobile. GitHub also offers [Dependabot alerts](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/dependabot-alerts/about-dependabot-alerts). Dependabot detects insecure dependencies of repositories and triggers alerts when a new advisory is added to the [GitHub Advisory Database](https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/dependabot-alerts/browsing-security-advisories-in-the-github-advisory-database) or the [dependency graph](https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph) for a repository changes. GitHub can also review and alert on dependency changes in pull requests made against the default branch of a repository. These alerts are viewable by admins in each repository, and admins can make them viewable to other users as well. These alerts can be sent to you via several channels: email, web interface, command line, and/or GitHub Mobile. Sourcegraph offers [code monitors](/code_monitoring), which continuously monitor the results of a specific search query and generate alerts when new results are returned. Code monitors only look at merged code, and they can be used to trigger alerts when undesirable code is added to a codebase. This can include known vulnerabilities, bad patterns, file changes, or consumption of deprecated endpoints (anything that can be queried via Sourcegraph). Each code monitor can span any scope of your choosing, such as a single repository, multiple repositories, or multiple code hosts. They can also be scoped to specific branches of a repository. Code monitor alerts can be configured to send notifications via email, Slack message, or webhook. Most queries used for a code monitor can also be reused for a Code Insights chart or a fix with Batch Changes. ## Embedded code search and documentation Sourcegaph’s [Notebooks](/notebooks) integrate code search with Markdown for knowledge sharing. Notebooks are created with blocks, and each block can be Markdown, a code search query, a live code snippet, a file, or a symbol. Notebooks pull information directly from your codebase, so the information served in notebooks (via code search blocks, for example) always reflects what is live in your code at that moment in time. By referencing live code, notebooks are useful for onboarding teammates, documenting vulnerabilities, walking through complex parts of a codebase, or keeping track of useful queries. GitHub does not currently offer functionality to embed code search within notebooks or documentation. ## Licensing GitHub is closed source, while Sourcegraph’s code is publicly available. ## Availability GitHub code search is currently available through a beta preview (you can sign up for their [waitlist](https://github.com/features/code-search-code-view/signup) to request access). The beta preview is not yet available for GitHub Enterprise. Sourcegraph’s code intelligence platform is generally available, and you can sign up for a free trial for your team [here](https://about.sourcegraph.com/get-started?t=enterprise/).
# Welcome to Sourcegraph This is a compilation of the most important information you will need to get started. ## Sync Code Hosts Sourcegraph is nothing without your code, so connecting your code hosts is crucial. How to connect to… - [GitHub](/admin/code_hosts/github) - [GitLab](/admin/code_hosts/gitlab) - [Bitbucket Cloud](/admin/code_hosts/bitbucket_cloud) - [Bitbucket Server / Bitbucket Data Center](/admin/code_hosts/bitbucket_server) - [Other Git code hosts (using a Git URL)](/admin/code_hosts/other) - [Non git hosts](/admin/code_hosts) ## Inviting users and SSO A team is essential when using Sourcegraph. Be sure to spread the word and get everybody in. ### Setting up SSO Sourcegraph supports out-of-the-box support for different auth providers. Our documentation provides guidance on how to setup these. - [User authentication (SSO) - Sourcegraph docs](/admin/auth) You may not have the right privileges or role in your team to set this up. In that case, you could invite someone with the right privileges and make them a site-admin. ### Inviting Single Users Getting users into Sourcegraph is easy, you just need to navigate to: **Site Admin** → **Users and auth** → **Users** → **+ Create user** ## Setup Email Server By default the Sourcegraph instance cannot send emails. So features like password resets, email invites and email code monitors will not work. - [Configure email sending / SMTP server](/admin/config/email) ## Learn Sourcegraph Extra resources that we think are helpful: - [Sourcegraph 101](/getting-started) - [Search Examples](/code-search/queries/examples) ## Community and Support [Join our discord server](https://srcgr.ph/discord-cloud-onboarding). If you need support, reach to via `support@sourcegraph.com`. # Color themes Sourcegraph has two color themes: - Light theme - Dark theme Signed-in users can switch between the color themes by going to **User menu** > **Use dark/light theme** . # Personalizing Sourcegraph - [Light and dark themes](/getting-started/personalization/themes) - [Badges for Go public repositories](/getting-started/personalization/badges) # Repository badges (Go open-source projects only) Right now, this feature is only supported for open-source Go repositories on Sourcegraph.com. Sourcegraph.com generates badges with usage statistics for open-source Go repositories. The badges shows the total number of Go packages (among all known public repositories) that import the repository's Go packages. To add a badge to your project's README, add this Markdown: ``` markdown [![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge) ``` (Be sure to replace `github.com/gorilla/mux` with your own repository's name.) This renders the following badge: [![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge) ## Known issues Please report any other issues and feature requests on the [Sourcegraph issue tracker](https://github.com/sourcegraph/sourcegraph/issues). - The number may be overcounted because it is the sum of counts for all of the repository's subpackages. If another project uses multiple subpackages in this repository, the project is counted multiple times. - Importers using custom Go import paths (i.e., anything other than import paths prefixed by the repository name, such as `github.com/foo/bar`) will not be counted. # Indexing the OSS universe Sourcegraph is on a mission to [make coding more accessible to the world](https://handbook.sourcegraph.com/company/strategy). In order to execute this mission, Sourcegraph has committed to indexing open source repositories from various code hosts including GitLab and GitHub. By indexing these repositories, Sourcegraph allows any engineer to tap into the knowledge of the open source universe near-instantaneously. You can read more about our [decision to do this](https://about.sourcegraph.com/blog/indexing-the-oss-universe-update-more-code-hosts/). Sourcegraph's open source code index includes more than 2 million repositories, and searching these open source repositories is available for free on [Sourcegraph.com](https://sourcegraph.com/search). ## Opting out We believe that having the universe of open source code available all in one place will prove to be an asset for many developers; however, we also understand that this may raise concerns among open source contributors. While we do not offer the ability to opt out of our open source code index today, it is something that we have heard requested from the community. Our teams are exploring solutions and are eager to partner with the larger community on how we implement an opt-out. This section will be updated as soon as we have more information to provide, but in the meantime, please reach out to us at [feedback@sourcegraph.com](mailto:feedback@sourcegraph.com). # Sourcegraph.com [Sourcegraph.com](https://sourcegraph.com/search) lets you search 2 million open source repositories. To use Sourcegraph on your own (private) code, [use Sourcegraph Cloud](/cloud/) or [deploy self-hosted Sourcegraph](/admin/deploy/). - [Indexing open source code in Sourcegraph.com](/dotcom/indexing_open_source_code) > Note: Sourcegraph.com is a special instance of Sourcegraph with some different behavior compared to that on Sourcegraph Cloud and self-hosted instances. If you're curious about the differences, search our codebase for [`envvar.SourcegraphDotComMode()`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+envvar.SourcegraphDotComMode%28%29&patternType=keyword). > > For example, global searches do not search unindexed code by default on sourcegraph.com, whereas on a cloud or self-hosted instance this isn't the case. > > To learn more about where dotcom handles things differently checkout use of the [SourcegraphDotcomMode](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+%22if+envvar.SourcegraphDotComMode%28%29%22&patternType=keyword) env var in our codebase! # Cody Pricing Plans

Learn about the different plans available for Cody.

Cody provides three subscription plans: **Free**, **Pro**, and **Enterprise**. Each plan is aimed to cater to a diverse range of users, from individual projects to large-scale enterprises. Cody Free includes basic features, while the Pro and Enterprise plans offer additional advanced features and resources to meet varying user requirements. The free plan is designed for individuals to get started with Cody. It comes with a set of features to enhance your coding experience. It includes **unlimited autocompletion suggestions** per month, covering both whole and multi-line suggestions. You also get **200 chats/prompts** per month with access to creating custom prompts. The free plan provides access to local context to enhance Cody's understanding of your code and ability to provide accurate suggestions. Local context uses keyword search to search the local repository (the one currently open in your IDE). Cody Free uses the DeepSeek-Coder-V2 model for autocomplete. It uses the Claude 3.5 Sonnet (New) model for chat and prompts, and users have several other model options they can switch to. See [Supported LLMs](https://sourcegraph.com/docs/cody/capabilities/supported-models) for more information. ### Billing cycle There is no billing cycle for Cody Free, as it is free to use. If you complete your monthly chat/prompts limit, you'll be prompted to upgrade to the Pro plan. Otherwise, you'll have to wait approximately 30 days for the limits to reset. The reset date is based on your sign-up date. For example, if you sign up on December 15th, your limit will reset on January 15th. ### Upgrading from Free to Pro ![upgrade-cody-pro](https://storage.googleapis.com/sourcegraph-assets/Docs/upgrade-cody-pro.png) To upgrade from Cody Free to Pro: - Log in to your [Cody dashboard](https://sourcegraph.com/cody/manage) - Click the **Upgrade** button in the top right corner - It takes you to the [Subscription plans](https://sourcegraph.com/cody/subscription) page - Under the Pro tier, click **Get Pro** - Enter your card details for billing - Click confirm and upgrade to Cody Pro for **$9 per month** Once your Pro subscription is confirmed, click **My subscription** to manage and view your activation details, or click **Dashboard** for the overall view. Cody Pro, designed for individuals or small teams at **$9 per user per month**, offers an enhanced coding experience beyond the free plan. It provides unlimited autocompletion suggestions plus increased limits for chat and prompts. It also uses local repository context to enhance Cody's understanding and accuracy. Cody Pro uses DeepSeek-Coder-V2 by default for autocomplete. Pro accounts also default to the Claude 3.5 Sonnet (New) model for chat and prompts, but users can switch to other LLM model choices. You can refer to the [supported LLM models](/cody/capabilities/supported-models) docs for more information. Support for Cody Pro is available through our Support team via support@sourcegraph.com, ensuring prompt assistance and guidance. ### Downgrading from Pro to Free To revert back to Cody Free from Pro: - Go to your Sourcegraph dashboard **Cody > Dashboard** - Next, **Manage subscription** that takes you to **Cody > Subscription** - Clicks **Cancel** on the Pro tier to cancel your Pro subscription - This automatically downgrades you to Cody Free once after your billing cycle ends ### Upgrading from Pro to Enterprise To upgrade from Cody Pro to Cody Enterprise, you should [Contact Sales](https://sourcegraph.com/contact/request-info) and connect with one of our account teams. They will help you set up your account and start with Cody Enterprise. ## Billing FAQs for Cody Pro ### What is Cody's pricing plan? You can get this info from our [pricing page](https://sourcegraph.com/pricing?product=cody). ### When are payments taken? We charge payments at the beginning of each billing cycle, and they get automatically renewed once you've added your credit card details. ### What is a billing cycle? The billing cycle refers to the start date you start your Cody Pro plan. Your Cody Pro plan will automatically renew at each billing date. You can view your current and previous billing cycles from the **My subscription** tab. ### What payment methods are available? We currently only support payments through a credit card. ### What happens when I cannot pay or don't want to renew the Pro plan? If you do not want to renew Cody Pro, you can cancel your Cody Pro subscription at any time by going to the [accounts page](https://accounts.sourcegraph.com/cody/subscription). If you cancel the Pro plan, your Cody Pro will continue until the end of the billing cycle. Once the billing cycle ends, your plan will not renew, and your card will not be charged. This automatically downgrades your plan from Cody Pro to Cody Free. If you change your mind after canceling your plan please contact our Support team at support@sourcegraph.com and we can help you get re-subscribed. ### Are there any refunds for the Pro subscription? We don't offer refunds, but if you have any queries regarding the Cody Pro plan, please write to support@sourcegraph.com, and we'll help resolve the issue. ### How do I access previous invoices? You can access your invoices via the [Cody Dashboard](https://sourcegraph.com/cody/manage) and clicking "Manage Subscription". ## Enterprise Starter Cody Pro users can also switch to the Enterprise Starter plan for **$19 per user per month**. This plan includes all the features of Cody Pro plus a multi-tenant Sourcegraph instance with core features like a fully managed version of Sourcegraph (AI + code search + intent detection with integrated search results, with privately indexed code) through a self-serve flow. Read more about the [Enterprise Starter plan](/pricing/enterprise-starter). Cody Enterprise is designed for enterprises prioritizing security and administrative controls. We offer either seat-based or token based pricing models, depending on what makes most sense for your organization. You get Claude Haiku 3.5 and Claude Sonnet 3.5 as the default LLM models without extra cost. You also get additional capabilities like BYOLLM (Bring Your Own LLM), supporting Single-Tenant and Self Hosted setups for flexible coding environments. Security features include SAML/SSO for enhanced authentication and guardrails to enforce coding standards. Cody Enterprise supports advanced Code Graph context and multi-code host context for a deeper understanding of codebases, especially in complex projects. With 24/5 enhanced support, Cody Enterprise ensures timely assistance. ## Billing FAQs for Cody Enterprise ### How are active users calculated for Cody? ### Billable active users This only applies to Enterprise Cody users. Cody Pro users pay for a seat every month, regardless of usage. A billable active Cody user is signed in to their Enterprise Sourcegraph account and actively interacts with Cody (for example, they see suggested autocompletions, run commands, or chat with Cody, they start new discussions, clear chat history, or copy text from chats. They change Cody's settings and more). Having Cody installed and signing in is not enough to be considered a billable user. Specific categories of user actions that qualify as active Cody usage for billing include, but are not limited to: - Signing in to Cody in an editor - Seeing suggested autocompletions and/or accepting/rejecting them - Running commands or chatting with Cody - Starting new chats, clearing chat history, copying text from chats or otherwise interacting with the Cody chat interface in the editor or on the web - Adding or changing context in a Cody chat interface or changing models - Interacting with Cody tutorials - Changing Cody personal or team settings ### Authenticated users An authenticated Cody user is authenticated (or signed in) to Cody in their editor within a given time period. This includes all users who interact with Cody on the web. Authenticated users are a superset of [billable users](#billable-active-users) defined above. They include users who are signed in but do not actively engage with Cody. ## Plans Comparison The following table shows a high-level comparison of the three plans available on Cody. | **Features** | **Free** | **Pro** | **Enterprise Starter** | **Enterprise** | | --------------------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | **Autocompletion suggestions** | Unlimited | Unlimited | Unlimited | Unlimited | | **Chat Executions** | 200 per month | Increased limits | Increased limits | Unlimited | | **Keyword Context (local code)** | Supported | Supported | Supported | Supported | | **Developer Limitations** | 1 developer | 1 developer | Scalable, per-seat pricing | Scalable, consumption-based pricing | | **LLM Support** | [View latest](/cody/capabilities/supported-models) | [View latest](/cody/capabilities/supported-models) | [View latest](/cody/capabilities/supported-models) | [View latest](/cody/capabilities/supported-models) | | **Code Editor Support** | VS Code, JetBrains IDEs, Visual Studio (Preview) | VS Code, JetBrains IDEs, Visual Studio (Preview) | VS Code, JetBrains IDEs, Visual Studio (Preview) | VS Code, JetBrains IDEs, Visual Studio (Preview) | | **Single-Tenant and Self Hosted** | N/A | N/A | N/A | Yes | | **SAML/SSO** | N/A | N/A | N/A | Yes | | **Guardrails** | N/A | N/A | N/A | Yes | | **Advanced Code Graph Context** | N/A | N/A | N/A | Included | | **Multi-Code Host Context** | N/A | N/A | GitHub only | Included | | **Discord Support** | Yes | Yes | Yes | Yes | | **24/5 Enhanced Support** | N/A | N/A | Yes | Yes |
# Troubleshooting Cody

Learn about common reasons for errors that you might run into when using Cody and how to troubleshoot them.

If you encounter errors or bugs while using Cody, try applying these troubleshooting methods to understand and configure the issue better. If the problem persists, you can report Cody bugs using the [issue tracker](https://github.com/sourcegraph/cody/issues), by using the [Support Forum](https://community.sourcegraph.com/), or by asking in the [Discord](https://discord.gg/s2qDtYGnAE) server. ## VS Code extension ### Cody is not responding in chat If you're experiencing issues with Cody not responding in chat, follow these steps: - Ensure you have the latest version of the [Cody VS Code extension](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai). Use the VS Code command `Extensions: Check for Extension Updates` to verify - Check the VS Code error console for relevant error messages. To open it, run the VS Code command `Developer: Toggle Developer Tools` and then look in the `Console` for relevant messages ### Cody responses/completions are slow If you're experiencing issues with Cody's responses or completions being too slow: - Ensure you have the latest version of the [Cody VS Code extension](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai). Use the VS Code command `Extensions: Check for Extension Updates` to verify - Enable verbose logging, restart the extension and reproduce the issue seen again (see below `Access Cody logs` for how to do this - Send information to the our Support Team at support@sourcegraph.com Some additional information that will be valuable: - Where are you located? Any proxies or firewalls in use? - Does this happen with multiple providers/models? Which models have you used? ### Access Cody logs VS Code logs can be accessed via the **Outputs** view. You will need to set Cody to verbose mode to ensure important information to debug is on the logs. To do so: - Go to the Cody Extension Settings and enable: `Cody › Debug: Verbose` - Restart or reload your VS Code editor - You can now see the logs in the Outputs view - Open the view via the menu bar: `View > Output` - Select **Cody by Sourcegraph** from the dropdown list - You can export the logs by using the command palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux) and searching for the "Cody Debug: Export Logs" command ![View Cody's autocomplete logs from the Output View in VS Code](https://storage.googleapis.com/sourcegraph-assets/Docs/autocomplete-logs.png) ### Errors trying to install Cody on macOS If you encounter the following errors: ```bash Command 'Cody: Set Access Token' resulted in an error Command 'cody.set-access-token' not found ``` Follow these steps to resolve the issue: - Close your VS Code editor - Open your Keychain Access app - Search for `cody` - Delete the `vscodesourcegraph.cody-ai` entry in the system keychain on the left - Reopen the VS Code editor. This should resolve the error ![Opening up Keychain Access](https://storage.googleapis.com/sourcegraph-assets/blog/cody-docs-troubleshooting-keychain-access.png) ### Signin fails on each VS Code restart If you find yourself being automatically signed out of Cody every time you restart VS Code, and suspect it's due to keychain authentication issues, you can address this by following the steps provided in the official VS Code documentation on [troubleshooting keychain issues](https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues). These guidelines should help you troubleshoot and resolve any keychain-related authentication issues, ensuring a seamless experience with Cody on VS Code. ### No context files were included by Cody If Cody's answers don't seem accurate, it may be because Cody is unable to find the right relevant files to use as context. You can see which files Cody used in the **Context** row right below your message. To troubleshoot further: 1. Enable the `cody.debug.verbose` setting in your VS Code user settings. 1. Open the **Cody by Sourcegraph** output channel in VS Code. 1. Look for log messages such as the following: ```bash █ SimpleChatPanelProvider: getEnhancedContext > search █ symf: using downloaded symf "/Users/beyang/Library/Application Support/Code/User/globalStorage/sourcegraph.cody-ai/symf/symf-v0.0.6-aarch64-macos" █ SimpleChatPanelProvider: getEnhancedContext > search (end) █ DefaultPrompter.makePrompt: Ignored 8 additional context items due to limit reached ``` ### Rate limits Cody Free provides **unlimited autocomplete suggestions** and **200 chat invocations** per user per month. On Cody Pro and Enterprise plans, usage limits are increased, and controlled by **Fair Usage**. This means that some users occasionally experience a limitation placed on their account. This limitation resets within 24 hours. If this issue persists, contact us through our [community forum](https://community.sourcegraph.com), Discord, or email support@sourcegraph.com. #### 429 errors A 429 status code means you are on a free account and hit your usage limit/quota for the day. It can also mean you were sending too many requests in a short period of time. If you have Cody Pro and you are seeing 429 errors, you can contact us at [support@sourcegraph.com](mailto:support@sourcegraph.com) to resolve this. ### Error logging in VS Code on Linux and Windows If you encounter difficulties logging in to Cody on Linux using your Sourcegraph instance URL, along with a valid access token, and notice that the sign-in process in VS Code hangs, it might be related to underlying networking rules concerning SSL certificates. To address this, follow these steps: - Close your VS Code editor - In your terminal, type and run the following command: `echo "export NODE_TLS_REJECT_UNAUTHORIZED=0">> ~/.bashrc` - Restart VS Code and try the sign in process again On Windows, - Close Visual Studio Code - In your Command Prompt or PowerShell window, run the following command: `setx NODE_TLS_REJECT_UNAUTHORIZED 0` - Restart Visual Studio Code and try the sign in process again ### Cloudflare Request Failed If you encounter this error: ``` Request Failed: Request to https://sourcegraph.com/.api/completions/stream?api-version=1&client-name=vscode&client-version=1.34.3 failed with 403 Forbidden ``` It indicates that our web application firewall provider, Cloudflare, has flagged the source IP as suspicious. Consider disabling anonymizers, VPNs, or open proxies. If using a VPN is essential, you can try [1.1.1.1](https://one.one.one.one), which is recognized to be compatible with our services. ### Error with Cody `contextFilters` during chat or editing code The `contextFilters` setting in Cody is used to control which files are included or excluded when Cody searches for relevant context while answering questions or providing code assistance. Sometimes, you can see the following error: ``` Edit failed to run: file is ignored (due to cody.contextFilters Enterprise configuration setting) ``` This error occurs when you're trying to work with a file that's been excluded by Cody's enterprise-level `contextFilters` configuration. At times, this can happen to files that also haven't been excluded. First, check with your organization's admin to understand which files are excluded. If the error occurs with a file that's not been excluded, the workaround is to uninstall the Cody plugin, restart your IDE and then reinstall the latest version of the extension. This should clear the error. ### VS Code Pro License Issues If VS Code prompts you to upgrade to Pro despite already having a Pro license, this usually happens because you're logged into a free Cody/Sourcegraph account rather than your Pro account. To fix this: - Check which account you're currently logged into - If needed, log out and sign in with your PRO account credentials ### Error exceeding `localStorage` quota When using Cody chat, you may come across this error: ```bash Failed to execute 'setItem' on 'Storage': Setting the value of 'user-history:$user_id' exceeded the quota. ``` This error indicates that the chat history size surpasses the capacity of your browser's local storage. Cody stores comprehensive context data with each chat message, contributing to this limitation. To fix this, navigate to https://sourcegraph.your-domain.com/cody/chat and click `Clear Chat History` if your instance is on v5.2.3+. For older versions, clear your browsing data or browser history. ### Record performance traces for Cody You can get performance traces from the Cody VS Code extension in production with full support for source maps. To do so: - Start VS Code with a special runtime flag. In macOS, you can do so via the terminal like this: ```bash /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron --inspect-extensions=9333 ``` Note that you may need to quit VSCode first, then run that command to re-launch it. It will open all of your windows and tabs again. - After VS Code is started, head over to Chrome and go to `chrome://inspect`, which takes you to the following: ![](https://gist.github.com/assets/458591/0a17881b-5449-48d5-a53e-5556f4f2dedd) - Configure the inspect server you started on port `9333` from here. To do so, click on **Open dedicated DevTools for Node**, then go to the **Connection** tab, and make sure to add `localhost:9333` to the list ![](https://gist.github.com/assets/458591/972ce113-88f0-482a-99b7-5e51957981ef) - Now head back to the `chrome://inspect` tab, and you should see a new remote target that you can inspect ![](https://gist.github.com/assets/458591/06b2e293-aea7-42e8-a9cc-592863b6fb07) - Clicking this will open a (somewhat reduced) DevTools view. Great! We've almost got it. From here you can go to the **Performance** tab to record a trace. And finally, swap tabs to the VS Code window and interact with the extension. Come back later to stop the recording and export it. ![](https://gist.github.com/assets/458591/d590636b-31e5-4436-8039-ee62b7a8e59f) ### Record a CPU profile for Cody in VSCode If you are experiencing performance issues with Cody in VSCode, recording a CPU profile can help diagnose the problem. Here’s how you can capture a CPU profile: 1. **Open Developer Tools**: - In VSCode, go to the Command Palette (`Ctrl+Shift+P` on Windows/Linux, `Cmd+Shift+P` on macOS). - Type `Developer: show running extensions` and select it to open running extensions. 2. **Record the CPU Profile**: - There you should see Cody in the list. Right click on it and start a host profile. - This will show you the running profile in the bottom right of the window. - Reproduce the issue you are experiencing with Cody. - Once you have reproduced the issue, click the message in the bottom right you stop the trace. 3. **Save the CPU Profile**: - After stopping the trace, you need to go back to the Developer: show running extensions view. - Right click Cody and click `Save extension profile`. 4. **Share the CPU Profile**: - Attach the `.cpuprofile` file to your issue report on GitHub or share it with the support team for further analysis. Following these steps will help the team understand and resolve the performance issues more effectively. ## JetBrains IntelliJ extension ### Access Cody logs JetBrains logs can be accessed via the **Output** panel. To access logs, you must first enable Cody logs from the Settings menu. To do so: - Open the Settings panel (`⌘,` for macOS) (`Ctrl+Alt+S` for Windows/Linux) - Go to `Sourcegraph & Cody` - Click on `Cody` - Check the box to Enable debug - Optionally, select the box to enable Verbose debug - Click Apply - To access the logs, go to Help - Show Log in Finder - Open the `idea.log` file ### High CPU Usage with Cody Agent If you notice the Cody agent reaching 100% CPU utilization, try the following: 1. Disable the Cody plugin. 1. Re-enable the plugin. This simple action of turning the plugin off and on again can often resolve the high CPU usage issue. ## Android Studio extension ### Cody cannot start. Stuck on spinning icon. This issue occurs because JCEF isn't supported in Android Studio and causes Cody to not start. The suggested workaround is to: 1. Go to `Help` > `Find Action: Registry`. 1. Scroll to `ide.browser.jcef.sandbox.enable`. 1. Disable that key and close. 1. Then go to `Help` > `Find Action: Choose Boot runtime for the IDE`. 1. Select the last option. 1. Restart Android Studio. ## Regular Expressions ### Asterisks being removed If you send Cody a prompt with a query string like `$filteredResults = preg_grep('*\.' . basename($inputPath) . '\.*', $fileList);`, the asterisks may be removed because Cody interprets the content as a literal string rather than code. When sharing code with Cody, wrap your code in triple backticks (```) to ensure it's recognized as a code block rather than plain text. For example: ````regex ``` $filteredResults = preg_grep('*\.' . basename($inputPath) . '\.*', $fileList); ``` ```` ## Forked Repos As Context If you would like to add a forked repository as Cody context, you may need to add `"search.includeForks": true` to the [global settings](/admin/config/settings#editing-global-settings-for-site-admins) for your instance. {/* ## Eclipse extension ### See a white screen the first time you open Cody chat This can happen if Eclipse prompts you to set up a password for secure storage and Cody timeouts while waiting. Simply close and re-open the Cody chat. ### "No password provided" in the error log If you see this error in the error log, it happens because the default OS password integration has been corrupted. Go to **Preferences > General > Security > Secure Storage** and ensure your OS integration is checked. Then click **Clear Passwords** at the top, and then click **Change Password**. If you see a dialog saying **An error occurred while decrypting stored values... Do you want to cancel password change?** Click **No**. This will reset the secure storage master password for OS integration. You will be asked if you want to provide additional information for password recovery, which is optional. Click **Apply and Close** and then restart Eclipse. ### General Tips You can open the Cody Log view using the same steps as above, but instead, select **Cody Log**. ![cody-logs](https://storage.googleapis.com/sourcegraph-assets/Docs/eclipse-cody-log-1124.png) This will include more information about what Cody is doing, including any errors. There is a copy button at the top right of the log view that you can use to copy the log to your clipboard and send it to us. Be careful not to include any sensitive information, as the log communication is verbose and may contain tokens. Additionally, Eclipse's built-in Error Log can be used to view any uncaught exceptions and their stack traces. You can open the Error Log using the **Window > Show View > Error Log** menu. */} ## OpenAI o1 ### Context Deadline Exceeded Error Symptoms: - "Request Failed: Request to... failed with 500 Internal Server Error: context deadline exceeded" - Happens even with relatively small inputs (~220 lines) Solutions: - Keep input context smaller - aim for less than 200 lines of code initially - Break down larger requests into smaller chunks - Start a new chat session if errors persist - Add "Keep your answer brief!" to prompts when possible Prevention: - Import only the most relevant files - Use file range syntax (e.g., @file:1-100) to limit context - Focus on specific sections rather than entire codebases ### Truncated Outputs Symptoms: - Response cuts off mid-sentence - Unable to get complete code examples - "Continue" requests also result in truncation Solutions: - Break down complex requests into smaller steps - Consider using Sonnet 3.5 for tasks requiring longer outputs Limits: - Input tokens: 45k - Output tokens: 4k ### Model Switching Issues Symptoms: - Model reverts to Sonnet 3.5 unexpectedly - "On waitlist" message appears after previously having access - Unable to select o1 models in command palette Solutions: - Restart IDE/VS Code - Sign out and sign back in - Check Pro subscription status - Contact support if issues persist ### Response Format Errors Symptoms: - "Request Failed: Unexpected response format" - Model stops responding - Inconsistent output formatting Solutions: - Cancel and retry the request - Start a new chat session - Reduce context complexity - Use one-shot prompts with clear requirements
# Cody Quickstart

This quickstart guide shows how to use Cody in the VS Code editor. You'll learn about the following tasks:

- Chat with Cody to ask questions about your code - Code completions and suggestions - Use Cody to refactor code - Use Cody to debug code and ask Cody to fix bugs There are [many ways to use Cody](/cody/clients). For this guide, we'll be using the [VS Code](/cody/clients/install-vscode) extension. ## Prerequisites Before you start, you'll need the following: - [Cody extension installed](/cody/clients/install-vscode) in your VS Code editor - Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account - A project open in VS Code ## Getting started with Cody After installing the extension and connecting to a Sourcegraph instance, you can leverage Cody to use the best LLM and context to understand, write, and fix code. Click the **Cody** icon from the VS Code side activity bar to open the Cody chat panel. By default, the chat input will have the context of your entire codebase, and Claude 3.5 Sonnet (New) is selected as the default chat model. Based on your [Cody tier](https://sourcegraph.com/pricing?product=cody), you can change the LLM model and context based on your use case to optimize speed, accuracy, or cost. To help you automate your key tasks in your development workflow, you get **[Prompts](/cody/capabilities/commands)**. If you are a part of an organization on Sourcegraph.com or a self-hosted Sourcegraph instance, you can view these pre-built Prompts created by your teammates. On the contrary, you can create your own Prompts via the **Prompt Library** from your Sourcegraph instance. The Cody chat interface offers a few more options and settings. [You can read more in these docs](/cody/capabilities/chat). ![cody-chat-interface](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-chat-interface-0225.jpg) ## Chat with Cody The best way to see Cody in action is through chat. Cody allows you to chat directly with AI to ask questions about your code. You can start by asking simple questions like: - What does this code do? - Explain this codebase in three to four lines Or ask more complex questions like: - Suggest ways to refactor the codebase? - How can I make this code more performant? Cody will respond with a code snippet, a suggested fix, or an explanation. ![chat-with-cody](https://storage.googleapis.com/sourcegraph-assets/Docs/chat-with-cody-1124.png) ## Code completions and suggestions Cody helps you code faster by providing real-time single and multi-line code completions. It uses the context of the code around your cursor to make accurate suggestions and starts predicting what you're trying to write before you type it. Let's try it by typing a `bubbleSort()` function in a JavaScript file. ![cody-completions](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-completions-1124.png) Cody automatically predicts the function body in gray-dimmed text. Press `Tab` to accept the suggestion or `Esc` to dismiss it. ## Use Cody to refactor code You can refactor your code with inline edits. All you need to do is highlight the code, hit the edit hotkey (`Opt + K`), and describe a change. Cody will generate a diff for the change in seconds. Let's use the same `bubbleSort()` function from the previous section. Now, refactor the function to sort dates in descending order. Highlight the function and press `Opt + K`. ![cody-refactor](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-refactor-code-1124.png) Type your refactoring suggestion in the input field and press `Enter`. Cody will generate a diff for the change in seconds. You can review the diff, accept the change, reject it, or retry if you are unsatisfied with the result. ## Use Cody to debug code You can ask Cody to debug your code and fix bugs. Cody chat and inline edits are both quite powerful in debugging. If there is a bug, you can ask Cody to debug and fix the code. VS Code and JetBrains IDEs offer **Ask Cody to fix** option. When a mistake occurs, a red warning is triggered. Along with this, you get a lightbulb icon. If you click on this lightbulb icon, there is an **Ask Cody to fix** option. Click this, and Cody will try to fix the bug with a **Cody is working** notice. ![code-actions](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-code-actions-vscode-1124.png) That's it for this quickstart guide! Feel free to continue chatting with Cody to learn more about its [capabilities](/cody/capabilities).
# Cody Prompting Guide

To get the best results from Cody, whether you're exploring a codebase, summarizing a pull request, or generating code, clear and effective prompts are key. This guide will help you write effective prompts to maximize your experience with Cody.

## Why do prompts matter? Prompts are the foundation of how AI coding assistants like Cody interact with large language models (LLMs). They're not just chat inputs—they guide Cody to give precise, contextual, and actionable code suggestions. While Cody handles a lot of prompt engineering under the hood, the quality of your prompts still plays a key role in shaping the results. So, what defines a great prompt? ## Anatomy of a prompt A well-crafted prompt has all the key elements to guide Cody in delivering accurate and relevant responses. You don’t need to include every element in every prompt, but understanding them can help you write more effectively. Let's split these docs into three parts: 1. **Preparation**: How you'll prepare your code for Cody 2. **Prompting**: How you will create effective prompts for Cody 3. **Example prompts**: Examples of prompts for different use cases ## 1. Preparation Before you start writing prompts, preparing your codebase for Cody is essential. Here are some key preparation steps: ## Treat Cody like a new team member When using Cody, it's helpful to treat it like a new team member unfamiliar with your codebase. This approach ensures you provide Cody with the necessary context and information to generate accurate and contextually aware answers. You should focus on providing Cody with all the necessary information, such as the codebase structure, function names, and any relevant docs. The more context and details you provide, the better Cody can assist you in generating relevant and accurate code. For example, ❌ Instead of a vague prompt like: ``` How can I filter products in JavaScript? ``` ✅ Provide a more specific prompt with details: ``` I have an array of product objects in JavaScript, each with the following properties: id, name, category, and price. How can I write a function to filter the products by category? ``` ## Define a persona or role Specify a persona or role in your prompt to provide an extra layer of context to guide Cody. For example, asking Cody to act as a **beginner Python developer** can result in simpler, more beginner-friendly code snippets. ## Choose descriptive variable names Using clear and descriptive names for variables, functions, and classes is essential for making your code readable and understandable for you and Cody. Avoid abbreviations or ambiguous names that may confuse your AI assistant. ✅ Good example: ```php function calculateTotalPrice($items, $taxRate) { // ... } ``` ❌ Bad example: ```php function calc($i, $t) { // ... } ``` ## Write clear code comments and docstrings In addition to variable names, comments, and docstrings are crucial in guiding Cody's understanding of your code. Treat them as a way to communicate with Cody, just like you would with a new engineer. Explain complex logic, algorithms, or project-specific concepts to give Cody context. ✅ Good example: ```javascript /** * Calculate the shipping cost based on the order total. * - For orders under $50, the shipping cost is $5. * - For orders between $50 and $100, the shipping cost is $10. * - For orders above $100, shipping is free. * * @param {number} orderTotal - The total amount of the order. * @returns {number} The shipping cost, determined by the following rules: */ function calculateShippingCost(orderTotal) { // Cody will autocomplete here } ``` A bonus here is that Cody can generate these docstrings for you, so you don't have to write them manually. You can use the **document-code** prompt to do this. ## @-mention context Cody leverages the `@-mention` syntax to source context via files, symbols, web URLs, and more. By default, Cody will automatically detect context from the codebase you're working in via pre-filled context chips in the chat input field. Make sure that when you are working with any codebase, Cody picks up the default context. An empty context chip means Cody will search based on generally available context. You can learn more about context [here](/cody/core-concepts/context). ### Indexing your repositories for context @-mention local and current repositories are only available if you have your repository indexed. Enterprise and Enterprise Starter users can request their admins to add their local project for indexing to get access to @-mention context. Repository indexing is only available to supported [Code Hosts](https://sourcegraph.com/docs/admin/code_hosts), please reach out to your admins if you require assistance with indexing. ## Selecting the right LLM Cody offers a variety of LLMs for both chat and in-line edits by all the leading LLM providers. Each LLM has its strengths and weaknesses, so it is important to select the right one for your use case. For example, Claude 3.5 Sonnet and GPT-4o are powerful for code generation and provide accurate results. However, Gemini 2.0 Flash is a decent choice for cost-effective searches. So, you can always optimize your choice of LLM based on your use case. Learn more about all the supported LLMs [here](/cody/capabilities/supported-models). ## 2. Prompting Now that your code is well-prepared, let's focus on writing effective prompts for Cody via the following best practices: ## Provide specific information When using Cody chat, provide as much detail as possible. Include information about the problem, expected behavior, constraints, and project-specific requirements. Be sure to include comprehensive details about the problem, what you expect to happen, any limitations, and specific requirements related to your project. ❌ Bad example: ``` How do I calculate discounts based on loyalty points in Laravel? ``` ✅ Good example: ``` I need to calculate discounts based on customer loyalty points. - If the customer has loyalty points above 500, apply a 10% discount. - If the customer has loyalty points between 200 and 500, apply a 5% discount. - If the customer has loyalty points below 200, no discount is applied. Create a function that takes the total amount and loyalty points as input and returns an object with the discount percentage and discount amount. ``` ## Provide specific context While preparing your codebase for Cody, you learned about the importance of context chips. In addition to this default context, you can provide additional and more specific context to help Cody better understand your codebase. You can continue to `@-mention` files, symbols, and other context sources (as supported by your Cody tier) to make your search more specific and granular. You should approach this as if explaining the situation to a new team member. You should: - Reference important files and symbols - Provide examples from other similar functions ## Provide examples and test cases You should include examples and test cases when applicable to clarify your expectations. Demonstrate edge cases or handling of special conditions to guide Cody in generating robust code. ❌ Bad example: ``` I need to validate email addresses in JavaScript ``` ✅ Good example: ``` Create a function to validate email addresses in JavaScript. Return true for valid email addresses and false for invalid ones. Here are some example test cases: Valid: - "john@example.com" - "jane.doe@example.co.uk" Invalid: - "john@example" - "jane.doe@example." - "invalid.email" Please write the function ``` ## Iterate and refine Start with a general prompt and incrementally add more details based on Cody's responses. Take advantage of the fact that you can chat with Cody. Bring the back-and-forth conversation, especially if you didn't like Cody's first response. Review the generated code or suggestions, provide feedback, and refine your prompts to get the desired results. Initial prompt: ``` I need to calculate the total price of an order. Help me write the function ``` Refined prompt: ``` Thanks. I forgot to mention: - The function should take an array of order items as input - We need to apply a 10% discount if the total price exceeds $100 - Final total should be rounded to two decimal places Please update the function ``` ## Leverage Cody's capabilities You can utilize many other [Cody's capabilities](/cody/capabilities) for generating boilerplate code, common patterns, and repetitive tasks. Prompt it to assist with unit tests, docs, and error handling to save time and ensure code quality. ✅ Good example: ``` Help me write tests for the `calculateAverageRating` function. Here are the test cases I have in mind: - Empty ratings array should return 0 - Array with one rating should return that rating - Array with multiple ratings should calculate the average correctly Make sure the tests cover any edge cases or potential issues. ``` You can also use the **generate-unit-tests** prompt to generate tests for your code. ## Miscellaneous information Try adding any supplementary details regarding comments, debugging guidelines, error management, required dependencies, or coding styles. For instance, when directing Cody to implement a database query in SQL, specify the need for parameterized queries to prevent SQL injection vulnerabilities and provide suggestions for optimizing query performance. ## Prompts Library To accelerate and automate your work, you can leverage Cody's Prompt Library, which helps you build customizable building blocks (prompts), share your best prompts with your teammates, and enable site administrators to promote the best prompts to the rest of the organization. The Prompt Library is a system for creating and sharing customizable prompts. It is explicitly designed for scalability, repeatability, and flexibility. Learn more about the [Prompts and the Prompt Library here](/cody/capabilities/commands). ## Example Prompts Let's examine some examples of good and reusable prompts that you can create via the Prompt Library. This prompt can help if Cody needs to generate code in the correct language/framework version. For example, >Cody generates code snippets using a newer [Spring](https://spring.io/) version that's incompatible with your legacy Java application, which runs Spring 3.x. This mismatch leads to examples utilizing features from Spring Boot 2.x that your project doesn't support. The prompt to tackle this issue looks like this: ``` Please generate Java code that is compatible with the following specifications: Java version: 1.6 Spring framework version: 3.x Testing framework: JUnit 4" ``` This prompt can help if Cody needs to follow your organization's coding standards or style guide. For example, >Your organization follows a specific Python coding style guide that mandates using snake_case for variable names and requires docstrings for all functions. However, Cody might generate code that doesn't adhere to these conventions, leading to inconsistency in your codebase. The prompt to resolve this inconsistency will be: ``` Generate Python code that adheres to our organization's style guide, which includes the following requirements: Use snake_case for all variable and function names. Include docstrings for all functions, describing their purpose and parameters. Follow PEP 8 guidelines for code formatting, including indentation and line length. ``` This prompt can help you if you want to generate unit tests for your code based on a specific format. For example, >You're working with Golang and need Cody to generate unit tests that comply with your team’s conventions. Your organization follows a specific structure for tests, including table-driven tests and `require` from the `testify` package for assertions. However, Cody might provide a simple test that does not align with your standards. While you can use the default `generate-unit-tests` prompt but to get the desired output, you can customize e the prompt to include the following: ``` Please generate Golang unit tests that adhere to the following conventions: Use table-driven tests for different input cases. Use the require package from testify for assertions. Follow idiomatic Go test naming conventions and structure. ``` This prompt can help you if you want to onboard new team members by providing them with a set of instructions or guidelines to get started with a project. For example, ``` @repo tell me about this project and how to set it up. ``` To encourage detailed and comprehensive docs of your codebase, you can create a prompt instructing Cody to generate documentation based on your style guide. For example, ``` Please generate a docstring for the given Python function that adheres to our team's documentation standards. The docstring should include: 1. A brief summary of the function's purpose. 2. A description of each parameter, including name, type, and purpose. 3. The return value, including its type and description. 4. Any raised exceptions, if applicable. 5. Example usage of the function, where relevant. ``` You can share all these prompt examples with your team members to help them get started with Cody. If you want others to make the most of these, you can also promote the best prompts.
# Cody Supported on all [Sourcegraph plans](https://about.sourcegraph.com/pricing). Available on VS Code, JetBrains, Visual Studio, and the Web. Cody is an AI coding assistant that uses all the latest LLMs and your development context to help you understand, write, and fix code faster. It uses the powerful Sourcegraph's advanced Search API to pull context from both local and remote codebases so that you can use context about APIs, symbols, and usage patterns from across your entire codebase. Cody connects seamlessly with codehosts like [GitHub](https://github.com/login?client_id=e917b2b7fa9040e1edd4), [GitLab](https://gitlab.com/users/sign_in) and IDEs like [VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains), and [Visual Studio](/cody/clients/install-visual-studio). Once connected, Cody acts as your personal AI coding assistant, equipped with the following capabilities: 1. Developer chat with the most powerful models and context 2. Code completions, code edits, and customizable prompts 3. Extensive context to deliver the most accurate results ## Getting started You can start using Cody with one of the following options: ## Main features Cody's main features include: | **Feature** | **Description** | | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **[Chat](/cody/capabilities/chat)** | Chat directly with AI to ask questions about your code, generate code, and edit code. Cody has the context of your open file and repository by default, and you can use `@` to add context on specific files, symbols, remote repositories, or other non-code artifacts. | | **[Autocomplete](/cody/capabilities/autocomplete)** | Cody predicts what you're trying to write before you type it. It makes single-line and multi-line suggestions as you type, using the context of the code around your cursor to make accurate suggestions. | | **[Prompts](/cody/capabilities/commands)** | Automate key tasks in your workflow with premade and customizable prompts. Any common query or task can be built into a prompt to save and share with your team. | | **[Context](/cody/core-concepts/context)** | Cody provides the best LLM models and context to power chat. It uses the powerful Sourcegraph's advanced Search API to pull context from both local and remote codebases. | | **[Debug code](/cody/capabilities/debug-code)** | Cody is optimized to identify and fix errors in your code. Its debugging capability and autocomplete suggestions can significantly accelerate your debugging process, increasing developer productivity. | | **[Context Filters](/cody/capabilities/ignore-context)** | Cody can ignore selected repositories from chat and autocomplete results, which helps you control and manage what context your codebase uses. | ## What data is collected, and how is it used? Cody collects and uses data in the following ways: - **Prompts and responses**: When you use Cody, Sourcegraph collects your prompts and responses to provide the service. For individuals using Cody via Sourcegraph.com, Sourcegraph may use your prompts and responses to enhance the user experience, but Sourcegraph does not use any of your data to train models. - **Usage data and feedback**: Sourcegraph also collects usage data and feedback to improve the user experience. Read more about Cody Usage and Privacy policy here → ## Compatible with Sourcegraph products Cody is compatible with other Sourcegraph products, like [Code Search](/code-search/). You can use Cody's chat to ask questions about your codebase. When you run any search query and open a repository or file, you’ll find the **Cody** button that takes you to Cody’s chat interface, which you can use to ask questions about the codebase. [Read more in the Cody FAQs to learn more about such queries →](/cody/faq) ## Join our community If you have any questions regarding Cody, you can always [ask our community](https://community.sourcegraph.com), [Discord](https://discord.com/invite/s2qDtYGnAE), or [create a post on X](https://twitter.com/sourcegraphcody). # Cody FAQs

Find answers to the most common questions about Cody.

## General ### Does Cody train on my code? For Enterprise customers, Sourcegraph will not train on your company’s data. For Free and Pro tier users, Sourcegraph will not train on your data without your permission. Our third-party Language Model (LLM) providers do not train on your specific codebase. Cody operates by following a specific process to generate answers to your queries: - **User query**: A user asks a question - **Code retrieval**: Sourcegraph, our underlying code intelligence platform, performs a search and code intelligence operation to retrieve code snippets relevant to the user's question. During this process, strict permissions are enforced to ensure that only code that the user has read permission for is retrieved - **Prompt to Language Model**: Sourcegraph sends a prompt, and the code snippets are retrieved to a Language Model (LLM). This prompt provides the context for the LLM to generate a meaningful response - **Response to user**: The response generated by the LLM is then sent back to Cody and presented to the user This process ensures that Cody can provide helpful answers to your questions while respecting data privacy and security by not training on or retaining your specific code. ### Does Cody work with self-hosted Sourcegraph? Yes, Cody is compatible with self-hosted Sourcegraph instances. However, there are a few considerations: - Cody operates by sending code snippets (up to 28 KB per request) to a third-party cloud service. By default, this service is Anthropic but can also be OpenAI - To use Cody effectively, your self-hosted Sourcegraph instance must have internet access for these interactions with external services ### Is Cody licensed for private code, and does it allow GPL-licensed code? There are no checks or exclusions for Cody PLG (VS Code, JetBrains) for private and GPL-licensed code. We are subject to whatever the LLMs are trained on. However, Cody can be used with [StarCoder for autocomplete](/cody/clients/enable-cody-enterprise#use-starcoder-for-autocomplete) which is trained only on permissively licensed code. ### Is there a public facing Cody API? Currently, there is no public-facing Cody API available. ### Does Cody require Sourcegraph to function? Yes, Cody relies on Sourcegraph for two essential functions: - It is used to retrieve context relevant to user queries - Sourcegraph acts as a proxy for the LLM provider to facilitate the interaction between Cody and the LLM ### What programming languages does Cody support? Cody supports a wide range of programming languages, including: - JavaScript - TypeScript - PHP - Python - Java - C/C++ - C# - Ruby - Go - SQL - Swift - Objective-C - Perl - Rust - Kotlin - Scala - Groovy - R - MATLAB - Dart - Lua - Julia - COBOL - Shell scripting languages (like Bash, PowerShell) Cody's response quality on a programming language depends on many factors, including the underlying LLM being used. We monitor accuracy metrics across all languages and regularly make improvements. [Let us know](https://community.sourcegraph.com/) if you're seeing poor quality on a particular programming language. ### Can Cody answer non-programming questions? Cody Chat is optimized for coding related use cases and can be used primarily for reviewing, analysis, testing, writing, and editing of software code. Use of Cody for any other purposes is against our [acceptable use policy](https://sourcegraph.com/terms/aup) and may result in your account being restricted. ### What happened to the Cody App? We’ve deprecated the Cody App to streamline the experience for our Cody Free and Cody Pro users.The Cody App is no longer available for download. ## Embeddings ### Why were embeddings removed once my instance was upgraded to v5.3? Cody leverages **Sourcegraph Search** as a primary context provider, which comes with the following benefits: - **More secure**: No code being sent to a third-party embedding API - **Easier to manage**: Less tech debt for embeddings setup and need for refreshes - **More repos**: Sourcegraph Search scales to larger repos and a greater number. Users on Enterprise instances will now be able to select multiple repos as context sources from within the IDE - **Equal, or better, quality**: Sourcegraph Search provides high-quality retrieval, as tested over the last ten years. When a customer sees degradation, we will be ready to respond quickly. We leverage multiple retrieval mechanisms to give Cody the right context and will be constantly iterating to improve Cody's quality. The most important aspect is getting the files from the codebase, not the specific algorithm used to find those files. ### Why are embeddings no longer supported on Cody PLG and Enterprise? Cody does not support embeddings on Cody PLG and Cody Enterprise because we have replaced them with Sourcegraph Search. There are two driving factors: - The need for a retrieval system that can scale across repos and to repos of greater size - A system that is secure and requires low maintenance on the part of users Leveraging Sourcegraph Search allowed us to deliver these enhancements. ## LLM Data Sharing and Retention ### Is any of my data sent to DeepSeek? Our autocomplete features uses the open source DeepSeek-Coder-V2 model, which is hosted by Fireworks.ai in a secure single-tenant environment located in the USA. No customer chat or autocomplete data - such as chat messages, or context such as code snippets or configuration - is stored by Fireworks.ai. Sourcegraph does not use models hosted by DeepSeek (the company), and does not send any data to the same. ## Third party dependencies ### What is the default `sourcegraph` provider for completions? The default provider for completions, specified as `"provider": "sourcegraph"` refers to the [Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway). The Cody Gateway facilitates access to completions for Sourcegraph enterprise instances by leveraging third-party services such as Anthropic and OpenAI. ### What third-party cloud services does Cody depend on? Cody relies on one primary third-party dependency, i.e., Anthropic's Claude API. Users can use this with the OpenAI API configuration. It's worth noting that these dependencies remain consistent when utilizing the [default `sourcegraph` provider, Cody Gateway](/cody/core-concepts/cody-gateway), which uses the same third-party providers. ### What is the retention policy for Anthropic and OpenAI? Please refer to this [terms and conditions](https://about.sourcegraph.com/terms/cody-notice) for details regarding the retention policy for data managed by Anthropic and OpenAI. ### Can I use my own API keys? Yes, [you can use your own API keys](https://sourcegraph.com/docs/cody/clients/install-vscode#experimental-models). However, this is an experimental feature. Bring-your-own-API-key is fully supported in the Enterprise plan. ### Can I use Cody with my Cloud IDE? Yes, Cody supports the following cloud development environments: - vscode.dev and GitHub Codespaces (install from the VS Code extension marketplace) - Any editor supporting the [Open VSX Registry](https://open-vsx.org/extension/sourcegraph/cody-ai), including [Gitpod](https://www.gitpod.io/blog/boosting-developer-productivity-unleashing-the-power-of-sourcegraph-cody-in-gitpod), Coder, and `code-server` (install from the [Open VSX Registry](https://open-vsx.org/extension/sourcegraph/cody-ai)) ### Can I use my LLM of preference to chat with Cody on CLI? Yes you can. In the CLI you can use the following command to get started. Please replace `$name_of_the_model` with the LLM model of your choice. ``` cody chat --model '$name_of_the_model' -m 'Hi Cody!' ``` For example, to use Claude 3.5 Sonnet, you'd pass the following command in your terminal, `cody chat --model 'claude-3.5-sonnet' -m 'Hi Cody!' ### Sign-in dialog gets stuck with Kaspersky Antivirus **Problem:** When attempting to sign in, users may encounter a perpetual `"Signing in to Sourcegraph..."` dialog that never completes. This issue persists across different VS Code extension versions (e.g. 1.40-1.48) and browsers (Chrome, Edge, Firefox). In the browser console at `accounts.sourcegraph.com/sign-in`, you might see an error: `"Uncaught ApolloError: value.toString is not a function"`. **Solution:** This issue is typically caused by Kaspersky Antivirus interfering with the authentication process. To resolve: - Locate the Kaspersky icon in your system tray - Right-click on the Kaspersky icon - Select "Stop Protection" - Right-click the icon again - Select "Exit" Once you are signed in make sure to re-enable protection. ## OpenAI o1 ### What are OpenAI o1 best practices? #### Context Management - Provide focused, relevant context - Use file references strategically - Keep initial requests concise #### Model Selection - **Sonnet 3.5**: Better for tasks requiring longer outputs #### Prompting Strategy - Be specific and direct - Include complete requirements upfront - Request brief responses when possible - Use step-by-step approach for complex tasks #### Response Time - Start with smaller contexts - Consider breaking complex tasks into stages #### Quality - Provide clear acceptance criteria - Include relevant context but avoid excess - Use specific examples when possible ### What are the known limitations? #### Technical Constraints - 45k input token limit - 4k output token limit - No streaming responses for o1 series - Limited context window
# Embeddings for repositories with 5+ stars Last updated: 07/23/2023, 12:29 AM UTC 1. [0hq/tinyvector](https://github.com/0hq/tinyvector) 1. [1Password/1password-teams-open-source](https://github.com/1Password/1password-teams-open-source) 1. [21y4d/nmapAutomator](https://github.com/21y4d/nmapAutomator) 1. [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 1. [AcademySoftwareFoundation/OpenTimelineIO](https://github.com/AcademySoftwareFoundation/OpenTimelineIO) 1. [AcademySoftwareFoundation/rez](https://github.com/AcademySoftwareFoundation/rez) 1. [Addepar/addepar.github.com](https://github.com/Addepar/addepar.github.com) 1. [Addepar/ember-charts](https://github.com/Addepar/ember-charts) 1. [Addepar/ember-data](https://github.com/Addepar/ember-data) 1. [Addepar/ember-json-viewer](https://github.com/Addepar/ember-json-viewer) 1. [Addepar/ember-table](https://github.com/Addepar/ember-table) 1. [Addepar/ember-widgets](https://github.com/Addepar/ember-widgets) 1. [Addepar/emberconf-schedule-2019](https://github.com/Addepar/emberconf-schedule-2019) 1. [Addepar/http-route-proxy](https://github.com/Addepar/http-route-proxy) 1. [Addepar/styleguides](https://github.com/Addepar/styleguides) 1. [Aircoookie/WLED](https://github.com/Aircoookie/WLED) 1. [AlexanderGrooff/nginx-static-analysis](https://github.com/AlexanderGrooff/nginx-static-analysis) 1. [AlphaWallet/alpha-wallet-android](https://github.com/AlphaWallet/alpha-wallet-android) 1. [AlphaWallet/alpha-wallet-ios](https://github.com/AlphaWallet/alpha-wallet-ios) 1. [AndrewRayCode/shaderfrog-2.0-hybrid-graph-demo](https://github.com/AndrewRayCode/shaderfrog-2.0-hybrid-graph-demo) 1. [AppLovin/AppLovin-MAX-SDK-Android](https://github.com/AppLovin/AppLovin-MAX-SDK-Android) 1. [Arinerron/heaptrace](https://github.com/Arinerron/heaptrace) 1. [Automattic/mongoose](https://github.com/Automattic/mongoose) 1. [B-Selin/mastermind](https://github.com/B-Selin/mastermind) 1. [Benqi-fi/BENQI-Smart-Contracts](https://github.com/Benqi-fi/BENQI-Smart-Contracts) 1. [BestBuyAPIs/bby-query-builder](https://github.com/BestBuyAPIs/bby-query-builder) 1. [BestBuyAPIs/bestbuy-cli](https://github.com/BestBuyAPIs/bestbuy-cli) 1. [BestBuyAPIs/bestbuy-sdk-js](https://github.com/BestBuyAPIs/bestbuy-sdk-js) 1. [BestBuyAPIs/open-data-set](https://github.com/BestBuyAPIs/open-data-set) 1. [Breakend/PileOfLaw](https://github.com/Breakend/PileOfLaw) 1. [BuilderIO/qwik](https://github.com/BuilderIO/qwik) 1. [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) 1. [ByConity/ByConity](https://github.com/ByConity/ByConity) 1. [CESNET/libyang](https://github.com/CESNET/libyang) 1. [CESNET/libyang-python](https://github.com/CESNET/libyang-python) 1. [Canto-Network/canto](https://github.com/Canto-Network/canto) 1. [Capgemini/dcx-react-library](https://github.com/Capgemini/dcx-react-library) 1. [CarperAI/trlx](https://github.com/CarperAI/trlx) 1. [CascadeOS/CascadeOS](https://github.com/CascadeOS/CascadeOS) 1. [CesiumGS/cesium](https://github.com/CesiumGS/cesium) 1. [Chainlit/chainlit](https://github.com/Chainlit/chainlit) 1. [ChenYFan/ClientWorker](https://github.com/ChenYFan/ClientWorker) 1. [Chocobozzz/PeerTube](https://github.com/Chocobozzz/PeerTube) 1. [ClickHouse/ClickHouse](https://github.com/ClickHouse/ClickHouse) 1. [Codecademy/learn-python](https://github.com/Codecademy/learn-python) 1. [CodelyTV/php-ddd-example](https://github.com/CodelyTV/php-ddd-example) 1. [ColinSPuck/RustyVoxelEngine](https://github.com/ColinSPuck/RustyVoxelEngine) 1. [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion) 1. [Conflux-Chain/js-conflux-sdk](https://github.com/Conflux-Chain/js-conflux-sdk) 1. [CorwinDev/Discord-Bot](https://github.com/CorwinDev/Discord-Bot) 1. [DIYgod/RSSHub](https://github.com/DIYgod/RSSHub) 1. [Demigiant/dotween](https://github.com/Demigiant/dotween) 1. [DevotedHealth/terraform-provider-looker](https://github.com/DevotedHealth/terraform-provider-looker) 1. [DioxusLabs/dioxus](https://github.com/DioxusLabs/dioxus) 1. [DolbyIO/awesome-audio](https://github.com/DolbyIO/awesome-audio) 1. [DolbyIO/comms-sdk-react-native](https://github.com/DolbyIO/comms-sdk-react-native) 1. [DolbyLaboratories/AM-Viewer](https://github.com/DolbyLaboratories/AM-Viewer) 1. [DolbyLaboratories/DVEF](https://github.com/DolbyLaboratories/DVEF) 1. [DolbyLaboratories/dlb_mp4base](https://github.com/DolbyLaboratories/dlb_mp4base) 1. [DolbyLaboratories/dlb_mp4demux](https://github.com/DolbyLaboratories/dlb_mp4demux) 1. [DrKLO/Telegram](https://github.com/DrKLO/Telegram) 1. [Dyalog/pynapl](https://github.com/Dyalog/pynapl) 1. [EasyAiStudio/AutoPromptFill](https://github.com/EasyAiStudio/AutoPromptFill) 1. [EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books) 1. [EddieHubCommunity/LinkFree](https://github.com/EddieHubCommunity/LinkFree) 1. [EdgeApp/airbitz-android-gui](https://github.com/EdgeApp/airbitz-android-gui) 1. [EdgeApp/airbitz-core](https://github.com/EdgeApp/airbitz-core) 1. [EdgeApp/airbitz-core-java](https://github.com/EdgeApp/airbitz-core-java) 1. [EdgeApp/airbitz-core-objc](https://github.com/EdgeApp/airbitz-core-objc) 1. [EdgeApp/airbitz-ios-gui](https://github.com/EdgeApp/airbitz-ios-gui) 1. [EdgeApp/airbitz-plugins](https://github.com/EdgeApp/airbitz-plugins) 1. [EdgeApp/airbitz-wallet-recovery](https://github.com/EdgeApp/airbitz-wallet-recovery) 1. [EdgeApp/android-ndk-linux](https://github.com/EdgeApp/android-ndk-linux) 1. [EdgeApp/biggystring](https://github.com/EdgeApp/biggystring) 1. [EdgeApp/edge-core-js](https://github.com/EdgeApp/edge-core-js) 1. [EdgeApp/edge-currency-accountbased](https://github.com/EdgeApp/edge-currency-accountbased) 1. [EdgeApp/edge-currency-plugins](https://github.com/EdgeApp/edge-currency-plugins) 1. [EdgeApp/edge-exchange-plugins](https://github.com/EdgeApp/edge-exchange-plugins) 1. [EdgeApp/edge-login-ui-rn](https://github.com/EdgeApp/edge-login-ui-rn) 1. [EdgeApp/edge-react-gui](https://github.com/EdgeApp/edge-react-gui) 1. [EmperorFPI/envolved39](https://github.com/EmperorFPI/envolved39) 1. [Expensify/App](https://github.com/Expensify/App) 1. [Eyevinn/mp4ff](https://github.com/Eyevinn/mp4ff) 1. [FFmpeg/FFmpeg](https://github.com/FFmpeg/FFmpeg) 1. [FelixKratz/dotfiles](https://github.com/FelixKratz/dotfiles) 1. [Ff00ff/mammoth](https://github.com/Ff00ff/mammoth) 1. [Fictiverse/Redream](https://github.com/Fictiverse/Redream) 1. [FlightControl-Master/MOOSE](https://github.com/FlightControl-Master/MOOSE) 1. [FlowiseAI/Flowise](https://github.com/FlowiseAI/Flowise) 1. [GSConnect/gnome-shell-extension-gsconnect](https://github.com/GSConnect/gnome-shell-extension-gsconnect) 1. [GabeRundlett/gvox_engine](https://github.com/GabeRundlett/gvox_engine) 1. [GetJobber/atlantis](https://github.com/GetJobber/atlantis) 1. [GetJobber/jest-a-coverage-slip-detector](https://github.com/GetJobber/jest-a-coverage-slip-detector) 1. [GiancarloZ/GardEnvy](https://github.com/GiancarloZ/GardEnvy) 1. [GillianPerard/typescript-json-serializer](https://github.com/GillianPerard/typescript-json-serializer) 1. [GitHuberPilot/statistics_model](https://github.com/GitHuberPilot/statistics_model) 1. [Glowforge/attribution](https://github.com/Glowforge/attribution) 1. [Glowforge/kernel-module-glowforge](https://github.com/Glowforge/kernel-module-glowforge) 1. [Glowforge/kernel-module-imx-pwm-audio](https://github.com/Glowforge/kernel-module-imx-pwm-audio) 1. [Glowforge/linux-glowforge](https://github.com/Glowforge/linux-glowforge) 1. [Glowforge/meta-glowforge-gpl](https://github.com/Glowforge/meta-glowforge-gpl) 1. [Glowforge/u-boot-glowforge](https://github.com/Glowforge/u-boot-glowforge) 1. [GoogleCloudPlatform/gcping](https://github.com/GoogleCloudPlatform/gcping) 1. [GoogleCloudPlatform/microservices-demo](https://github.com/GoogleCloudPlatform/microservices-demo) 1. [GoogleCloudPlatform/spark-on-k8s-operator](https://github.com/GoogleCloudPlatform/spark-on-k8s-operator) 1. [GoogleCloudPlatform/terraformer](https://github.com/GoogleCloudPlatform/terraformer) 1. [Gopiandcode/petrol](https://github.com/Gopiandcode/petrol) 1. [Habrador/Unity-Programming-Patterns](https://github.com/Habrador/Unity-Programming-Patterns) 1. [HiTECNOLOGYs/cl-charms](https://github.com/HiTECNOLOGYs/cl-charms) 1. [HigherOrderCO/HVM](https://github.com/HigherOrderCO/HVM) 1. [HoffsMH/infra](https://github.com/HoffsMH/infra) 1. [Homebrew/brew](https://github.com/Homebrew/brew) 1. [Homebrew/homebrew-cask](https://github.com/Homebrew/homebrew-cask) 1. [InvoicePlane/InvoicePlane](https://github.com/InvoicePlane/InvoicePlane) 1. [JabRef/jabref](https://github.com/JabRef/jabref) 1. [JetBrains/intellij-community](https://github.com/JetBrains/intellij-community) 1. [JetBrains/kotlin](https://github.com/JetBrains/kotlin) 1. [JoepVanlier/JSFX](https://github.com/JoepVanlier/JSFX) 1. [JoshuaKGoldberg/TypeStat](https://github.com/JoshuaKGoldberg/TypeStat) 1. [JoshuaKGoldberg/ts-api-utils](https://github.com/JoshuaKGoldberg/ts-api-utils) 1. [JuliaLang/julia](https://github.com/JuliaLang/julia) 1. [KDE/konsole](https://github.com/KDE/konsole) 1. [KeepSafe/dexcount-gradle-plugin](https://github.com/KeepSafe/dexcount-gradle-plugin) 1. [KichangKim/DeepDanbooru](https://github.com/KichangKim/DeepDanbooru) 1. [KirillOsenkov/SourceBrowser](https://github.com/KirillOsenkov/SourceBrowser) 1. [Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) 1. [LTLA/scuttle](https://github.com/LTLA/scuttle) 1. [LazyVim/LazyVim](https://github.com/LazyVim/LazyVim) 1. [LinqLover/SimulationStudio](https://github.com/LinqLover/SimulationStudio) 1. [Linyou/taichi-ngp-renderer](https://github.com/Linyou/taichi-ngp-renderer) 1. [LukeMathWalker/pavex](https://github.com/LukeMathWalker/pavex) 1. [MacoskoLab/brain-atlas](https://github.com/MacoskoLab/brain-atlas) 1. [MacoskoLab/slideseq-tools](https://github.com/MacoskoLab/slideseq-tools) 1. [Mastercard/client-encryption-java](https://github.com/Mastercard/client-encryption-java) 1. [Mastercard/insomnia-plugin-mastercard](https://github.com/Mastercard/insomnia-plugin-mastercard) 1. [Mathijs-Bakker/Extenject](https://github.com/Mathijs-Bakker/Extenject) 1. [McLovin-RSPS/AutoPromptFill](https://github.com/McLovin-RSPS/AutoPromptFill) 1. [McLovin-RSPS/MapConverter](https://github.com/McLovin-RSPS/MapConverter) 1. [McLovin-RSPS/Vanguard-RuneLite](https://github.com/McLovin-RSPS/Vanguard-RuneLite) 1. [McLovin-RSPS/Xeros-Client](https://github.com/McLovin-RSPS/Xeros-Client) 1. [McLovin-RSPS/fluxious-client](https://github.com/McLovin-RSPS/fluxious-client) 1. [McLovin-RSPS/qodat](https://github.com/McLovin-RSPS/qodat) 1. [MetaMask/metamask-extension](https://github.com/MetaMask/metamask-extension) 1. [MetaMask/metamask-mobile](https://github.com/MetaMask/metamask-mobile) 1. [Metim0l/free-gpt-engineer](https://github.com/Metim0l/free-gpt-engineer) 1. [MichaelPilyavskiy/ReaScripts](https://github.com/MichaelPilyavskiy/ReaScripts) 1. [Mikubill/sd-webui-controlnet](https://github.com/Mikubill/sd-webui-controlnet) 1. [MineDojo/Voyager](https://github.com/MineDojo/Voyager) 1. [MockBukkit/MockBukkit](https://github.com/MockBukkit/MockBukkit) 1. [Momilijaz96/Face-DTR](https://github.com/Momilijaz96/Face-DTR) 1. [Momilijaz96/SentimentAnalysis](https://github.com/Momilijaz96/SentimentAnalysis) 1. [MoralisWeb3/Moralis-Python-SDK](https://github.com/MoralisWeb3/Moralis-Python-SDK) 1. [Mudlet/Mudlet](https://github.com/Mudlet/Mudlet) 1. [Museum-Barberini/Barberini-Analytics](https://github.com/Museum-Barberini/Barberini-Analytics) 1. [NCATSTranslator/ReasonerAPI](https://github.com/NCATSTranslator/ReasonerAPI) 1. [NCIP/lexevs](https://github.com/NCIP/lexevs) 1. [NVIDIA/DeepLearningExamples](https://github.com/NVIDIA/DeepLearningExamples) 1. [NVIDIA/Megatron-LM](https://github.com/NVIDIA/Megatron-LM) 1. [NVIDIA/NeMo](https://github.com/NVIDIA/NeMo) 1. [NVIDIA/TransformerEngine](https://github.com/NVIDIA/TransformerEngine) 1. [NVIDIA/tensorflow](https://github.com/NVIDIA/tensorflow) 1. [NetSPI/PowerUpSQL](https://github.com/NetSPI/PowerUpSQL) 1. [NicholasLYang/vicuna](https://github.com/NicholasLYang/vicuna) 1. [NixOS/nix](https://github.com/NixOS/nix) 1. [NixOS/nixpkgs](https://github.com/NixOS/nixpkgs) 1. [NordicSemiconductor/asset-tracker-cloud-aws-js](https://github.com/NordicSemiconductor/asset-tracker-cloud-aws-js) 1. [Nuand/bladeRF](https://github.com/Nuand/bladeRF) 1. [Nutlope/roomGPT](https://github.com/Nutlope/roomGPT) 1. [Occlusion-Solutions/llm_explorer](https://github.com/Occlusion-Solutions/llm_explorer) 1. [OneKeyHQ/app-monorepo](https://github.com/OneKeyHQ/app-monorepo) 1. [Open-EO/openeo-geopyspark-driver](https://github.com/Open-EO/openeo-geopyspark-driver) 1. [Open-EO/openeo-geopyspark-integrationtests](https://github.com/Open-EO/openeo-geopyspark-integrationtests) 1. [Open-EO/openeo-geotrellis-extensions](https://github.com/Open-EO/openeo-geotrellis-extensions) 1. [Open-EO/openeo-geotrellis-kubernetes](https://github.com/Open-EO/openeo-geotrellis-kubernetes) 1. [Open-EO/openeo-processes](https://github.com/Open-EO/openeo-processes) 1. [Open-EO/openeo-python-client](https://github.com/Open-EO/openeo-python-client) 1. [Open-EO/openeo-python-driver](https://github.com/Open-EO/openeo-python-driver) 1. [Open-Swarm-Net/GPT-Swarm](https://github.com/Open-Swarm-Net/GPT-Swarm) 1. [OpenMS/OpenMS](https://github.com/OpenMS/OpenMS) 1. [OpenSmalltalk/opensmalltalk-vm](https://github.com/OpenSmalltalk/opensmalltalk-vm) 1. [OpenZeppelin/openzeppelin-contracts](https://github.com/OpenZeppelin/openzeppelin-contracts) 1. [OpenZeppelin/openzeppelin-contracts-upgradeable](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable) 1. [OptimalScale/LMFlow](https://github.com/OptimalScale/LMFlow) 1. [OrchardCMS/OrchardCore](https://github.com/OrchardCMS/OrchardCore) 1. [Outsiderj/McBucks](https://github.com/Outsiderj/McBucks) 1. [PX4/PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) 1. [PatrickJS/awesome-angular](https://github.com/PatrickJS/awesome-angular) 1. [PowerShell/PowerShell](https://github.com/PowerShell/PowerShell) 1. [PrefectHQ/marvin](https://github.com/PrefectHQ/marvin) 1. [PrefectHQ/prefect](https://github.com/PrefectHQ/prefect) 1. [PriNova/SAM-GPT](https://github.com/PriNova/SAM-GPT) 1. [Promises/refactored-client-377](https://github.com/Promises/refactored-client-377) 1. [PySimpleGUI/PySimpleGUI](https://github.com/PySimpleGUI/PySimpleGUI) 1. [Pycord-Development/pycord](https://github.com/Pycord-Development/pycord) 1. [Qihoo360/evpp](https://github.com/Qihoo360/evpp) 1. [RawrJoey/ptcg-elite](https://github.com/RawrJoey/ptcg-elite) 1. [ReaTeam/JSFX](https://github.com/ReaTeam/JSFX) 1. [ReaTeam/ReaScripts](https://github.com/ReaTeam/ReaScripts) 1. [ReactiveX/RxJava](https://github.com/ReactiveX/RxJava) 1. [ReactiveX/RxSwift](https://github.com/ReactiveX/RxSwift) 1. [ReactiveX/rxjs](https://github.com/ReactiveX/rxjs) 1. [ReeceDonovan/donovan.dev](https://github.com/ReeceDonovan/donovan.dev) 1. [Regen1337/-](https://github.com/Regen1337/-) 1. [RimWorld-zh/RimWorld-Decompile](https://github.com/RimWorld-zh/RimWorld-Decompile) 1. [RoadieHQ/roadie-backstage-plugins](https://github.com/RoadieHQ/roadie-backstage-plugins) 1. [Ruu3f/freeGPT](https://github.com/Ruu3f/freeGPT) 1. [Sairyss/domain-driven-hexagon](https://github.com/Sairyss/domain-driven-hexagon) 1. [SciML/GlobalSensitivity.jl](https://github.com/SciML/GlobalSensitivity.jl) 1. [SciML/Optimization.jl](https://github.com/SciML/Optimization.jl) 1. [ScorpionOO8/PerfectChallenge](https://github.com/ScorpionOO8/PerfectChallenge) 1. [SeleniumHQ/selenium](https://github.com/SeleniumHQ/selenium) 1. [ShaderFrog/glsl-parser](https://github.com/ShaderFrog/glsl-parser) 1. [Shaked/gomobiledetect](https://github.com/Shaked/gomobiledetect) 1. [Shopify/shopify-app-template-node](https://github.com/Shopify/shopify-app-template-node) 1. [SigmaHQ/sigma](https://github.com/SigmaHQ/sigma) 1. [Significant-Gravitas/Auto-GPT](https://github.com/Significant-Gravitas/Auto-GPT) 1. [SillyTavern/SillyTavern](https://github.com/SillyTavern/SillyTavern) 1. [Snowfork/snowbridge](https://github.com/Snowfork/snowbridge) 1. [SocialFinance/datalab](https://github.com/SocialFinance/datalab) 1. [SocialFinance/fiximulator](https://github.com/SocialFinance/fiximulator) 1. [SocialFinance/homebrew-sofi](https://github.com/SocialFinance/homebrew-sofi) 1. [SocialFinance/sofi-checks](https://github.com/SocialFinance/sofi-checks) 1. [Stahldavid/autocode](https://github.com/Stahldavid/autocode) 1. [StanGirard/quivr](https://github.com/StanGirard/quivr) 1. [StarRocks/starrocks](https://github.com/StarRocks/starrocks) 1. [StephanRoemer/ReaScripts](https://github.com/StephanRoemer/ReaScripts) 1. [StockSharp/StockSharp](https://github.com/StockSharp/StockSharp) 1. [SynthstromAudible/DelugeFirmware](https://github.com/SynthstromAudible/DelugeFirmware) 1. [THU-DSP-LAB/ventus-gpgpu](https://github.com/THU-DSP-LAB/ventus-gpgpu) 1. [THUDM/CodeGeeX](https://github.com/THUDM/CodeGeeX) 1. [TanStack/query](https://github.com/TanStack/query) 1. [TanStack/router](https://github.com/TanStack/router) 1. [TanStack/table](https://github.com/TanStack/table) 1. [Tencent/QMUI_Android](https://github.com/Tencent/QMUI_Android) 1. [Tencent/mars](https://github.com/Tencent/mars) 1. [Tencent/wcdb](https://github.com/Tencent/wcdb) 1. [TensorSpeech/TensorFlowASR](https://github.com/TensorSpeech/TensorFlowASR) 1. [Textualize/textual](https://github.com/Textualize/textual) 1. [TheAlgorithms/Java](https://github.com/TheAlgorithms/Java) 1. [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python) 1. [TimDettmers/bitsandbytes](https://github.com/TimDettmers/bitsandbytes) 1. [TimothyStiles/poly](https://github.com/TimothyStiles/poly) 1. [TransformerOptimus/SuperAGI](https://github.com/TransformerOptimus/SuperAGI) 1. [Trusted-AI/adversarial-robustness-toolbox](https://github.com/Trusted-AI/adversarial-robustness-toolbox) 1. [TryGhost/Ghost](https://github.com/TryGhost/Ghost) 1. [Uniswap/web3-react](https://github.com/Uniswap/web3-react) 1. [Unity-Technologies/ECS-Network-Racing-Sample](https://github.com/Unity-Technologies/ECS-Network-Racing-Sample) 1. [Unity-Technologies/EntityComponentSystemSamples](https://github.com/Unity-Technologies/EntityComponentSystemSamples) 1. [Unity-Technologies/UnityCsReference](https://github.com/Unity-Technologies/UnityCsReference) 1. [Unity-Technologies/unity-ads-android](https://github.com/Unity-Technologies/unity-ads-android) 1. [Unleash/unleash-client-node](https://github.com/Unleash/unleash-client-node) 1. [Unleash/unleash-proxy](https://github.com/Unleash/unleash-proxy) 1. [UseHover/Stax](https://github.com/UseHover/Stax) 1. [VirtusLab/Inkuire](https://github.com/VirtusLab/Inkuire) 1. [VirtusLab/scala-cli](https://github.com/VirtusLab/scala-cli) 1. [WebKit/WebKit](https://github.com/WebKit/WebKit) 1. [WiseLibs/better-sqlite3](https://github.com/WiseLibs/better-sqlite3) 1. [WongKinYiu/yolov7](https://github.com/WongKinYiu/yolov7) 1. [WordPress/WordPress](https://github.com/WordPress/WordPress) 1. [Workiva/frugal](https://github.com/Workiva/frugal) 1. [Workiva/go-datastructures](https://github.com/Workiva/go-datastructures) 1. [Workiva/over_react](https://github.com/Workiva/over_react) 1. [Workiva/react_testing_library](https://github.com/Workiva/react_testing_library) 1. [X-Raym/REAPER-ReaScripts](https://github.com/X-Raym/REAPER-ReaScripts) 1. [XetaIO/Xeta](https://github.com/XetaIO/Xeta) 1. [Yelp/paasta](https://github.com/Yelp/paasta) 1. [YuLab-SMU/enrichplot](https://github.com/YuLab-SMU/enrichplot) 1. [YuLab-SMU/ggtree](https://github.com/YuLab-SMU/ggtree) 1. [Zettlr/Zettlr](https://github.com/Zettlr/Zettlr) 1. [Zielon/INSTA-pytorch](https://github.com/Zielon/INSTA-pytorch) 1. [Zielon/metrical-tracker](https://github.com/Zielon/metrical-tracker) 1. [a16z-infra/companion-app](https://github.com/a16z-infra/companion-app) 1. [aarnphm/whispercpp](https://github.com/aarnphm/whispercpp) 1. [abetlen/llama-cpp-python](https://github.com/abetlen/llama-cpp-python) 1. [abey79/vpype](https://github.com/abey79/vpype) 1. [abey79/vsketch](https://github.com/abey79/vsketch) 1. [abrudz/aplcart](https://github.com/abrudz/aplcart) 1. [abseil/abseil-cpp](https://github.com/abseil/abseil-cpp) 1. [accel-sim/accel-sim-framework](https://github.com/accel-sim/accel-sim-framework) 1. [accel-sim/gpgpu-sim_distribution](https://github.com/accel-sim/gpgpu-sim_distribution) 1. [acheong08/ChatGPT](https://github.com/acheong08/ChatGPT) 1. [acheong08/EdgeGPT](https://github.com/acheong08/EdgeGPT) 1. [activepieces/activepieces](https://github.com/activepieces/activepieces) 1. [actix/actix-web](https://github.com/actix/actix-web) 1. [adelosa/learnasm370](https://github.com/adelosa/learnasm370) 1. [ading2210/poe-api](https://github.com/ading2210/poe-api) 1. [adithya-s-sekhar/termux-setup](https://github.com/adithya-s-sekhar/termux-setup) 1. [adobe/react-spectrum](https://github.com/adobe/react-spectrum) 1. [adobe/spectrum-css](https://github.com/adobe/spectrum-css) 1. [adobe/spectrum-web-components](https://github.com/adobe/spectrum-web-components) 1. [adplabs/JQL](https://github.com/adplabs/JQL) 1. [adplabs/PigeonKeeper](https://github.com/adplabs/PigeonKeeper) 1. [adplabs/unicorn](https://github.com/adplabs/unicorn) 1. [aertslab/scenicplus](https://github.com/aertslab/scenicplus) 1. [ago109/predictive-forward-forward](https://github.com/ago109/predictive-forward-forward) 1. [aianlinb/LibGGPK3](https://github.com/aianlinb/LibGGPK3) 1. [airbnb/javascript](https://github.com/airbnb/javascript) 1. [airbnb/lottie-android](https://github.com/airbnb/lottie-android) 1. [airbytehq/airbyte](https://github.com/airbytehq/airbyte) 1. [ajaxorg/ace](https://github.com/ajaxorg/ace) 1. [akka/akka](https://github.com/akka/akka) 1. [alcaras/mplus.subcreation.net](https://github.com/alcaras/mplus.subcreation.net) 1. [alibaba/ARouter](https://github.com/alibaba/ARouter) 1. [alibaba/formily](https://github.com/alibaba/formily) 1. [alibaba/ice](https://github.com/alibaba/ice) 1. [allegro/bigcache](https://github.com/allegro/bigcache) 1. [allegro/bigflow](https://github.com/allegro/bigflow) 1. [allegro/hermes](https://github.com/allegro/hermes) 1. [alpacahq/alpaca-py](https://github.com/alpacahq/alpaca-py) 1. [altair-viz/altair](https://github.com/altair-viz/altair) 1. [ameinias/ObiFluid](https://github.com/ameinias/ObiFluid) 1. [americanexpress/earlybird](https://github.com/americanexpress/earlybird) 1. [americanexpress/holocron](https://github.com/americanexpress/holocron) 1. [americanexpress/jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot) 1. [americanexpress/one-app](https://github.com/americanexpress/one-app) 1. [americanexpress/react-albus](https://github.com/americanexpress/react-albus) 1. [analogdevicesinc/hdl](https://github.com/analogdevicesinc/hdl) 1. [angrycub/nomad_example_jobs](https://github.com/angrycub/nomad_example_jobs) 1. [angular/angular](https://github.com/angular/angular) 1. [ant-design/ant-design](https://github.com/ant-design/ant-design) 1. [apache/airflow](https://github.com/apache/airflow) 1. [apache/arrow-datafusion](https://github.com/apache/arrow-datafusion) 1. [apache/arrow-rs](https://github.com/apache/arrow-rs) 1. [apache/beam](https://github.com/apache/beam) 1. [apache/cassandra](https://github.com/apache/cassandra) 1. [apache/doris](https://github.com/apache/doris) 1. [apache/flink](https://github.com/apache/flink) 1. [apache/hadoop](https://github.com/apache/hadoop) 1. [apache/hive](https://github.com/apache/hive) 1. [apache/hudi](https://github.com/apache/hudi) 1. [apache/lucene](https://github.com/apache/lucene) 1. [apache/ofbiz](https://github.com/apache/ofbiz) 1. [apache/ofbiz-framework](https://github.com/apache/ofbiz-framework) 1. [apache/ofbiz-plugins](https://github.com/apache/ofbiz-plugins) 1. [apache/seatunnel](https://github.com/apache/seatunnel) 1. [apache/spark](https://github.com/apache/spark) 1. [apache/trafficserver](https://github.com/apache/trafficserver) 1. [apexsharp/apexparser](https://github.com/apexsharp/apexparser) 1. [apexsharp/apexsharp](https://github.com/apexsharp/apexsharp) 1. [api-platform/api-platform](https://github.com/api-platform/api-platform) 1. [apollographql/embeddable-explorer](https://github.com/apollographql/embeddable-explorer) 1. [apollographql/fullstack-tutorial](https://github.com/apollographql/fullstack-tutorial) 1. [appium/appium](https://github.com/appium/appium) 1. [apple/swift](https://github.com/apple/swift) 1. [apple/swift-algorithms](https://github.com/apple/swift-algorithms) 1. [apple/swift-corelibs-foundation](https://github.com/apple/swift-corelibs-foundation) 1. [appsmithorg/appsmith](https://github.com/appsmithorg/appsmith) 1. [appwrite/appwrite](https://github.com/appwrite/appwrite) 1. [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter) 1. [apuentemedallia/tools-and-techniques-for-vulnerability-validation](https://github.com/apuentemedallia/tools-and-techniques-for-vulnerability-validation) 1. [ardanlabs/gotraining](https://github.com/ardanlabs/gotraining) 1. [ardanlabs/service](https://github.com/ardanlabs/service) 1. [argoproj/argo-cd](https://github.com/argoproj/argo-cd) 1. [argoproj/argo-workflows](https://github.com/argoproj/argo-workflows) 1. [ariburaco/chatgpt-file-uploader-extended](https://github.com/ariburaco/chatgpt-file-uploader-extended) 1. [arkworks-rs/crypto-primitives](https://github.com/arkworks-rs/crypto-primitives) 1. [artichoke/artichoke](https://github.com/artichoke/artichoke) 1. [artichoke/artichoke.github.io](https://github.com/artichoke/artichoke.github.io) 1. [artichoke/roe](https://github.com/artichoke/roe) 1. [asafstr2/shemenotef](https://github.com/asafstr2/shemenotef) 1. [ashmind/SharpLab](https://github.com/ashmind/SharpLab) 1. [asim/turbo](https://github.com/asim/turbo) 1. [askibin/perpetuals](https://github.com/askibin/perpetuals) 1. [askibin/twamm](https://github.com/askibin/twamm) 1. [asticode/go-astits](https://github.com/asticode/go-astits) 1. [astral-sh/ruff](https://github.com/astral-sh/ruff) 1. [aurae-runtime/aurae](https://github.com/aurae-runtime/aurae) 1. [aurora-opensource/au](https://github.com/aurora-opensource/au) 1. [aurora-opensource/streetscape.gl](https://github.com/aurora-opensource/streetscape.gl) 1. [aurora-opensource/xviz](https://github.com/aurora-opensource/xviz) 1. [auth0-samples/auth0-golang-api-samples](https://github.com/auth0-samples/auth0-golang-api-samples) 1. [authzed/spicedb](https://github.com/authzed/spicedb) 1. [autorope/donkeycar](https://github.com/autorope/donkeycar) 1. [aws-amplify/amplify-js](https://github.com/aws-amplify/amplify-js) 1. [aws-powertools/powertools-lambda-python](https://github.com/aws-powertools/powertools-lambda-python) 1. [aws-powertools/powertools-lambda-typescript](https://github.com/aws-powertools/powertools-lambda-typescript) 1. [aws-samples/aws-glue-samples](https://github.com/aws-samples/aws-glue-samples) 1. [aws/aws-cdk](https://github.com/aws/aws-cdk) 1. [aws/aws-cdk-go](https://github.com/aws/aws-cdk-go) 1. [aws/aws-cdk-rfcs](https://github.com/aws/aws-cdk-rfcs) 1. [aws/aws-cli](https://github.com/aws/aws-cli) 1. [aws/aws-lambda-go](https://github.com/aws/aws-lambda-go) 1. [aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) 1. [aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) 1. [aws/aws-sdk-js](https://github.com/aws/aws-sdk-js) 1. [axios/axios](https://github.com/axios/axios) 1. [aypan17/machiavelli](https://github.com/aypan17/machiavelli) 1. [azure-rtos/threadx](https://github.com/azure-rtos/threadx) 1. [backstage/backstage](https://github.com/backstage/backstage) 1. [balena-io/open-balena-api](https://github.com/balena-io/open-balena-api) 1. [bazelbuild/bazel](https://github.com/bazelbuild/bazel) 1. [bazelbuild/rules_foreign_cc](https://github.com/bazelbuild/rules_foreign_cc) 1. [bbatsov/prelude](https://github.com/bbatsov/prelude) 1. [bboymega/Termux_url_opener_all_in_one_downloader](https://github.com/bboymega/Termux_url_opener_all_in_one_downloader) 1. [beir-cellar/beir](https://github.com/beir-cellar/beir) 1. [bellard/quickjs](https://github.com/bellard/quickjs) 1. [benmills/vim-golang-alternate](https://github.com/benmills/vim-golang-alternate) 1. [bentoml/BentoML](https://github.com/bentoml/BentoML) 1. [benweet/stackedit](https://github.com/benweet/stackedit) 1. [betaflight/betaflight-configurator](https://github.com/betaflight/betaflight-configurator) 1. [bgavran/Category_Theory_Machine_Learning](https://github.com/bgavran/Category_Theory_Machine_Learning) 1. [bgkatz/motorcontrol](https://github.com/bgkatz/motorcontrol) 1. [bigomics/omicsplayground](https://github.com/bigomics/omicsplayground) 1. [bigscience-workshop/Megatron-DeepSpeed](https://github.com/bigscience-workshop/Megatron-DeepSpeed) 1. [bigscience-workshop/petals](https://github.com/bigscience-workshop/petals) 1. [bigskysoftware/htmx](https://github.com/bigskysoftware/htmx) 1. [bilibili/ijkplayer](https://github.com/bilibili/ijkplayer) 1. [billxbf/ReWOO](https://github.com/billxbf/ReWOO) 1. [binary-husky/gpt_academic](https://github.com/binary-husky/gpt_academic) 1. [biolab/orange3](https://github.com/biolab/orange3) 1. [biolink/biolink-model](https://github.com/biolink/biolink-model) 1. [biopython/biopython](https://github.com/biopython/biopython) 1. [bisontrails/rules_kustomize](https://github.com/bisontrails/rules_kustomize) 1. [bitcoin/bitcoin](https://github.com/bitcoin/bitcoin) 1. [bitwarden/server](https://github.com/bitwarden/server) 1. [blackrock/TopNotch](https://github.com/blackrock/TopNotch) 1. [blackrock/lcso](https://github.com/blackrock/lcso) 1. [blender/blender](https://github.com/blender/blender) 1. [blender/blender-addons](https://github.com/blender/blender-addons) 1. [blender/cycles](https://github.com/blender/cycles) 1. [blockworks-foundation/mango-v4](https://github.com/blockworks-foundation/mango-v4) 1. [bloxapp/ssv](https://github.com/bloxapp/ssv) 1. [bloxapp/ssv-contracts](https://github.com/bloxapp/ssv-contracts) 1. [bloxapp/ssv-keys](https://github.com/bloxapp/ssv-keys) 1. [bloxapp/ssv-network](https://github.com/bloxapp/ssv-network) 1. [bloxapp/ssv-spec](https://github.com/bloxapp/ssv-spec) 1. [bloxapp/ssv-web](https://github.com/bloxapp/ssv-web) 1. [blugelabs/bluge](https://github.com/blugelabs/bluge) 1. [boardgameio/boardgame.io](https://github.com/boardgameio/boardgame.io) 1. [bookingcom/bpfink](https://github.com/bookingcom/bpfink) 1. [bookingcom/carbonapi](https://github.com/bookingcom/carbonapi) 1. [boostorg/boost](https://github.com/boostorg/boost) 1. [boto/boto3](https://github.com/boto/boto3) 1. [bpowers/judyarrays](https://github.com/bpowers/judyarrays) 1. [bregman-arie/devops-exercises](https://github.com/bregman-arie/devops-exercises) 1. [browserify/resolve](https://github.com/browserify/resolve) 1. [bufbuild/buf](https://github.com/bufbuild/buf) 1. [buildbuddy-io/buildbuddy](https://github.com/buildbuddy-io/buildbuddy) 1. [buildkite/go-buildkite](https://github.com/buildkite/go-buildkite) 1. [buildo/bento-design-system](https://github.com/buildo/bento-design-system) 1. [buildo/retro](https://github.com/buildo/retro) 1. [bytebase/bytebase](https://github.com/bytebase/bytebase) 1. [bytecodealliance/wasmtime](https://github.com/bytecodealliance/wasmtime) 1. [caddyserver/caddy](https://github.com/caddyserver/caddy) 1. [caddyserver/certmagic](https://github.com/caddyserver/certmagic) 1. [caddyserver/website](https://github.com/caddyserver/website) 1. [cakephp/cakephp](https://github.com/cakephp/cakephp) 1. [camel-ai/camel](https://github.com/camel-ai/camel) 1. [canonical/cloud-init](https://github.com/canonical/cloud-init) 1. [canonical/go-dqlite](https://github.com/canonical/go-dqlite) 1. [canonical/lxd](https://github.com/canonical/lxd) 1. [canonical/microk8s](https://github.com/canonical/microk8s) 1. [canonical/pebble](https://github.com/canonical/pebble) 1. [capitalone/AI_Dictionary_English_Spanish](https://github.com/capitalone/AI_Dictionary_English_Spanish) 1. [capitalone/BankAccountStarter-API-reference-app](https://github.com/capitalone/BankAccountStarter-API-reference-app) 1. [capitalone/CreditOffers-API-reference-app](https://github.com/capitalone/CreditOffers-API-reference-app) 1. [capitalone/DataProfiler](https://github.com/capitalone/DataProfiler) 1. [capitalone/OAuthClient](https://github.com/capitalone/OAuthClient) 1. [capitalone/Particle-Cloud-Framework](https://github.com/capitalone/Particle-Cloud-Framework) 1. [capitalone/Rewards-API-reference-app](https://github.com/capitalone/Rewards-API-reference-app) 1. [capitalone/SWHttpTrafficRecorder](https://github.com/capitalone/SWHttpTrafficRecorder) 1. [capitalone/ablation](https://github.com/capitalone/ablation) 1. [capitalone/acronym-decoder](https://github.com/capitalone/acronym-decoder) 1. [capitalone/architecture-viewer](https://github.com/capitalone/architecture-viewer) 1. [capitalone/bash_shell_mock](https://github.com/capitalone/bash_shell_mock) 1. [capitalone/checks-out](https://github.com/capitalone/checks-out) 1. [capitalone/cqrs-manager-for-distributed-reactive-services](https://github.com/capitalone/cqrs-manager-for-distributed-reactive-services) 1. [capitalone/dataCompareR](https://github.com/capitalone/dataCompareR) 1. [capitalone/datacompy](https://github.com/capitalone/datacompy) 1. [capitalone/easy-screenshots](https://github.com/capitalone/easy-screenshots) 1. [capitalone/edgetest](https://github.com/capitalone/edgetest) 1. [capitalone/edgetest-conda](https://github.com/capitalone/edgetest-conda) 1. [capitalone/edgetest-hub](https://github.com/capitalone/edgetest-hub) 1. [capitalone/federated-model-aggregation](https://github.com/capitalone/federated-model-aggregation) 1. [capitalone/fpe](https://github.com/capitalone/fpe) 1. [capitalone/giraffez](https://github.com/capitalone/giraffez) 1. [capitalone/global-attribution-mapping](https://github.com/capitalone/global-attribution-mapping) 1. [capitalone/go-future-context](https://github.com/capitalone/go-future-context) 1. [capitalone/grpc-cucumber-js](https://github.com/capitalone/grpc-cucumber-js) 1. [capitalone/json-syntax](https://github.com/capitalone/json-syntax) 1. [capitalone/jwt-security](https://github.com/capitalone/jwt-security) 1. [capitalone/local-crontab](https://github.com/capitalone/local-crontab) 1. [capitalone/locopy](https://github.com/capitalone/locopy) 1. [capitalone/modtracker](https://github.com/capitalone/modtracker) 1. [capitalone/oas-nodegen](https://github.com/capitalone/oas-nodegen) 1. [capitalone/otvPlots](https://github.com/capitalone/otvPlots) 1. [capitalone/react-native-pathjs-charts](https://github.com/capitalone/react-native-pathjs-charts) 1. [capitalone/rubicon-ml](https://github.com/capitalone/rubicon-ml) 1. [capitalone/screen-object](https://github.com/capitalone/screen-object) 1. [capitalone/serverless-shell](https://github.com/capitalone/serverless-shell) 1. [capitalone/slackbot-destroyer](https://github.com/capitalone/slackbot-destroyer) 1. [capitalone/stack-deployment-tool](https://github.com/capitalone/stack-deployment-tool) 1. [capitalone/synthetic-data](https://github.com/capitalone/synthetic-data) 1. [capnproto/capnproto](https://github.com/capnproto/capnproto) 1. [carlmjohnson/requests](https://github.com/carlmjohnson/requests) 1. [carlospolop/hacktricks](https://github.com/carlospolop/hacktricks) 1. [cdktf/cdktf-provider-aws-go](https://github.com/cdktf/cdktf-provider-aws-go) 1. [cfillion/reaimgui](https://github.com/cfillion/reaimgui) 1. [cfillion/reascripts](https://github.com/cfillion/reascripts) 1. [chakra-ui/chakra-ui](https://github.com/chakra-ui/chakra-ui) 1. [chaosparrot/talon_hud](https://github.com/chaosparrot/talon_hud) 1. [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) 1. [chathub-dev/chathub](https://github.com/chathub-dev/chathub) 1. [chroma-core/chroma](https://github.com/chroma-core/chroma) 1. [chromium/chromium](https://github.com/chromium/chromium) 1. [chubin/wttr.in](https://github.com/chubin/wttr.in) 1. [ciaochaos/qrbtf](https://github.com/ciaochaos/qrbtf) 1. [ciel-lang/CIEL](https://github.com/ciel-lang/CIEL) 1. [cilium/cilium](https://github.com/cilium/cilium) 1. [circe/circe](https://github.com/circe/circe) 1. [circleci/bond](https://github.com/circleci/bond) 1. [circleci/ex](https://github.com/circleci/ex) 1. [civo/civo-cloud-controller-manager](https://github.com/civo/civo-cloud-controller-manager) 1. [civo/civogo](https://github.com/civo/civogo) 1. [civo/cli](https://github.com/civo/cli) 1. [civo/terraform-provider-civo](https://github.com/civo/terraform-provider-civo) 1. [cleder/fastkml](https://github.com/cleder/fastkml) 1. [cleder/pygeoif](https://github.com/cleder/pygeoif) 1. [clerkinc/clerk-docs](https://github.com/clerkinc/clerk-docs) 1. [clerkinc/clerk-sdk-go](https://github.com/clerkinc/clerk-sdk-go) 1. [clerkinc/javascript](https://github.com/clerkinc/javascript) 1. [cloudflare/workerd](https://github.com/cloudflare/workerd) 1. [cloudscape-design/components](https://github.com/cloudscape-design/components) 1. [cloudwego/cloudwego.github.io](https://github.com/cloudwego/cloudwego.github.io) 1. [cocktailpeanut/dalai](https://github.com/cocktailpeanut/dalai) 1. [codemirror/autocomplete](https://github.com/codemirror/autocomplete) 1. [codemirror/collab](https://github.com/codemirror/collab) 1. [codemirror/commands](https://github.com/codemirror/commands) 1. [codemirror/lang-javascript](https://github.com/codemirror/lang-javascript) 1. [codemirror/lang-sql](https://github.com/codemirror/lang-sql) 1. [codemirror/language](https://github.com/codemirror/language) 1. [codemirror/language-data](https://github.com/codemirror/language-data) 1. [codemirror/lint](https://github.com/codemirror/lint) 1. [codemirror/merge](https://github.com/codemirror/merge) 1. [codemirror/search](https://github.com/codemirror/search) 1. [codemirror/state](https://github.com/codemirror/state) 1. [codemirror/view](https://github.com/codemirror/view) 1. [coder/coder](https://github.com/coder/coder) 1. [codota/tabnine-nvim](https://github.com/codota/tabnine-nvim) 1. [cohesity/ansible-collection](https://github.com/cohesity/ansible-collection) 1. [cohesity/app-sdk-go](https://github.com/cohesity/app-sdk-go) 1. [cohesity/cohesity-powershell-module](https://github.com/cohesity/cohesity-powershell-module) 1. [cohesity/management-sdk-python](https://github.com/cohesity/management-sdk-python) 1. [colinhacks/zod](https://github.com/colinhacks/zod) 1. [collabora/WhisperSpeech](https://github.com/collabora/WhisperSpeech) 1. [cometbft/cometbft](https://github.com/cometbft/cometbft) 1. [commaai/openpilot](https://github.com/commaai/openpilot) 1. [compbiomed/singleCellTK](https://github.com/compbiomed/singleCellTK) 1. [compodoc/compodoc](https://github.com/compodoc/compodoc) 1. [concrete-utopia/utopia](https://github.com/concrete-utopia/utopia) 1. [conda/conda](https://github.com/conda/conda) 1. [conda/conda-build](https://github.com/conda/conda-build) 1. [confluentinc/schema-registry](https://github.com/confluentinc/schema-registry) 1. [containerd/containerd](https://github.com/containerd/containerd) 1. [containerd/nerdctl](https://github.com/containerd/nerdctl) 1. [contentful/contentful.js](https://github.com/contentful/contentful.js) 1. [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede) 1. [coredns/coredns.io](https://github.com/coredns/coredns.io) 1. [coreinfrastructure/best-practices-badge](https://github.com/coreinfrastructure/best-practices-badge) 1. [cp-algorithms/cp-algorithms](https://github.com/cp-algorithms/cp-algorithms) 1. [crate-ci/typos](https://github.com/crate-ci/typos) 1. [crossoverJie/cim](https://github.com/crossoverJie/cim) 1. [cruise-automation/daytona](https://github.com/cruise-automation/daytona) 1. [cruise-automation/fwanalyzer](https://github.com/cruise-automation/fwanalyzer) 1. [cruise-automation/isopod](https://github.com/cruise-automation/isopod) 1. [cruise-automation/webviz](https://github.com/cruise-automation/webviz) 1. [crystal-lang/crystal](https://github.com/crystal-lang/crystal) 1. [csells/curlconverter](https://github.com/csells/curlconverter) 1. [cssnano/cssnano](https://github.com/cssnano/cssnano) 1. [ctsstc/typio-form-recovery-reboot](https://github.com/ctsstc/typio-form-recovery-reboot) 1. [cucumber/cucumber-ruby](https://github.com/cucumber/cucumber-ruby) 1. [cue-lang/cue](https://github.com/cue-lang/cue) 1. [curl/curl](https://github.com/curl/curl) 1. [cursorless-dev/cursorless](https://github.com/cursorless-dev/cursorless) 1. [cypress-io/cypress](https://github.com/cypress-io/cypress) 1. [d3/d3](https://github.com/d3/d3) 1. [dagger/dagger](https://github.com/dagger/dagger) 1. [dagster-io/dagster](https://github.com/dagster-io/dagster) 1. [dailydotdev/apps](https://github.com/dailydotdev/apps) 1. [dailydotdev/daily](https://github.com/dailydotdev/daily) 1. [dair-ai/Prompt-Engineering-Guide](https://github.com/dair-ai/Prompt-Engineering-Guide) 1. [dapr/dapr](https://github.com/dapr/dapr) 1. [dart-lang/sdk](https://github.com/dart-lang/sdk) 1. [dask/dask](https://github.com/dask/dask) 1. [databricks/terraform-provider-databricks](https://github.com/databricks/terraform-provider-databricks) 1. [datafuselabs/databend](https://github.com/datafuselabs/databend) 1. [datawire/ambassador-docs](https://github.com/datawire/ambassador-docs) 1. [datawire/edge-stack](https://github.com/datawire/edge-stack) 1. [datawire/emojivoto](https://github.com/datawire/emojivoto) 1. [datawire/envoy-gateway](https://github.com/datawire/envoy-gateway) 1. [datawire/go-mkopensource](https://github.com/datawire/go-mkopensource) 1. [davecheney/pub](https://github.com/davecheney/pub) 1. [davidteren/sensible_rails_starter](https://github.com/davidteren/sensible_rails_starter) 1. [dbt-labs/dbt-core](https://github.com/dbt-labs/dbt-core) 1. [ddd-by-examples/library](https://github.com/ddd-by-examples/library) 1. [de4dot/de4dot](https://github.com/de4dot/de4dot) 1. [deepak2431/issue_gpt](https://github.com/deepak2431/issue_gpt) 1. [deforum-art/sd-webui-deforum](https://github.com/deforum-art/sd-webui-deforum) 1. [dell/dkms](https://github.com/dell/dkms) 1. [delta-io/delta](https://github.com/delta-io/delta) 1. [demonnic/Highlighter](https://github.com/demonnic/Highlighter) 1. [demonnic/MDK](https://github.com/demonnic/MDK) 1. [demonnic/muddler](https://github.com/demonnic/muddler) 1. [denoland/deno](https://github.com/denoland/deno) 1. [denoland/fresh](https://github.com/denoland/fresh) 1. [derailed/k9s](https://github.com/derailed/k9s) 1. [dgtlmoon/changedetection.io](https://github.com/dgtlmoon/changedetection.io) 1. [dhenson02/libredis](https://github.com/dhenson02/libredis) 1. [digitalocean/doctl](https://github.com/digitalocean/doctl) 1. [directus/directus](https://github.com/directus/directus) 1. [discourse/discourse](https://github.com/discourse/discourse) 1. [disney/groovity](https://github.com/disney/groovity) 1. [disney/meteor-base](https://github.com/disney/meteor-base) 1. [disney/quanta](https://github.com/disney/quanta) 1. [distribution/distribution](https://github.com/distribution/distribution) 1. [divnix/std](https://github.com/divnix/std) 1. [django/django](https://github.com/django/django) 1. [dmcable/spacexr](https://github.com/dmcable/spacexr) 1. [docker/compose](https://github.com/docker/compose) 1. [dolfies/discord.py-self](https://github.com/dolfies/discord.py-self) 1. [dolthub/dolt](https://github.com/dolthub/dolt) 1. [domgen/insightappsec-scan-github-actions](https://github.com/domgen/insightappsec-scan-github-actions) 1. [doomemacs/doomemacs](https://github.com/doomemacs/doomemacs) 1. [dosbox-staging/dosbox-staging](https://github.com/dosbox-staging/dosbox-staging) 1. [dotnet/Silk.NET](https://github.com/dotnet/Silk.NET) 1. [dotnet/aspnetcore](https://github.com/dotnet/aspnetcore) 1. [dotnet/efcore](https://github.com/dotnet/efcore) 1. [dotnet/orleans](https://github.com/dotnet/orleans) 1. [dotnet/roslyn](https://github.com/dotnet/roslyn) 1. [dotnet/roslyn-sdk](https://github.com/dotnet/roslyn-sdk) 1. [dotnet/sdk](https://github.com/dotnet/sdk) 1. [dreamwidth/dreamwidth](https://github.com/dreamwidth/dreamwidth) 1. [dreamworksanimation/openmoonray](https://github.com/dreamworksanimation/openmoonray) 1. [drift-labs/protocol-v2](https://github.com/drift-labs/protocol-v2) 1. [drizzle-team/drizzle-orm](https://github.com/drizzle-team/drizzle-orm) 1. [droidian/deviceinfo](https://github.com/droidian/deviceinfo) 1. [droidian/hybris-usb](https://github.com/droidian/hybris-usb) 1. [dropbox/dbx_build_tools](https://github.com/dropbox/dbx_build_tools) 1. [dropbox/dropshots](https://github.com/dropbox/dropshots) 1. [dropbox/godropbox](https://github.com/dropbox/godropbox) 1. [dropbox/ts-transform-import-path-rewrite](https://github.com/dropbox/ts-transform-import-path-rewrite) 1. [dropbox/zxcvbn](https://github.com/dropbox/zxcvbn) 1. [drupal/drupal](https://github.com/drupal/drupal) 1. [dstoc/pkmapp](https://github.com/dstoc/pkmapp) 1. [dtolnay/inventory](https://github.com/dtolnay/inventory) 1. [dtolnay/linkme](https://github.com/dtolnay/linkme) 1. [duckdb/duckdb](https://github.com/duckdb/duckdb) 1. [easy-graph/Easy-Graph](https://github.com/easy-graph/Easy-Graph) 1. [ebkalderon/tower-lsp](https://github.com/ebkalderon/tower-lsp) 1. [eclipse-zenoh/zenoh](https://github.com/eclipse-zenoh/zenoh) 1. [eclipse/eclipse-collections](https://github.com/eclipse/eclipse-collections) 1. [ecomfe/reskript](https://github.com/ecomfe/reskript) 1. [elastic/beats](https://github.com/elastic/beats) 1. [elastic/elasticsearch](https://github.com/elastic/elasticsearch) 1. [electronicarts/CnC_Remastered_Collection](https://github.com/electronicarts/CnC_Remastered_Collection) 1. [electronicarts/EASTL](https://github.com/electronicarts/EASTL) 1. [electronicarts/ea-async](https://github.com/electronicarts/ea-async) 1. [element-plus/element-plus](https://github.com/element-plus/element-plus) 1. [elementor/wp2static](https://github.com/elementor/wp2static) 1. [elixir-ecto/ecto](https://github.com/elixir-ecto/ecto) 1. [elixir-lang/elixir](https://github.com/elixir-lang/elixir) 1. [emacs-mirror/emacs](https://github.com/emacs-mirror/emacs) 1. [emilybache/GildedRose-Refactoring-Kata](https://github.com/emilybache/GildedRose-Refactoring-Kata) 1. [emissary-ingress/emissary](https://github.com/emissary-ingress/emissary) 1. [emptycrown/llama-hub](https://github.com/emptycrown/llama-hub) 1. [emscripten-core/emscripten](https://github.com/emscripten-core/emscripten) 1. [emscripten-core/emsdk](https://github.com/emscripten-core/emsdk) 1. [encode/django-rest-framework](https://github.com/encode/django-rest-framework) 1. [endojs/endo](https://github.com/endojs/endo) 1. [envoyproxy/envoy](https://github.com/envoyproxy/envoy) 1. [enzymejs/enzyme](https://github.com/enzymejs/enzyme) 1. [ergoplatform/oracle-core](https://github.com/ergoplatform/oracle-core) 1. [erikerlandson/coulomb](https://github.com/erikerlandson/coulomb) 1. [erocarrera/pefile](https://github.com/erocarrera/pefile) 1. [es-shims/es5-shim](https://github.com/es-shims/es5-shim) 1. [esbuild-kit/tsx](https://github.com/esbuild-kit/tsx) 1. [eslint/eslint](https://github.com/eslint/eslint) 1. [espnet/espnet](https://github.com/espnet/espnet) 1. [ethereum/go-ethereum](https://github.com/ethereum/go-ethereum) 1. [ethereum/solidity](https://github.com/ethereum/solidity) 1. [ethereum/web3.py](https://github.com/ethereum/web3.py) 1. [eugenp/tutorials](https://github.com/eugenp/tutorials) 1. [evmos/ethermint](https://github.com/evmos/ethermint) 1. [ewired/gjs-guide](https://github.com/ewired/gjs-guide) 1. [exchange-core/exchange-core](https://github.com/exchange-core/exchange-core) 1. [explosion/spaCy](https://github.com/explosion/spaCy) 1. [expressjs/express](https://github.com/expressjs/express) 1. [facebook/docusaurus](https://github.com/facebook/docusaurus) 1. [facebook/folly](https://github.com/facebook/folly) 1. [facebook/lexical](https://github.com/facebook/lexical) 1. [facebook/prop-types](https://github.com/facebook/prop-types) 1. [facebook/prophet](https://github.com/facebook/prophet) 1. [facebook/react](https://github.com/facebook/react) 1. [facebook/react-native](https://github.com/facebook/react-native) 1. [facebook/yoga](https://github.com/facebook/yoga) 1. [facebookincubator/AITemplate](https://github.com/facebookincubator/AITemplate) 1. [facebookresearch/detectron2](https://github.com/facebookresearch/detectron2) 1. [facebookresearch/fairseq](https://github.com/facebookresearch/fairseq) 1. [facebookresearch/llama](https://github.com/facebookresearch/llama) 1. [faif/python-patterns](https://github.com/faif/python-patterns) 1. [fairnesscoop/permacoop](https://github.com/fairnesscoop/permacoop) 1. [fastapi-users/fastapi-users](https://github.com/fastapi-users/fastapi-users) 1. [faster-cpython/cpython](https://github.com/faster-cpython/cpython) 1. [fayazara/onelink](https://github.com/fayazara/onelink) 1. [fbsamples/audience-network](https://github.com/fbsamples/audience-network) 1. [felHR85/UsbSerial](https://github.com/felHR85/UsbSerial) 1. [felixge/traceutils](https://github.com/felixge/traceutils) 1. [finos/spring-bot](https://github.com/finos/spring-bot) 1. [firebase/firebase-admin-python](https://github.com/firebase/firebase-admin-python) 1. [firebase/firebase-js-sdk](https://github.com/firebase/firebase-js-sdk) 1. [fish-shell/fish-shell](https://github.com/fish-shell/fish-shell) 1. [fivetran/benchmark](https://github.com/fivetran/benchmark) 1. [flix/flix](https://github.com/flix/flix) 1. [floating-ui/floating-ui](https://github.com/floating-ui/floating-ui) 1. [floooh/sokol](https://github.com/floooh/sokol) 1. [flores-jacob/philippine-regions-provinces-cities-municipalities-barangays](https://github.com/flores-jacob/philippine-regions-provinces-cities-municipalities-barangays) 1. [flutter-stripe/flutter_stripe](https://github.com/flutter-stripe/flutter_stripe) 1. [flutter/codelabs](https://github.com/flutter/codelabs) 1. [flutter/flutter](https://github.com/flutter/flutter) 1. [flutter/packages](https://github.com/flutter/packages) 1. [flutter/samples](https://github.com/flutter/samples) 1. [fluxcd/kustomize-controller](https://github.com/fluxcd/kustomize-controller) 1. [fluxcd/source-controller](https://github.com/fluxcd/source-controller) 1. [folke/lazy.nvim](https://github.com/folke/lazy.nvim) 1. [framer/motion](https://github.com/framer/motion) 1. [francoismassart/eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss) 1. [frappe/erpnext](https://github.com/frappe/erpnext) 1. [freddyaboulton/gradio-tools](https://github.com/freddyaboulton/gradio-tools) 1. [freeCodeCamp/freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) 1. [freenome/flyte](https://github.com/freenome/flyte) 1. [fuqunaga/RosettaUI](https://github.com/fuqunaga/RosettaUI) 1. [fyne-io/fyne](https://github.com/fyne-io/fyne) 1. [gajus/slonik](https://github.com/gajus/slonik) 1. [galaxyproject/ansible-galaxy](https://github.com/galaxyproject/ansible-galaxy) 1. [garden-io/garden](https://github.com/garden-io/garden) 1. [gatsbyjs/gatsby](https://github.com/gatsbyjs/gatsby) 1. [gcanti/fp-ts](https://github.com/gcanti/fp-ts) 1. [gemini-hlsw/clue](https://github.com/gemini-hlsw/clue) 1. [gemini-hlsw/crystal](https://github.com/gemini-hlsw/crystal) 1. [gemini-hlsw/explore](https://github.com/gemini-hlsw/explore) 1. [gemini-hlsw/lucuma-catalog](https://github.com/gemini-hlsw/lucuma-catalog) 1. [gemini-hlsw/lucuma-core](https://github.com/gemini-hlsw/lucuma-core) 1. [gemini-hlsw/lucuma-odb](https://github.com/gemini-hlsw/lucuma-odb) 1. [gemini-hlsw/lucuma-react](https://github.com/gemini-hlsw/lucuma-react) 1. [gemini-hlsw/lucuma-schemas](https://github.com/gemini-hlsw/lucuma-schemas) 1. [gemini-hlsw/lucuma-sso](https://github.com/gemini-hlsw/lucuma-sso) 1. [gemini-hlsw/lucuma-ui](https://github.com/gemini-hlsw/lucuma-ui) 1. [geopandas/geopandas](https://github.com/geopandas/geopandas) 1. [getlantern/systray](https://github.com/getlantern/systray) 1. [getsentry/relay](https://github.com/getsentry/relay) 1. [getsentry/self-hosted](https://github.com/getsentry/self-hosted) 1. [getsentry/sentry](https://github.com/getsentry/sentry) 1. [getsentry/snuba](https://github.com/getsentry/snuba) 1. [getsentry/symbolicator](https://github.com/getsentry/symbolicator) 1. [ggerganov/ggml](https://github.com/ggerganov/ggml) 1. [ggerganov/llama.cpp](https://github.com/ggerganov/llama.cpp) 1. [ggerganov/whisper.cpp](https://github.com/ggerganov/whisper.cpp) 1. [gin-gonic/gin](https://github.com/gin-gonic/gin) 1. [gitkraken/vscode-gitlens](https://github.com/gitkraken/vscode-gitlens) 1. [gitlab.com/CalcProgrammer1/OpenRGB](https://gitlab.com/CalcProgrammer1/OpenRGB) 1. [gitlab.com/antonok/enum_dispatch](https://gitlab.com/antonok/enum_dispatch) 1. [gitlab.com/gitlab-com/www-gitlab-com](https://gitlab.com/gitlab-com/www-gitlab-com) 1. [gitlab.com/gitlab-org/gitlab](https://gitlab.com/gitlab-org/gitlab) 1. [gitlab.com/gitlab-org/gitlab-foss](https://gitlab.com/gitlab-org/gitlab-foss) 1. [gitlab.com/gitlab-org/gitlab-runner](https://gitlab.com/gitlab-org/gitlab-runner) 1. [gitlab.com/graphviz/graphviz](https://gitlab.com/graphviz/graphviz) 1. [gitlab.com/plom/plom](https://gitlab.com/plom/plom) 1. [gitlab.com/sourcegraph/jsonrpc2](https://gitlab.com/sourcegraph/jsonrpc2) 1. [gitpod-io/gitpod](https://github.com/gitpod-io/gitpod) 1. [gitpod-io/gitpod-code](https://github.com/gitpod-io/gitpod-code) 1. [gitpod-io/openvscode-server](https://github.com/gitpod-io/openvscode-server) 1. [gitpod-io/website](https://github.com/gitpod-io/website) 1. [gkamradt/langchain-tutorials](https://github.com/gkamradt/langchain-tutorials) 1. [gnuradio/gnuradio](https://github.com/gnuradio/gnuradio) 1. [go-delve/delve](https://github.com/go-delve/delve) 1. [go-kratos/kratos](https://github.com/go-kratos/kratos) 1. [go-kratos/kratos-layout](https://github.com/go-kratos/kratos-layout) 1. [go-python/cpy3](https://github.com/go-python/cpy3) 1. [go/Sirupsen/logrus](https://go/github.com/Sirupsen/logrus) 1. [go/aws/aws-cdk-go/awscdk](https://go/github.com/aws/aws-cdk-go/awscdk) 1. [go/aws/aws-cdk-go/awscdk/v2](https://go/github.com/aws/aws-cdk-go/awscdk/v2) 1. [go/go.mongodb.org/mongo-driver](https://go/go.mongodb.org/mongo-driver) 1. [go/smallstep/cli](https://go/github.com/smallstep/cli) 1. [godotengine/godot](https://github.com/godotengine/godot) 1. [gofiber/fiber](https://github.com/gofiber/fiber) 1. [gohugoio/hugo](https://github.com/gohugoio/hugo) 1. [golang/go](https://github.com/golang/go) 1. [goldmansachs/gs-quant](https://github.com/goldmansachs/gs-quant) 1. [goldmansachs/obevo](https://github.com/goldmansachs/obevo) 1. [goldmansachs/reladomo](https://github.com/goldmansachs/reladomo) 1. [google/blockly](https://github.com/google/blockly) 1. [google/closure-library](https://github.com/google/closure-library) 1. [google/gin-config](https://github.com/google/gin-config) 1. [google/go-github](https://github.com/google/go-github) 1. [google/googletest](https://github.com/google/googletest) 1. [google/gvisor](https://github.com/google/gvisor) 1. [google/highway](https://github.com/google/highway) 1. [google/jax](https://github.com/google/jax) 1. [google/python-fire](https://github.com/google/python-fire) 1. [google/skia](https://github.com/google/skia) 1. [google/starlark-go](https://github.com/google/starlark-go) 1. [googleads/googleads-mobile-android-examples](https://github.com/googleads/googleads-mobile-android-examples) 1. [gothinkster/realworld](https://github.com/gothinkster/realworld) 1. [gradio-app/gradio](https://github.com/gradio-app/gradio) 1. [gradle/gradle](https://github.com/gradle/gradle) 1. [gradle/gradle-completion](https://github.com/gradle/gradle-completion) 1. [gradle/gradle-profiler](https://github.com/gradle/gradle-profiler) 1. [grafana/grafana](https://github.com/grafana/grafana) 1. [grafana/loki](https://github.com/grafana/loki) 1. [graphql-java/graphql-java](https://github.com/graphql-java/graphql-java) 1. [graphql-python/gql](https://github.com/graphql-python/gql) 1. [graphql/swapi-graphql](https://github.com/graphql/swapi-graphql) 1. [greenboxal/aip](https://github.com/greenboxal/aip) 1. [greenhat/cairo](https://github.com/greenhat/cairo) 1. [greenhat/omnizk](https://github.com/greenhat/omnizk) 1. [grf-labs/grf](https://github.com/grf-labs/grf) 1. [growthbook/growthbook](https://github.com/growthbook/growthbook) 1. [growthbook/growthbook-c-sharp](https://github.com/growthbook/growthbook-c-sharp) 1. [growthbook/growthbook-cli](https://github.com/growthbook/growthbook-cli) 1. [growthbook/growthbook-golang](https://github.com/growthbook/growthbook-golang) 1. [growthbook/growthbook-js](https://github.com/growthbook/growthbook-js) 1. [growthbook/growthbook-kotlin](https://github.com/growthbook/growthbook-kotlin) 1. [growthbook/growthbook-php](https://github.com/growthbook/growthbook-php) 1. [growthbook/growthbook-proxy](https://github.com/growthbook/growthbook-proxy) 1. [growthbook/growthbook-python](https://github.com/growthbook/growthbook-python) 1. [growthbook/growthbook-react](https://github.com/growthbook/growthbook-react) 1. [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) 1. [grpc/grpc](https://github.com/grpc/grpc) 1. [grpc/grpc-go](https://github.com/grpc/grpc-go) 1. [guanfuchen/statistics_model](https://github.com/guanfuchen/statistics_model) 1. [guilleiguaran/xv6](https://github.com/guilleiguaran/xv6) 1. [hackforla/311-data-archive](https://github.com/hackforla/311-data-archive) 1. [haguro/elevenlabs-go](https://github.com/haguro/elevenlabs-go) 1. [hahwul/dalfox](https://github.com/hahwul/dalfox) 1. [halfrost/LeetCode-Go](https://github.com/halfrost/LeetCode-Go) 1. [handshake-org/hs-airdrop](https://github.com/handshake-org/hs-airdrop) 1. [hapijs/joi](https://github.com/hapijs/joi) 1. [hashicorp-forge/hermes](https://github.com/hashicorp-forge/hermes) 1. [hashicorp/consul](https://github.com/hashicorp/consul) 1. [hashicorp/design-system](https://github.com/hashicorp/design-system) 1. [hashicorp/dev-portal](https://github.com/hashicorp/dev-portal) 1. [hashicorp/errwrap](https://github.com/hashicorp/errwrap) 1. [hashicorp/go-multierror](https://github.com/hashicorp/go-multierror) 1. [hashicorp/go-tfe](https://github.com/hashicorp/go-tfe) 1. [hashicorp/hcl](https://github.com/hashicorp/hcl) 1. [hashicorp/nomad](https://github.com/hashicorp/nomad) 1. [hashicorp/react-components](https://github.com/hashicorp/react-components) 1. [hashicorp/terraform](https://github.com/hashicorp/terraform) 1. [hashicorp/terraform-provider-aws](https://github.com/hashicorp/terraform-provider-aws) 1. [hashicorp/vault](https://github.com/hashicorp/vault) 1. [hashicorp/waypoint-client](https://github.com/hashicorp/waypoint-client) 1. [haskell-hint/hint](https://github.com/haskell-hint/hint) 1. [hasura/graphql-engine](https://github.com/hasura/graphql-engine) 1. [hatemhosny/parse-starter](https://github.com/hatemhosny/parse-starter) 1. [helix-editor/helix](https://github.com/helix-editor/helix) 1. [helm/helm](https://github.com/helm/helm) 1. [hgrecco/pint](https://github.com/hgrecco/pint) 1. [hms-dbmi/UpSetR](https://github.com/hms-dbmi/UpSetR) 1. [holoviz/holoviews](https://github.com/holoviz/holoviews) 1. [holoviz/panel](https://github.com/holoviz/panel) 1. [holoviz/param](https://github.com/holoviz/param) 1. [home-assistant/core](https://github.com/home-assistant/core) 1. [hora-search/hora](https://github.com/hora-search/hora) 1. [hpi-swa-lab/SqueakByExample-english](https://github.com/hpi-swa-lab/SqueakByExample-english) 1. [hpi-swa-lab/godot-pronto](https://github.com/hpi-swa-lab/godot-pronto) 1. [hpi-swa-lab/squeak-inbox-talk](https://github.com/hpi-swa-lab/squeak-inbox-talk) 1. [hpi-swa-lab/squeak-tracedebugger](https://github.com/hpi-swa-lab/squeak-tracedebugger) 1. [hpi-swa/sandblocks](https://github.com/hpi-swa/sandblocks) 1. [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) 1. [http4s/http4s](https://github.com/http4s/http4s) 1. [huangsam/ultimate-python](https://github.com/huangsam/ultimate-python) 1. [hubbleprotocol/scope](https://github.com/hubbleprotocol/scope) 1. [huggingface/accelerate](https://github.com/huggingface/accelerate) 1. [huggingface/diffusers](https://github.com/huggingface/diffusers) 1. [huggingface/peft](https://github.com/huggingface/peft) 1. [huggingface/tokenizers](https://github.com/huggingface/tokenizers) 1. [huggingface/transformers](https://github.com/huggingface/transformers) 1. [hustoj/hustoj-neo](https://github.com/hustoj/hustoj-neo) 1. [hustoj/runner](https://github.com/hustoj/runner) 1. [hwchase17/langchain](https://github.com/hwchase17/langchain) 1. [hwchase17/langchain-codespaces](https://github.com/hwchase17/langchain-codespaces) 1. [hwchase17/langchain-gradio-template](https://github.com/hwchase17/langchain-gradio-template) 1. [hwchase17/langchain-hub](https://github.com/hwchase17/langchain-hub) 1. [hwchase17/langchain-pages](https://github.com/hwchase17/langchain-pages) 1. [hwchase17/langchain-streamlit-template](https://github.com/hwchase17/langchain-streamlit-template) 1. [hwchase17/langchain-template-node-fly](https://github.com/hwchase17/langchain-template-node-fly) 1. [hwchase17/langchainjs](https://github.com/hwchase17/langchainjs) 1. [hypothesis/browser-extension](https://github.com/hypothesis/browser-extension) 1. [iPoetDev/terni-lapilli--toe](https://github.com/iPoetDev/terni-lapilli--toe) 1. [iainc/iA-Writer-Templates](https://github.com/iainc/iA-Writer-Templates) 1. [ibi-group/datatools-server](https://github.com/ibi-group/datatools-server) 1. [ibi-group/datatools-ui](https://github.com/ibi-group/datatools-ui) 1. [ideasman42/nerd-dictation](https://github.com/ideasman42/nerd-dictation) 1. [iluwatar/java-design-patterns](https://github.com/iluwatar/java-design-patterns) 1. [immich-app/immich](https://github.com/immich-app/immich) 1. [import-js/eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) 1. [indeedeng/anomaly-detection](https://github.com/indeedeng/anomaly-detection) 1. [indeedeng/api](https://github.com/indeedeng/api) 1. [indeedeng/apollo-kotlin](https://github.com/indeedeng/apollo-kotlin) 1. [indeedeng/charm](https://github.com/indeedeng/charm) 1. [indeedeng/cni](https://github.com/indeedeng/cni) 1. [indeedeng/imhotep](https://github.com/indeedeng/imhotep) 1. [indeedeng/imhotep-builder-jira](https://github.com/indeedeng/imhotep-builder-jira) 1. [indeedeng/imhotep-cloudformation](https://github.com/indeedeng/imhotep-cloudformation) 1. [indeedeng/imhotep-docker](https://github.com/indeedeng/imhotep-docker) 1. [indeedeng/proctor](https://github.com/indeedeng/proctor) 1. [indico/indico](https://github.com/indico/indico) 1. [indoorvivants/sn-bindgen](https://github.com/indoorvivants/sn-bindgen) 1. [influitive/apartment](https://github.com/influitive/apartment) 1. [influitive/multiple_man](https://github.com/influitive/multiple_man) 1. [infracost/infracost](https://github.com/infracost/infracost) 1. [input-leap/input-leap](https://github.com/input-leap/input-leap) 1. [inspect-js/node-deep-equal](https://github.com/inspect-js/node-deep-equal) 1. [inspect-js/object-inspect](https://github.com/inspect-js/object-inspect) 1. [inspect-js/which-collection](https://github.com/inspect-js/which-collection) 1. [instacart/Nantes](https://github.com/instacart/Nantes) 1. [instacart/Snacks](https://github.com/instacart/Snacks) 1. [instacart/TrueTime.swift](https://github.com/instacart/TrueTime.swift) 1. [instacart/activerecord-redshift-adapter](https://github.com/instacart/activerecord-redshift-adapter) 1. [instacart/ahab](https://github.com/instacart/ahab) 1. [instacart/ahoy-android](https://github.com/instacart/ahoy-android) 1. [instacart/amountable](https://github.com/instacart/amountable) 1. [instacart/arn](https://github.com/instacart/arn) 1. [instacart/cwam](https://github.com/instacart/cwam) 1. [instacart/formula](https://github.com/instacart/formula) 1. [instacart/instacart-android-pp-sandbox](https://github.com/instacart/instacart-android-pp-sandbox) 1. [instacart/instacart-ios-pp-starter](https://github.com/instacart/instacart-ios-pp-starter) 1. [instacart/jardin-archived](https://github.com/instacart/jardin-archived) 1. [instacart/lore](https://github.com/instacart/lore) 1. [instacart/makara](https://github.com/instacart/makara) 1. [instacart/ohmycron](https://github.com/instacart/ohmycron) 1. [instacart/openapi-generator](https://github.com/instacart/openapi-generator) 1. [instacart/optplayground](https://github.com/instacart/optplayground) 1. [instacart/pghero](https://github.com/instacart/pghero) 1. [instacart/rack-attack](https://github.com/instacart/rack-attack) 1. [instacart/redux-rails](https://github.com/instacart/redux-rails) 1. [instacart/redux-rails-resource](https://github.com/instacart/redux-rails-resource) 1. [instacart/rswag](https://github.com/instacart/rswag) 1. [instacart/sidekiq](https://github.com/instacart/sidekiq) 1. [instacart/truetime-android](https://github.com/instacart/truetime-android) 1. [instacart/ubuntu-ec2net](https://github.com/instacart/ubuntu-ec2net) 1. [instacart/wilson_score](https://github.com/instacart/wilson_score) 1. [intel/neural-compressor](https://github.com/intel/neural-compressor) 1. [invoiceninja/invoiceninja](https://github.com/invoiceninja/invoiceninja) 1. [ironsource-mobile/Mediation-Demo-Apps](https://github.com/ironsource-mobile/Mediation-Demo-Apps) 1. [isocpp/CppCoreGuidelines](https://github.com/isocpp/CppCoreGuidelines) 1. [isrc-cas/flounder](https://github.com/isrc-cas/flounder) 1. [istio/istio](https://github.com/istio/istio) 1. [istio/tools](https://github.com/istio/tools) 1. [jaceyi/chat](https://github.com/jaceyi/chat) 1. [jagannatharjun/qbt-theme](https://github.com/jagannatharjun/qbt-theme) 1. [jakartaee/persistence](https://github.com/jakartaee/persistence) 1. [jamf/API_Scripts](https://github.com/jamf/API_Scripts) 1. [jamf/AppConfig-Generator](https://github.com/jamf/AppConfig-Generator) 1. [jamf/PPPC-Utility](https://github.com/jamf/PPPC-Utility) 1. [jamf/aftermath](https://github.com/jamf/aftermath) 1. [jamf/authchanger](https://github.com/jamf/authchanger) 1. [jamf/mut](https://github.com/jamf/mut) 1. [jamf/regatta](https://github.com/jamf/regatta) 1. [janestreet/bonsai](https://github.com/janestreet/bonsai) 1. [janestreet/ppx_expect](https://github.com/janestreet/ppx_expect) 1. [janestreet/ppx_fields_conv](https://github.com/janestreet/ppx_fields_conv) 1. [janestreet/re2](https://github.com/janestreet/re2) 1. [janestreet/torch](https://github.com/janestreet/torch) 1. [janestreet/universe](https://github.com/janestreet/universe) 1. [janestreet/vcaml](https://github.com/janestreet/vcaml) 1. [janestreet/virtual_dom](https://github.com/janestreet/virtual_dom) 1. [janet-lang/argparse](https://github.com/janet-lang/argparse) 1. [janet-lang/circlet](https://github.com/janet-lang/circlet) 1. [janet-lang/janet](https://github.com/janet-lang/janet) 1. [janet-lang/janet-lang.org](https://github.com/janet-lang/janet-lang.org) 1. [janet-lang/janet.vim](https://github.com/janet-lang/janet.vim) 1. [janet-lang/janetui](https://github.com/janet-lang/janetui) 1. [janet-lang/jaylib](https://github.com/janet-lang/jaylib) 1. [janet-lang/jhydro](https://github.com/janet-lang/jhydro) 1. [janet-lang/jpm](https://github.com/janet-lang/jpm) 1. [janet-lang/json](https://github.com/janet-lang/json) 1. [jaredpalmer/formik](https://github.com/jaredpalmer/formik) 1. [jart/blink](https://github.com/jart/blink) 1. [jart/cosmopolitan](https://github.com/jart/cosmopolitan) 1. [jauderho/bl3auto](https://github.com/jauderho/bl3auto) 1. [jauderho/dockerfiles](https://github.com/jauderho/dockerfiles) 1. [jauderho/psfiles](https://github.com/jauderho/psfiles) 1. [jauderho/sandbox](https://github.com/jauderho/sandbox) 1. [jdorfman/gitcoin-bounites](https://github.com/jdorfman/gitcoin-bounites) 1. [jdorfman/www](https://github.com/jdorfman/www) 1. [jellydn/next-swagger-doc](https://github.com/jellydn/next-swagger-doc) 1. [jerryjliu/llama_index](https://github.com/jerryjliu/llama_index) 1. [jestjs/jest](https://github.com/jestjs/jest) 1. [jgm/pandoc](https://github.com/jgm/pandoc) 1. [jina-ai/auto-gpt-web](https://github.com/jina-ai/auto-gpt-web) 1. [jitsucom/bulker](https://github.com/jitsucom/bulker) 1. [jlevy/the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line) 1. [joemccann/dillinger](https://github.com/joemccann/dillinger) 1. [johnspade/taskobot-scala](https://github.com/johnspade/taskobot-scala) 1. [joinhandshake/Querl](https://github.com/joinhandshake/Querl) 1. [joinhandshake/api-python](https://github.com/joinhandshake/api-python) 1. [joinhandshake/fast_inserter](https://github.com/joinhandshake/fast_inserter) 1. [joinhandshake/knockoff](https://github.com/joinhandshake/knockoff) 1. [joinhandshake/seira](https://github.com/joinhandshake/seira) 1. [jokergoo/ComplexHeatmap](https://github.com/jokergoo/ComplexHeatmap) 1. [josephmisiti/awesome-machine-learning](https://github.com/josephmisiti/awesome-machine-learning) 1. [jpmorganchase/jif-dashboard](https://github.com/jpmorganchase/jif-dashboard) 1. [jpmorganchase/modular](https://github.com/jpmorganchase/modular) 1. [jpmorganchase/python-training](https://github.com/jpmorganchase/python-training) 1. [jpmorganchase/salt-ds](https://github.com/jpmorganchase/salt-ds) 1. [jsdotlua/react-lua](https://github.com/jsdotlua/react-lua) 1. [json5/json5](https://github.com/json5/json5) 1. [jspsych/jsPsych](https://github.com/jspsych/jsPsych) 1. [jsx-eslint/eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) 1. [jsx-eslint/eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) 1. [junegunn/fzf](https://github.com/junegunn/fzf) 1. [jupyter-server/jupyter_server](https://github.com/jupyter-server/jupyter_server) 1. [jupyter/jupyter_client](https://github.com/jupyter/jupyter_client) 1. [jupyter/notebook](https://github.com/jupyter/notebook) 1. [jupyterlab/jupyterlab](https://github.com/jupyterlab/jupyterlab) 1. [jwt/ruby-jwt](https://github.com/jwt/ruby-jwt) 1. [k2-fsa/k2](https://github.com/k2-fsa/k2) 1. [kairos-io/kairos](https://github.com/kairos-io/kairos) 1. [kamranahmedse/design-patterns-for-humans](https://github.com/kamranahmedse/design-patterns-for-humans) 1. [kangax/compat-table](https://github.com/kangax/compat-table) 1. [kedro-org/kedro](https://github.com/kedro-org/kedro) 1. [keeshii/ryuu-play](https://github.com/keeshii/ryuu-play) 1. [keinsell/neuronek](https://github.com/keinsell/neuronek) 1. [kelseyhightower/kubernetes-the-hard-way](https://github.com/kelseyhightower/kubernetes-the-hard-way) 1. [kelseyhightower/vault-init](https://github.com/kelseyhightower/vault-init) 1. [ken107/read-aloud](https://github.com/ken107/read-aloud) 1. [keyval-dev/odigos](https://github.com/keyval-dev/odigos) 1. [khuedoan/homelab](https://github.com/khuedoan/homelab) 1. [kolobashek/specmash-itinerary](https://github.com/kolobashek/specmash-itinerary) 1. [kolobashek/specmash-server](https://github.com/kolobashek/specmash-server) 1. [koolhazz/LuaGameEngine](https://github.com/koolhazz/LuaGameEngine) 1. [kovidgoyal/kitty](https://github.com/kovidgoyal/kitty) 1. [krassowski/complex-upset](https://github.com/krassowski/complex-upset) 1. [kristoff-it/zig-okredis](https://github.com/kristoff-it/zig-okredis) 1. [kube-hetzner/terraform-hcloud-kube-hetzner](https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner) 1. [kubearmor/KubeArmor](https://github.com/kubearmor/KubeArmor) 1. [kubernetes-client/javascript](https://github.com/kubernetes-client/javascript) 1. [kubernetes-sigs/kui](https://github.com/kubernetes-sigs/kui) 1. [kubernetes/apimachinery](https://github.com/kubernetes/apimachinery) 1. [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) 1. [kubernetes/test-infra](https://github.com/kubernetes/test-infra) 1. [kubevirt/kubevirt](https://github.com/kubevirt/kubevirt) 1. [kumahq/kuma](https://github.com/kumahq/kuma) 1. [kumahq/kuma-demo](https://github.com/kumahq/kuma-demo) 1. [kumahq/kuma-gui](https://github.com/kumahq/kuma-gui) 1. [kumahq/kuma-website](https://github.com/kumahq/kuma-website) 1. [kuzudb/kuzu](https://github.com/kuzudb/kuzu) 1. [kysely-org/kysely](https://github.com/kysely-org/kysely) 1. [labstack/echo](https://github.com/labstack/echo) 1. [lampepfl/dotty](https://github.com/lampepfl/dotty) 1. [laravel/framework](https://github.com/laravel/framework) 1. [laravel/laravel](https://github.com/laravel/laravel) 1. [launchbadge/sqlx](https://github.com/launchbadge/sqlx) 1. [laurent22/joplin](https://github.com/laurent22/joplin) 1. [lazear/sage](https://github.com/lazear/sage) 1. [leondz/garak](https://github.com/leondz/garak) 1. [leptos-rs/leptos](https://github.com/leptos-rs/leptos) 1. [levitsky/pyteomics](https://github.com/levitsky/pyteomics) 1. [lf-edge/eve](https://github.com/lf-edge/eve) 1. [libgdx/libgdx](https://github.com/libgdx/libgdx) 1. [libp2p/go-libp2p-pubsub](https://github.com/libp2p/go-libp2p-pubsub) 1. [libuv/libuv](https://github.com/libuv/libuv) 1. [lieff/minimp3](https://github.com/lieff/minimp3) 1. [linebender/xilem](https://github.com/linebender/xilem) 1. [linkedin/rest.li](https://github.com/linkedin/rest.li) 1. [linkedin/venice](https://github.com/linkedin/venice) 1. [linuxserver/docker-kasm](https://github.com/linuxserver/docker-kasm) 1. [lit/lit](https://github.com/lit/lit) 1. [live-codes/livecodes](https://github.com/live-codes/livecodes) 1. [livebook-dev/livebook](https://github.com/livebook-dev/livebook) 1. [livekit/livekit](https://github.com/livekit/livekit) 1. [livewire/livewire](https://github.com/livewire/livewire) 1. [ljharb/es-abstract](https://github.com/ljharb/es-abstract) 1. [ljharb/object.assign](https://github.com/ljharb/object.assign) 1. [ljharb/tape](https://github.com/ljharb/tape) 1. [lllyasviel/ControlNet-v1-1-nightly](https://github.com/lllyasviel/ControlNet-v1-1-nightly) 1. [llvm/llvm-project](https://github.com/llvm/llvm-project) 1. [localstack/localstack](https://github.com/localstack/localstack) 1. [locationtech/geotrellis](https://github.com/locationtech/geotrellis) 1. [logspace-ai/langflow](https://github.com/logspace-ai/langflow) 1. [loopbackio/loopback-connector](https://github.com/loopbackio/loopback-connector) 1. [loopbackio/loopback-connector-mysql](https://github.com/loopbackio/loopback-connector-mysql) 1. [loopbackio/loopback-datasource-juggler](https://github.com/loopbackio/loopback-datasource-juggler) 1. [loopbackio/loopback-next](https://github.com/loopbackio/loopback-next) 1. [luc-tielen/eclair-lang](https://github.com/luc-tielen/eclair-lang) 1. [luca-git/OlaGPT](https://github.com/luca-git/OlaGPT) 1. [lucidrains/audiolm-pytorch](https://github.com/lucidrains/audiolm-pytorch) 1. [lucidrains/vector-quantize-pytorch](https://github.com/lucidrains/vector-quantize-pytorch) 1. [lucidrains/vit-pytorch](https://github.com/lucidrains/vit-pytorch) 1. [lucidrains/x-transformers](https://github.com/lucidrains/x-transformers) 1. [lugia19/elevenlabslib](https://github.com/lugia19/elevenlabslib) 1. [luning/jquery.parcel](https://github.com/luning/jquery.parcel) 1. [luxiaoxun/NettyRpc](https://github.com/luxiaoxun/NettyRpc) 1. [lvgl/lv_binding_micropython](https://github.com/lvgl/lv_binding_micropython) 1. [maciejgryka/regex_help](https://github.com/maciejgryka/regex_help) 1. [mage-ai/mage-ai](https://github.com/mage-ai/mage-ai) 1. [magenta/magenta](https://github.com/magenta/magenta) 1. [magento/magento2](https://github.com/magento/magento2) 1. [magit/transient](https://github.com/magit/transient) 1. [man-group/ArcticDB](https://github.com/man-group/ArcticDB) 1. [man-group/notebooker](https://github.com/man-group/notebooker) 1. [man-group/pytest-plugins](https://github.com/man-group/pytest-plugins) 1. [mantinedev/mantine](https://github.com/mantinedev/mantine) 1. [mantinedev/ui.mantine.dev](https://github.com/mantinedev/ui.mantine.dev) 1. [marcleblanc2/cody-embeddings-discord-bot](https://github.com/marcleblanc2/cody-embeddings-discord-bot) 1. [mark-when/timeline](https://github.com/mark-when/timeline) 1. [mastodon/mastodon](https://github.com/mastodon/mastodon) 1. [matomo-org/device-detector](https://github.com/matomo-org/device-detector) 1. [matplotlib/matplotlib](https://github.com/matplotlib/matplotlib) 1. [mattermost/mattermost](https://github.com/mattermost/mattermost) 1. [maxcountryman/axum-login](https://github.com/maxcountryman/axum-login) 1. [maxcountryman/flask-login](https://github.com/maxcountryman/flask-login) 1. [mckaywrigley/chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) 1. [medallia/Word2VecJava](https://github.com/medallia/Word2VecJava) 1. [mehcode/config-rs](https://github.com/mehcode/config-rs) 1. [melonjs/melonJS](https://github.com/melonjs/melonJS) 1. [meltano/meltano](https://github.com/meltano/meltano) 1. [memphisdev/memphis](https://github.com/memphisdev/memphis) 1. [memphisdev/memphis-benchmark](https://github.com/memphisdev/memphis-benchmark) 1. [memphisdev/memphis-cli-old](https://github.com/memphisdev/memphis-cli-old) 1. [memphisdev/memphis-docker](https://github.com/memphisdev/memphis-docker) 1. [memphisdev/memphis-k8s](https://github.com/memphisdev/memphis-k8s) 1. [memphisdev/memphis.go](https://github.com/memphisdev/memphis.go) 1. [memphisdev/memphis.java](https://github.com/memphisdev/memphis.java) 1. [memphisdev/memphis.js](https://github.com/memphisdev/memphis.js) 1. [memphisdev/memphis.net](https://github.com/memphisdev/memphis.net) 1. [memphisdev/memphis.py](https://github.com/memphisdev/memphis.py) 1. [mercadolibre/chico](https://github.com/mercadolibre/chico) 1. [mercadolibre/golang-restclient](https://github.com/mercadolibre/golang-restclient) 1. [mercadolibre/java-restclient](https://github.com/mercadolibre/java-restclient) 1. [mercadolibre/java-sdk](https://github.com/mercadolibre/java-sdk) 1. [mercadolibre/mlbusiness-components-ios](https://github.com/mercadolibre/mlbusiness-components-ios) 1. [mercadolibre/net-sdk](https://github.com/mercadolibre/net-sdk) 1. [mercadolibre/php-sdk](https://github.com/mercadolibre/php-sdk) 1. [mercadolibre/piper](https://github.com/mercadolibre/piper) 1. [mercadolibre/python-sdk](https://github.com/mercadolibre/python-sdk) 1. [mercadolibre/toiler](https://github.com/mercadolibre/toiler) 1. [mesonbuild/meson](https://github.com/mesonbuild/meson) 1. [metabase/metabase](https://github.com/metabase/metabase) 1. [mholt/acmez](https://github.com/mholt/acmez) 1. [micropython/micropython](https://github.com/micropython/micropython) 1. [microsoft/DeepSpeed](https://github.com/microsoft/DeepSpeed) 1. [microsoft/JARVIS](https://github.com/microsoft/JARVIS) 1. [microsoft/OLive](https://github.com/microsoft/OLive) 1. [microsoft/OpenAPI.NET](https://github.com/microsoft/OpenAPI.NET) 1. [microsoft/PowerToys](https://github.com/microsoft/PowerToys) 1. [microsoft/SPTAG](https://github.com/microsoft/SPTAG) 1. [microsoft/TaskMatrix](https://github.com/microsoft/TaskMatrix) 1. [microsoft/TypeScript](https://github.com/microsoft/TypeScript) 1. [microsoft/Windows-Driver-Frameworks](https://github.com/microsoft/Windows-Driver-Frameworks) 1. [microsoft/Windows-driver-samples](https://github.com/microsoft/Windows-driver-samples) 1. [microsoft/calculator](https://github.com/microsoft/calculator) 1. [microsoft/fluentui-blazor](https://github.com/microsoft/fluentui-blazor) 1. [microsoft/guidance](https://github.com/microsoft/guidance) 1. [microsoft/kiota](https://github.com/microsoft/kiota) 1. [microsoft/microsoft-ui-xaml](https://github.com/microsoft/microsoft-ui-xaml) 1. [microsoft/onnxruntime](https://github.com/microsoft/onnxruntime) 1. [microsoft/playwright](https://github.com/microsoft/playwright) 1. [microsoft/pyright](https://github.com/microsoft/pyright) 1. [microsoft/semantic-kernel](https://github.com/microsoft/semantic-kernel) 1. [microsoft/thrifty](https://github.com/microsoft/thrifty) 1. [microsoft/vscode](https://github.com/microsoft/vscode) 1. [microsoft/vscode-jupyter](https://github.com/microsoft/vscode-jupyter) 1. [microsoft/vscode-languageserver-node](https://github.com/microsoft/vscode-languageserver-node) 1. [miekg/dns](https://github.com/miekg/dns) 1. [mikelove/DESeq2](https://github.com/mikelove/DESeq2) 1. [milvus-io/knowhere](https://github.com/milvus-io/knowhere) 1. [milvus-io/milvus](https://github.com/milvus-io/milvus) 1. [mirror/x264](https://github.com/mirror/x264) 1. [mit-cml/appinventor-sources](https://github.com/mit-cml/appinventor-sources) 1. [mit-pdos/xv6-riscv](https://github.com/mit-pdos/xv6-riscv) 1. [mjpieters/aiolimiter](https://github.com/mjpieters/aiolimiter) 1. [mlc-ai/mlc-llm](https://github.com/mlc-ai/mlc-llm) 1. [mljar/mercury](https://github.com/mljar/mercury) 1. [mllg/batchtools](https://github.com/mllg/batchtools) 1. [mobxjs/mobx](https://github.com/mobxjs/mobx) 1. [moby/moby](https://github.com/moby/moby) 1. [mocobeta/janome](https://github.com/mocobeta/janome) 1. [monobilisim/whatsapp-ws](https://github.com/monobilisim/whatsapp-ws) 1. [morganstanley/binlog](https://github.com/morganstanley/binlog) 1. [morganstanley/desktopJS](https://github.com/morganstanley/desktopJS) 1. [morganstanley/testplan](https://github.com/morganstanley/testplan) 1. [mozilla/pdf.js](https://github.com/mozilla/pdf.js) 1. [mrnugget/fzz](https://github.com/mrnugget/fzz) 1. [mrnugget/vimconfig](https://github.com/mrnugget/vimconfig) 1. [mrousavy/react-native-mmkv](https://github.com/mrousavy/react-native-mmkv) 1. [mrxiaozhuox/karaty](https://github.com/mrxiaozhuox/karaty) 1. [mui/material-ui](https://github.com/mui/material-ui) 1. [mysql/mysql-server](https://github.com/mysql/mysql-server) 1. [n8n-io/n8n](https://github.com/n8n-io/n8n) 1. [nalexn/clean-architecture-swiftui](https://github.com/nalexn/clean-architecture-swiftui) 1. [needle-mirror/com.unity.entities](https://github.com/needle-mirror/com.unity.entities) 1. [neelnanda-io/TransformerLens](https://github.com/neelnanda-io/TransformerLens) 1. [neo4j/neo4j](https://github.com/neo4j/neo4j) 1. [neovim/neovim](https://github.com/neovim/neovim) 1. [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) 1. [nerfstudio-project/nerfstudio](https://github.com/nerfstudio-project/nerfstudio) 1. [nestjs/docs.nestjs.com](https://github.com/nestjs/docs.nestjs.com) 1. [nestjs/graphql](https://github.com/nestjs/graphql) 1. [nestjs/nest](https://github.com/nestjs/nest) 1. [nestjs/passport](https://github.com/nestjs/passport) 1. [netdata/libjudy](https://github.com/netdata/libjudy) 1. [netneurolab/netneurotools](https://github.com/netneurolab/netneurotools) 1. [netneurolab/neuromaps](https://github.com/netneurolab/neuromaps) 1. [netty/netty](https://github.com/netty/netty) 1. [networkx/networkx](https://github.com/networkx/networkx) 1. [neurorestore/Libra](https://github.com/neurorestore/Libra) 1. [newrelic/go-agent](https://github.com/newrelic/go-agent) 1. [nextauthjs/next-auth](https://github.com/nextauthjs/next-auth) 1. [nextdns/nextdns](https://github.com/nextdns/nextdns) 1. [nginx/nginx](https://github.com/nginx/nginx) 1. [ngrx/platform](https://github.com/ngrx/platform) 1. [niespodd/browser-fingerprinting](https://github.com/niespodd/browser-fingerprinting) 1. [nim-lang/Nim](https://github.com/nim-lang/Nim) 1. [nix-community/home-manager](https://github.com/nix-community/home-manager) 1. [nix-community/poetry2nix](https://github.com/nix-community/poetry2nix) 1. [nlewo/nix2container](https://github.com/nlewo/nix2container) 1. [nltk/nltk](https://github.com/nltk/nltk) 1. [nmrshll/auth-rs](https://github.com/nmrshll/auth-rs) 1. [nmrshll/auth-rs-warp](https://github.com/nmrshll/auth-rs-warp) 1. [nmrshll/bb](https://github.com/nmrshll/bb) 1. [nmrshll/chart](https://github.com/nmrshll/chart) 1. [nocodb/nocodb](https://github.com/nocodb/nocodb) 1. [node-red/node-red](https://github.com/node-red/node-red) 1. [node-red/node-red-nodes](https://github.com/node-red/node-red-nodes) 1. [nodejs/node](https://github.com/nodejs/node) 1. [nodejs/nodejs.org](https://github.com/nodejs/nodejs.org) 1. [nokia/5g-network-emulator](https://github.com/nokia/5g-network-emulator) 1. [nokia/7x50_protobufs](https://github.com/nokia/7x50_protobufs) 1. [nokia/AndroidOpenCameraKapture](https://github.com/nokia/AndroidOpenCameraKapture) 1. [nokia/AttestationEngine](https://github.com/nokia/AttestationEngine) 1. [nokia/Augustus](https://github.com/nokia/Augustus) 1. [nokia/Avro-Schema-Generator](https://github.com/nokia/Avro-Schema-Generator) 1. [nokia/BYONND](https://github.com/nokia/BYONND) 1. [nokia/CMPclient-embedded-lib](https://github.com/nokia/CMPclient-embedded-lib) 1. [nokia/CPU-Pooler](https://github.com/nokia/CPU-Pooler) 1. [nokia/ClickNF](https://github.com/nokia/ClickNF) 1. [nokia/CloudFlow](https://github.com/nokia/CloudFlow) 1. [nokia/LearningStore](https://github.com/nokia/LearningStore) 1. [nokia/NCBounds](https://github.com/nokia/NCBounds) 1. [nokia/ONAP-VESPA](https://github.com/nokia/ONAP-VESPA) 1. [nokia/OSSMediator](https://github.com/nokia/OSSMediator) 1. [nokia/OWASP-CheatSheetSeries](https://github.com/nokia/OWASP-CheatSheetSeries) 1. [nokia/PyBGL](https://github.com/nokia/PyBGL) 1. [nokia/PyVenvManage](https://github.com/nokia/PyVenvManage) 1. [nokia/RED](https://github.com/nokia/RED) 1. [nokia/SROS-grpc-services](https://github.com/nokia/SROS-grpc-services) 1. [nokia/SReXperts](https://github.com/nokia/SReXperts) 1. [nokia/SYSLIB](https://github.com/nokia/SYSLIB) 1. [nokia/SliM](https://github.com/nokia/SliM) 1. [nokia/TPMCourse](https://github.com/nokia/TPMCourse) 1. [nokia/YangModels](https://github.com/nokia/YangModels) 1. [nokia/accelerated-offloading](https://github.com/nokia/accelerated-offloading) 1. [nokia/adcs-issuer](https://github.com/nokia/adcs-issuer) 1. [nokia/akka-typed-persistence](https://github.com/nokia/akka-typed-persistence) 1. [nokia/ansible-networking-collections](https://github.com/nokia/ansible-networking-collections) 1. [nokia/argocd-krm-plugin-examples](https://github.com/nokia/argocd-krm-plugin-examples) 1. [nokia/armadillo-with-fixed-point-support](https://github.com/nokia/armadillo-with-fixed-point-support) 1. [nokia/asn1c](https://github.com/nokia/asn1c) 1. [nokia/atom-netconf](https://github.com/nokia/atom-netconf) 1. [nokia/awkcc](https://github.com/nokia/awkcc) 1. [nokia/backstage](https://github.com/nokia/backstage) 1. [nokia/causal-digital-twin](https://github.com/nokia/causal-digital-twin) 1. [nokia/code-compass](https://github.com/nokia/code-compass) 1. [nokia/codesearch](https://github.com/nokia/codesearch) 1. [nokia/consumer-rate-limiting](https://github.com/nokia/consumer-rate-limiting) 1. [nokia/contract-test-framework](https://github.com/nokia/contract-test-framework) 1. [nokia/cppJNI](https://github.com/nokia/cppJNI) 1. [nokia/danm](https://github.com/nokia/danm) 1. [nokia/danm-utils](https://github.com/nokia/danm-utils) 1. [nokia/docker-registry-client](https://github.com/nokia/docker-registry-client) 1. [nokia/domino-library](https://github.com/nokia/domino-library) 1. [nokia/dynamic-local-pv-provisioner](https://github.com/nokia/dynamic-local-pv-provisioner) 1. [nokia/etcd-cpp-api](https://github.com/nokia/etcd-cpp-api) 1. [nokia/git-changelog-generator](https://github.com/nokia/git-changelog-generator) 1. [nokia/gitcache-ssh](https://github.com/nokia/gitcache-ssh) 1. [nokia/gitops-conductor](https://github.com/nokia/gitops-conductor) 1. [nokia/gnmi](https://github.com/nokia/gnmi) 1. [nokia/gnmic](https://github.com/nokia/gnmic) 1. [nokia/helm-charts](https://github.com/nokia/helm-charts) 1. [nokia/intel-nuc-router](https://github.com/nokia/intel-nuc-router) 1. [nokia/jspy](https://github.com/nokia/jspy) 1. [nokia/k8s-ipam](https://github.com/nokia/k8s-ipam) 1. [nokia/kong](https://github.com/nokia/kong) 1. [nokia/kong-oidc](https://github.com/nokia/kong-oidc) 1. [nokia/koredump](https://github.com/nokia/koredump) 1. [nokia/kubernetes-community](https://github.com/nokia/kubernetes-community) 1. [nokia/kubernetes-contrib](https://github.com/nokia/kubernetes-contrib) 1. [nokia/ldap-tgen](https://github.com/nokia/ldap-tgen) 1. [nokia/libNoSync](https://github.com/nokia/libNoSync) 1. [nokia/libdash](https://github.com/nokia/libdash) 1. [nokia/mesos-scala-api](https://github.com/nokia/mesos-scala-api) 1. [nokia/minifold](https://github.com/nokia/minifold) 1. [nokia/moler](https://github.com/nokia/moler) 1. [nokia/napalm-sros](https://github.com/nokia/napalm-sros) 1. [nokia/natural-language-processing](https://github.com/nokia/natural-language-processing) 1. [nokia/ncm-issuer](https://github.com/nokia/ncm-issuer) 1. [nokia/nephio-nephio](https://github.com/nokia/nephio-nephio) 1. [nokia/nlc2cmd-submission-hubris](https://github.com/nokia/nlc2cmd-submission-hubris) 1. [nokia/nokia-deployer](https://github.com/nokia/nokia-deployer) 1. [nokia/nsp-workflow](https://github.com/nokia/nsp-workflow) 1. [nokia/ntt](https://github.com/nokia/ntt) 1. [nokia/pandas-extras](https://github.com/nokia/pandas-extras) 1. [nokia/prometheus-metric-tools](https://github.com/nokia/prometheus-metric-tools) 1. [nokia/protobufs](https://github.com/nokia/protobufs) 1. [nokia/pygnmi](https://github.com/nokia/pygnmi) 1. [nokia/pysros](https://github.com/nokia/pysros) 1. [nokia/pytest-exploratory](https://github.com/nokia/pytest-exploratory) 1. [nokia/radish-bdd-extensions](https://github.com/nokia/radish-bdd-extensions) 1. [nokia/rcm-bluez](https://github.com/nokia/rcm-bluez) 1. [nokia/regexp-learner](https://github.com/nokia/regexp-learner) 1. [nokia/restful](https://github.com/nokia/restful) 1. [nokia/robotframework-autoitlibrary](https://github.com/nokia/robotframework-autoitlibrary) 1. [nokia/saltstack-formulas](https://github.com/nokia/saltstack-formulas) 1. [nokia/samtools](https://github.com/nokia/samtools) 1. [nokia/scorecard](https://github.com/nokia/scorecard) 1. [nokia/skilltree](https://github.com/nokia/skilltree) 1. [nokia/srlinux-ansible-collection](https://github.com/nokia/srlinux-ansible-collection) 1. [nokia/srlinux-container-image](https://github.com/nokia/srlinux-container-image) 1. [nokia/srlinux-ndk-go](https://github.com/nokia/srlinux-ndk-go) 1. [nokia/srlinux-ndk-protobufs](https://github.com/nokia/srlinux-ndk-protobufs) 1. [nokia/srlinux-ndk-py](https://github.com/nokia/srlinux-ndk-py) 1. [nokia/srlinux-yang-models](https://github.com/nokia/srlinux-yang-models) 1. [nokia/sros-ansible](https://github.com/nokia/sros-ansible) 1. [nokia/time-series-data-collector](https://github.com/nokia/time-series-data-collector) 1. [nokia/ts-serialize-closures](https://github.com/nokia/ts-serialize-closures) 1. [nokia/twampy](https://github.com/nokia/twampy) 1. [nokia/unixgame-challenges](https://github.com/nokia/unixgame-challenges) 1. [nokia/vault_keystone_plugin](https://github.com/nokia/vault_keystone_plugin) 1. [nokia/virtualenvrunner](https://github.com/nokia/virtualenvrunner) 1. [nokia/vscode-netconf](https://github.com/nokia/vscode-netconf) 1. [nokia/vscode-ttcn3](https://github.com/nokia/vscode-ttcn3) 1. [nokia/web-assembly-self-certifying-compilation-framework](https://github.com/nokia/web-assembly-self-certifying-compilation-framework) 1. [nokia/wiredis](https://github.com/nokia/wiredis) 1. [nokia/wireless-suite](https://github.com/nokia/wireless-suite) 1. [nokiatech/heif](https://github.com/nokiatech/heif) 1. [nomic-ai/gpt4all](https://github.com/nomic-ai/gpt4all) 1. [nopSolutions/nopCommerce](https://github.com/nopSolutions/nopCommerce) 1. [not-fl3/macroquad](https://github.com/not-fl3/macroquad) 1. [nothings/stb](https://github.com/nothings/stb) 1. [nrfconnect/sdk-nrf](https://github.com/nrfconnect/sdk-nrf) 1. [nrwl/nx](https://github.com/nrwl/nx) 1. [nuljon/mm](https://github.com/nuljon/mm) 1. [numpy/numpy](https://github.com/numpy/numpy) 1. [numtide/devshell](https://github.com/numtide/devshell) 1. [nushell/nushell](https://github.com/nushell/nushell) 1. [nutanix/libvfio-user](https://github.com/nutanix/libvfio-user) 1. [nuxt/nuxt](https://github.com/nuxt/nuxt) 1. [nvim-lua/kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) 1. [nvim-lua/plenary.nvim](https://github.com/nvim-lua/plenary.nvim) 1. [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) 1. [nvm-sh/nvm](https://github.com/nvm-sh/nvm) 1. [o1-labs/snarkyjs](https://github.com/o1-labs/snarkyjs) 1. [objeck/objeck-lang](https://github.com/objeck/objeck-lang) 1. [observatorium/api](https://github.com/observatorium/api) 1. [oceanbase/oceanbase](https://github.com/oceanbase/oceanbase) 1. [oess/oeommtools](https://github.com/oess/oeommtools) 1. [okta/okta-auth-js](https://github.com/okta/okta-auth-js) 1. [olrea/openai-cpp](https://github.com/olrea/openai-cpp) 1. [onnx/onnx](https://github.com/onnx/onnx) 1. [onnx/onnx-tensorrt](https://github.com/onnx/onnx-tensorrt) 1. [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui) 1. [open-mmlab/mmcv](https://github.com/open-mmlab/mmcv) 1. [open-telemetry/opentelemetry-collector](https://github.com/open-telemetry/opentelemetry-collector) 1. [open-telemetry/opentelemetry-collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) 1. [open-telemetry/opentelemetry-demo](https://github.com/open-telemetry/opentelemetry-demo) 1. [open-telemetry/opentelemetry-go](https://github.com/open-telemetry/opentelemetry-go) 1. [open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java) 1. [open-telemetry/opentelemetry-js](https://github.com/open-telemetry/opentelemetry-js) 1. [openai-translator/openai-translator](https://github.com/openai-translator/openai-translator) 1. [openai/chatgpt-retrieval-plugin](https://github.com/openai/chatgpt-retrieval-plugin) 1. [openai/evals](https://github.com/openai/evals) 1. [openai/openai-cookbook](https://github.com/openai/openai-cookbook) 1. [openai/openai-python](https://github.com/openai/openai-python) 1. [openai/triton](https://github.com/openai/triton) 1. [openconfig/gnmi](https://github.com/openconfig/gnmi) 1. [openconfig/gnmic](https://github.com/openconfig/gnmic) 1. [openconfig/reference](https://github.com/openconfig/reference) 1. [openconfig/ygot](https://github.com/openconfig/ygot) 1. [opencv/opencv](https://github.com/opencv/opencv) 1. [opendoor-labs/protoc-gen-graphql](https://github.com/opendoor-labs/protoc-gen-graphql) 1. [opendoor-labs/pyfin](https://github.com/opendoor-labs/pyfin) 1. [opendoor-labs/rets](https://github.com/opendoor-labs/rets) 1. [openfga/openfga](https://github.com/openfga/openfga) 1. [openframeworks/openFrameworks](https://github.com/openframeworks/openFrameworks) 1. [openjdk/jdk](https://github.com/openjdk/jdk) 1. [openlayers/openlayers](https://github.com/openlayers/openlayers) 1. [openrelayxyz/plugeth](https://github.com/openrelayxyz/plugeth) 1. [openssl/openssl](https://github.com/openssl/openssl) 1. [opentripplanner/OpenTripPlanner](https://github.com/opentripplanner/OpenTripPlanner) 1. [opentripplanner/otp-react-redux](https://github.com/opentripplanner/otp-react-redux) 1. [opentripplanner/otp-ui](https://github.com/opentripplanner/otp-ui) 1. [openxla/iree](https://github.com/openxla/iree) 1. [operator-framework/api](https://github.com/operator-framework/api) 1. [operator-framework/catalogd](https://github.com/operator-framework/catalogd) 1. [operator-framework/deppy](https://github.com/operator-framework/deppy) 1. [operator-framework/olm-docs](https://github.com/operator-framework/olm-docs) 1. [operator-framework/operator-controller](https://github.com/operator-framework/operator-controller) 1. [operator-framework/operator-lifecycle-manager](https://github.com/operator-framework/operator-lifecycle-manager) 1. [operator-framework/operator-registry](https://github.com/operator-framework/operator-registry) 1. [operator-framework/operator-sdk](https://github.com/operator-framework/operator-sdk) 1. [operator-framework/rukpak](https://github.com/operator-framework/rukpak) 1. [osTicket/osTicket](https://github.com/osTicket/osTicket) 1. [osTicket/osTicket-plugins](https://github.com/osTicket/osTicket-plugins) 1. [ossu/computer-science](https://github.com/ossu/computer-science) 1. [oven-sh/bun](https://github.com/oven-sh/bun) 1. [pachyderm/pachyderm](https://github.com/pachyderm/pachyderm) 1. [pacocoursey/cmdk](https://github.com/pacocoursey/cmdk) 1. [paisano-nix/core](https://github.com/paisano-nix/core) 1. [paisano-nix/tui](https://github.com/paisano-nix/tui) 1. [palantir/blueprint](https://github.com/palantir/blueprint) 1. [pallets/click](https://github.com/pallets/click) 1. [pallets/flask](https://github.com/pallets/flask) 1. [pandas-dev/pandas](https://github.com/pandas-dev/pandas) 1. [panoply/esthetic](https://github.com/panoply/esthetic) 1. [panva/node-oidc-provider](https://github.com/panva/node-oidc-provider) 1. [paritytech/substrate](https://github.com/paritytech/substrate) 1. [pastelsky/bundlephobia](https://github.com/pastelsky/bundlephobia) 1. [paul-gauthier/aider](https://github.com/paul-gauthier/aider) 1. [paulmillr/es6-shim](https://github.com/paulmillr/es6-shim) 1. [payloadcms/payload](https://github.com/payloadcms/payload) 1. [payloadcms/plugin-cloud-storage](https://github.com/payloadcms/plugin-cloud-storage) 1. [payloadcms/plugin-form-builder](https://github.com/payloadcms/plugin-form-builder) 1. [payloadcms/plugin-nested-docs](https://github.com/payloadcms/plugin-nested-docs) 1. [payloadcms/plugin-password-protection](https://github.com/payloadcms/plugin-password-protection) 1. [payloadcms/plugin-search](https://github.com/payloadcms/plugin-search) 1. [payloadcms/plugin-seo](https://github.com/payloadcms/plugin-seo) 1. [payloadcms/template-ecommerce](https://github.com/payloadcms/template-ecommerce) 1. [payloadcms/template-ecommerce-nextjs](https://github.com/payloadcms/template-ecommerce-nextjs) 1. [pbatard/rufus](https://github.com/pbatard/rufus) 1. [penpot/penpot](https://github.com/penpot/penpot) 1. [penpot/penpot-admin](https://github.com/penpot/penpot-admin) 1. [penpot/penpot-docs](https://github.com/penpot/penpot-docs) 1. [penpot/penpot-files](https://github.com/penpot/penpot-files) 1. [penrose/penrose](https://github.com/penrose/penrose) 1. [phillco/talon-axkit](https://github.com/phillco/talon-axkit) 1. [phoenixframework/phoenix](https://github.com/phoenixframework/phoenix) 1. [php/php-src](https://github.com/php/php-src) 1. [pinterest/PINRemoteImage](https://github.com/pinterest/PINRemoteImage) 1. [pinterest/api-description](https://github.com/pinterest/api-description) 1. [pinterest/api-quickstart](https://github.com/pinterest/api-quickstart) 1. [pinterest/arcanist-linters](https://github.com/pinterest/arcanist-linters) 1. [pinterest/arcanist-owners](https://github.com/pinterest/arcanist-owners) 1. [pinterest/bazel](https://github.com/pinterest/bazel) 1. [pinterest/bender](https://github.com/pinterest/bender) 1. [pinterest/bonsai](https://github.com/pinterest/bonsai) 1. [pinterest/corman](https://github.com/pinterest/corman) 1. [pinterest/debezium](https://github.com/pinterest/debezium) 1. [pinterest/gestalt](https://github.com/pinterest/gestalt) 1. [pinterest/knox](https://github.com/pinterest/knox) 1. [pinterest/querybook](https://github.com/pinterest/querybook) 1. [plaid/pattern](https://github.com/plaid/pattern) 1. [plaid/plaid-python](https://github.com/plaid/plaid-python) 1. [plaid/quickstart](https://github.com/plaid/quickstart) 1. [plasmicapp/plasmic](https://github.com/plasmicapp/plasmic) 1. [plastic-labs/tutor-gpt](https://github.com/plastic-labs/tutor-gpt) 1. [plausible/analytics](https://github.com/plausible/analytics) 1. [plokhotnyuk/jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) 1. [plokhotnyuk/rtree2d](https://github.com/plokhotnyuk/rtree2d) 1. [pmndrs/jotai](https://github.com/pmndrs/jotai) 1. [pnpm/pnpm](https://github.com/pnpm/pnpm) 1. [pola-rs/polars](https://github.com/pola-rs/polars) 1. [pomdtr/sunbeam](https://github.com/pomdtr/sunbeam) 1. [postcss/postcss](https://github.com/postcss/postcss) 1. [postgres/postgres](https://github.com/postgres/postgres) 1. [preactjs/preact](https://github.com/preactjs/preact) 1. [preactjs/signals](https://github.com/preactjs/signals) 1. [prestodb/presto](https://github.com/prestodb/presto) 1. [primefaces/primeng](https://github.com/primefaces/primeng) 1. [princeton-nlp/tree-of-thought-llm](https://github.com/princeton-nlp/tree-of-thought-llm) 1. [princeton-vl/infinigen](https://github.com/princeton-vl/infinigen) 1. [prisma/docs](https://github.com/prisma/docs) 1. [prisma/ecosystem-tests](https://github.com/prisma/ecosystem-tests) 1. [prisma/language-tools](https://github.com/prisma/language-tools) 1. [prisma/prisma](https://github.com/prisma/prisma) 1. [prisma/prisma-engines](https://github.com/prisma/prisma-engines) 1. [probml/pyprobml](https://github.com/probml/pyprobml) 1. [processing/p5.js](https://github.com/processing/p5.js) 1. [prometheus/alertmanager](https://github.com/prometheus/alertmanager) 1. [prometheus/prometheus](https://github.com/prometheus/prometheus) 1. [prometheus/prometheus_api_client_ruby](https://github.com/prometheus/prometheus_api_client_ruby) 1. [provectus/kafka-ui](https://github.com/provectus/kafka-ui) 1. [prysmaticlabs/prysm](https://github.com/prysmaticlabs/prysm) 1. [psf/black](https://github.com/psf/black) 1. [pubkey/rxdb](https://github.com/pubkey/rxdb) 1. [public-apis/public-apis](https://github.com/public-apis/public-apis) 1. [pulumi/pulumi](https://github.com/pulumi/pulumi) 1. [pydantic/pydantic](https://github.com/pydantic/pydantic) 1. [pydcs/dcs](https://github.com/pydcs/dcs) 1. [pygame/pygame](https://github.com/pygame/pygame) 1. [pymc-devs/pymc](https://github.com/pymc-devs/pymc) 1. [pynamodb/PynamoDB](https://github.com/pynamodb/PynamoDB) 1. [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) 1. [pyscript/pyscript](https://github.com/pyscript/pyscript) 1. [python-discord/bot](https://github.com/python-discord/bot) 1. [python/cpython](https://github.com/python/cpython) 1. [pytorch/examples](https://github.com/pytorch/examples) 1. [pytorch/pytorch](https://github.com/pytorch/pytorch) 1. [qbittorrent/qBittorrent](https://github.com/qbittorrent/qBittorrent) 1. [qdrant/qdrant](https://github.com/qdrant/qdrant) 1. [qdrant/vector-db-benchmark](https://github.com/qdrant/vector-db-benchmark) 1. [qemu/qemu](https://github.com/qemu/qemu) 1. [qilingframework/qiling](https://github.com/qilingframework/qiling) 1. [qmk/qmk_configurator](https://github.com/qmk/qmk_configurator) 1. [quickwit-oss/tantivy](https://github.com/quickwit-oss/tantivy) 1. [quil/quil](https://github.com/quil/quil) 1. [quilljs/quill](https://github.com/quilljs/quill) 1. [qunash/hf-spaces-semantic-search](https://github.com/qunash/hf-spaces-semantic-search) 1. [radix-ui/primitives](https://github.com/radix-ui/primitives) 1. [rafaelw/mutation-summary](https://github.com/rafaelw/mutation-summary) 1. [rails/rails](https://github.com/rails/rails) 1. [rainforestapp/rainforest-cli](https://github.com/rainforestapp/rainforest-cli) 1. [ramda/ramda](https://github.com/ramda/ramda) 1. [ramnes/notion-sdk-py](https://github.com/ramnes/notion-sdk-py) 1. [ranaroussi/yfinance](https://github.com/ranaroussi/yfinance) 1. [rancher/elemental](https://github.com/rancher/elemental) 1. [rasbt/deeplearning-models](https://github.com/rasbt/deeplearning-models) 1. [rasterio/rasterio](https://github.com/rasterio/rasterio) 1. [ravendb/ravendb](https://github.com/ravendb/ravendb) 1. [ray-project/kuberay](https://github.com/ray-project/kuberay) 1. [ray-project/ray](https://github.com/ray-project/ray) 1. [raycast/extensions](https://github.com/raycast/extensions) 1. [raysan5/raylib](https://github.com/raysan5/raylib) 1. [rclone/rclone](https://github.com/rclone/rclone) 1. [react-hook-form/react-hook-form](https://github.com/react-hook-form/react-hook-form) 1. [react-navigation/react-navigation](https://github.com/react-navigation/react-navigation) 1. [reactjs/react.dev](https://github.com/reactjs/react.dev) 1. [reddit/IndicatorFastScroll](https://github.com/reddit/IndicatorFastScroll) 1. [redhat-developer/odo](https://github.com/redhat-developer/odo) 1. [redis/redis](https://github.com/redis/redis) 1. [redis/redis-doc](https://github.com/redis/redis-doc) 1. [reduxjs/redux](https://github.com/reduxjs/redux) 1. [reduxjs/redux-toolkit](https://github.com/reduxjs/redux-toolkit) 1. [redwoodjs/redwood](https://github.com/redwoodjs/redwood) 1. [reinismu/runescape-web-client-377](https://github.com/reinismu/runescape-web-client-377) 1. [release-it/release-it](https://github.com/release-it/release-it) 1. [remix-run/react-router](https://github.com/remix-run/react-router) 1. [remix-run/remix](https://github.com/remix-run/remix) 1. [renovatebot/renovate](https://github.com/renovatebot/renovate) 1. [renovatebot/renovate-approve-bot](https://github.com/renovatebot/renovate-approve-bot) 1. [renovatebot/renovate-approve-bot-bitbucket-cloud](https://github.com/renovatebot/renovate-approve-bot-bitbucket-cloud) 1. [renovatebot/renovatebot.github.io](https://github.com/renovatebot/renovatebot.github.io) 1. [replayio/devtools](https://github.com/replayio/devtools) 1. [replicatedhq/kURL](https://github.com/replicatedhq/kURL) 1. [replicatedhq/kots](https://github.com/replicatedhq/kots) 1. [returntocorp/semgrep](https://github.com/returntocorp/semgrep) 1. [returntocorp/semgrep-rules](https://github.com/returntocorp/semgrep-rules) 1. [reworkd/AgentGPT](https://github.com/reworkd/AgentGPT) 1. [roboflow/notebooks](https://github.com/roboflow/notebooks) 1. [roboflow/supervision](https://github.com/roboflow/supervision) 1. [roboflow/zero-shot-object-tracking](https://github.com/roboflow/zero-shot-object-tracking) 1. [roq-trading/roq-api](https://github.com/roq-trading/roq-api) 1. [ros2/examples](https://github.com/ros2/examples) 1. [ros2/ros2](https://github.com/ros2/ros2) 1. [rostedt/trace-cmd](https://github.com/rostedt/trace-cmd) 1. [rrousselGit/riverpod](https://github.com/rrousselGit/riverpod) 1. [rspec/rspec-core](https://github.com/rspec/rspec-core) 1. [rstudio/py-shiny](https://github.com/rstudio/py-shiny) 1. [rstudio/shiny](https://github.com/rstudio/shiny) 1. [rstudio/shiny-examples](https://github.com/rstudio/shiny-examples) 1. [rubrikinc/wachy](https://github.com/rubrikinc/wachy) 1. [run-llama/llama-api](https://github.com/run-llama/llama-api) 1. [run-llama/llama-hub](https://github.com/run-llama/llama-hub) 1. [run-llama/llama-lab](https://github.com/run-llama/llama-lab) 1. [russellhaering/gosaml2](https://github.com/russellhaering/gosaml2) 1. [rust-embedded/rust-raspberrypi-OS-tutorials](https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials) 1. [rust-lang/rust](https://github.com/rust-lang/rust) 1. [rust-lang/rust-analyzer](https://github.com/rust-lang/rust-analyzer) 1. [rust-phf/rust-phf](https://github.com/rust-phf/rust-phf) 1. [rust-unofficial/patterns](https://github.com/rust-unofficial/patterns) 1. [rwestphal/yang2-rs](https://github.com/rwestphal/yang2-rs) 1. [saadeghi/daisyui](https://github.com/saadeghi/daisyui) 1. [safe-global/safe-android](https://github.com/safe-global/safe-android) 1. [safe-global/safe-wallet-web](https://github.com/safe-global/safe-wallet-web) 1. [sagemathinc/cocalc](https://github.com/sagemathinc/cocalc) 1. [saki4510t/UVCCamera](https://github.com/saki4510t/UVCCamera) 1. [salesforce/ALBEF](https://github.com/salesforce/ALBEF) 1. [salesforce/BLIP](https://github.com/salesforce/BLIP) 1. [salesforce/CodeGen](https://github.com/salesforce/CodeGen) 1. [salesforce/CodeT5](https://github.com/salesforce/CodeT5) 1. [salesforce/CodeTF](https://github.com/salesforce/CodeTF) 1. [salesforce/LAVIS](https://github.com/salesforce/LAVIS) 1. [salesforce/Merlion](https://github.com/salesforce/Merlion) 1. [salesforce/OmniXAI](https://github.com/salesforce/OmniXAI) 1. [salesforce/Timbermill](https://github.com/salesforce/Timbermill) 1. [salesforce/TransmogrifAI](https://github.com/salesforce/TransmogrifAI) 1. [salesforce/ai-economist](https://github.com/salesforce/ai-economist) 1. [salesforce/akita](https://github.com/salesforce/akita) 1. [salesforce/base-components-recipes](https://github.com/salesforce/base-components-recipes) 1. [salesforce/cloudsplaining](https://github.com/salesforce/cloudsplaining) 1. [salesforce/ctrl](https://github.com/salesforce/ctrl) 1. [salesforce/decaNLP](https://github.com/salesforce/decaNLP) 1. [salesforce/design-system-react](https://github.com/salesforce/design-system-react) 1. [salesforce/hassh](https://github.com/salesforce/hassh) 1. [salesforce/ja3](https://github.com/salesforce/ja3) 1. [salesforce/jarm](https://github.com/salesforce/jarm) 1. [salesforce/lwc](https://github.com/salesforce/lwc) 1. [salesforce/o4](https://github.com/salesforce/o4) 1. [salesforce/p4-fusion](https://github.com/salesforce/p4-fusion) 1. [salesforce/policy_sentry](https://github.com/salesforce/policy_sentry) 1. [salesforce/reactive-grpc](https://github.com/salesforce/reactive-grpc) 1. [salesforce/sa11y](https://github.com/salesforce/sa11y) 1. [salesforce/sloop](https://github.com/salesforce/sloop) 1. [salesforce/tough-cookie](https://github.com/salesforce/tough-cookie) 1. [salsa-rs/salsa](https://github.com/salsa-rs/salsa) 1. [sanity-io/sanity](https://github.com/sanity-io/sanity) 1. [sass/sass](https://github.com/sass/sass) 1. [satijalab/seurat](https://github.com/satijalab/seurat) 1. [sbcl/sbcl](https://github.com/sbcl/sbcl) 1. [scala-js/scala-js](https://github.com/scala-js/scala-js) 1. [scala-native/scala-native](https://github.com/scala-native/scala-native) 1. [scala/scala](https://github.com/scala/scala) 1. [scalacenter/bloop](https://github.com/scalacenter/bloop) 1. [scalameta/mdoc](https://github.com/scalameta/mdoc) 1. [scalameta/metals](https://github.com/scalameta/metals) 1. [scalameta/munit](https://github.com/scalameta/munit) 1. [scalameta/scalameta](https://github.com/scalameta/scalameta) 1. [scaleapi/nucleus-python-client](https://github.com/scaleapi/nucleus-python-client) 1. [schemahero/schemahero](https://github.com/schemahero/schemahero) 1. [scikit-learn/scikit-learn](https://github.com/scikit-learn/scikit-learn) 1. [scipy/scipy](https://github.com/scipy/scipy) 1. [seanmonstar/reqwest](https://github.com/seanmonstar/reqwest) 1. [seek-oss/aec](https://github.com/seek-oss/aec) 1. [selfrefactor/rambda](https://github.com/selfrefactor/rambda) 1. [sequelize/sequelize](https://github.com/sequelize/sequelize) 1. [serde-rs/serde](https://github.com/serde-rs/serde) 1. [serenity-kit/Serenity](https://github.com/serenity-kit/Serenity) 1. [servo/rust-url](https://github.com/servo/rust-url) 1. [sgtest/megarepo](https://github.com/sgtest/megarepo) 1. [shadcn-ui/taxonomy](https://github.com/shadcn-ui/taxonomy) 1. [shadcn-ui/ui](https://github.com/shadcn-ui/ui) 1. [shaman-ai/agent-actors](https://github.com/shaman-ai/agent-actors) 1. [shaman-ai/llambdao](https://github.com/shaman-ai/llambdao) 1. [shap/shap](https://github.com/shap/shap) 1. [shapely/shapely](https://github.com/shapely/shapely) 1. [shapely/shapely-rfc](https://github.com/shapely/shapely-rfc) 1. [shinyorg/shiny](https://github.com/shinyorg/shiny) 1. [shivasurya/App-invites](https://github.com/shivasurya/App-invites) 1. [shivasurya/FeedbackDialog](https://github.com/shivasurya/FeedbackDialog) 1. [shivasurya/android](https://github.com/shivasurya/android) 1. [shivasurya/instamojo-webhook](https://github.com/shivasurya/instamojo-webhook) 1. [shivasurya/openai-assistant](https://github.com/shivasurya/openai-assistant) 1. [shivasurya/waterloo-grt-live-map](https://github.com/shivasurya/waterloo-grt-live-map) 1. [shomali11/slacker](https://github.com/shomali11/slacker) 1. [signalapp/Signal-Android](https://github.com/signalapp/Signal-Android) 1. [signalapp/Signal-Desktop](https://github.com/signalapp/Signal-Desktop) 1. [silverbullet233/starrocks](https://github.com/silverbullet233/starrocks) 1. [simonw/datasette](https://github.com/simonw/datasette) 1. [simonw/sqlite-utils](https://github.com/simonw/sqlite-utils) 1. [simplcommerce/SimplCommerce](https://github.com/simplcommerce/SimplCommerce) 1. [singer-io/getting-started](https://github.com/singer-io/getting-started) 1. [singer-io/singer-tap-template](https://github.com/singer-io/singer-tap-template) 1. [sirupsen/logrus](https://github.com/sirupsen/logrus) 1. [sjoerdev/voxel-engine](https://github.com/sjoerdev/voxel-engine) 1. [sky-uk/osprey](https://github.com/sky-uk/osprey) 1. [slackapi/bolt-python](https://github.com/slackapi/bolt-python) 1. [slackapi/python-slack-events-api](https://github.com/slackapi/python-slack-events-api) 1. [slackapi/python-slack-sdk](https://github.com/slackapi/python-slack-sdk) 1. [slowkow/ggrepel](https://github.com/slowkow/ggrepel) 1. [smallstep/cli](https://github.com/smallstep/cli) 1. [smallstep/cli-utils](https://github.com/smallstep/cli-utils) 1. [smallstep/clients](https://github.com/smallstep/clients) 1. [smol-ai/developer](https://github.com/smol-ai/developer) 1. [smol-ai/logger](https://github.com/smol-ai/logger) 1. [smol-ai/menubar](https://github.com/smol-ai/menubar) 1. [socketio/socket.io](https://github.com/socketio/socket.io) 1. [socketteer/loom](https://github.com/socketteer/loom) 1. [solana-labs/solana-program-library](https://github.com/solana-labs/solana-program-library) 1. [solendprotocol/solana-program-library](https://github.com/solendprotocol/solana-program-library) 1. [solidjs/solid](https://github.com/solidjs/solid) 1. [solidusio/solidus](https://github.com/solidusio/solidus) 1. [solidusio/solidus_auth_devise](https://github.com/solidusio/solidus_auth_devise) 1. [sonatype-nexus-community/iq-config-as-code](https://github.com/sonatype-nexus-community/iq-config-as-code) 1. [sonatype/nexus-public](https://github.com/sonatype/nexus-public) 1. [soulhighwing/LocalGPT](https://github.com/soulhighwing/LocalGPT) 1. [sourcegraph/about](https://github.com/sourcegraph/about) 1. [sourcegraph/app](https://github.com/sourcegraph/app) 1. [sourcegraph/appdash](https://github.com/sourcegraph/appdash) 1. [sourcegraph/code-intel-extensions](https://github.com/sourcegraph/code-intel-extensions) 1. [sourcegraph/cody](https://github.com/sourcegraph/cody) 1. [sourcegraph/cody-embeddings-discord-bot](https://github.com/sourcegraph/cody-embeddings-discord-bot) 1. [sourcegraph/conc](https://github.com/sourcegraph/conc) 1. [sourcegraph/deploy-sourcegraph-docker](https://github.com/sourcegraph/deploy-sourcegraph-docker) 1. [sourcegraph/deploy-sourcegraph-helm](https://github.com/sourcegraph/deploy-sourcegraph-helm) 1. [sourcegraph/doctree](https://github.com/sourcegraph/doctree) 1. [sourcegraph/go-langserver](https://github.com/sourcegraph/go-langserver) 1. [sourcegraph/handbook](https://github.com/sourcegraph/handbook) 1. [sourcegraph/jsonrpc2](https://github.com/sourcegraph/jsonrpc2) 1. [sourcegraph/jsonschemadoc](https://github.com/sourcegraph/jsonschemadoc) 1. [sourcegraph/jsonx](https://github.com/sourcegraph/jsonx) 1. [sourcegraph/k8s](https://github.com/sourcegraph/k8s) 1. [sourcegraph/llmsp](https://github.com/sourcegraph/llmsp) 1. [sourcegraph/scip](https://github.com/sourcegraph/scip) 1. [sourcegraph/scip-clang](https://github.com/sourcegraph/scip-clang) 1. [sourcegraph/scip-go](https://github.com/sourcegraph/scip-go) 1. [sourcegraph/scip-java](https://github.com/sourcegraph/scip-java) 1. [sourcegraph/scip-kotlin](https://github.com/sourcegraph/scip-kotlin) 1. [sourcegraph/scip-python](https://github.com/sourcegraph/scip-python) 1. [sourcegraph/scip-ruby](https://github.com/sourcegraph/scip-ruby) 1. [sourcegraph/scip-rust](https://github.com/sourcegraph/scip-rust) 1. [sourcegraph/scip-typescript](https://github.com/sourcegraph/scip-typescript) 1. [sourcegraph/sg.nvim](https://github.com/sourcegraph/sg.nvim) 1. [sourcegraph/sourcegraph](https://github.com/sourcegraph/sourcegraph) 1. [sourcegraph/src-cli](https://github.com/sourcegraph/src-cli) 1. [sourcegraph/srclib](https://github.com/sourcegraph/srclib) 1. [sourcegraph/typescript-language-server](https://github.com/sourcegraph/typescript-language-server) 1. [sourcegraph/zoekt](https://github.com/sourcegraph/zoekt) 1. [spacecloud-io/space-cloud](https://github.com/spacecloud-io/space-cloud) 1. [spdx/spdx-to-osv](https://github.com/spdx/spdx-to-osv) 1. [speechbrain/speechbrain](https://github.com/speechbrain/speechbrain) 1. [spf13/cobra](https://github.com/spf13/cobra) 1. [spinamp/spindexer](https://github.com/spinamp/spindexer) 1. [spring-projects/spring-boot](https://github.com/spring-projects/spring-boot) 1. [spring-projects/spring-cloud](https://github.com/spring-projects/spring-cloud) 1. [spring-projects/spring-data-book](https://github.com/spring-projects/spring-data-book) 1. [spring-projects/spring-data-elasticsearch](https://github.com/spring-projects/spring-data-elasticsearch) 1. [spring-projects/spring-data-redis](https://github.com/spring-projects/spring-data-redis) 1. [spring-projects/spring-framework](https://github.com/spring-projects/spring-framework) 1. [spring-projects/spring-restdocs](https://github.com/spring-projects/spring-restdocs) 1. [spring-projects/spring-security](https://github.com/spring-projects/spring-security) 1. [spring-projects/spring-ws](https://github.com/spring-projects/spring-ws) 1. [spring/spring](https://github.com/spring/spring) 1. [spyderbat/spydertop](https://github.com/spyderbat/spydertop) 1. [sqlalchemy/sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) 1. [sqlite/sqlite](https://github.com/sqlite/sqlite) 1. [square/javapoet](https://github.com/square/javapoet) 1. [square/kotlinpoet](https://github.com/square/kotlinpoet) 1. [square/okhttp](https://github.com/square/okhttp) 1. [square/okio](https://github.com/square/okio) 1. [stargate/stargate](https://github.com/stargate/stargate) 1. [status-im/status-mobile](https://github.com/status-im/status-mobile) 1. [steam-test1/Payday-2-LuaJIT-Complete](https://github.com/steam-test1/Payday-2-LuaJIT-Complete) 1. [stenevang/sftp](https://github.com/stenevang/sftp) 1. [steven-tey/dub](https://github.com/steven-tey/dub) 1. [stitchfix/hamilton](https://github.com/stitchfix/hamilton) 1. [storj/common](https://github.com/storj/common) 1. [storj/gateway-mt](https://github.com/storj/gateway-mt) 1. [storj/private](https://github.com/storj/private) 1. [storj/storj](https://github.com/storj/storj) 1. [storj/uplink](https://github.com/storj/uplink) 1. [strapi/strapi](https://github.com/strapi/strapi) 1. [streamlit/streamlit](https://github.com/streamlit/streamlit) 1. [stretchr/testify](https://github.com/stretchr/testify) 1. [stripe/stripe-android](https://github.com/stripe/stripe-android) 1. [stripe/stripe-apps](https://github.com/stripe/stripe-apps) 1. [stripe/stripe-cli](https://github.com/stripe/stripe-cli) 1. [stripe/stripe-connect-custom-rocketdeliveries](https://github.com/stripe/stripe-connect-custom-rocketdeliveries) 1. [stripe/stripe-ios](https://github.com/stripe/stripe-ios) 1. [stripe/stripe-node](https://github.com/stripe/stripe-node) 1. [stripe/stripe-php](https://github.com/stripe/stripe-php) 1. [stripe/stripe-python](https://github.com/stripe/stripe-python) 1. [stripe/stripe-ruby](https://github.com/stripe/stripe-ruby) 1. [stryker-mutator/stryker-js](https://github.com/stryker-mutator/stryker-js) 1. [stryker-mutator/stryker4s](https://github.com/stryker-mutator/stryker4s) 1. [suika2engine/suika2](https://github.com/suika2engine/suika2) 1. [supabase/postgres-meta](https://github.com/supabase/postgres-meta) 1. [supabase/postgrest-js](https://github.com/supabase/postgrest-js) 1. [supabase/realtime](https://github.com/supabase/realtime) 1. [supabase/supabase](https://github.com/supabase/supabase) 1. [supabase/supabase-js](https://github.com/supabase/supabase-js) 1. [supranational/blst](https://github.com/supranational/blst) 1. [sveltejs/kit](https://github.com/sveltejs/kit) 1. [sveltejs/svelte](https://github.com/sveltejs/svelte) 1. [sveltejs/svelte-todomvc](https://github.com/sveltejs/svelte-todomvc) 1. [svenstaro/miniserve](https://github.com/svenstaro/miniserve) 1. [swig/swig](https://github.com/swig/swig) 1. [swyxio/swyxkit](https://github.com/swyxio/swyxkit) 1. [symfony/symfony](https://github.com/symfony/symfony) 1. [sympy/sympy](https://github.com/sympy/sympy) 1. [syntaxfm/website](https://github.com/syntaxfm/website) 1. [systemd/systemd](https://github.com/systemd/systemd) 1. [t3-oss/create-t3-app](https://github.com/t3-oss/create-t3-app) 1. [tableau/embedding-playbook](https://github.com/tableau/embedding-playbook) 1. [tailscale/tailscale](https://github.com/tailscale/tailscale) 1. [tailwindlabs/tailwindcss](https://github.com/tailwindlabs/tailwindcss) 1. [talonhub/community](https://github.com/talonhub/community) 1. [tatsu-lab/stanford_alpaca](https://github.com/tatsu-lab/stanford_alpaca) 1. [tauri-apps/tauri](https://github.com/tauri-apps/tauri) 1. [teaxyz/cli](https://github.com/teaxyz/cli) 1. [tekumara/fakesnow](https://github.com/tekumara/fakesnow) 1. [telepresenceio/telepresence](https://github.com/telepresenceio/telepresence) 1. [tensorflow/tensorflow](https://github.com/tensorflow/tensorflow) 1. [tensorflow/tfx](https://github.com/tensorflow/tfx) 1. [tercen/ondo](https://github.com/tercen/ondo) 1. [testcontainers/testcontainers-dotnet](https://github.com/testcontainers/testcontainers-dotnet) 1. [testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) 1. [testcontainers/testcontainers-java](https://github.com/testcontainers/testcontainers-java) 1. [testcontainers/testcontainers-ruby](https://github.com/testcontainers/testcontainers-ruby) 1. [thanos-io/thanos](https://github.com/thanos-io/thanos) 1. [thi-ng/umbrella](https://github.com/thi-ng/umbrella) 1. [thomasjacquin/allsky](https://github.com/thomasjacquin/allsky) 1. [tiangolo/fastapi](https://github.com/tiangolo/fastapi) 1. [tiangolo/sqlmodel](https://github.com/tiangolo/sqlmodel) 1. [tidyverse/dplyr](https://github.com/tidyverse/dplyr) 1. [tidyverse/ggplot2](https://github.com/tidyverse/ggplot2) 1. [tidyverse/purrr](https://github.com/tidyverse/purrr) 1. [tidyverse/readr](https://github.com/tidyverse/readr) 1. [tidyverse/rvest](https://github.com/tidyverse/rvest) 1. [tidyverse/tidyr](https://github.com/tidyverse/tidyr) 1. [tigerbeetledb/docs](https://github.com/tigerbeetledb/docs) 1. [tintinweb/smart-contract-sanctuary](https://github.com/tintinweb/smart-contract-sanctuary) 1. [tinygrad/tinygrad](https://github.com/tinygrad/tinygrad) 1. [tis-gmbh/vscode-migrate](https://github.com/tis-gmbh/vscode-migrate) 1. [tldraw/signia](https://github.com/tldraw/signia) 1. [tldraw/tldraw](https://github.com/tldraw/tldraw) 1. [tloen/alpaca-lora](https://github.com/tloen/alpaca-lora) 1. [toasttab/GC-API-example-implementation](https://github.com/toasttab/GC-API-example-implementation) 1. [toasttab/Loyalty-API-example-implementation](https://github.com/toasttab/Loyalty-API-example-implementation) 1. [tobiasbueschel/search-gpt](https://github.com/tobiasbueschel/search-gpt) 1. [tokio-rs/axum](https://github.com/tokio-rs/axum) 1. [tokio-rs/tokio](https://github.com/tokio-rs/tokio) 1. [tokio-rs/tokio-core](https://github.com/tokio-rs/tokio-core) 1. [tokio-rs/tokio-io](https://github.com/tokio-rs/tokio-io) 1. [tokio-rs/tokio-timer](https://github.com/tokio-rs/tokio-timer) 1. [tokio-rs/tracing](https://github.com/tokio-rs/tracing) 1. [torocatala/stickershop](https://github.com/torocatala/stickershop) 1. [torvalds/linux](https://github.com/torvalds/linux) 1. [tpetrychyn/osrs-map-editor](https://github.com/tpetrychyn/osrs-map-editor) 1. [traefik/traefik](https://github.com/traefik/traefik) 1. [transmissions11/solmate](https://github.com/transmissions11/solmate) 1. [tree-sitter/tree-sitter](https://github.com/tree-sitter/tree-sitter) 1. [treeverse/lakeFS](https://github.com/treeverse/lakeFS) 1. [trilogy-group/cn-gitpod](https://github.com/trilogy-group/cn-gitpod) 1. [trimble-oss/contribute](https://github.com/trimble-oss/contribute) 1. [trimble-oss/dba-dash](https://github.com/trimble-oss/dba-dash) 1. [trimble-oss/modus](https://github.com/trimble-oss/modus) 1. [trimble-oss/modus-web-components](https://github.com/trimble-oss/modus-web-components) 1. [trinodb/trino](https://github.com/trinodb/trino) 1. [triton-inference-server/server](https://github.com/triton-inference-server/server) 1. [trpc/trpc](https://github.com/trpc/trpc) 1. [tuist/tuist](https://github.com/tuist/tuist) 1. [tullytim/pinecone-cli](https://github.com/tullytim/pinecone-cli) 1. [turbot/steampipe](https://github.com/turbot/steampipe) 1. [turbot/steampipe-docs](https://github.com/turbot/steampipe-docs) 1. [turbot/steampipe-plugin-mastodon](https://github.com/turbot/steampipe-plugin-mastodon) 1. [turbot/steampipe-plugin-sdk](https://github.com/turbot/steampipe-plugin-sdk) 1. [tw-in-js/twind](https://github.com/tw-in-js/twind) 1. [twbs/bootstrap](https://github.com/twbs/bootstrap) 1. [tweepy/tweepy](https://github.com/tweepy/tweepy) 1. [twentyhq/twenty](https://github.com/twentyhq/twenty) 1. [twilio-labs/paste](https://github.com/twilio-labs/paste) 1. [twitter/the-algorithm](https://github.com/twitter/the-algorithm) 1. [twitter/the-algorithm-ml](https://github.com/twitter/the-algorithm-ml) 1. [typelevel/cats](https://github.com/typelevel/cats) 1. [typelevel/cats-effect](https://github.com/typelevel/cats-effect) 1. [typelevel/fs2](https://github.com/typelevel/fs2) 1. [typeorm/typeorm](https://github.com/typeorm/typeorm) 1. [typescript-eslint/typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) 1. [typst/typst](https://github.com/typst/typst) 1. [uWaterloo/OpenData](https://github.com/uWaterloo/OpenData) 1. [uber/h3-py](https://github.com/uber/h3-py) 1. [ueberdosis/tiptap](https://github.com/ueberdosis/tiptap) 1. [ultralytics/yolov5](https://github.com/ultralytics/yolov5) 1. [umijs/umi](https://github.com/umijs/umi) 1. [unicorn-engine/unicorn](https://github.com/unicorn-engine/unicorn) 1. [unionai-oss/pandera](https://github.com/unionai-oss/pandera) 1. [unocss/unocss](https://github.com/unocss/unocss) 1. [upserve/docker-api](https://github.com/upserve/docker-api) 1. [uptech/git-ps-rs](https://github.com/uptech/git-ps-rs) 1. [urbit/js-http-api](https://github.com/urbit/js-http-api) 1. [urbit/urbit](https://github.com/urbit/urbit) 1. [urbit/vere](https://github.com/urbit/vere) 1. [urllib3/urllib3](https://github.com/urllib3/urllib3) 1. [v8/v8](https://github.com/v8/v8) 1. [varabyte/kobweb](https://github.com/varabyte/kobweb) 1. [varabyte/kotter](https://github.com/varabyte/kotter) 1. [varabyte/truthish](https://github.com/varabyte/truthish) 1. [vasanthk/react-bits](https://github.com/vasanthk/react-bits) 1. [vercel-labs/ai](https://github.com/vercel-labs/ai) 1. [vercel/next.js](https://github.com/vercel/next.js) 1. [vercel/turbo](https://github.com/vercel/turbo) 1. [vercel/vercel](https://github.com/vercel/vercel) 1. [vim/vim](https://github.com/vim/vim) 1. [vimwiki/vimwiki](https://github.com/vimwiki/vimwiki) 1. [vindarel/cl-ansi-term](https://github.com/vindarel/cl-ansi-term) 1. [vinta/awesome-python](https://github.com/vinta/awesome-python) 1. [vinted/elasticsearch-dsl-rs](https://github.com/vinted/elasticsearch-dsl-rs) 1. [vitejs/vite](https://github.com/vitejs/vite) 1. [voxelphile/boson](https://github.com/voxelphile/boson) 1. [vuejs/core](https://github.com/vuejs/core) 1. [vuejs/pinia](https://github.com/vuejs/pinia) 1. [vuejs/vue](https://github.com/vuejs/vue) 1. [vuetifyjs/vuetify](https://github.com/vuetifyjs/vuetify) 1. [vueuse/vueuse](https://github.com/vueuse/vueuse) 1. [w3bdesign/dfweb-v3](https://github.com/w3bdesign/dfweb-v3) 1. [w3bdesign/earthdoom](https://github.com/w3bdesign/earthdoom) 1. [wagmi-dev/wagmi](https://github.com/wagmi-dev/wagmi) 1. [walmartlabs/concord](https://github.com/walmartlabs/concord) 1. [walmartlabs/lacinia-pedestal](https://github.com/walmartlabs/lacinia-pedestal) 1. [warp-tech/russh](https://github.com/warp-tech/russh) 1. [warrant-dev/warrant](https://github.com/warrant-dev/warrant) 1. [wasp-lang/wasp](https://github.com/wasp-lang/wasp) 1. [wbkd/react-flow](https://github.com/wbkd/react-flow) 1. [wdullaer/MaterialDateTimePicker](https://github.com/wdullaer/MaterialDateTimePicker) 1. [web-infra-dev/modern.js](https://github.com/web-infra-dev/modern.js) 1. [webpack/webpack](https://github.com/webpack/webpack) 1. [webpro/knip](https://github.com/webpro/knip) 1. [wention/BeautifulSoup4](https://github.com/wention/BeautifulSoup4) 1. [williamboman/mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim) 1. [windmill-labs/windmill](https://github.com/windmill-labs/windmill) 1. [wine-mirror/wine](https://github.com/wine-mirror/wine) 1. [winfsp/cgofuse](https://github.com/winfsp/cgofuse) 1. [winglang/wing](https://github.com/winglang/wing) 1. [wintercms/storm](https://github.com/wintercms/storm) 1. [wintercms/winter](https://github.com/wintercms/winter) 1. [wmd-glowforge/text2vector](https://github.com/wmd-glowforge/text2vector) 1. [wolfeidau/snowdrift](https://github.com/wolfeidau/snowdrift) 1. [wolfi-dev/os](https://github.com/wolfi-dev/os) 1. [wolfpld/tracy](https://github.com/wolfpld/tracy) 1. [wordpress-mobile/WordPress-Android](https://github.com/wordpress-mobile/WordPress-Android) 1. [xeome/Zmem](https://github.com/xeome/Zmem) 1. [xeome/jcc](https://github.com/xeome/jcc) 1. [xhwhis/monkey.rs](https://github.com/xhwhis/monkey.rs) 1. [xmake-io/xmake](https://github.com/xmake-io/xmake) 1. [xmtp-labs/xmtp-inbox-web](https://github.com/xmtp-labs/xmtp-inbox-web) 1. [yk/gpt-4chan-public](https://github.com/yk/gpt-4chan-public) 1. [yoheinakajima/babyagi](https://github.com/yoheinakajima/babyagi) 1. [yowainwright/codependence](https://github.com/yowainwright/codependence) 1. [yugabyte/yugabyte-db](https://github.com/yugabyte/yugabyte-db) 1. [zapier/zapier-platform](https://github.com/zapier/zapier-platform) 1. [zed-industries/docs](https://github.com/zed-industries/docs) 1. [zellij-org/zellij](https://github.com/zellij-org/zellij) 1. [zephyrproject-rtos/zephyr](https://github.com/zephyrproject-rtos/zephyr) 1. [zhllxt/asio2](https://github.com/zhllxt/asio2) 1. [ziglang/zig](https://github.com/ziglang/zig) 1. [zigtools/zls](https://github.com/zigtools/zls) 1. [zilliztech/feder](https://github.com/zilliztech/feder) 1. [zillow/luminaire](https://github.com/zillow/luminaire) 1. [zillow/zind](https://github.com/zillow/zind) 1. [zio/zio](https://github.com/zio/zio) 1. [zitadel/oidc](https://github.com/zitadel/oidc) 1. [zitadel/zitadel](https://github.com/zitadel/zitadel) 1. [zitadel/zitadel-go](https://github.com/zitadel/zitadel-go) 1. [zotero/pdf-reader](https://github.com/zotero/pdf-reader) 1. [zotero/translate](https://github.com/zotero/translate) 1. [zotero/zotero](https://github.com/zotero/zotero) 1. [zsh-users/zsh](https://github.com/zsh-users/zsh) # Cody Tutorial This tutorial gives you a quick walkthrough of leveraging Cody for autocompletion, chat, explaining code, and running commands in VS Code. ## Code Autocomplete ![](https://storage.googleapis.com/sourcegraph-assets/blog/vs-code-onboarding-walkthrough-dec-2023-cody-autocomplete-tsx.gif) Start writing code and Cody will complete the line (or the entire function) for you. Press **Tab** to accept the suggestion. **✨ Pro-tips for using Cody autocomplete** - Autocomplete uses the surrounding code and context to inform the suggestions, so if you need to guide it you can add a comment above the line you're editing. - You can hover over the grey suggestion to see a toolbar of alternative suggestions, as well as other options such as accepting a single word at a time. - You can use the "Trigger Autocomplete at Cursor" command to trigger a code suggestion at any time, using the default keyboard shortcut of `Opt+L`/`Alt+L`. ## Chat ![](https://storage.googleapis.com/sourcegraph-assets/blog/blog-vscode-v018-release/blog-v018-context-controls-002.gif) Answer questions about general programming topics, or specific to your codebase, with Cody chat. You can choose between LLMs, @-mentions files and symbols, and enable enhanced repository-wide code context. You can start a chat at any time using the default keyboard shortcut of `Opt+L`/`Alt+L`. **✨ Pro-tips for using Cody chat** - Tagging specific files and symbols gives the selected LLM more context to help answer your questions more accurately. - If you want to chat directly with the LLM without any additional context adding, delete the @-mentions that are automatically inserted in each new Cody chat and just ask a plain question. ## Cody Commands ![](https://storage.googleapis.com/sourcegraph-assets/blog/vs-code-onboarding-walkthrough-dec-2023-explain.gif) Cody has a range of commands for explaining code, generating unit tests, adding documentation, and more. To get started: select code in your editor, right click, and choose a command from the "Cody" menu. You can also use the [Cody: Commands Menu](command:cody.menu.commands) which has the default keyboard shortcut of `Opt+C`/`Alt+C`. **✨ Pro-tips for using Cody commands** - You can build your own [Custom Commands (Beta)](https://sourcegraph.com/docs/cody/custom-commands) with custom prompts, output into chat or perform code edits, and more. ## Edit Code You can ask Cody to perform code edits using the Edit Code command. This will edit code according to your instructions, giving you the chance to retry the edit with a new prompt, undo, or accept the change. To get started: select code in your editor, right click, and choose "Cody → Edit Code". You can also use the default keyboard shortcut of `Opt+K`/`Alt+K`. **✨ Pro-tips for code editing with Cody** - You can open the 💡 menu, with an "Cody: Edit Code" option, by selecting any line of code and using the keyboard short `Command` `.` on macOS or `Crtl` `.` on Windows & Linux. - If you start an empty line and open the 💡 menu (using the keyboard short `Command` `.` on macOS or `Ctrl` `.` on Windows & Linux) you can use "Cody: Generate Code" to generate new lines of code based on instructions. - You define your own custom code editing commands using [Custom Commands (Beta)](https://sourcegraph.com/docs/cody/custom-commands), by setting the [`commands..mode` property](https://sourcegraph.com/docs/cody/capabilities/commands#commands-id-mode). ## Explain Code Use Cody to get an in-depth explanation of any piece of code in any programming language. To get started, select code in your editor, right-click, and choose "Cody > Explain Code". You can also run this command from the [Cody: Commands Menu](command:cody.menu.commands), which has the default keyboard shortcut of `Opt+C`/`Alt+C`. **✨ Pro-tips for understanding code with Cody** - Cody can also explain errors too, with the "Ask Cody to Explain" option in the 💡 menus, or by right clicking on any items in the "Problems" tab of VS Code. - You can define your own custom code to explain commands to suit, such as a prompt that requests an explanation focused on potential security issues, using [Custom Commands (Beta)](/cody/capabilities/custom-commands). ## Fix Code ![](https://storage.googleapis.com/sourcegraph-assets/blog/vs-code-onboarding-walkthrough-dec-2023-ask-to-fix.gif) Something wrong with your code? Use Cody’s "Ask Cody to Fix" command to fix it, or explain the problem. **✨ Pro-tips for fixing code with Cody** - You can open the 💡 menu, with an "Ask Cody to Fix" option, by moving the cursor over any line of code with an error and using the keyboard short `Command` `.` on macOS or `Crtl` `.` on Windows & Linux. - You can also right click on any items in the "Problems" tab of VS Code and select "Ask Cody to Fix" ## Keyboard Shortcuts Cody offers an extensive set of default key bindings (keyboard shortcuts) to make it easy for you to perform various actions using the keyboard. You can also update these bindings in the `Keyboard Shortcuts Editor`. ### Keyboard Shortcuts Editor The `Keyboard Shortcuts Editor` allows you to easily update the default bindings (keyboard shortcuts). This is particularly useful if the default key bindings conflict with your current or preferred key bindings. By accessing the `Keyboard Shortcuts Editor` in VSCode or `Keymap Shortcuts Editor` in JetBrains, you can search for specific commands, reassign keybindings, and customize your keyboard shortcuts to suit your workflow. ### Getting Started (VSCode) To get started: 1. Click on the **Keyboard Shortcuts** icon in the Cody sidebar under `**SETTINGS AND SUPPORT**` to open the `Keyboard Shortcuts Editor`. 2. In the `Keyboard Shortcuts Editor`, you can search for a specific command by typing in the search bar. 3. Once you have found the command you want to reassign keybindings for, click on it to select it. 4. Follow the instruction on screen to assign a new keybinding. ### Getting Started (JetBrains) To get started: 1. Click on the **IntelliJ IDEA** icon at the top menu bar and then click on **Keymap** from the dropdown to open the `Keymap Shortcuts Editor`. 2. In the `Keymap Shortcuts Editor`, you can search for a specific command by typing in the search bar. 3. Once you have found the command you want to reassign keymappings for, click on it to select it. 4. Follow the instruction on screen to assign a new keymappings. **✨ Pro-tips for assigning keyboard shortcuts for Cody** - You can assign key bindings (keyboard shortcuts) to individual custom commands. # Generate Unit Tests

In this guide, you'll learn how to use Cody to generate unit tests for your codebase.

Writing unit tests for your code is important for a robust and reliable codebase. These unit tests will help you ensure that your code works as expected and doesn't break in the future. Writing these tests can appear cumbersome, but Cody can automatically generate unit tests for your codebase. This guide will teach you to generate a unit test using Cody with real-time code examples. ## Prerequisites Before you begin, make sure you have the following: - Access to Sourcegraph and are logged into your account - Cody VS Code extension installed and connected to your Sourcegraph instance > NOTE: Cody also provides extensions for JetBrains which are not covered in this guide. ## Generate unit tests with Cody One of the prominent commands in Cody is **Generate unit tests** (`/test`). All you need to do is select a code block and ask Cody to write the tests for you. For this guide, let's use an example that converts any `given date` into a human-readable description of the time elapsed between the `given date` and the `current date`. ## Using the `/test` command Cody offers a default `/test` command that you can use to generate unit tests for your codebase. Inside the Cody chat window, type `/test` and select the code block for which you want to generate a unit test. Hit **Enter**, and Cody will start writing a unit test for you. > NOTE: The unit test command is only available in VS Code and JetBrains editor Cody extensions. Let's create a unit test for the `getHumanReadableTime()` function in the `date.js` file. ```js /** * Returns a human-readable string describing the time difference between the given date string and now. * * Calculates the difference in years, months, and days between the given date string and the current date. * Formats the time difference into a descriptive string like "2 years 3 months ago". * Handles singular/plural years/months/days. * If the given date is in the future, returns the string "today". */ export function getHumanReadableTime(dateString) { const startDate = new Date(dateString); const currentDate = new Date(); const years = currentDate.getFullYear() - startDate.getFullYear(); const months = currentDate.getMonth() - startDate.getMonth(); const days = currentDate.getDate() - startDate.getDate(); let timeAgoDescription = ''; if (years > 0) { timeAgoDescription += `${years} ${years === 1 ? 'year' : 'years'}`; } if (months > 0) { if (timeAgoDescription !== '') { timeAgoDescription += ' '; } timeAgoDescription += `${months} ${months === 1 ? 'month' : 'months'}`; } if (days > 0) { if (timeAgoDescription !== '') { timeAgoDescription += ' '; } timeAgoDescription += `${days} ${days === 1 ? 'day' : 'days'}`; } if (timeAgoDescription === '') { timeAgoDescription = 'today'; } else { timeAgoDescription += ' ago'; } return timeAgoDescription; } ``` For such an example, a unit test that checks the basic validation of expected output for recent dates, older dates, current date, and invalid inputs is required. As shown in the demo above, Cody intelligently generated a unit test for you with just a single command. Also, note that with the available context, Cody analyzed the codebase and automatically learned that you are using Vite. So, it tailored the test to be compatible with Vite's testing framework. This shows how Cody leverages context to provide relevant, framework-specific unit tests. If the generated test does not meet your requirements, you can continue the chat thread with follow-up questions, and Cody will help you create a unit test of your choice. ## Trying out the generated test Let's run the generated test to see whether it works or not. Inside your terminal, run the following command: ```bash npm run test ``` All the tests should pass, and you should see the following output: That's it! You've successfully generated a unit test for your codebase using Cody.
# Building Front-End UI with Cody

In this guide, you'll learn how to use Cody to build a user interface for your front-end apps.

## WIP That's it! You've successfully built a front-end using Cody.
# Model Configuration

Learn how to configure Cody via `modelConfiguration` on a Sourcegraph Enterprise instance.

`modelConfiguration` is the recommended way to configure chat and autocomplete models in Sourcegraph `v5.6.0` and later. The `modelConfiguration` field in the **Site config** section allows you to configure Cody to use different LLM models for chat and autocomplete, enabling greater flexibility in selecting the best model for your needs. Using this configuration, you get an LLM selector in the Cody chat with an Enterprise instance that allows you to select the model you want to use. The LLM models available for a Sourcegraph Enterprise instance offer a combination of Sourcegraph-provided models and any custom models providers that you explicitly add to your Sourcegraph instance site configuration. ## `modelConfiguration` The model configuration for Cody is managed through the `"modelConfiguration"` field in the **Site config** section. It includes the following fields: | **Field** | **Description** | | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | [`sourcegraph`](/cody/enterprise/model-configuration#sourcegraph-provided-models) | Configures access to Sourcegraph-provided models available through Cody Gateway. | | [`providerOverrides`](/cody/model-configuration#provider-overrides) | Configures access to models through your keys with most common LLM providers (BYOK) or hosted behind any openaicompatible endpoint | | [`modelOverrides`](/cody/enterprise/model-configuration#model-overrides) | Extends or modifies the list of models Cody recognizes and their configurations. | | [`selfHostedModels`](/cody/enterprise/model-configuration#self-hosted-models) | Adds models to Cody’s recognized models list with default configurations provided by Sourcegraph. Only available for certain models; general models can be configured in `modelOverrides`. | | [`defaultModels`](/cody/enterprise/model-configuration#default-models) | Specifies the models assigned to each Cody feature (chat, fast chat, autocomplete). | ## Getting started with `modelConfiguration` The recommended and easiest way to set up model configuration is using Sourcegraph-provided models through the Cody Gateway. For a minimal configuration example, see [Configure Sourcegraph-supplied models](/cody/enterprise/model-configuration#configure-sourcegraph-provided-models). ## Sourcegraph-provided models Sourcegraph-provided models, accessible through the [Cody Gateway](/cody/core-concepts/cody-gateway), are managed via your site configuration. For most administrators, relying on these models alone ensures access to high-quality models without needing to manage specific configurations. The use of these models is controlled through the `"modelConfiguration.sourcegraph"` field in the site config. ### Configure Sourcegraph-provided models The minimal configuration for Sourcegraph-provided models is: ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": {} } ``` The above configuration sets up the following: - Sourcegraph-provided models are enabled (`sourcegraph` is not set to `null`) - Requests to LLM providers are routed through the Cody Gateway (no `providerOverrides` field specified) - Sourcegraph-defined default models are used for Cody features (no `defaultModels` field specified) There are three main settings for configuring Sourcegraph-provided LLM models: | **Field** | **Description** | | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `endpoint` | (Optional) The URL for connecting to Cody Gateway. The default is set to the production instance. | | `accessToken` | (Optional) The access token for connecting to Cody Gateway defaults to the current license key. | | [`modelFilters`](/cody/enterprise/model-configuration#model-filters) | (Optional) Filters specifying which models to include from Cody Gateway. | ### Disable Sourcegraph-provided models To disable all Sourcegraph-provided models and use only the models explicitly defined in your site configuration, set the `"sourcegraph"` field to `null` as shown in the example below. ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, // ignore Sourcegraph-provided models "providerOverrides": { // define access to the LLM providers }, "modelOverrides": { // define models available via providers defined in the providerOverrides }, "defaultModels": { // set default models per Cody feature from the list of models defined in modelOverrides } } ``` ## Default models The `"modelConfiguration"` setting includes a `"defaultModels"` field, which allows you to specify the LLM model used for each Cody feature (`"chat"`, `"fastChat"`, and `"autocomplete"`). The values for each feature should be `modelRef`s of either Sourcegraph-provided models or models configured in the `modelOverrides` section. If no default is specified or the specified model is not found, the configuration will silently fall back to a suitable alternative. ### Model Filters The `"modelFilters"` section allows you to control which Cody Gateway models are available to users of your Sourcegraph Enterprise instance. The following table describes each field: | **Field** | **Description** | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `statusFilter` | Filters models based on their release status, such as stable, beta, deprecated or experimental. By default, all models available on Cody Gateway are accessible. | | `allow` | An array of `modelRef`s specifying which models to include. Supports wildcards. | | `deny` | An array of `modelRef`s specifying which models to exclude. Supports wildcards. | The following examples demonstrate how to use each of these settings together: ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": { "modelFilters": { // Only allow "beta" and "stable" models. // Not "experimental" or "deprecated". "statusFilter": ["beta", "stable"], // Allow any models provided by Anthropic, OpenAI, Google and Fireworks. "allow": [ "anthropic::*", // Anthropic models "openai::*", // OpenAI models "google::*", // Google Gemini models "fireworks::*", // Open-source models hosted by Sourcegraph on Fireworks.ai (typically used for autocomplete and Mistral Chat models) ], // Example: Do not include any models with the Model ID containing "turbo", // or any models from a hypothetical provider "AcmeCo" "deny": [ "*turbo*", "acmeco::*" ] } } } ``` ## Provider Overrides A `provider` is an organizational concept for grouping LLM models. Typically, a provider refers to the company that produced the model or the specific API/service used to access it, serving as a namespace. By defining a provider override in your Sourcegraph site configuration, you can introduce a new namespace to organize models or customize the existing provider namespace supplied by Sourcegraph (e.g., for all `"anthropic"` models). Provider overrides are configured via the `"modelConfiguration.providerOverrides"` field in the site configuration. This field is an array of items, each containing the following fields: | **Field** | **Description** | | ------------------ | --------------------------------------------------------------------------------- | | `id` | The namespace for models accessed via the provider. | | `displayName` | A human-readable name for the provider. | | `serverSideConfig` | Defines how to access the provider. See the section below for additional details. | Example configuration: ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": {}, "providerOverrides": [ { "id": "openai", "displayName": "OpenAI (via BYOK)", "serverSideConfig": { "type": "openai", "accessToken": "token", "endpoint": "https://api.openai.com" } }, ], "defaultModels": { "chat": "google::v1::gemini-1.5-pro", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "autocomplete": "fireworks::v1::deepseek-coder-v2-lite-base" } } ``` In the example above: - Sourcegraph-provided models are enabled (`sourcegraph` is not set to `null`) - The `"openai"` provider configuration is overridden to be accessed using your own key, with the provider API accessed directly via the specified `endpoint` URL. In contrast, models from the `"anthropic"` provider are accessed through the Cody Gateway Refer to the [examples page](/cody/enterprise/model-config-examples) for additional examples. ### Server-side config The most important part of a provider's configuration is the `"serverSideConfig"` field, which defines how the LLM models should be invoked, i.e., which external service or API will handle the LLM requests. Sourcegraph natively supports several types of LLM API providers. The current set of supported providers includes: | **Provider type** | **Description** | | -------------------- | ---------------------------------------------------------------------------------------------------------- | | `"sourcegraph"` | [Cody Gateway](/cody/core-concepts/cody-gateway), offering access to various models from multiple services | | `"openaicompatible"` | Any OpenAI-compatible API implementation | | `"awsBedrock"` | [Amazon Bedrock](https://docs.aws.amazon.com/bedrock/) | | `"azureOpenAI"` | [Microsoft Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service/) | | `"anthropic"` | [Anthropic](https://www.anthropic.com) | | `"fireworks"` | [Fireworks AI](https://fireworks.ai) | | `"google"` | [Google Gemini](http://cloud.google.com/gemini) and [Vertex](https://cloud.google.com/vertex-ai/) | | `"openai"` | [OpenAI](http://platform.openai.com) | | `"huggingface-tgi"` | [Hugging Face Text Generation Interface](https://huggingface.co/docs/text-generation-inference/en/index) | The configuration for `serverSideConfig` varies by provider type. Refer to the [examples page](/cody/enterprise/model-config-examples) for examples. ## Model Overrides With a provider defined (either a Sourcegraph-provided provider or a custom provider configured via the `providerOverrides` field), custom models can be specified for that provider by adding them to the `"modelConfiguration.modelOverrides"` section. This field is an array of items, each with the following fields: - `modelRef`: Uniquely identifies the model within the provider namespace - A string in the format `${providerId}::${apiVersionId}::${modelId}` - To associate a model with your provider, `${providerId}` must match the provider’s ID - `${modelId}` can be any URL-safe string - `${apiVersionId}` specifies the API version, which helps detect compatibility issues between models and Sourcegraph instances. For example, `"2023-06-01"` can indicate that the model uses that version of the Anthropic API. If unsure, you may set this to `"unknown"` when defining custom models - `displayName`: An optional, user-friendly name for the model. If not set, clients should display the `ModelID` part of the `modelRef` instead (not the `modelName`) - `modelName`: A unique identifier the API provider uses to specify which model is being invoked. This is the identifier that the LLM provider recognizes to determine the model you are calling - `capabilities`: A list of capabilities that the model supports. Supported values: **autocomplete** and **chat** - `category`: Specifies the model's category with the following options: - `"balanced"`: Typically the best default choice for most users. This category is suited for models like Sonnet 3.5 (as of October 2024) - `"speed"`: Ideal for low-parameter models that may not suit general-purpose chat but are beneficial for specialized tasks, such as query rewriting - `"accuracy"`: Reserved for models, like OpenAI o1, that use advanced reasoning techniques to improve response accuracy, though with slower latency - `"other"`: Used for older models without distinct advantages in reasoning or speed. Select this category if you are uncertain about which category to choose - `"deprecated"`: For models that are no longer supported by the provider and are filtered out on the client side (not available for use) - `contextWindow`: An object that defines the **number of tokens** (units of text) that can be sent to the LLM. This setting influences response time and request cost and may vary according to the limits set by each LLM model or provider. It includes two fields: - `maxInputTokens`: Specifies the maximum number of tokens for the contextual data in the prompt (e.g., question, relevant snippets) - `maxOutputTokens`: Specifies the maximum number of tokens allowed in the response - `serverSideConfig`: Additional configuration for the model. It can be one of the following: - `awsBedrockProvisionedThroughput`: Specifies provisioned throughput settings for AWS Bedrock models with the following fields: - `type`: Must be `"awsBedrockProvisionedThroughput"` - `arn`: The ARN (Amazon Resource Name) for provisioned throughput to use when sending requests to AWS Bedrock. The ARN format for provisioned models is: `arn:${Partition}:bedrock:${Region}:${Account}:provisioned-model/${ResourceId}`. - `openaicompatible`: Configuration specific to models provided by an OpenAI-compatible provider, with the following fields: - `type`: Must be `"openaicompatible"` - `apiModel`: The literal string value of the `model` field to be sent to the `/chat/completions` API. If set, Sourcegraph treats this as an opaque string and sends it directly to the API without inferring any additional information. By default, the configured model name is sent #### Example configuration ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": {}, "providerOverrides": [ { "id": "huggingface-codellama", "displayName": "huggingface", "serverSideConfig": { "type": "openaicompatible", "endpoints": [ { "url": "https://api-inference.huggingface.co/models/meta-llama/CodeLlama-7b-hf/v1/", "accessToken": "token" } ] } } ], "modelOverrides": [ { "modelRef": "huggingface-codellama::v1::CodeLlama-7b-hf", "modelName": "CodeLlama-7b-hf", "displayName": "(HuggingFace) CodeLlama-7b-hf", "contextWindow": { "maxInputTokens": 8192, "maxOutputTokens": 4096 }, "serverSideConfig": { "type": "openaicompatible", "apiModel": "meta-llama/CodeLlama-7b-hf" }, "clientSideConfig": { "openaicompatible": {} }, "capabilities": ["autocomplete", "chat"], "category": "balanced", "status": "stable" } ], "defaultModels": { "chat": "google::v1::gemini-1.5-pro", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "autocomplete": "huggingface-codellama::v1::CodeLlama-7b-hf" } } ``` In the example above: - Sourcegraph-provided models are enabled (`sourcegraph` is not set to `null`) - An additional provider, `"huggingface-codellama"`, is configured to access Hugging Face’s OpenAI-compatible API directly - A custom model, `"CodeLlama-7b-hf"`, is added using the `"huggingface-codellama"` provider - Default models are set up as follows: - Sourcegraph-provided models are used for `"chat"` and `"fastChat"` (accessed via Cody Gateway) - The newly configured model, `"huggingface-codellama::v1::CodeLlama-7b-hf"`, is used for `"autocomplete"` (connecting directly to Hugging Face’s OpenAI-compatible API) #### Example configuration with Claude 3.7 Sonnet ```json { "modelRef": "anthropic::2024-10-22::claude-3-7-sonnet-latest", "displayName": "Claude 3.7 Sonnet", "modelName": "claude-3-7-sonnet-latest", "capabilities": [ "chat", "reasoning" ], "category": "accuracy", "status": "stable", "tier": "pro", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 }, "modelCost": { "unit": "mtok", "inputTokenPennies": 300, "outputTokenPennies": 1500 }, "reasoningEffort": "high" }, ``` In this modelOverrides config example: - The model is configured to use Claude 3.7 Sonnet with Cody Gateway - The model is configured to use the `"chat"` and `"reasoning"` capabilities - The `reasoningEffort` can be set to 3 different options in the Model Config. These options are `high`, `medium` and `low` - The default `reasoningEffort` is set to `low` - When the reasoning effort is `low`, 1024 tokens is used as the thinking budget. With `medium` and `high` the thinking budget is set via `max_tokens_to_sample/2` Refer to the [examples page](/cody/enterprise/model-config-examples) for additional examples. ## View configuration To view the current model configuration, run the following command: ```bash export INSTANCE_URL="https://sourcegraph.test:3443" # Replace with your Sourcegraph instance URL export ACCESS_TOKEN="your access token" curl --location "${INSTANCE_URL}/.api/modelconfig/supported-models.json" \ --header "Authorization: token $ACCESS_TOKEN" ``` The response includes: - Configured providers and models—both Sourcegraph-provided (if enabled, with any applied filters) and any overrides - Default models for Cody features #### Example response ```json "schemaVersion": "1.0", "revision": "0.0.0+dev", "providers": [ { "id": "anthropic", "displayName": "Anthropic" }, { "id": "fireworks", "displayName": "Fireworks" }, { "id": "google", "displayName": "Google" }, { "id": "openai", "displayName": "OpenAI" }, { "id": "mistral", "displayName": "Mistral" } ], "models": [ { "modelRef": "anthropic::2024-10-22::claude-3-5-sonnet-latest", "displayName": "Claude 3.5 Sonnet (Latest)", "modelName": "claude-3-5-sonnet-latest", "capabilities": ["chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, { "modelRef": "anthropic::2023-06-01::claude-3-haiku", "displayName": "Claude 3 Haiku", "modelName": "claude-3-haiku-20240307", "capabilities": ["chat"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } }, { "modelRef": "fireworks::v1::starcoder", "displayName": "StarCoder", "modelName": "starcoder", "capabilities": ["autocomplete"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 2048, "maxOutputTokens": 256 } }, { "modelRef": "fireworks::v1::deepseek-coder-v2-lite-base", "displayName": "DeepSeek V2 Lite Base", "modelName": "accounts/sourcegraph/models/deepseek-coder-v2-lite-base", "capabilities": ["autocomplete"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 2048, "maxOutputTokens": 256 } }, { "modelRef": "google::v1::gemini-1.5-pro", "displayName": "Gemini 1.5 Pro", "modelName": "gemini-1.5-pro", "capabilities": ["chat"], "category": "balanced", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, { "modelRef": "openai::2024-02-01::gpt-4o", "displayName": "GPT-4o", "modelName": "gpt-4o", "capabilities": ["chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, { "modelRef": "openai::2024-02-01::cody-chat-preview-001", "displayName": "OpenAI o1-preview", "modelName": "cody-chat-preview-001", "capabilities": ["chat"], "category": "accuracy", "status": "waitlist", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, ], "defaultModels": { "chat": "anthropic::2024-10-22::claude-3-5-sonnet-latest", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "codeCompletion": "fireworks::v1::deepseek-coder-v2-lite-base" } ```
# Model Configuration Examples

This section includes examples about how to configure Cody to use Sourcegraph-provided models with `modelConfiguration`. These examples will use the following:

- [Minimal configuration](/cody/enterprise/model-configuration#configure-sourcegraph-provided-models) - [Using model filters](/cody/enterprise/model-configuration#model-filters) - [Change default models](/cody/enterprise/model-configuration#default-models) ## Sourcegraph-provided models and BYOK (Bring Your Own Key) By default, Sourcegraph is fully aware of several models from the following providers: - "anthropic" - "google" - "fireworks" - "mistral" - "openai" ### Override configuration of a model provider Instead of Sourcegraph using its own servers to make LLM requests, it is possible to bring your own API keys for a given model provider. For example, if you wish for all Anthropic API requests to go directly to your own Anthropic account and use your own API keys instead of going via Sourcegraph's servers, you could override the `anthropic` provider's configuration: ```json { "cody.enabled": true, "modelConfiguration": { "sourcegraph": {}, "providerOverrides": [ { "id": "anthropic", "displayName": "Anthropic BYOK", "serverSideConfig": { "type": "anthropic", "accessToken": "token", "endpoint": "https://api.anthropic.com/v1/messages" } } ], "defaultModels": { "chat": "anthropic::2024-10-22::claude-3.5-sonnet", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "codeCompletion": "fireworks::v1::deepseek-coder-v2-lite-base" } } ``` In the configuration above: - Enable Sourcegraph-provided models and do not set any overrides (note that `"modelConfiguration.modelOverrides"` is not specified) - Route requests for Anthropic models directly to the Anthropic API (via the provider override specified for "anthropic") - Route requests for other models (such as the Fireworks model for "autocomplete") through Cody Gateway ### Partially override provider config in the namespace If you want to override the provider config for some models in the namespace and use the Sourcegraph-configured provider config for the rest, you can route requests directly to the LLM provider (bypassing the Cody Gateway) for some models while using the Sourcegraph-configured provider config for the rest. Example configuration ```json { "cody.enabled": true, "modelConfiguration": { "sourcegraph": {}, "providerOverrides": [ { "id": "anthropic-byok", "displayName": "Anthropic BYOK", "serverSideConfig": { "type": "anthropic", "accessToken": "token", "endpoint": "https://api.anthropic.com/v1/messages" } } ], "modelOverrides": [ { "modelRef": "anthropic-byok::2023-06-01::claude-3.5-sonnet", "displayName": "Claude 3.5 Sonnet", "modelName": "claude-3-5-sonnet-latest", "capabilities": ["edit", "chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, ], "defaultModels": { "chat": "anthropic-byok::2023-06-01::claude-3.5-sonnet", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "codeCompletion": "fireworks::v1::deepseek-coder-v2-lite-base" } } ``` In the configuration above, we: - Enable Sourcegraph-supplied models (the `sourcegraph` field is not empty or `null`) - Define a new provider with the ID `"anthropic-byok"` and configure it to use the Anthropic API - Since this provider is unknown to Sourcegraph, no Sourcegraph-supplied models are available. Therefore, we add a custom model in the `"modelOverrides"` section - Use the custom model configured in the previous step (`"anthropic-byok::2024-10-22::claude-3.5-sonnet"`) for `"chat"`. Requests are sent directly to the Anthropic API as set in the provider override - For `"fastChat"` and `"autocomplete"`, we use Sourcegraph-provided models via Cody Gateway ## Config examples for various LLM providers Below are configuration examples for setting up various LLM providers using BYOK. These examples are applicable whether or not you are using Sourcegraph-supported models. - In this section, all configuration examples have Sourcegraph-provided models disabled. Please refer to the previous section to use a combination of Sourcegraph-provided models and BYOK. - Ensure that at least one model is available for each Cody feature ("chat" and "autocomplete"), regardless of the provider and model overrides configured. To verify this, [view the configuration](/cody/enterprise/model-configuration#view-configuration) and confirm that appropriate models are listed in the `"defaultModels"` section. ```json { "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "anthropic", "displayName": "Anthropic", "serverSideConfig": { "type": "anthropic", "accessToken": "token", "endpoint": "https://api.anthropic.com/v1/messages" } } ], "modelOverrides": [ { "modelRef": "anthropic::2024-10-22::claude-3.5-sonnet", "displayName": "Claude 3.5 Sonnet", "modelName": "claude-3-5-sonnet-latest", "capabilities": ["chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, ], "defaultModels": { "chat": "anthropic::2024-10-22::claude-3.5-sonnet", "fastChat": "anthropic::2023-06-01::claude-3-haiku", "codeCompletion": "fireworks::v1::deepseek-coder-v2-lite-base" } } ``` In the configuration above, - Set up a provider override for Anthropic, routing requests for this provider directly to the specified Anthropic endpoint (bypassing Cody Gateway) - Add three Anthropic models: - Two models with chat capabilities (`"anthropic::2024-10-22::claude-3.5-sonnet"` and `"anthropic::2023-06-01::claude-3-haiku"`), providing options for chat users - One model with autocomplete capability (`"fireworks::v1::deepseek-coder-v2-lite-base"`) - Set the configured models as default models for Cody features in the `"defaultModels"` field ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "fireworks", "displayName": "Fireworks", "serverSideConfig": { "type": "fireworks", "accessToken": "token", "endpoint": "https://api.fireworks.ai/inference/v1/completions" } } ], "modelOverrides": [ { "modelRef": "fireworks::v1::mixtral-8x7b-instruct", "displayName": "Mixtral 8x7B", "modelName": "accounts/fireworks/models/mixtral-8x7b-instruct", "capabilities": ["chat"], "category": "other", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } }, { "modelRef": "fireworks::v1::starcoder-16b", "modelName": "accounts/fireworks/models/starcoder-16b", "displayName": "(Fireworks) Starcoder 16B", "contextWindow": { "maxInputTokens": 8192, "maxOutputTokens": 4096 }, "capabilities": ["autocomplete"], "category": "balanced", "status": "stable" } ], "defaultModels": { "chat": "fireworks::v1::mixtral-8x7b-instruct", "fastChat": "fireworks::v1::mixtral-8x7b-instruct", "codeCompletion": "fireworks::v1::starcoder-16b" } } ``` In the configuration above, - Set up a provider override for Fireworks, routing requests for this provider directly to the specified Fireworks endpoint (bypassing Cody Gateway) - Add two Fireworks models: - `"fireworks::v1::mixtral-8x7b-instruct"` with "chat" capabiity - used for "chat" and "fastChat" - `"fireworks::v1::starcoder-16b"` with "autocomplete" capability - used for "autocomplete" ```json "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "openai", "displayName": "OpenAI", "serverSideConfig": { "type": "openai", "accessToken": "token", "endpoint": "https://api.openai.com" } } ], "modelOverrides": [ { "modelRef": "openai::2024-02-01::gpt-4o", "displayName": "GPT-4o", "modelName": "gpt-4o", "capabilities": ["chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, { "modelRef": "openai::unknown::gpt-3.5-turbo-instruct", "displayName": "GPT-3.5 Turbo Instruct", "modelName": "gpt-3.5-turbo-instruct", "capabilities": ["autocomplete"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } } ], "defaultModels": { "chat": "openai::2024-02-01::gpt-4o", "fastChat": "openai::2024-02-01::gpt-4o", "codeCompletion": "openai::unknown::gpt-3.5-turbo-instruct" } } ``` In the configuration above, - Set up a provider override for OpenAI, routing requests for this provider directly to the specified OpenAI endpoint (bypassing Cody Gateway) - Add two OpenAI models: - `"openai::2024-02-01::gpt-4o"` with "chat" capabilities - used for "chat" and "fastChat" - `"openai::unknown::gpt-3.5-turbo-instruct"` with "autocomplete" capability - used for "autocomplete" ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "azure-openai", "displayName": "Azure OpenAI", "serverSideConfig": { "type": "azureOpenAI", "accessToken": "token", "endpoint": "https://acme-test.openai.azure.com/", "user": "", "useDeprecatedCompletionsAPI": true } } ], "modelOverrides": [ { "modelRef": "azure-openai::unknown::gpt-4o", "displayName": "GPT-4o", "modelName": "gpt-4o", "capabilities": ["chat"], "category": "accuracy", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } }, { "modelRef": "azure-openai::unknown::gpt-35-turbo-instruct-test", "displayName": "GPT-3.5 Turbo Instruct", "modelName": "gpt-35-turbo-instruct-test", "capabilities": ["autocomplete"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } } ], "defaultModels": { "chat": "azure-openai::unknown::gpt-4o", "fastChat": "azure-openai::unknown::gpt-4o", "codeCompletion": "azure-openai::unknown::gpt-35-turbo-instruct-test" } } ``` In the configuration above, - Set up a provider override for Azure OpenAI, routing requests for this provider directly to the specified Azure OpenAI endpoint (bypassing Cody Gateway). **Note:** For Azure OpenAI, ensure that the `modelName` matches the name defined in your Azure portal configuration for the model. - Add two OpenAI models: - `"azure-openai::unknown::gpt-4o"` with "chat" capability - used for "chat" and "fastChat" - `"azure-openai::unknown::gpt-35-turbo-instruct-test"` with "autocomplete" capability - used for "autocomplete" - Since `"azure-openai::unknown::gpt-35-turbo-instruct-test"` is not supported on the newer OpenAI `"v1/chat/completions"` endpoint, we set `"useDeprecatedCompletionsAPI"` to `true` to route requests to the legacy `"v1/completions"` endpoint. This setting is unnecessary if you are using a model supported on the `"v1/chat/completions"` endpoint. ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "fireworks", "displayName": "Fireworks", "serverSideConfig": { "type": "openaicompatible", "endpoints": [ { "url": "https://api.fireworks.ai/inference/v1", "accessToken": "token" } ] } }, { "id": "huggingface-codellama", "displayName": "Hugging Face", "serverSideConfig": { "type": "openaicompatible", "endpoints": [ { "url": "https://api-inference.huggingface.co/models/meta-llama/CodeLlama-7b-hf/v1/", "accessToken": "token" } ] } }, ], "modelOverrides": [ { "modelRef": "fireworks::v1::llama-v3p1-70b-instruct", "modelName": "llama-v3p1-70b-instruct", "displayName": "(Fireworks) Llama 3.1 70B Instruct", "contextWindow": { "maxInputTokens": 64000, "maxOutputTokens": 8192 }, "serverSideConfig": { "type": "openaicompatible", "apiModel": "accounts/fireworks/models/llama-v3p1-70b-instruct" }, "clientSideConfig": { "openaicompatible": {} }, "capabilities": ["chat"], "category": "balanced", "status": "stable" }, { "modelRef": "huggingface-codellama::v1::CodeLlama-7b-hf", "modelName": "CodeLlama-7b-hf", "displayName": "(HuggingFace) CodeLlama-7b-hf", "contextWindow": { "maxInputTokens": 8192, "maxOutputTokens": 4096 }, "serverSideConfig": { "type": "openaicompatible", "apiModel": "meta-llama/CodeLlama-7b-hf" }, "clientSideConfig": { "openaicompatible": {} }, "capabilities": ["autocomplete", "chat"], "category": "balanced", "status": "stable" } ], "defaultModels": { "chat": "fireworks::v1::llama-v3p1-70b-instruct", "fastChat": "fireworks::v1::llama-v3p1-70b-instruct", "codeCompletion": "huggingface-codellama::v1::CodeLlama-7b-hf" } } ``` In the configuration above, - Configure two OpenAI-compatible providers: `"fireworks"` and `"huggingface-codellama"` - Add two OpenAI-compatible models: `"fireworks::v1::llama-v3p1-70b-instruct"` and `"huggingface-codellama::v1::CodeLlama-7b-hf"`. Additionally: - Set `clientSideConfig.openaicompatible` to `{}` to indicate to Cody clients that these models are OpenAI-compatible, ensuring the appropriate code paths are utilized - Designate these models as the default choices for chat and autocomplete, respectively ```json "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "google", "displayName": "Google Gemini", "serverSideConfig": { "type": "google", "accessToken": "token", "endpoint": "https://generativelanguage.googleapis.com/v1beta/models" } } ], "modelOverrides": [ { "modelRef": "google::v1::gemini-1.5-pro", "displayName": "Gemini 1.5 Pro", "modelName": "gemini-1.5-pro", "capabilities": ["chat", "autocomplete"], "category": "balanced", "status": "stable", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 } } ], "defaultModels": { "chat": "google::v1::gemini-1.5-pro", "fastChat": "google::v1::gemini-1.5-pro", "codeCompletion": "google::v1::gemini-1.5-pro" } } ``` In the configuration above, - Set up a provider override for Google Gemini, routing requests for this provider directly to the specified endpoint (bypassing Cody Gateway) - Add the `"google::v1::gemini-1.5-pro"` model, which is used for all Cody features. We do not add other models for simplicity, as adding multiple models is already covered in the examples above ```json "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "google", "displayName": "Google Anthropic", "serverSideConfig": { "type": "google", "accessToken": "token", "endpoint": "https://us-east5-aiplatform.googleapis.com/v1/projects/project-name/locations/us-east5/publishers/anthropic/models" } } ], "modelOverrides": [ { "modelRef": "google::unknown::claude-3-5-sonnet", "displayName": "Claude 3.5 Sonnet (via Google/Vertex)", "modelName": "claude-3-5-sonnet@20240620", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 }, "capabilities": ["chat"], "category": "accuracy", "status": "stable" }, { "modelRef": "google::unknown::claude-3-haiku", "displayName": "Claude 3 Haiku", "modelName": "claude-3-haiku@20240307", "capabilities": ["autocomplete", "chat"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } }, ], "defaultModels": { "chat": "google::unknown::claude-3-5-sonnet", "fastChat": "google::unknown::claude-3-5-sonnet", "codeCompletion": "google::unknown::claude-3-haiku" } } ``` In the configuration above, - Set up a provider override for Google Anthropic, routing requests for this provider directly to the specified endpoint (bypassing Cody Gateway) - Add two Anthropic models: - `"google::unknown::claude-3-5-sonnet"` with "chat" capabiity - used for "chat" and "fastChat" - `"google::unknown::claude-3-haiku"` with "autocomplete" capability - used for "autocomplete" ```json "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "google", "displayName": "Google Gemini", "serverSideConfig": { "type": "google", "accessToken": "token", "endpoint": "https://us-east5-aiplatform.googleapis.com/v1/projects/project-name/locations/us-east5/publishers/anthropic/models" } } ], "modelOverrides": [ { "modelRef": "google::unknown::claude-3-5-sonnet", "displayName": "Claude 3.5 Sonnet (via Google/Vertex)", "modelName": "claude-3-5-sonnet@20240620", "contextWindow": { "maxInputTokens": 45000, "maxOutputTokens": 4000 }, "capabilities": ["chat"], "category": "accuracy", "status": "stable" }, { "modelRef": "google::unknown::claude-3-haiku", "displayName": "Claude 3 Haiku", "modelName": "claude-3-haiku@20240307", "capabilities": ["autocomplete", "chat"], "category": "speed", "status": "stable", "contextWindow": { "maxInputTokens": 7000, "maxOutputTokens": 4000 } }, ], "defaultModels": { "chat": "google::unknown::claude-3-5-sonnet", "fastChat": "google::unknown::claude-3-5-sonnet", "codeCompletion": "google::unknown::claude-3-haiku" } } ``` In the configuration above, - Set up a provider override for Google Anthropic, routing requests for this provider directly to the specified endpoint (bypassing Cody Gateway) - Add two Anthropic models: - `"google::unknown::claude-3-5-sonnet"` with "chat" capabiity - used for "chat" and "fastChat" - `"google::unknown::claude-3-haiku"` with "autocomplete" capability - used for "autocomplete" ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": null, "providerOverrides": [ { "id": "aws-bedrock", "displayName": "Anthropic models through AWS Bedrock", "serverSideConfig": { "type": "awsBedrock", "accessToken": "", "region": "us-west-2" } } ], "modelOverrides": [ { "modelRef": "aws-bedrock::2024-02-29::claude-3-sonnet", "displayName": "Claude 3 Sonnet", "modelName": "claude-3-sonnet", "serverSideConfig": { "type": "awsBedrockProvisionedThroughput", "arn": "" // e.g., arn:aws:bedrock:us-west-2:537452198621:provisioned-model/57z3lgkt1cx2 }, "contextWindow": { "maxInputTokens": 16000, "maxOutputTokens": 4000 }, "capabilities": ["chat", "autocomplete"], "category": "balanced", "status": "stable" }, ], "defaultModels": { "chat": "aws-bedrock::2024-02-29::claude-3-sonnet", "codeCompletion": "aws-bedrock::2024-02-29::claude-3-sonnet", "fastChat": "aws-bedrock::2024-02-29::claude-3-sonnet" }, } ``` In the configuration described above, - Set up a provider override for Amazon Bedrock, routing requests for this provider directly to the specified endpoint, bypassing Cody Gateway - Add the `"aws-bedrock::2024-02-29::claude-3-sonnet"` model, which is used for all Cody features. We do not add other models for simplicity, as adding multiple models is already covered in the examples above - Note: Since the model in the example uses provisioned throughput, specify the ARN in the `serverSideConfig.arn` field of the model override. Provider override `serverSideConfig` fields: | **Field** | **Description** | | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | Must be `"awsBedrock"`. | | `accessToken` | Leave empty to rely on instance role bindings or other AWS configurations in the frontend service. Use `:` for direct credential configuration, or `::` if a session token is also required. | | `endpoint` | For pay-as-you-go, set it to an AWS region code (e.g., `us-west-2`) when using a public Amazon Bedrock endpoint. For provisioned throughput, set it to the provisioned VPC endpoint for the bedrock-runtime API (e.g., `https://vpce-0a10b2345cd67e89f-abc0defg.bedrock-runtime.us-west-2.vpce.amazonaws.com`). | | `region` | The region to use when configuring API clients. This is necessary because the 'frontend' binary container cannot access environment variables from the host OS. | Provisioned throughput for Amazon Bedrock models can be configured using the `"awsBedrockProvisionedThroughput"` server-side configuration type. Refer to the [Model Overrides](/cody/enterprise/model-configuration#model-overrides) section for more details. We only recommend configuring AWS Bedrock to use an accessToken for authentication. Specifying no accessToken (e.g. to use [IAM roles for EC2 / instance role binding](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)) is not currently recommended (there is a known performance bug with this method which will prevent autocomplete from working correctly. (internal issue: PRIME-662)
# Cody Enterprise features

Along with the core features, Cody Enterprise offers additional features to enhance your coding experience.

## IDE token expiry Site administrators can set the duration of access tokens for users connecting Cody from their IDEs (VS Code, JetBrains, etc.). This can be configured from the **Site admin** page of the Sourcegraph Enterprise instance. Available options include **7, 14, 30, 60, and 90 days**. ![ide-token-expiry](https://storage.googleapis.com/sourcegraph-assets/Docs/token-expiry.png) ## Guardrails Guardrails for public code is currently in Beta and is supported with VS Code and JetBrains IDEs extensions. Open source attribution guardrails for public code, commonly called copyright guardrails, reduce the exposure to copyrighted code. This involves implementing a verification mechanism within Cody to ensure that any code generated by the platform does not replicate open source code. Guardrails for public code are available to all Sourcegraph Enterprise instances and are **disabled** by default. You can enable them from the Site configuration section by setting `attribution.enabled` to `true`. Guardrails don't differentiate between license types. It matches any code snippet that is at least **ten lines** long from the **290,000** indexed open source repositories. ## Admin controls Admin controls are supported with VS Code and JetBrains IDE extension. Site administrators have selective control over users' access to Cody Enterprise, which is managed via the Sourcegraph role-based access control system. This provides a more intuitive user interface for assigning permission to use Cody. ## Analytics Cody Analytics are supported with VS Code IDE extension and on the latest versions of JetBrains IDEs. Cody Enterprise users can view analytics for their instance. A separately managed cloud service for Cody analytics handles user auth, gets metrics data from Sourcegraph's BigQuery instance, and visualizes the metrics data. The following metrics are available for Cody Enterprise users: | **Metric Type** | **What is measured?** | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Active users | - Total active users
- Average daily users
- Average no. of days each user used Cody (of last 30 days)
- Cody users by day (last 30 days)
- Cody users by month (last two months)
- Cody users by number of days used | | Completions | - Total accepted completions
- Minutes saved per completion
- Hours saved by completions
- Cody completions by day
- Completions acceptance rate
- Weighted completions acceptance rate
- Average completion latency
- Acceptance rate by language
| | Chat | - Total chat events
- Minutes saved per chat
- Hours saved by chats
- Cody chats by day | | Commands | - Total command events
- Minutes saved per command
- Hours saved by commands
- Cody commands by day
- Most used commands | To enable Cody Analytics: - Create an account on [Sourcegraph Accounts](https://accounts.sourcegraph.com/) - A user already having a Sourcegraph.com account gets automatically migrated to Sourcegraph Accounts. Users can sign in to Cody Analytics using their email and password - Users without a Sourcegraph.com account should contact one of our team members. They can help with both the account setup and assigning instances to specific users - Map your user account to a Sourcegraph instance, and this gives you access to Cody analytics ## Multi-repository context Cody supports multi-repository context, allowing you to search up to 10 repositories simultaneously for relevant information. Open a new chat, type `@`, and select `Remote Repositories.` Keep @-mentioning repos that you want to include in your context. This flexibility lets you get more comprehensive and accurate responses by leveraging information across multiple codebases. ## @-mention directories To better support teams working with large monorepos, Enterprise users can `@-mention` directories when chatting with Cody. This helps you define more specific directories and sub-directories within that monorepo to give more precise context. To do this, type `@` in the chat, and then select **Directories** to search other repositories for context in your codebase. ![@-mention-directory](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-ent-at-mention-dir-2025.png) Please note that you can only `@-mention` remote directories (i.e., directories in your Sourcegraph instance) but not local directories. This means any recent changes to your directories can't be utilized as context until your Sourcegraph instance re-indexes any changes. If you want to include recent changes that haven't been indexed in your Sourcegraph instance, you can `@-mention` specific files, lines of code, or symbols. ## Prompt pre-instructions Prompt pre-instructions is supported for Sourcegraph `v5.10` and more. **Site admins** can add and configure prompt pre-instructions for Cody. These are text instructions that Cody uses with every chat query, allowing organizations to configure how Cody responds to their users. For example, if you don’t want Cody to answer questions relating to sensitive non-code matters, you can pre-instruct Cody about it. In this case, if a user asks an unrelated question, Cody responds with a pre-instructed context. To configure pre-instructions, add the following to your site admin configuration file: ```json { ... "modelConfiguration": { "systemPreInstruction": "If the question is not directly related to software development, respond with \"I can only answer programming-related questions\"" } } ``` We cannot guarantee that these pre-instructions or their intended use case will be fully accurate. If your pre-instructions are not working as expected, please get in touch with us. ## Supported LLM models Sourcegraph Enterprise supports different LLM providers and models, such as models from Anthropic and OpenAI. You can do this by adjusting your Sourcegraph instance configuration. For the supported LLM models listed above, refer to the following notes: 1. Microsoft Azure is planning to deprecate the APIs used in Sourcegraph version `>5.3.3` on July 1, 2024 [Source](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation) 2. Claude 2.1 is not recommended 3. Sourcegraph doesn’t recommend using the GPT-4 (non-Turbo), Claude 1, or Claude 2 models anymore 4. Only supported through legacy completions API 5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances 6. GPT-4 and GPT-4o for completions have a bug that is resulting in many failed completions {/*Temporarily removed*/} {/* ## Supported model configuration Use the drop-down menu to make your desired selection and get a detailed breakdown of the supported model configuration for each provider on Cody Enterprise. This is an on-site configuration. Admins should pick a value from the table for `chatModel` to configure their chat model. For the supported LLM model configuration listed above, refer to the following notes: 1. Microsoft Azure is planning to deprecate the APIs used in Sourcegraph version `>5.3.3` on July 1, 2024 [Source](https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation) 2. Claude 2.1 is not recommended 3. Sourcegraph doesn't recommend GPT-4 non-turbo, Claude 1 or 2 models 4. Only supported through legacy completions API 5. BYOK (Bring Your Own Key) with managed services are only supported for Self-hosted Sourcegraph instances */}
# Completions Configuration

Learn how to configure Cody via `completions` on a Sourcegraph Enterprise instance.

Configuring Cody via `completions` is legacy but it's still supported. We recommend using the new [`modelConfiguration`](/cody/enterprise/model-configuration) for flexible LLM model selection. [Cody Enterprise](https://sourcegraph.com/enterprise) supports many models and model providers. You can configure Cody Enterprise to access models via Sourcegraph Cody Gateway or directly using your own model provider account or infrastructure. Let's look at these options in more detail. ## Using Sourcegraph Cody Gateway This is the recommended way to configure Cody Enterprise. It supports all the latest models from Anthropic, OpenAI, and more without requiring a separate account or incurring separate charges. You can learn more about these in our [supported models](/cody/capabilities/supported-models) docs. ## Using your organization's account with a model provider ### Example: Your organization's Anthropic account First, [create your own key with Anthropic](https://console.anthropic.com/account/keys). Once you have the key, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "provider": "anthropic", "chatModel": "claude-2.0", // Or any other model you would like to use "fastChatModel": "claude-instant-1.2", // Or any other model you would like to use "completionModel": "claude-instant-1.2", // Or any other model you would like to use "accessToken": "" } } ``` ### Example: Your organization's OpenAI account First, [create your own key with OpenAI](https://beta.openai.com/account/api-keys). Once you have the key, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "provider": "openai", "chatModel": "gpt-4", // Or any other model you would like to use "fastChatModel": "gpt-3.5-turbo", // Or any other model you would like to use "completionModel": "gpt-3.5-turbo-instruct", // Or any other model that supports the legacy completions endpoint "accessToken": "" } } ``` [Learn more about OpenAI models.](https://platform.openai.com/docs/models) ## Using your organization's public cloud infrastructure ### Example: Use Amazon Bedrock You can use Anthropic Claude models on [Amazon Bedrock](https://aws.amazon.com/bedrock/). First, make sure you can access Amazon Bedrock. Then, request access to the Anthropic Claude models in Bedrock. This may take some time to provision. Next, create an IAM user with programmatic access in your AWS account. Depending on your AWS setup, different ways may be required to provide access. All completion requests are made from the `frontend` service, so this service needs to be able to access AWS. You can use instance role bindings or directly configure the IAM user credentials in the configuration. The `AWS_REGION` environment variable must also be set in the `frontend` container to scope the IAM credentials for the AWS region hosting the Bedrock endpoint. Once ready, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "provider": "aws-bedrock", "chatModel": "anthropic.claude-3-opus-20240229-v1:0", "completionModel": "anthropic.claude-instant-v1", "endpoint": "", "accessToken": "" } } ``` For the `chatModel` and `completionModel` fields, see [Amazon's Bedrock docs](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html) for an up-to-date list of supported model IDs, and cross reference against Sourcegraph's [supported LLM list](/cody/capabilities/supported-models) to verify compatibility with Cody. For `endpoint`, you can either: - For **pay-as-you-go**, set it to an AWS region code (e.g., `us-west-2`) when using a public Amazon Bedrock endpoint - For **provisioned throughput**, set it to the provisioned VPC endpoint for the `bedrock-runtime` API (e.g., `"https://vpce-0a10b2345cd67e89f-abc0defg.bedrock-runtime.us-west-2.vpce.amazonaws.com"`) For `accessToken`, you can either: - Leave it empty and rely on instance role bindings or other AWS configurations in the `frontend` service - Set it to `:` if directly configuring the credentials - Set it to `::` if a session token is also required We only recommend configuring AWS Bedrock to use an accessToken for authentication. Specifying no accessToken (e.g. to use [IAM roles for EC2 / instance role binding](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)) is not currently recommended (there is a known performance bug with this method which will prevent autocomplete from working correctly. (internal issue: PRIME-662) ### Example: Using GCP Vertex AI On [GCP Vertex](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude), we only support Anthropic Claude models. - Enable the [Vertex AI API](https://console.cloud.google.com/marketplace/product/google/aiplatform.googleapis.com) in the GCP console. Once Vertex has been enabled in your project, navigate to the [Vertex Model Garden](https://console.cloud.google.com/vertex-ai/model-garden) to select and enable the Anthropic Claude model(s) that you wish to use with Cody. See [Supported LLM Models](/capabilities/supported-models) for an up-to-date list of Anthropic Claude models supported by Cody. It may take some time to enable Vertex and provision access to the models you plan to use 1. **Create a Service Account**: - Create a [service account](https://cloud.google.com/iam/docs/service-account-overview) - Assign the `Vertex AI User` role to the service account - Generate a JSON key for the service account and download it 2. **Convert JSON Key to Base64** by doing: ```python cat | base64 ``` Once ready, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "chatModel": "claude-3-opus@20240229", "completionModel": "claude-3-haiku@20240307", "provider": "google", "endpoint": "", "accessToken": "" } } ``` For the `endpoint`, you can: - Go to the Claude 3 Haiku docs on the GCP Console Model garden - Scroll through the page to find the example that shows how to use the `cURL` command with the Claude 3 Haiku model. The example will include a sample request JSON body and the necessary endpoint URL. Copy the URL in the site-admin config - The endpoint URL will look something like this: `https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/anthropic/models/` - Example URL: `https://us-east5-aiplatform.googleapis.com/v1/projects/sourcegraph-vertex-staging/locations/us-east5/publishers/anthropic/models` ### Example: Use Azure OpenAI service Create a project in the Azure OpenAI Service portal. From the project overview, go to **Keys and Endpoint and get one of the keys** on that page and the **endpoint**. Next, under **Model deployments**, click **manage deployments** and ensure you deploy the models you want, for example, `gpt-35-turbo`. Take note of the **deployment name**. Once done, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "provider": "azure-openai", "chatModel": "", "fastChatModel": "", "completionModel": "", // the model must support the legacy completions endpoint such as gpt-3.5-turbo-instruct "endpoint": "", "accessToken": "" } } ``` For the access token, - For Sourcegraph `v5.2.4` or more, the access token can be left empty, and it will rely on Environmental, Workload Identity, or Managed Identity credentials configured for the `frontend` and `worker` services - Set it to `` if directly configuring the credentials using the API key specified in the Azure portal ### Use StarCoder for autocomplete When tested with other coder models for the autocomplete use case, [StarCoder](https://huggingface.co/blog/starcoder) offered significant improvements in quality and latency compared to our control groups for users on Sourcegraph.com. You can read more about the improvements in our [October 2023 release notes](https://sourcegraph.com/blog/feature-release-october-2023) and the [GA release notes](https://sourcegraph.com/blog/cody-is-generally-available). To ensure a fast and reliable experience, we are partnering with [Fireworks](https://fireworks.ai/) and have set up a dedicated hardware deployment for our Enterprise users. Sourcegraph supports StarCoder using the [Cody Gateway](/cody/core-concepts/cody-gateway). To enable StarCoder, go to **Site admin > Site configuration** (`/site-admin/configuration`) and change the `completionModel`: ```json { // [...] "cody.enabled": true, "completions": { "provider": "sourcegraph", "completionModel": "fireworks/starcoder" } } ``` Users of the Cody extensions will automatically pick up this change when connected to your Enterprise instance.
# Cody Input and Output Token Limits

Learn about Cody's token limits and how to manage them.

For all models, Cody allows up to **4,000 tokens of output**, which is approximately **500-600** lines of code. For Claude 3 Sonnet models, Cody tracks two separate token limits: - The @-mention context is limited to **30,000 tokens** (~4,000 lines of code) and can be specified using the @-filename syntax. The user explicitly defines this context, which provides specific information to Cody. - Conversation context is limited to **15,000 tokens**, including user questions, system responses, and automatically retrieved context items. Apart from user questions, Cody generates this context automatically. All other models are currently capped at **7,000 tokens** of shared context between the `@-mention` context and chat history. Here's a detailed breakdown of the token limits by model: | **Model** | **Conversation Context** | **@-mention Context** | **Output** | | ----------------------------- | ------------------------ | --------------------- | ---------- | | GPT 4o mini | 7,000 | shared | 4,000 | | GPT o3 mini medium | 7,000 | shared | 4,000 | | Claude 3.5 Haiku | 7,000 | shared | 4,000 | | **Claude 3.5 Sonnet (New)** | **15,000** | **30,000** | **4,000** | | Gemini 1.5 Pro | 7,000 | shared | 4,000 | | Gemini 2.0 Flash | 7,000 | shared | 4,000 | | Gemini 2.0 Flash-Lite Preview | 7,000 | shared | 4,000 | The Pro tier supports the token limits for the LLM models on Free tier, plus: | **Model** | **Conversation Context** | **@-mention Context** | **Output** | | ----------------------------- | ------------------------ | --------------------- | ---------- | | GPT 4o mini | 7,000 | shared | 4,000 | | GPT o3 mini medium | 7,000 | shared | 4,000 | | GPT 4 Turbo | 7,000 | shared | 4,000 | | GPT 4o | 7,000 | shared | 4,000 | | o1 | 7,000 | shared | 4,000 | | Claude 3.5 Haiku | 7,000 | shared | 4,000 | | **Claude 3.5 Sonnet (New)** | **15,000** | **30,000** | **4,000** | | Claude 3.7 Sonnet | 15,000 | 30,000 | 4,000 | | Gemini 1.5 Pro | 15,000 | 30,000 | 4,000 | | Gemini 2.0 Flash | 7,000 | shared | 4,000 | | Gemini 2.0 Flash-Lite Preview | 7,000 | shared | 4,000 | The Enterprise tier supports the token limits for the LLM models on Free and Pro tier, plus: | **Model** | **Conversation Context** | **@-mention Context** | **Output** | | ----------------------------- | ------------------------ | --------------------- | ---------- | | GPT 4o mini | 7,000 | shared | 4,000 | | GPT o3 mini medium | 7,000 | shared | 4,000 | | GPT 4 Turbo | 7,000 | shared | 4,000 | | GPT 4o | 7,000 | shared | 4,000 | | o1 | 7,000 | shared | 4,000 | | o3 mini high | 7,000 | shared | 4,000 | | Claude 3.5 Haiku | 7,000 | shared | 4,000 | | **Claude 3.5 Sonnet (New)** | **15,000** | **30,000** | **4,000** | | Claude 3.7 Sonnet | 15,000 | 30,000 | 4,000 | | Gemini 2.0 Flash | 7,000 | shared | 4,000 | | Gemini 2.0 Flash-Lite Preview | 7,000 | shared | 4,000 |
For Cody Enterprise, the token limits are the standard limits. Exact token limits may vary depending on your deployment. Please get in touch with your Sourcegraph representative. For more information on how Cody builds context, see our [docs here](/cody/core-concepts/context). ## What is a Context Window? A context window in large language models refers to the maximum number of tokens (words or subwords) the model can process simultaneously. This window determines how much context the model can consider when generating text or code. Context windows exist due to computational limitations and memory constraints. Large language models have billions of parameters, and processing extremely long sequences of text can quickly become computationally expensive and memory-intensive. Limiting the context window allows the model to operate more efficiently and make predictions in a reasonable amount of time. ## What is an Output Limit? **Output Limit** refers to the maximum number of tokens a large language model can generate in a single response. This limit is typically set to ensure the model's output remains manageable and relevant to the context. When a model generates text or code, it does so token by token, predicting the most likely next token based on the input context and its learned patterns. The output limit determines when the model should stop generating further tokens, even if it could continue. The output limit helps to keep the generated text focused, concise, and manageable by preventing the model from going off-topic or generating excessively long responses. It also ensures that the output can be efficiently processed and displayed by downstream applications or user interfaces while managing computational resources. ## Tradeoffs: Size, Accuracy, Latency and Cost So why does Cody not use each model's full available context window? We need to consider a few tradeoffs, namely, context size, retrieval accuracy, latency, and costs. ### Context Size A larger context window allows Cody to consider more information, potentially leading to more coherent and relevant outputs. However, in RAG-based systems like Cody, the value of increasing the context window is related to the precision and recall of the underlying retrieval mechanism. If the relevant files can be retrieved with high precision and added to an existing context window, expansion may not increase response quality. Conversely, some queries require a vast array of documents to synthesize the best response, so increasing the context window would be beneficial. We work to balance these nuances against increased latency and cost tradeoffs for input token lengths. ### Retrieval Accuracy Not all context windows are created equal. Research shows that an LLM's ability to retrieve a fact from a context window can degrade dramatically as the size of the context window increases. This means it is important to put the relevant information into as few tokens as possible to avoid confusing the underlying LLM. As foundation models continue to improve, we see an increase in context retrieval, meaning that large context windows are becoming more viable. We are excited to bring these improvements to Cody. ### Latency With a larger context window, the model needs to process more data, which can increase the latency or response time. The end user often experiences this as "time to first token" or how long they wait until they see an output start to stream. In some cases, longer latency is a worthy tradeoff for higher accuracy, but our research shows that this is very use-case and user-dependent. ### Computational Cost Finally, processing large context windows costs linearly with the context window size. Cody leverages our expertise in code-based RAG to drive down generation costs while maintaining output quality to provide a high-quality response at a reasonable cost to the user.
# Keyword Search

Learn how Cody makes use to Keyword Search to gather context.

Keyword search is the traditional approach to text search. It splits content into terms and builds a mapping from terms to documents. At query time, it extracts terms from the query and uses the mapping to retrieve your documents. Both Cody chat and completions use Keyword Search. It comes out of the box without any additional setup. Cody with Keyword Search searches your local VS Code workspace and is a cost-effective and time-saving solution. For an enterprise admin who has set up Cody with a Code Search instance, developers on their local machines can seamlessly access it.
# Core Concepts

Learn about all the core concepts and fundamentals that helps Cody provide codebase-aware answers.

# Cody Enterprise architecture

[Cody Enterprise](/cody/clients/enable-cody-enterprise) can be deployed via the Sourcegraph Cloud or on your self-hosted infrastructure. This page describes the architecture diagrams for Cody deployed in different Sourcegraph environments.

{/* Figma source: https://www.figma.com/file/lAPHpdhtEmOJ22IQXVZ0vs/Cody-architecture-diagrams-SQS-draft-2024-04?type=whiteboard&node-id=0-1&t=blg78H2YXXbdGSPc-0 */} ## Sourcegraph Cloud deployment This is a recommended deployment for Cody Enterprise. It uses the Sourcegraph Cloud infrastructure and Cody gateway. ## Sourcegraph Enterprise Server (self-hosted) on Amazon Bedrock This is an example of a more complex deployment that uses Sourcegraph Enterprise Server (self-hosted) and Amazon Bedrock. ## Data flow The following diagram describes the data flow between the different components of Cody Enterprise.
# Embeddings

Learn how you can use embeddings with Cody for better code understanding.

Embeddings are no longer supported on Cody Free, Pro or Enterprise. ## What are embeddings? Embeddings are a semantic representation of text that allows you to create a search index over your codebase. Cody splits your codebase into searchable chunks and sends them to an external service specified in your site's configuration for embedding. The resulting embedding index is stored in your local hard drive. ## Embeddings in VS Code As of Sourcegraph version 5.3, embeddings are only available to Cody Free and Cody Pro users on the VS Code extension. Cody Free and Pro users can leverage local embeddings for context fetching. Embeddings are created automatically and are used to provide context to Cody in chat, edits, and more.
# Cody Context

Understand how context helps Cody write more accurate code.

Context refers to any additional information provided to help Cody understand and write code relevant to your codebase. While LLMs have extensive knowledge, they lack context about an individual or organization's codebase. Cody's ability to provide context-aware code responses is what sets it apart. ## Why is context important? Context and [methods of retrieving context](#context-sources) are crucial to the quality and accuracy of AI. Cody relies on its ability to retrieve context from user codebases to provide reliable and accurate answers to developers’ questions. When Cody has access to the most relevant context about your codebase, it can: - Answer questions about your codebase - Produce unit tests and docs - Generate code that aligns with the libraries and style of your codebase - Significantly reduce your work that's required to translate LLM-provided answers into actionable value for your users ## Context sources Cody uses a variety of sources to retrieve context relevant to the user input. These sources include: - **Keyword Search**: A traditional text-based search method that finds keywords matching the user input. When needed, queries are automatically rewritten to include more relevant terms. - **Sourcegraph Search**: The powerful native Sourcegraph Search API. Queries are sent to the SG instance (managed or self-hosted), and search is done using the SG search stack. Relevant documents are returned to the user IDE for use by the LLM. - **Code Graph**: Analyzing the structure of the code, Cody examines how components are interconnected and used, finding context based on code elements' relationships. All these methods collectively ensure Cody's ability to provide relevant and high-quality context to enhance your coding experience. ## Cody context fetching features Cody uses @-mentions to retrieve context from your codebase. Inside the chat window, there is an `@` icon that you can click to select a context source. Alternatively, you can press `@` to open the context picker. Based on your Cody tier, you can @-mention the following: | **Tier** | **Client** | **Files** | **Symbols** | **Web URLs** | **Remote Files/Directories** | **OpenCtx** | | -------------- | ------------- | --------- | ----------- | ------------ | ---------------------------- | ----------- | | **Free/Pro** | VS Code | ✅ | ✅ | ✅ | ❌ | ✅ | | | JetBrains | ✅ | ❌ | ✅ | ❌ | ❌ | | | Visual Studio | ✅ | ✅ | ✅ | ❌ | ❌ | | | Cody Web | ✅ | ✅ | ✅ | ❌ | ❌ | | **Enterprise** | VS Code | ✅ | ✅ | ✅ | ✅ | ✅ | | | JetBrains | ✅ | ❌ | ✅ | ✅ | ❌ | | | Visual Studio | ✅ | ✅ | ✅ | ✅ | ✅ | | | Cody Web | ✅ | ✅ | ✅ | ✅ | ❌ | ## Repo-based context Cody supports repo-based context. You can link single or multiple repositories based on your tier. Here's a detailed breakdown of the number of repositories supported by each client for Cody Free, Pro, and Enterprise users: | **Tier** | **Client** | **Repositories** | | -------------- | ------------- | ---------------- | | **Free/Pro** | VS Code | 1 | | | JetBrains | 1 | | | Visual Studio | 1 | | **Enterprise** | Cody Web | Multi | | | VS Code | Multi | | | JetBrains | Multi | | | Visual Studio | Multi | ## How does context work with Cody prompts? Cody works in conjunction with an LLM to provide codebase-aware answers. The LLM is a machine learning model that generates text in response to natural language prompts. However, the LLM needs to inherently understand your codebase or specific coding requirements. Cody bridges this gap by generating context-aware prompts. A typical prompt has three parts: - **Prefix**: An optional description of the desired output, often derived from predefined [Prompts](/cody/capabilities/commands) that specify tasks the LLM can perform - **User input**: The information provided, including your code query or request - **Context**: Additional information that helps the LLM provide a relevant answer based on your specific codebase ## Impact of context LLM vs Cody When the same prompt is sent to a standard LLM, the response may need more specifics about your codebase. In contrast, Cody augments the prompt with context from relevant code snippets, making the answer far more specific to your codebase. This difference underscores the importance of context in Cody's functionality. ## Manage Cody context window size While Cody aims to provide maximum context for each prompt, there are limits to ensure efficiency. For more details, see our [docs on token limits](/cody/core-concepts/token-limits). Site administrators can update the maximum context window size to meet their specific requirements. While using fewer tokens is a cost-saving solution, it can also cause errors. For example, using an `edit` or `describe` type prompts with a too small context window size might give you errors like `You've selected too much code`. Using more tokens usually produces higher-quality responses but also increases response times. In general, it's recommended not to modify the token limit. However, if needed, you can set it to a value that should not compromise quality or generate errors.
# Sourcegraph Cody Gateway

Learn how Cody Gateway powers the default Sourcegraph provider for completions, enabling Cody features for Sourcegraph Enterprise customers.

Cody Gateway is available for Sourcegraph Enterprise customers using version 5.1 or more. Cody Gateway powers the default `"provider": "sourcegraph"` and Cody completions for Sourcegraph Enterprise users. It integrates with various upstream LLM providers, including [Anthropic](https://www.anthropic.com/) and [OpenAI](https://openai.com/), with rate limits, quotas, and model availability tied to your Sourcegraph Enterprise subscription. ## Supported Models For a full list of supported models and providers, read our [Supported LLMs](/cody/capabilities/supported-models) docs. ## Setting up Cody Gateway in Sourcegraph Enterprise To enable completions provided by Cody Gateway on your Sourcegraph Enterprise instance, make sure your license key is set and Cody is enabled in your [site configuration](/admin/config/site_config): ```jsonc { "licenseKey": "<...>", "cody.enabled": true, "completions": { "provider": "sourcegraph" } } ``` Once the license key is added, default configuration and authentication are automatically applied. For more details about configuring Cody, it's recommended to read about [Enabling Cody for Sourcegraph Enterprise](/cody/clients/enable-cody-enterprise). Cody Gateway is hosted at `cody-gateway.sourcegraph.com`. To use Cody Gateway, your Sourcegraph instance must be connected to the service in this domain. Sourcegraph Cody Gateway access must be included in your Sourcegraph Enterprise subscription. You can verify it by checking it with your account manager. If you are a [Sourcegraph Cloud](/cloud/) user, Cody is enabled by default on your instance starting with Sourcegraph 5.1. ## Rate limits and quotas Rate limits, quotas, and model availability are tied to your Sourcegraph Enterprise license for Sourcegraph Enterprise instances. All successful requests to Cody Gateway will count toward your rate limits. Unsuccessful requests are not counted as usage. Rate limits, quotas, and model availability are also configured per Cody feature - for example, you will have separate rate limits for Cody chat and completions. In addition to the above, we may throttle concurrent requests to Cody Gateway per Sourcegraph Enterprise instance or Cody App user to prevent excessive burst consumption. You can reach out for more details about Sourcegraph Cody Gateway access available to you and how you can gain access to higher rate limits, quotas, and/or model options. ## Privacy and security Sourcegraph Cody Gateway does not retain sensitive data (prompt test and source code included in requests, etc.) from any traffic received. Only rate limit consumption per Sourcegraph Enterprise license and high-level diagnostic data (error codes from upstream, numeric/enum request parameters, etc) are tracked. For more details about Cody Gateway security practices, please contact your account manager. For more privacy details about Cody in general, refer to the [Cody usage and privacy notice](https://about.sourcegraph.com/terms/cody-notice).
# Code Graph

Understand what is Code Graph and how Cody use it to gather context.

Code Graph is a key component of Cody's capacity to generate contextual responses based on your codebase. It involves analyzing the structure of the code rather than treating it as plain text. Cody examines how different components of the codebase are interconnected and how they are used. This method is dependent on the code's structure and inheritance relationships. It can help Cody find context related to your input based on how code elements are linked and utilized. ## Code Graph data Code graph data refers to the information that describes various semantic elements within your source code, like definitions, references, symbols, and doc comments. This dataset is produced by an indexer and subsequently transferred to a Sourcegraph instance. The process of generating this data can vary based on factors such as the programming language and build system in use. In some cases, Sourcegraph can automatically create this data through auto-indexing within the platform itself. Alternately, you may need to set up a periodic CI job, specifically designed to produce and upload this index to your Sourcegraph instance. As of January 23, 2023, open-source projects have the capability to generate Code Graph data in their CI pipelines and then upload it to Sourcegraph.com, enhancing precision in code navigation.
# Installing Cody in VS Code

Learn how to use Cody and its features with the VS Code editor.

The Cody extension by Sourcegraph enhances your coding experience in VS Code by providing intelligent code suggestions, context-aware autocomplete, and advanced code analysis. This guide will walk you through the steps to install and set up Cody within your VS Code environment. ## Prerequisites - You have the latest version of [VS Code](https://code.visualstudio.com/) installed - You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account ## Install the VS Code extension You can install VS Code directly from the [VS Code extension marketplace listing](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) or by following these steps directly within VS Code: - Open VS Code editor on your local machine - Click the **Extensions** icon in the Activity Bar on the side of VS Code, or use the keyboard shortcut `Cmd+Shift+X` (macOS) or `Ctrl+Shift+X` (Windows/Linux) - Type **Cody AI** in the search bar and click the **Install** button - After installing, you may be prompted to reload VS Code to activate the extension ![install-cody-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/install-cody-vscode-2025.png) Alternatively, you can also [download and install the extension from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) directly. ## Connect the extension to Sourcegraph After a successful installation, the Cody icon appears in the [Activity sidebar](https://code.visualstudio.com/api/ux-guidelines/activity-bar). ### Cody Free or Cody Pro Users Cody Free and Cody Pro users can sign in to their Sourcegraph.com accounts through GitHub, GitLab, or Google. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-new-ui-2025.jpg) ### Sourcegraph Enterprise Cody Users If you are using an older version of Cody, uninstall it and reload VS Code. It's always recommended to install the latest version before proceeding to next steps. Sourcegraph Enterprise users should connect Cody to their Enterprise instance by clicking **Sign In to Your Enterprise Instance**. You'll be prompted to choose how to sign-in, Enter the URL of your Enterprise instance. If you are unsure, please contact your administrator. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/vscode-cody-enterprise-login.png) A pop-up will ask if you want to Open the URL in a new window. Click **Open** to open the URL in a new window. Next, sign in to your instance. If you do not yet have a login, please contact your administrator. ![](https://storage.googleapis.com/sourcegraph-assets/Docs/sign-in-to-sourcegraph-2025.jpg) Create an access token from Account Settings - Access Tokens. Click **+ Generate new token** Creating an access token Name the token and click **+ Generate token**. Token name Copy the token and return to VSCode. Copying the token Again, click **Sign In to Your Enterprise Instance** and choose **Sign In to Sourcegraph Instances v5.1 and above**. Enter the URL of your instance. You should now be prompted to authorize Sourcegraph to connect to your VSCode extension using the token you created. Click **Authorize**. Finally, you will be asked to allow the extension access. CLick **Open**. VSCode should now display the Cody panel and you're ready to go. ## Verifying the installation Once connected, click the Cody icon from the sidebar again. The Cody extension will open in a configurable side panel. Let's create an autocomplete suggestion to verify that the Cody extension has been successfully installed and is working as expected. Cody provides intelligent code suggestions and context-aware autocompletions for numerous programming languages like JavaScript, Python, TypeScript, Go, etc. - Create a new file in VS Code, for example, `code.js` - Next, type the following algorithm function to sort an array of numbers ```js function bubbleSort(array){ } ``` - As you start typing, Cody will automatically provide suggestions and context-aware completions based on your coding patterns and the code context - These autocomplete suggestions appear as grayed text. To accept the suggestion, press the `Tab` key ## Chat Cody chat in VS Code is available in a unified interface opened right next to your code. Once connected to Sourcegraph, a new chat input field is opened with a default `@-mention` [context chips](#context-retrieval). All your previous and existing chats are stored for later use and can be accessed via the **History** icon from the top menu. You can download them to share or use later in a `.json` file or delete them altogether. ### Chat interface The chat interface is designed intuitively. Your very first chat input lives at the top of the panel, and the first message in any chat log will stay pinned to the top of the chat. After your first message, the chat input window moves to the bottom of the sidebar. Since your first message to Cody anchors the conversation, you can return to the top chat box anytime, edit your prompt, or re-run it using a different LLM model. ### Chat History A chat history icon at the top of your chat input window allows you to navigate between chats (and search chats) without opening the Cody sidebar. ### Changing LLM model for chat You need to be a Cody Free or Pro user to have multi-model selection capability. You can view which LLMs you have access to on our [supported LLMs page](/cody/capabilities/supported-models). Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model. For Chat: - Open chat or toggle between editor and chat (Opt+L/Alt+L) - Click on the model selector (which by default indicates Claude 3.5 Sonnet) - See the selection of models and click the model you desire. This model will now be the default model going forward on any new chats For Edit: - On any file, select some code and a right-click - Select Cody->Edit Code (optionally, you can do this with Opt+K/Alt+K) - Select the default model available - See the selection of models and click the model you desire. This model will now be the default model going forward on any new edits ### Selecting Context with @-mentions Cody's chat allows you to add files and symbols as context in your messages. - Type `@-file` and then a filename to include a file as a context - Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols The `@-file` also supports line numbers to query the context of large files. You can add ranges of large files to your context by @-mentioning a large file and appending a number range to the filename, for example, `@filepath/filename:1-10`. When you `@-mention` files to add to Cody’s context window, the file lookup takes `files.exclude`, `search.exclude`, and `.gitgnore` files into account. This makes the file search faster as a result up to 100ms. Moreover, when you `@-mention` files, Cody will track the number of characters in those files against the context window limit of the selected chat model. As you `@-mention` multiple files, Cody will calculate how many tokens of the context window remain. When the remaining context window size becomes too small, you'll receive **File too large** errors when attempting to `@-mention` additional files. Cody defaults to showing @-mention context chips for all the context it intends to use. When you open a new chat, Cody will show context chips for your current repository and current file (or file selection if you have code highlighted). ### Context retrieval When you start a new Cody chat, the chat input window opens with a default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted). ![context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/context-retrieval-2025.png) At any point in time, you can edit these context chips or remove them completely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new source of context. When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. ### @-mention context providers with OpenCtx OpenCtx context providers are in Experimental stage for all Cody users. Enterprise users can also use this but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10). [OpenCtx](https://openctx.org/) is an open standard for bringing contextual info about code into your dev tools. Cody Free and Pro users can use OpenCtx providers to fetch and use context from the following sources: - [Webpages](https://openctx.org/docs/providers/web) (via URL) - [Jira tickets](https://openctx.org/docs/providers/jira) - [Linear issues](https://openctx.org/docs/providers/linear-issues) - [Notion pages](https://openctx.org/docs/providers/notion) - [Google Docs](https://openctx.org/docs/providers/google-docs) - [Sourcegraph code search](https://openctx.org/docs/providers/sourcegraph-search) To try it out, add context providers to your VS Code settings. For example, to use the [DevDocs provider](https://openctx.org/docs/providers/devdocs), add the following to your `settings.json`: ```json "openctx.providers": { "https://openctx.org/npm/@openctx/provider-devdocs": { "urls": ["https://devdocs.io/go/", "https://devdocs.io/angular~16/"] } }, ``` You don't need the OpenCtx VS Code extension to use context fetching with OpenCtx. We recommend uninstalling the extension before using this feature in Cody. ### Rerun prompts with different context If Cody's answer isn't helpful, you can try asking again with different context: - Public knowledge only: Cody will not use your own code files as context; it’ll only use knowledge trained into the base model. - Add context: Provides @-mention context options to improve the response by explicitly including files, symbols, remote repositories, or even web pages (by URL). ![re-run-with-context](https://storage.googleapis.com/sourcegraph-assets/Docs/re-run-with-context-2025.png) ## Context fetching mechanism VS Code users on the Free or Pro plan use [local context](/cody/core-concepts/context#context-sources). Enterprise users can use the full power of the Sourcegraph search engine as Cody's primary context provider. Read more about [Context fetching mechanism](/cody/core-concepts/context/#context-fetching-mechanism) in detail. ## Context sources You can @-mention files, symbols, and web pages in Cody. Cody Enterprise also supports @-mentioning repositories to search for context in a broader scope. Cody's experimental [OpenCtx](https://openctx.org) support adds even more context sources, including Jira, Linear, Google Docs, Notion, and more. Cody Free and Pro offer single-repo context, and Cody Enterprise supports multi-repo context. ### Cody Context Filters Context Filters is available for all Cody Enterprise users running Cody VS Code extension version `>=1.20.0`. Admins on the Sourcegraph Enterprise instance can use the Cody Context Filters to determine which repositories Cody can use as the context in its requests to third-party LLMs. Inside your site configuration, you can define a set of `include` and `exclude` rules that will be used to filter the list of repositories Cody can access. For repos mentioned in the `exclude` field, prompts are disabled, and you cannot use them for context fetching. If you try running any of these, you'll be prompted with an error message. However, Cody chat will still work, and you can use it to ask questions. [Read more about the Cody Context Filters here →](/cody/capabilities/ignore-context) ## Prompts Cody allows you create quick, ready-to-use [prompts](/cody/capabilities/commands) to automate key tasks in your workflow. Prompts are created and saved in the Prompt Library and can be accessed from the **Tools > Prompt Library** in the top navigation bar in your Sourcegraph instance. To help you get started, there are a few prompts that are available by default. These can assist you to: - Document code - Explain code - Detect code smells - Generate unit tests ![default-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/default-prompts-2025.png) ## Smart Apply code suggestions Cody lets you dynamically insert code from chat into your files with **Smart Apply**. Every time Cody provides you with a code suggestion, you can click the **Apply** button. Cody will then analyze your open code file, find where that relevant code should live, and add a diff. For chat messages where Cody provides multiple code suggestions, you can apply each in sequence to go from chat suggestions to written code. Smart Apply also supports executing commands in the terminal. When you ask Cody a question related to terminal commands, you can execute the suggestion in your terminal by clicking the `Execute` button in the chat window. ![smart-apply-execute](https://storage.googleapis.com/sourcegraph-assets/Docs/smart-apply-2025.png) ## Keyboard shortcuts Cody provides a set of powerful keyboard shortcuts to streamline your workflow and boost productivity. These shortcuts allow you to quickly access Cody's features without leaving your keyboard. * `Opt+L` (macOS) or `Alt+L` (Windows/Linux): Toggles between the chat view and the last active text editor. If a chat view doesn't exist, it opens a new one. When used with an active selection in a text editor, it adds the selected code to the chat for context. * `Shift+Opt+L` (macOS) or `Shift+Alt+L` (Windows/Linux): Instantly starts a new chat session, perfect for when you want to begin a fresh conversation with Cody. * `Opt+K` (macOS) or `Alt+K` (Windows/Linux): Opens the Edit Code instruction box. This works with either selected code or the code at the cursor position, allowing you to quickly request edits or improvements. * `Opt+C` (macOS) or `Alt+C` (Windows/Linux): Opens the Cody Commands Menu, giving you quick access to a range of Cody's powerful features. * `Cmd+.` (macOS) or `Ctrl+.` (Windows/Linux): Opens the Quick Fix menu, which includes options for Cody to edit or generate code based on your current context. ## Updating the extension VS Code will typically notify you when updates are available for installed extensions. Follow the prompts to update the Cody AI extension to the latest version. ## Authenticating Cody with VS Code forks Cody also works with Cursor, Gitpod, IDX, and other similar VS Code forks. To access VS Code forks like Cursor, select **Sign in with URL and access token** and generate an access token. Next, copy and paste into the allocated field, using `https://sourcegraph.com` as the URL. ## Supported LLM models Claude 3.5 Sonnet is the default LLM model for inline edits and prompts. If you've used a different or older LLM model for inline edits before, remember to manually change your model to Claude 3.5 Sonnet. Default model changes only affect new users. Users on Cody **Free** and **Pro** can choose from a list of [supported LLM models](/cody/capabilities/supported-models) for chat. ![LLM-models-for-cody-free](https://storage.googleapis.com/sourcegraph-assets/Docs/llm-dropdown-options-0225.jpg) Enterprise users get Claude 3.5 Sonnet as the default LLM models without extra cost. Moreover, Enterprise users can use Claude 3.5 models through Cody Gateway, Anthropic BYOK, Amazon Bedrock (limited availability), and GCP Vertex. For enterprise users on Amazon Bedrock: 3.5 Sonnet is unavailable in `us-west-2` but available in `us-east-1`. Check the current model availability on AWS and your customer's instance location before switching. Provisioned throughput via AWS is not supported for 3.5 Sonnet. You also get additional capabilities like BYOLLM (Bring Your Own LLM), supporting Single-Tenant and Self Hosted setups for flexible coding environments. Your site administrator determines the LLM, and cannot be changed within the editor. However, Cody Enterprise users when using Cody Gateway have the ability to [configure custom models](/cody/core-concepts/cody-gateway#configuring-custom-models) from Anthropic, OpenAI, and Google Gemini. Read more about all the supported LLM models [here](/cody/capabilities/supported-models) ## Experimental models Support for the following models is currently in the Experimental stage, and available for Cody Free and Pro plans. The following experimental model providers can be configured in Cody's extension settings JSON: - Google (requires [Google AI Studio API key](https://aistudio.google.com/app/apikey)) - Groq (requires [GroqCloud API key](https://console.groq.com/docs/api-keys)) - OpenAI & OpenAI-Compatible API (requires [OpenAI API key](https://platform.openai.com/account/api-keys)) - Ollama (remote) Once configured, and VS Code has been restarted, you can select the configured model from the dropdown both for chat and for edits. Example VS Code user settings JSON configuration: ```json { "cody.dev.models": [ { "provider": "google", "model": "gemini-2.0-flash-exp", "inputTokens": 1048576, "outputTokens": 8192, "apiKey": "", "options": { "temperature": 0.0 } }, { "provider": "groq", "model": "llama2-70b-4096", "inputTokens": 4000, "outputTokens": 4000, "apiKey": "", "options": { "temperature": 0.0 } }, { "provider": "openai", "model": "some-model-id", "inputTokens": 32000, "outputTokens": 4000, "apiKey": "", "options": { "temperature": 0.0 }, "apiEndpoint": "https://host.domain/path" }, { "provider": "ollama", "model": "some-model-id", "apiEndpoint": "https://host.domain/path" } ] } ``` ### Provider configuration options - `"provider"`: `"google"`, `"groq"`, `"ollama"` or `"openai"` - The LLM provider type. - `"model"`: `string` - The ID of the model, e.g. `"gemini-2.0-flash-exp"` - `"inputTokens"`: `number` - optional - The context window size of the model's input. Default: 7000. - `"outputTokens"`: `number` - optional - The context window size of the model's output. Default: 4000. - `"apiKey"`: `string` - optional - The API key for the endpoint. Required if the provider is `"google"`, `"groq"`, `"ollama"` or `"openai"`. - `"apiEndpoint"`: `string` - optional - The endpoint URL, if you don't want to use the provider’s default endpoint. - `"options"` : `object` - optional - Additional parameters like `temperature`, `topK`, `topP` based on provider documentation. ### Debugging experimental models To debug problems with the experimental models, use the VS Code output panel which can be opened using the following steps: - Open the Cody Sidebar - Next to "Settings and Support" click the "..." icon - Click "Open Output Channel" ## Add/remove account To add/remove an account you can do the following: 1. Open Cody by clicking the Cody icon on the left navbar 1. On the open sidebar select the Account icon 1. Select `Sign Out` to remove account or `Switch Account` to login to a different account
# Installing Cody in Visual Studio

Learn how to use Cody and its features with the Visual Studio editor.

Cody for Visual Studio is currently in the Experimental stage and currently supports chat and autocomplete. Cody extension for Visual Studio enhances your coding experience by providing intelligent and contextually aware answers to your questions. This guide will walk you through installing and setting Cody within your Visual Studio editor. ## Prerequisites - You have the latest version of [Visual Studio](https://visualstudio.microsoft.com/) installed - You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account ## Install the Visual Studio extension - Download the Cody extension for Visual Studio from the [GitHub repository](https://github.com/sourcegraph/cody-vs/releases) - Run the installer and follow the prompts to install the extension - Once installed, go to the **Extensions > Manage Extensions** tab in Visual Studio and search for Cody under the **Installed** list for confirmation ## Connect the extension to Sourcegraph Cody for Visual Studio is available for all Cody plans, including Cody Free, Pro, and Enterprise. After a successful installation, go to **Tools** from the main toolbar at the top and click the **Cody Chat** from the drop-down. This opens the dialog box to connect to your Sourcegraph instance. Cody Free or Pro users can sign in to their Sourcegraph.com accounts through GitHub, GitLab, or Google. Meanwhile, Sourcegraph Enterprise users should connect Cody via their Enterprise instance URL and the Access Token. Complete these steps, and you'll be ready to start using Cody in Visual Studio. ![install-cody-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-setup-102024-2.png) ## Chat Cody in Visual Studio allows you to ask questions about your code and get contextually aware answers. The chat window is available in a unified interface next to your code. All your previous and existing chats are stored for later use and can be accessed via the **History** icon from the top menu. You can download them to share or use later in a `.json` file or delete them. The chat input field has a default `@-mention` [context chips](#context-retrieval). These are automatically populated with the names of the files you have open in your editor. There is also a drop-down for [LLM selection](#llm-selection) and a button to run pre-built [prompts and commands](#prompts). ![cody-vs-chat](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-visual-studio-1024.png) ## LLM selection Cody offers a variety of large language models (LLMs) to power your chat experience. Cody Free users can access the latest base models from Anthropic, OpenAI, Google. At the same time, Cody Pro and Enterprise users can access more extended models. You can read more about it in our [Supported LLM models docs](/cody/capabilities/supported-models). ## Selecting Context with @-mentions Cody's chat allows you to [add files and symbols as context](/cody/core-concepts/context) in your messages. - Type `@-file` and then a filename to include a file as a context - Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols ![cody-vs-context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-mention-102024-2.png) ### Context retrieval When you start a new Cody chat, the chat input window opens with a default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted). At any point in time, you can edit these context chips or remove them completely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new context source. When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. ## Prompts Cody allows you create quick, ready-to-use [prompts](/cody/capabilities/commands) to automate key tasks in your workflow. Prompts are created and saved in the Prompt Library and can be accessed from the **Tools > Prompt Library** in the top navigation bar in your Sourcegraph instance. To help you get started, there are a few prompts that are available by default. These can assist you to: - Document code - Explain code - Detect code smells - Generate unit tests ![cody-vs-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-vs-prompts-102024-2.png) ## Autocomplete Cody for Visual Studio supports single and multi-line autocompletions. The autocomplete feature is available in the Cody extension starting in `v0.2.0` and requires a Visual Studios version of 17.8+ and above. It's enabled by default, with settings to turn it off. Advanced features like [auto-edit](/cody/capabilities/auto-edit) are not yet supported. To disable the autocomplete feature, you can do it from your Cody settings section.
# Install Cody for Neovim

Learn how to use Cody and its features with the Neovim editor.

Cody for Neovim is currently in the experimental stage and is no longer actively maintained, so support will be limited. The Cody extension for Neovim by Sourcegraph enhances your coding experience in your IDE by providing intelligent code suggestions, context-aware completions, and advanced code analysis. This guide will walk you through installing and setting up the Cody within your Neovim environment. ## Prerequisites - `nvim 0.9 or nvim nightly` version of Neovim installed - `Node.js >= 18.17.0 (LTS)` at runtime for [cody-agent.js](https://github.com/sourcegraph/cody) - You have enabled an instance for [Cody from your Sourcegraph.com](/cody/clients/cody-with-sourcegraph) account ## Installation `sg.nvim` is a plugin that uses Sourcegraph's code intelligence features directly within the Neovim text editor. You can install the plugin using different Neovim plugin managers like: ### `lazy.nvim` ```lua return { { "sourcegraph/sg.nvim", dependencies = { "nvim-lua/plenary.nvim" }, -- If you have a recent version of lazy.nvim, you don't need to add this! build = "nvim -l build/init.lua", }, } ``` ### `packer.nvim` ```lua -- Packer.nvim, also make sure to install nvim-lua/plenary.nvim use { 'sourcegraph/sg.nvim', run = 'nvim -l build/init.lua' } ``` ### `vim-plug` ```lua -- Using vim-plug Plug 'sourcegraph/sg.nvim', { 'do': 'nvim -l build/init.lua' } ``` Once you have installed the plugin, run `:checkhealth sg` to verify a successful installation. Next, you are prompted to log in as a free user by connecting to your Sourcegraph.com account or using the enterprise instance. ## Setting up with Sourcegraph instance To connect `sg.nvim` with Sourcegraph, you need to follow these steps: - Log in on your Sourcegraph instance - Go to **Settings > Access tokens** from the top right corner - Create your access token, and then run `:SourcegraphLogin` in your neovim editor after installation - Type in the link to your Sourcegraph instance (for example, https://sourcegraph.com) - Next, paste your generated access token An alternative way to this is to use the environment variables specified for [`src-cli`](https://github.com/sourcegraph/src-cli#log-into-your-sourcegraph-instance). At any point, you can run `:checkhealth sg` to ensure you're logged in and connected to your Sourcegraph instance. ## Features The `sg.nvim` plugin supports a wide range of features that helps you integrate and use Cody and Sourcegraph Search directly within your Neovim environment. ### Cody The `sg.nvim` extension supports the following features for Cody: | **Feature** | **Description** | | ------------------- | --------------------------------------------------- | | **Chat** | Chat interface and associated commands | | **Autocompletions** | Support both prompted and suggested autocompletions | ### Search The `sg.nvim` extension supports the following features for Sourcegraph Search: | **Feature** | **Description** | | ---------------------------- | --------------------------------------------------------------------------------------------- | | **Read files** | Directly from sourcegraph links: `:edit ` | | | Automatically adds protocols for `https://sourcegraph.com/*` links | | | Directly from buffer names `:edit sg://github.com/tjdevries/sam.py/-/src/sam.py` | | **Read non-files** | Repository roots, folders (both expanded and non-expanded), open file from folder | | **Built-in LSP client** | Connects to Sourcegraph via `Goto Definition` and `Goto References` (less than 20 references) | | **Basic search** | Keyword and regexp support, `type:symbol` support, and repo support | | **Advanced search features** | Autocompletions and memory of last searches | ## Commands The `sg.nvim` extension also supports pre-built reusable prompts for Cody called "Commands" that help you quickly get started with common programming tasks like: - `:CodyAsk`: Ask a question about the current selection - `:CodyChat {title}`: Starts a new Cody chat, with an optional `{title}` - `:CodyRestart`: Restarts Cody and Sourcegraph - `:CodyTask {task_description}`: Instructs Cody to perform a task on a selected text - `:CodyTaskAccept`: Accepts the current `CodyTask` - `:CodyTaskNext`: Cycles to the next `CodyTask` - `:CodyTaskPrev`: Cycles to the previous `CodyTask` - `:CodyTaskView`: Opens the last active `CodyTask` - `:CodyToggle`: Toggle to the current Cody Chat window
# Installing Cody for JetBrains

Learn how to use Cody and its features with JetBrains editors.

The Cody plugin by Sourcegraph enhances your coding experience in your IDE by providing intelligent code suggestions, context-aware completions, and advanced code analysis. This guide will walk you through the steps to install and set up Cody within your JetBrains environment. ## Prerequisites - You have the latest version of JetBrains IDEs installed - You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account - Cody is compatible with the following JetBrains IDEs: - [Android Studio](https://developer.android.com/studio) - [AppCode](https://www.jetbrains.com/objc/) - [CLion](https://www.jetbrains.com/clion/) - [DataGrip](https://www.jetbrains.com/datagrip/) - [GoLand](https://www.jetbrains.com/go/) - [IntelliJ IDEA](https://www.jetbrains.com/idea/) (Community and Ultimate editions) - [PhpStorm](https://www.jetbrains.com/phpstorm/) - [PyCharm](https://www.jetbrains.com/pycharm/) (Community and Professional editions) - [Rider](https://www.jetbrains.com/rider/) - [RubyMine](https://www.jetbrains.com/ruby/) - [WebStorm](https://www.jetbrains.com/webstorm/) ## Install the JetBrains Cody plugin Follow these steps to install the Cody plugin: - Open a supported JetBrains editor on your local machine - Open **Settings** (macOS: `⌘+,` Windows: `Ctrl+Alt+S`) and select **Plugins** - Search for **Cody: AI Coding Assistant with Autocomplete & Chat** in the marketplace and click **Install** ![cody-for-intellij](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-for-intellij-062024.png) Alternatively, you can also [download and install the plugin from the JetBrains marketplace](https://plugins.jetbrains.com/plugin/9682-sourcegraph) directly. ## Connect the plugin to Sourcegraph After a successful installation, the Cody icon appears in the Tool Windows Bar. ### Cody Free or Cody Pro Users Cody Free and Pro users can sign in to their Sourcegraph.com accounts using SSO through GitHub, GitLab, or Google. ![cody-for-intellij-login](https://storage.googleapis.com/sourcegraph-assets/Docs/sign-in-cody-jb-2025.jpg) ### Sourcegraph Enterprise Cody Users Sourcegraph Enterprise users should connect Cody to their Enterprise instance by clicking **Sign in with an Enterprise Instance**. To connect the plugin with your Enterprise instance, - Click **Sign in with an Enterprise Instance** - Enter the URL of your Enterprise instance. If you are unsure, please get in touch with your administrator - Select **Authorize in Browser**. You'll be directed to an authorization page on your instance in the browser Alternatively, you can access advanced authorization settings by clicking **Show Advanced**. You can manually enter a token generated from your User Settings in your Sourcegraph Enterprise instance or add optional custom request headers. ## Verifying the installation Once connected, click the Cody icon from the sidebar again. The Cody plugin will open in a configurable side panel. Let's create an autocomplete suggestion to verify that the Cody plugin has been installed and works as expected. Cody provides intelligent code suggestions and context-aware autocompletion for numerous programming languages, such as JavaScript, Python, TypeScript, Go, etc. - Create a new file in your JetBrains IDE, for example, `code.js` - Next, type the following algorithm function to sort an array of numbers ```js function bubbleSort(array){ } ``` - As you start typing, Cody will automatically provide suggestions and context-aware completions based on your coding patterns and the code context - These autocomplete suggestions appear as grayed text. To accept the suggestion, press the `Tab` key ## Chat Cody chat in JetBrains is available in a unified interface that opens right next to your code. Once connected to Sourcegraph, a new chat input field opens with the default `@-mention` [context chips](#context-retrieval). All your previous and existing chats are stored for later use and can be accessed via the **History** icon from the top menu. You can download them to share or use later in a `.json` file or delete them. ### Chat interface The chat interface is designed intuitively. Your very first chat input lives at the top of the panel, and the first message in any chat log will stay pinned to the top of the chat. After your first message, the chat input window moves to the bottom of the sidebar. Since your first message to Cody anchors the conversation, you can return to the top chat box anytime, edit your prompt, or rerun it using a different LLM model. ![chat-interface](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-chat-interface-2025.png) Users must be on JetBrains v2023.2 and Cody plugin v7.0.0 or above to get the new and improved chat UI. ### Chat History A chat history icon at the top of your chat input window allows you to navigate between chats (and search chats) without opening the Cody sidebar. ### Changing LLM model for chat You need to be a Cody Free or Pro user to have multi-model selection capability. You can view which LLMs you can access on our [supported LLMs page](/cody/capabilities/supported-models). Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model. For Chat: - Open chat or toggle between editor and chat - Click on the model selector (which by default indicates Claude 3.5 Sonnet) - See the selection of models and click the model you desire. This model will now be the default model for any new chats For Edit: - On any file, select some code and right-click - Select **Cody > Edit Code** (optionally, you can do this with `Opt+K`/`Alt+K`) - Select the default model available - See the selection of models and click the model you desire. This model will now be the default model for any new edits ### Selecting Context with @-mentions Cody's chat allows you to add files as context in your messages. - Type `@-file` and then a filename to include a file as a context. The `@-file` also supports line numbers to query the context of large files. You can add ranges of large files to your context by @-mentioning a large file and appending a number range to the filename, for example, `@filepath/filename:1-10`. When you `@-mention` files to add to Cody’s context window, the file lookup takes `files.exclude`, `search.exclude`, and `.gitgnore` files into account. This makes the file search faster as a result up to 100ms. Moreover, when you `@-mention` files, Cody will track the number of characters in those files against the context window limit of the selected chat model. As you `@-mention` multiple files, Cody will calculate how many tokens of the context window remain. When the remaining context window size becomes too small, you'll receive **File too large** errors when attempting to `@-mention` additional files. You can read more about context limits when selecting context [here](/cody/core-concepts/token-limits). ### Context retrieval When you start a new Cody chat, the input window opens with default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted). ![jb-context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-context-retrieval-2025.png) At any point in time, you can edit these context chips, add additional context chips, or remove them completely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file to let Cody use it as a new context source. When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. ### Rerun prompts with different context If Cody's answer isn't helpful, you can try asking again with a different context: - **Public knowledge only**: Cody will not use your code files as context; it’ll only use knowledge trained into the base model. - **Current file only**: Rerun the prompt using just the current file as context. - **Add context**: Provides @-mention context options to improve the response by explicitly including files, remote repositories, or web pages (URL). ![jb-rerun-context](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-rerun-context-2025.png) ## Context fetching mechanism JetBrains users on the Free or Pro plan use [local context](/cody/core-concepts/context#context-sources). Enterprise users can leverage the full power of the Sourcegraph search engine as Cody's primary context provider. Read more about [Context fetching mechanisms](/cody/core-concepts/context/#context-fetching-mechanism) in detail. ## Context sources You can @-mention files and web pages in Cody. Cody Enterprise also supports @-mentioning repositories to search for context in a broader scope. Cody Free and Pro offer single-repo context, and Cody Enterprise supports multi-repo context. ### Cody Context Filters Context Filters is available for all Cody Enterprise users running Cody JetBrains plugin version `>=6.0.0`. Admins on the Sourcegraph Enterprise instance can use Cody Context Filters to determine which repositories Cody can use as the context in its requests to third-party LLMs. Inside your site configuration, you can define a set of `include` and `exclude` rules that will be used to filter the list of repositories Cody can access. For repos mentioned in the `exclude` field, Cody prompts are disabled, and you cannot use them for context fetching. If you try running any of these, you'll be prompted with an error message. However, Cody chat will still work, and you can use it to ask questions. [Read more about Cody Context Filters here →](/cody/capabilities/ignore-context) ## Autocomplete Cody provides multi-line autocomplete as you type. Autocomplete suggestions appear as inlay suggestions and are enabled by default in your JetBrains IDE. This setting lists the programming languages supported and enabled by default. To manually configure the Autocomplete feature, - Go to the **Cody Settings...** from the Cody icon in the sidebar - Next, click the **Sourcegraph & Cody** dropdown and select **Cody** - The **Autocomplete** settings will appear with the list of **Enabled Languages** Autocomplete suggestions use the same color as inline parameter hints according to your configured editor theme. However, you can optionally enable the **Custom color for completions** checkbox to customize the color of your choice. In addition, you can use the following keyboard shortcuts to interact with Cody's autocomplete suggestions: - `Tab` to accept a suggestion - `Alt + [` (Windows) or `Opt + [` (macOS) to cycle suggestions - `Alt + \` (Windows) or `Opt + \` (macOS) to manually trigger autocomplete if no suggestions have been returned ## Prompts Cody allows you create quick, ready-to-use [prompts](/cody/capabilities/commands) to automate key tasks in your workflow. Prompts are created and saved in the Prompt Library and can be accessed from the **Tools > Prompt Library** in the top navigation bar in your Sourcegraph instance. To help you get started, there are a few prompts that are available by default. These can assist you to: - Document code - Explain code - Detect code smells - Generate unit tests ![jb-default-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-default-prompts-2025.png) ### Inline code edits You can directly perform inline edits on your code without opening the chat window. - Select the code you want to edit - Then right-click and select **Cody > Edit Code** - Alternatively, you can press Opt+K (macOS) or Alt+K (Windows) to open the inline editor Here, you can describe the change you want to make and select the LLM model you want to use. Once you enter your prompt, Cody will perform inline edits that you can **Accept**, **Undo**, or **Show diff** for the change. Click **Edit & Retry** to iterate your prompt and get alternate suggestions. ![jb-inline-code-edit](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-inline-edits-2025.png) ### Inline code fix Cody with JetBrains can also propose fixes and updates to errors in your code. The inline **Ask Cody to Fix** functionality alerts a user when it notices an issue. It provides a workflow to suggest a fix, review the suggestion, and accept the change, all within the editor. All you need to do is select and highlight the code line with the error and click the lightbulb icon. Then select **Ask Cody to Fix**. You can then view the diff and accept or undo the suggested change. ## Updating the plugin JetBrains IDEs will typically notify you when updates are available for installed plugins. Follow the prompts to update the Cody AI plugin to the latest version. ## Change the update channel for stable or nightly releases Our nightly release channel gets updated much more frequently, which might help verify bug fixes that will be included in the next stable release. To update your update channel, you can do the following: 1. Open your JetBrains IDE settings by selecting **IDE Name | Settings** on macOS or **File | Settings** on Windows and Linux from the main menu. 1. Get to the Cody Settings by navigating to `Tools -> Sourcegraph & Cody` 1. Under the update channel, select `Stable` or `Nightly` ## Supported LLM models Cody Free and Pro users can choose from a list of supported LLM models for chat. ![llm-selection-cody](https://storage.googleapis.com/sourcegraph-assets/Docs/jb-llm-select-2025.png) Enterprise users who have [model configuration](/Cody/clients/model-configuration#model-configuration) configured can also select from the available models for their instance. On instances with the ["completions" configuration](/Cody/clients/model-configuration#completions-configuration), a site admin determines the LLM, which cannot be changed within the editor. Read and learn more about the [supported LLMs](/cody/capabilities/supported-models) and [token limits](/cody/core-concepts/token-limits) on Cody Free, Pro and Enterprise. ## Add/remove account To add or remove an account, you can do the following: 1. Open Cody by clicking the Cody icon on the toolbar 1. On the open sidebar, select the Account icon 1. Select `Sign Out` to remove an account Alternatively, you can also manage multiple accounts in Cody Settings: 1. Open your IDE settings by selecting **IDE | Settings** on macOS or **File | Settings** on Windows and Linux from the main menu. 1. Go to the Cody Settings by navigating to `Tools -> Sourcegraph & Cody` 1. Under authentication, see the accounts that are currently logged in 1. To remove, select your account and hit `-`. To add click `+` and choose the appropriate login method ## Find Cody features You can find and discover all Cody features and actions using the **Search Everywhere** option in JetBrains IDEs. Press `Shift` twice to open the `Search Everywhere` window. Then, type in the `Cody:` prefix to get a list of all supported Cody actions. ![search-everywhere](https://storage.googleapis.com/sourcegraph-assets/Docs/search-everywhere-cody.png)
# Installing Cody in Eclipse

Learn how to use Cody and its features with the Eclipse editor.

Cody for Eclipse is currently in the Experimental stage and supports only chat. It is compatible with Eclipse version 2024-03 (4.31.0) and runs on Windows 11. The support is also limited feel free to contact us for any questions or feedback. Cody extension for Eclipse enhances your coding experience by providing intelligent and contextually aware answers to your questions. This guide will walk you through installing and setting Cody within your Eclipse editor. ## Prerequisites - You have the correct version of [Eclipse](https://www.eclipse.org/downloads/packages/release/2024-03/r) IDE installed - You have a Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account ## Install the Eclipse extension - Inside Eclipse, go to **Help > Install New Software** - Next, add the site URL `https://sourcegraph.github.io/eclipse` - After adding this URL, you should see the **Cody** category in the list of available plugins ![add-eclispe-extension](https://storage.googleapis.com/sourcegraph-assets/Docs/add-eclipse-url-1124.png) - Click **Next** and follow the installation instructions - After you have completed the installation and restarted Eclipse, you should see the **Cody** view in the **Window > Show View > Other** menu ![eclipse-cody-view](https://storage.googleapis.com/sourcegraph-assets/Docs/eclipse-cody-view-1124.png) ## Connect the extension to Sourcegraph Cody for Eclipse is available for all Cody plans, including Cody Free, Pro, and Enterprise. After a successful installation, open the **Cody** view. You should see a button to sign into your Sourcegraph account. ![eclipse-cody-sign-in](https://storage.googleapis.com/sourcegraph-assets/Docs/eclispe-signin-sourcegraph-1124-2.png) Cody Free or Pro users can sign in to their Sourcegraph.com accounts. Meanwhile, Sourcegraph Enterprise users should connect Cody via their Enterprise instance URL and the Access Token. Complete these steps, and you'll be ready to use Cody chat in Eclipse. ## Chat Cody in Eclipse allows you to ask questions about your code and get contextually aware answers. The chat window is available in a unified interface next to your code. All your previous and existing chats are stored for later use and can be accessed via the **History** icon from the top menu. You can download them to share or use later in a `.json` file or delete them. The chat input field has a default `@-mention` [context chips](#context-retrieval). These are automatically populated with the names of the files you have open in your editor. There is also a drop-down for [LLM selection](#llm-selection) and a button to run pre-built [prompts](#prompts). ![cody-eclipse-chat](https://storage.googleapis.com/sourcegraph-assets/Docs/eclipse-cody-chat-1124.png) ## LLM selection Cody offers a variety of large language models (LLMs) to power your chat experience. Cody Free users can access the latest base models from Anthropic, OpenAI, Google. At the same time, Cody Pro and Enterprise users can access more extended models. You can read more about it in our [Supported LLM models docs](/cody/capabilities/supported-models). ## Selecting Context with @-mentions Cody's chat allows you to [add files and symbols as context](/cody/core-concepts/context) in your messages. - Type `@-file` and then a filename to include a file as a context - Type `@#` and then a symbol name to include the symbol's definition as context. Functions, methods, classes, types, etc., are all symbols ### Context retrieval When you start a new Cody chat, the chat input window opens with a default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted). At any point in time, you can edit these context chips or remove them completely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new context source. When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. ## Prompts Cody offers a variety of [pre-built prompts](/cody/capabilities/commands) to help you get the most out of your chat experience. You can access these prompts from the chat input field. ## Feedback While Cody for Eclipse is currently in the experimental stage, we are open to feedback [in our forum](https://community.sourcegraph.com/c/cody/eclipse/13).
# Install Cody CLI

Learn how to install the cody command-line tool and using the cody chat subcommand.

Cody CLI support is in the Experimental stage for Enterprise accounts. Cody CLI is the same technology that powers the Cody IDE plugins but available from the command-line. Use Cody CLI for ad-hoc exploration in your terminal or as part of scripts to automate your workflows. ## Prerequisites - You have Node.js `v20` or newer installed - You have `npm`, `yarn`, `pnpm`, or an equivalent package manager installed ## Install CLI from npm Run the following command to install the Cody CLI: ```shell npm install -g @sourcegraph/cody ``` ```shell yarn global add @sourcegraph/cody ``` ```shell pnpm install -g @sourcegraph/cody ``` Confirm that the installation was successful by running the following command: ```shell cody help ``` ## Authenticate with cody auth login To start using the Cody CLI, you need to authenticate it with your Sourcegraph account. When using `cody auth login`, the access token is stored in the secure storage of your operating system or equivalent security tool. If you prefer not to let Cody store your access token, authenticate with [environment variables](#authenticate-with-only-environment-variables) instead. First, make sure you have installed the necessary tools to use `cody auth login`. The pre-installed `security` tool is used. No additional installation is required. The [CredentialManager](https://www.powershellgallery.com/packages/CredentialManager/2.0) PowerShell module is required. Open a PowerShell terminal with administrator privileges and run the following command: ```powershell Install-Module -Name CredentialManager ``` The [`secret-tool`](https://manpages.ubuntu.com/manpages/focal/man1/secret-tool.1.html#:~:text=secret%2Dtool%20is%20a%20command,of%20attribute%20keys%20and%20values) command-line tool is used. Run the following commands to install it: ```shell sudo apt install libsecret-tools sudo apt install gnome-keyring ``` Run the following command to authenticate the Cody CLI: ```shell cody auth login --web ``` This will open a browser window where you can authenticate with your Sourcegraph account. Close the browser tab after authentication is complete. - Cody Enterprise accounts can sign into their Sourcegraph Enterprise account and create an access token under `Account > Settings > Access Tokens`. - ```shell export SRC_ENDPOINT=ENDPOINT export SRC_ACCESS_TOKEN=ACCESS_TOKEN cody auth login # stores the access token securely ``` You don't need to export `SRC_ENDPOINT` or `SRC_ACCESS_TOKEN` after running `cody auth login`. Subsequent command invocation will use the stored access token. Confirm that the authentication was successful by running the following command: ```shell cody auth whoami # ✔ Authenticated as USERNAME on ENDPOINT ``` ## Authenticate with only environment variables **Skip this step if you have already authenticated with the `cody auth login` command.** If you prefer not to let Cody CLI store your access token, you can also pass the endpoint URL and access token through the environment variables `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN`. ```shell export SRC_ENDPOINT=ENDPOINT export SRC_ACCESS_TOKEN=ACCESS_TOKEN ``` ```powershell $env:SRC_ENDPOINT = "ENDPOINT" $env:SRC_ACCESS_TOKEN = "ACCESS_TOKEN" ``` It's recommended to store these access tokens in a secure location. For example, you can store them with a password manager like [1Password](https://1password.com/) or [Bitwarden](https://bitwarden.com/). It is not recommended to export these variables in your shell startup script because it will expose your access token to all commands you run from the terminal. Instead, consider sourcing these environment variables on-demand when you need to authenticate with the Cody CLI. ## Sign out with cody auth logout To sign out of the Cody CLI, run the following command: ```shell cody auth logout ``` Running this command wil remove the access token from the secure storage of your operating system. Run `cody auth whoami` to confirm that the Cody CLI is no longer authenticated. ## Chat with basic message Once you've authenticated the Cody CLI, you can start using it to chat with Cody. To start a new chat, run the following command: ```shell cody chat -m 'Explain React hooks' ``` The following commands are equivalent to the above: ```shell # use --message instead of -m cody chat --message 'Explain React hooks' # space separated arguments cody chat Explain React hooks ``` ## Chat with --context-file to add context from local files Use `--context-file` to provide context from local files ```shell cody chat --context-file src/controller.ts -m 'Are there code smells in this file?' ``` ## Chat with --context-repo to add context from remote repositories This feature is only supported on Cody Enterprise. Use `--context-repo` to provide context from remote repositories. ```shell cody chat --context-repo github.com/sourcegraph/cody -m 'What is the agent?' ``` ## Chat with --stdin to read message from standard input Use `--stdin` to provide context from standard input ```shell echo 'Explain React hooks' | cody chat --stdin ``` Combine `--stdin` with `--message` to send a concatenated message. The `--message` string appears at the top of the prompt and the `--stdin` text appears at the bottom. ```shell git diff | cody chat --stdin -m 'Write a commit message for this diff' ``` Use the `-` trailing argument as an alternative to `--stdin` to read the diff from standard input. ```shell git diff | cody chat -m 'Write a commit message for this diff' - ```
# Cody Clients

There are multiple ways to use Cody: you can install its extension in your favorite IDEs, access it via the Sourcegraph web app, or use it through the Cody CLI.

# Feature Parity Reference for Sourcegraph Clients

This document compares features and capabilities across different clients and platforms like VS Code, JetBrains, and Sourcegraph.com (Web UI).

## Chat | **Feature** | **VS Code** | **JetBrains** | **Visual Studio** | **Web** | **CLI** | | ---------------------------------------- | ----------- | ------------- | ----------------- | -------------------- | ------- | | Chat | ✅ | ✅ | ✅ | ✅ | ✅ | | Chat history | ✅ | ✅ | ✅ | ✅ | ❌ | | Clear chat history | ✅ | ✅ | ✅ | ✅ | ❌ | | Edit sent messages | ✅ | ✅ | ✅ | ✅ | ❌ | | SmartApply/Execute | ✅ | ❌ | ❌ | ❌ | ❌ | | Show context files | ✅ | ✅ | ✅ | ✅ | ❌ | | @-file | ✅ | ✅ | ✅ | ✅ | ❌ | | @-symbol | ✅ | ❌ | ✅ | ✅ | ❌ | | LLM Selection | ✅ | ✅ | ✅ | ✅ | ❌ | | **Context Selection** | | | | | | | Single-repo context | ✅ | ✅ | ✅ | ✅ | ❌ | | Multi-repo context | ❌ | ❌ | ❌ | ✅ (public code only) | ❌ | | Local context | ✅ | ✅ | ✅ | ❌ | ✅ | | OpenCtx context providers (experimental) | ✅ | ❌ | ❌ | ❌ | ❌ | | **Prompts** | | | | | | | Access to prompts and Prompt library | ✅ | ✅ | ✅ | ✅ | ❌ | | Promoted Prompts | ✅ | ❌ | ❌ | ✅ | ❌ | ## Code Autocomplete | **Feature** | **VS Code** | **JetBrains** | **Visual Studio** | | --------------------------------------------- | ----------- | ------------- | ----------------- | | Single and multi-line autocompletion | ✅ | ✅ | ✅ | | Cycle through multiple completion suggestions | ✅ | ✅ | ✅ | | Accept suggestions word-by-word | ✅ | ❌ | ❌ | Few exceptions that apply to Cody Pro and Cody Enterprise users: - Multi-repo context is not supported in VS Code, JetBrains, or the Web UI for Cody Pro - Admin LLM selection is suported on VS Code, JetBrains, Visual Studio, and Web both for chat and code autocomplete - Multi-repo context is supported on VS Code, JetBrains, Visual Studio, and Web - [Guardrails](/cody/clients/enable-cody-enterprise#guardrails) are supported on VS Code, JetBrains, and Web - [Repo-based Cody Context Filters](/cody/capabilities/ignore-context#cody-context-filters) are supported on all Cody clients. - `@-mention` directories are supported on VS Code, JetBrains, Visual Studio, and Web
# Cody for Enterprise

Cody enhances your coding experience by providing intelligent code suggestions, context-aware completions, and advanced code analysis. These docs will help you use Cody on your Sourcegraph Enterprise instance.

## Setting up Cody Enterprise You can set up Cody for your Enterprise instance by two methods: 1. Sourcegraph Cloud 2. Self-hosted Sourcegraph ## Cody on Sourcegraph Cloud With [Sourcegraph Cloud](/cloud/), you get Cody as a managed service, and you **do not** need to enable Cody as is required for self-hosted setup. However, by contacting your account manager, Cody can still be enabled or disabled on-demand on your Sourcegraph instance. ## Self-hosted Sourcegraph Enterprise ### Prerequisites - You have Sourcegraph version `5.1.0` or more - A Sourcegraph Enterprise subscription with [Cody Gateway](/cody/core-concepts/cody-gateway) or an account with a third-party LLM provider ### Enable Cody on your Sourcegraph instance Site admins can only enable Cody on the Sourcegraph instance. To do so, - First, configure your desired LLM provider either by [using Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway) or by directly using a third-party LLM provider - Next, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "completions": { "provider": "sourcegraph" } } ``` - Cody is enabled on your self-hosted Sourcegraph enterprise instance ## Disable Cody To turn Cody off: - Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": false } ``` ## Enable Cody only for some users How to enable Cody only for _some_ users depends on what version of Sourcegraph you are running. ### Sourcegraph v5.3+ In Sourcegraph v5.3+, access to Cody is managed via user roles. By default, all users have access. First, ensure Cody is enabled in your site configuration. Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, // Make sure cody.restrictUsersFeatureFlag is not in your configuration! If it is, remove it. } ``` Ensure `cody.restrictUsersFeatureFlag` is **not** in your site configuration. If it is, remove it or else the old feature-flag approach from Sourcegraph 5.2 and earlier will be used. Next, go to **Site admin > Users & Auth > Roles** (`/site-admin/roles`) on your instance. On that page, you can: - Control whether users **by default** have access to Cody (expand `User [System]` and toggle **Cody** > **Access** as desired) - Control whether groups of users have access to Cody (`+Create role` and enable the **Cody** > **Access** toggle as desired) ### Sourcegraph v5.2 and earlier In Sourcegraph v5.2 and earlier, you should use the feature flag `cody` to turn Cody on selectively for some users. To do so: - Go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: ```json { // [...] "cody.enabled": true, "cody.restrictUsersFeatureFlag": true } ``` - Next, go to **Site admin > Feature flags** (`/site-admin/feature-flags`) - Add a feature flag called `cody` - Select the `boolean` type and set it to `false` - Once added, click on the feature flag and use **add overrides** to pick users that will have access to Cody ![add-overrides](https://user-images.githubusercontent.com/25070988/235454594-9f1a6b27-6882-44d9-be32-258d6c244880.png) ## Configure Cody for LLM providers Cody supports several LLM providers and models. You can access these models via the Cody Gateway, directly using your own model provider account or infrastructure. There are two ways of configuring Cody for LLM providers:
# Cody for Web

Learn how to use Cody in the web interface with your Sourcegraph.com instance.

In addition to the Cody extensions for [VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains), and [Visual Studio](/cody/clients/install-visual-studio ) IDEs, Cody is also available in the Sourcegraph web app. Community users can use Cody for free by logging into their accounts on Sourcegraph.com, and enterprise users can use Cody within their Sourcegraph instance. ## Initial setup Create a [Sourcegraph.com account](https://sourcegraph.com/sign-up) by logging in through codehosts like GitHub and GitLab or via traditional Google sign-in. This takes you to Sourcegraph’s web interface. From here, there are two ways to access the Cody chat: 1. Run any search query via **Code Search** and click the **Cody** button on the left to open the chat window 2. Directly click the **Chat** tab from the top header to open the chat interface ![cody-web](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-web-2025.png) Enterprise users can also log in to their Sourcegraph.com Enterprise instance and use Cody in the web interface. ## Chat interface The Cody chat interface for the web is similar to the one you get with the IDE extensions. However, the chat experience is slightly different depending on whether you use Cody with your search query results or directly from the top header. The chat interface with your Code Search queries opens parallel to your query search results, similar to the chat window in the IDE extensions. However, when you click **Cody** from the top header in your Sourcegraph.com instance, the chat interface opens on a new page. The new and improved chat UI for Cody for the web is currently available to users on Sourcegraph versions >=5.5. To use this new chat interface, you should update your Sourcegraph instance to the latest version. ## Chat with Cody on the web interface The feature set for the Cody chat is the same as the IDE extensions. Your previous chats can be viewed from the **History** tab. Claude 3.5 Sonnet (New) is selected as the default chat model. You can change this LLM model based on your use case to optimize speed, accuracy, or cost. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model. You can read about these supported LLM models [here](/cody/capabilities/supported-models#chat-and-commands). To help you automate your key tasks in your development workflow, you get **[Prompts](/cody/capabilities/commands)**. If you are a part of an organization on Sourcegraph.com or a self-hosted Sourcegraph instance, you can view these pre-built Prompts created by your teammates. On the contrary, you can create your Prompts via the **Prompt Library** from your Sourcegraph instance. ## Context selection If you use Cody with your search results, the chat input will, by default, have the context of your searched codebase. This context is based on your current repository and file. ![cody-web-with-search](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-web-search-results-2025.png) You can add or delete any new or existing context by `@-mentioning` files, symbols, directories, repositories, and web URLs. Enterprise users can `@-mention` remote directories as well. When you have both a repository and files as context, Cody will search the repository for context while prioritizing the mentioned files. If you use Cody directly from the top header, the chat input will have no pre-filled context chips by default. You can chat without context or add or delete any new or existing context by `@-mentioning` context chips. ![cody-web-no-search](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-web-top-header-2025.png) ### Rerun prompts with different context If Cody's answer isn't helpful, you can try asking again with a different context: - **Public knowledge only**: Cody will not use your code files as context; it’ll only use knowledge trained into the base model - **Add context**: Provides @-mention context options to improve the response by explicitly including files, symbols, and remote repositories ![re-run-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/rerun-prompt-web-2025.png) For a detailed breakdown of Cody's capabilities across different clients [read these feature parity docs](/cody/clients/feature-reference). ## Prompts Cody allows you create quick, ready-to-use [prompts](/cody/capabilities/commands) to automate key tasks in your workflow. Prompts are created and saved in the Prompt Library and can be accessed from the **Tools > Prompt Library** in the top navigation bar in your Sourcegraph instance. ![cody-web-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-web-prompts-2025.png)
# Supported LLMs ## Chat and Prompts Cody supports a variety of cutting-edge large language models for use in chat and prompts, allowing you to select the best model for your use case. Newer versions of Sourcegraph Enterprise, starting from v5.6, it will be even easier to add support for new models and providers, see [Model Configuration](/cody/enterprise/model-configuration) for more information. | **Provider** | **Model** | **Free** | **Pro** | **Enterprise** | | | | | | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------- | :----------- | :----------- | :------------- | --- | --- | --- | --- | | OpenAI | [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo#:~:text=TRAINING%20DATA-,gpt%2D4%2D0125%2Dpreview,-New%20GPT%2D4) | - | ✅ | ✅ | | | | | | OpenAI | [GPT-4o](https://platform.openai.com/docs/models#gpt-4o) | - | ✅ | ✅ | | | | | | OpenAI | [GPT-4o-mini](https://platform.openai.com/docs/models#gpt-4o-mini) | ✅ | ✅ | ✅ | | | | | | OpenAI | [o3-mini-medium](https://openai.com/index/openai-o3-mini/) (experimental) | ✅ | ✅ | ✅ | | | | | | OpenAI | [o3-mini-high](https://openai.com/index/openai-o3-mini/) (experimental) | - | - | ✅ | | | | | | OpenAI | [o1](https://platform.openai.com/docs/models#o1) | - | ✅ | ✅ | | | | | | Anthropic | [Claude 3.5 Haiku](https://docs.anthropic.com/claude/docs/models-overview#model-comparison) | ✅ | ✅ | ✅ | | | | | | Anthropic | [Claude 3.5 Sonnet](https://docs.anthropic.com/claude/docs/models-overview#model-comparison) | ✅ | ✅ | ✅ | | | | | | Anthropic | [Claude 3.7 Sonnet](https://docs.anthropic.com/claude/docs/models-overview#model-comparison) | - | ✅ | ✅ | | | | | | Google | [Gemini 1.5 Pro](https://deepmind.google/technologies/gemini/pro/) | ✅ | ✅ | ✅ (beta) | | | | | | Google | [Gemini 2.0 Flash](https://deepmind.google/technologies/gemini/flash/) | ✅ | ✅ | ✅ | | | | | | Google | [Gemini 2.0 Flash-Lite Preview](https://deepmind.google/technologies/gemini/flash/) (experimental) | ✅ | ✅ | ✅ | | | | | To use Claude 3 Sonnet models with Cody Enterprise, make sure you've upgraded your Sourcegraph instance to the latest version. Claude 3.7 Sonnet with thinking is not supported for BYOK deployments. ## Autocomplete Cody uses a set of models for autocomplete which are suited for the low latency use case. | **Provider** | **Model** | **Free** | **Pro** | **Enterprise** | | | | | | :-------------------- | :---------------------------------------------------------------------------------------- | :------- | :------ | :------------- | --- | --- | --- | --- | | Fireworks.ai | [DeepSeek-Coder-V2](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct) | ✅ | ✅ | ✅ | | | | | | Fireworks.ai | [StarCoder](https://arxiv.org/abs/2305.06161) | - | - | ✅ | | | | | | Anthropic | [claude Instant](https://docs.anthropic.com/claude/docs/models-overview#model-comparison) | - | - | ✅ | | | | | | | | | | | | | | | The default autocomplete model for Cody Free, Pro and Enterprise users is DeepSeek-Coder-V2. The DeepSeek model used by Sourcegraph is hosted by Fireworks.ai, and is hosted as a single-tenant service in a US-based data center. For more information see our [Cody FAQ](https://sourcegraph.com/docs/cody/faq#is-any-of-my-data-sent-to-deepseek). # Chat Query Types

This page lists all the query types that will return search results with the Sourcegraph chat.

Query types are only supported on Enterprise Starter and Enterprise plans. ## Symbol Search Symbol Search is a query type or workflow that helps developers understand how specific symbols (like functions, variables, or hooks) are used across a codebase by combining search results with contextual analysis through chat. It enables developers to explore and understand symbol usage patterns through a two-step process. First, developers search for a specific symbol (like `useCallback`) using Sourcegraph Chat, which returns relevant code snippets from across the codebase. These search results are automatically preserved as context for follow-up chat interactions. Developers can refine their understanding by selecting specific search results and asking natural language questions about the symbol's usage patterns. The chat will analyze the selected code context and provide a comprehensive summary of how the symbol is implemented and used throughout the codebase. ### Try it 1. Query for `= useCallback` 2. Select a subset of the search results which include usage for `useCallback` 3. Follow up and ask Sourcegraph chat `Summarize how useCallback is used` ### Example ## File Search Search is a query type or workflow that enables users to locate specific files across repositories and perform targeted analysis on the selected files through natural language follow-up queries. File Search simplifies finding and analyzing specific file types across your codebase. Unlike traditional code search, this workflow allows you to identify relevant files (for example, all `package.json` files), select the specific files you want to analyze, and then ask follow-up questions about the selected files. This two-step approach is particularly powerful when analyzing patterns or extracting information from similar files spread across multiple repositories. For instance, you could identify all configuration files, select the ones from relevant services, and then analyze their contents for inconsistencies or gather specific information through natural language queries. ### Try it 1. Type `package.json` 2. Check the checkbox next to the results you want to analyze 3. Follow up with `List all the dependencies used across these package.json files` ### Example ## String Literal Search String literal search is a query type or workflow that allows you to find exact text matches by enclosing your search term in quotes. This ensures precise matching instead of keyword-based results. When you enclose the text in quotes like `" authInfo: async provider =>"",` Sourcegraph performs an exact match search rather than keyword matching. After finding relevant files, you can select specific ones to analyze and ask follow-up questions about their contents - creating an interactive workflow combining precise search and contextual code analysis. ### Try it 1. Start a new chat with `"authInfo: async provider =>"` 2. Select a subset of the search results which include usage for the string 3. Follow up with `Summarize the contents` ### Example ## Error Lookups Error Lookups is a conversational workflow for Sourcegraph chat that helps developers understand error messages by providing plain-English explanations of when and why specific errors occur in their codebase and external service calls. Developers can use Error Lookups to understand error messages occurring in their codebase. When encountering an error, especially from external services or dependencies, developers can use chat to: 1. Search for specific error messages across their codebase 2. Select relevant files where the error is thrown or handled 3. Request a natural language explanation of the error's context, triggers, and implications The workflow combines Sourcegraph's code search capabilities with AI-powered analysis to provide developers with a clear, contextual understanding of error scenarios. Instead of having to dig through docs or source code manually, developers can quickly grasp the following: * The specific conditions that trigger the error * The underlying reasons for the error occurrence * Common scenarios where this error might appear * Potential approaches to handling or preventing the error This approach helps developers make more informed decisions about error handling and debugging, reducing the time spent deciphering cryptic error messages or searching through external docs. ### Try it * Query for `"unsupported platform"` * Select the file(s) where the error is thrown * Follow up with "Explain when and why this error is thrown" ### Demo
# Run Cody via proxies

This documentation helps you set up HTTP, HTTPS, and SOCKS proxies in VS Code and JetBrains IDEs. It also includes instructions for handling self-signed certificates on macOS and Windows.

You may be unable to authenticate with Cody or see a network reachability issue if you attempt to use Cody before configuring your proxy settings. ### Accessing the Proxy Settings 1. Open VS Code. 2. Navigate to the settings window of VS Code 3. In the search bar at the top of the Settings pane, type `proxy` 4. Click on `Edit in settings.json` to open the `settings.json` file ### Modifying `settings.json` for Proxy Configuration Add the following configuration fields in the `settings.json` file to set up your proxy: ```json { "http.proxy": "http://proxy_ip:port", // Replace with your proxy IP and port "http.proxySupport": "on", "http.proxyStrictSSL": true, "http.systemCertificates": true, "http.experimental.systemCertificatesV2": true } ``` ### Self-Signed Certificates in VS Code If your proxy uses self-signed certificates, ensure the following settings are enabled: ```json { "http.systemCertificates": true, "http.experimental.systemCertificatesV2": true } ``` ### Restart VS Code After modifying the `settings.json` file, close and restart VS Code to apply the new proxy settings. ### Supported Proxy Types VS Code supports HTTP, HTTPS, and SOCKS proxies. The `http.proxy` setting in `settings.json` will accommodate all three types based on the provided proxy URL. You may be unable to authenticate with Cody or see a network reachability issue if you attempt to use Cody before configuring your proxy settings. ### Accessing the Proxy Settings 1. Open your JetBrains IDE (e.g., IntelliJ IDEA, PyCharm) 2. Navigate to `Settings` by clicking on `File` > `Settings` (or `Preferences` on macOS) 3. In the search bar at the top, type `proxy` to find the proxy settings 4. Select the `HTTP` proxy or `SOCKS` proxy based on your requirement ### Configuring HTTP Proxy 1. In the proxy settings, choose `Manual Proxy Configuration` 2. Enter the following details: - **HTTP Proxy:** `http://proxy_ip:port` (Replace with your proxy IP and port) - **Enable proxy authentication if needed and provide credentials** 3. Click `Apply` and then `OK` to save the settings ### Configuring SOCKS Proxy 1. In the proxy settings, choose `Manual Proxy Configuration` 2. Enter the following details: - **SOCKS Proxy:** `socks5://proxy_ip:port` (Replace with your proxy IP and port) - **Enable proxy authentication if needed and provide credentials** 3. Click `Apply` and then `OK` to save the settings ### Using the Proxy with Cody 1. Open Cody settings within your JetBrains IDE 2. Connect to the Sourcegraph instance using the provided instance IP and token: - **Instance IP:** `http://instance_ip` - **Token:** `your_token` 3. Click `Apply`, then `OK`, and test the connection ### Supported Proxy Types JetBrains supports HTTP and SOCKS proxies. The `Manual Proxy Configuration` in the settings will accommodate both types based on the provided proxy URL. ### Known Limitations 1. Currently, only `Manual Proxy Configuration` is supported. The `auto-detect proxy settings` option is not fully supported. 2. HTTPS proxy is not supported in JetBrains currently ## Troubleshooting the Proxy Setup ### Basic Connectivity Test To verify that your proxy setup works, use the following `curl` command in your terminal, replacing `proxy_ip` and `instance_ip` with your actual proxy and instance IP addresses: ```bash curl -x http://proxy_ip:port http://instance_ip ``` This command should return a response from the instance, confirming that the proxy is correctly routing your requests. ## Adding Self-Signed Certificates ### For macOS 1. Download the self-signed certificate. 2. Open `Keychain Access` and import the certificate. 3. Ensure the certificate is added by searching for the proxy IP. 4. Set the certificate to `Always Trust`. ### For Windows 1. Download the self-signed certificate. 2. Open `Manage User Certificates` by typing it in the Windows search bar. 3. Import the certificate into the `Trusted Root Certification Authorities` store. 4. Confirm that the certificate is listed and trusted. Please confirm with your IT Administrator to ensure you trust the right certificate. When adding self-signed certificates, try making a `curl` request routed through the HTTPS proxy to check if the computer uses the self-signed certificate. Your request will look something like: ```bash curl -x https://proxy_ip https://destination_ip ``` ### Additional Support Please get in touch with the Cody support team if you need further assistance with proxy configurations, especially for special enterprise setups. They can provide guidance tailored to your specific network environment.
# Prompts

Learn how prompts can automate and accelerate your workflow with Cody.

Cody offers quick, ready-to-use **Prompts** to automate key tasks in your workflow. Prompts are created and saved in the **Prompt Library** and can be accessed from the top navigation bar in the Sourcegraph.com instance. To run Prompts and access Prompt Library, you must have the following: - Free account on Sourcegraph.com or Sourcegraph Enterprise instance with Cody enabled - Cody extension installed in your IDE (VS Code, JetBrains, Visual Studio) ## Prompt Library The **Prompt Library** allows you to create, edit, share, and save prompts you’ve created or shared within your organization. You can also search for prompts, filter the list to find a specific prompt by the owner, and sort by name or updated recently. Go to **Tools > Prompt Library** from the top navigation bar in the Sourcegraph.com instance. Alternatively, you can access the **Prompt Library** from the **Cody** extension in your IDE, which directs you to the Prompt Library page. Here, you can view all prompts (shared with you in an organization or created by you) and some core (built-in) prompts to help you get started. ![prompt-library-overview](https://storage.googleapis.com/sourcegraph-assets/Docs/prompt-library-overview-2025.png) ### Core (built-in) prompts The core (built-in) prompts are available to all users. These prompts are designed to help you start with Cody and provide a starting point for your own prompts. You get the following core (built-in) prompts: - document-code - explain-code - find-code-smells - generate-unit-tests You can run these prompts by clicking the **play** icon next to the prompt name, **copy the prompt permalink**, or **duplicate the prompt** to make a copy and edit it according to your needs. ## Create prompts Click the **New prompt** button from the **Prompt Library** page. - Select the **Owner** and **Prompt Name** - Write a prompt description - Next, fill out the **Prompt template** box with all your prompt instructions - You can also add dynamic context that will allow your prompt to use content from different sources like current selection and current file - Select the visibility of the prompt, either **Public** or **Private** - You can mark your prompt as **draft**. Draft prompts are not visible to other users until you publish it - Choose the mode of the prompt, whether it will be **Chat only** or can **Edit code** - Once done, click the **Create prompt** button There are also a few advanced options that you can configure. ![create-prompt](https://storage.googleapis.com/sourcegraph-assets/Docs/create-prompts-0225.jpg) ### Draft prompts You can mark your prompt as a draft. A draft prompt is not visible to everyone. You can only view, run, and edit your draft prompts until you publish it. ## View prompts The new prompt is added to the Prompt Library page and appears in the Prompts list in the Cody chat panel (both in the editor and on the web). If your prompt does not appear in the Prompts list, make sure you've logged in with the same account you used to create it. Once the prompt is visible, it's ready to be used by: - **The prompt's owner** if it is a user - **All members of the organization** if the prompt's owner is an organization - **Everyone** if the prompt is marked **Public** (which only site admins can do) ![prompts-in-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/prompt-in-vscode-2025.jpg) ## Edit prompts To edit a prompt, click the Edit button next to the prompt in the Prompt Library and make the necessary changes. You can also use this interface to **Transfer Ownership** of the prompt or delete it from this view. ## Prompt tags Prompt tags are supported in Sourcegraph Enterprise, and only site admins can create them. Site admins can categorize prompts and create **tags**. This helps you keep your prompts organized, especially when there are many prompts to use and manage. - Go to **Tools > Prompt Library** from your Enterprise Sourcegraph instance - From the left sidebar click **Manage** next to the **tags** list - All the new and existing tags are listed here. You can also search for a specific tag by typing its name in the search box - Click **New tag**, type the **Tag name** and hit the **Create** button ![prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/prompts-tags-2025.png) Once created, it will appear in the **Tags** list and in the sidebar of the Prompt Library. To manage your prompt tags, you can **edit**, **delete**, or **copy link to prompts with this tag**. ### Assigning tags to prompts Once site admins create tags, other users in your organization can assign tags to their prompts. While creating or editing a prompt, there is a drop-down selector **Add prompt to...** to assign tags to the prompt. ![assign-prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/assign-prompt-tags-2025.png) You can assign multiple tags to a prompt and group them based on their functionality, category, or any other criteria for your organization. In addition, with tags assigned to prompts, you can filter prompts by tags in the Prompt Library. ## Specific and dynamic context Sourcegraph 6.0 adds Beta support for the `@` mention menu in the prompt library. When writing prompts, you can leverage both specific and dynamic context through the `@` mention system. ![A dropdown appears after typing `@` in the prompt editor.](https://storage.googleapis.com/sourcegraph-assets/Docs/%40-mention-prompts-0225.jpg) Type `@` to open a dropdown menu that lets you reference specific context like symbols, directories, files, repositories and web URLs. When selecting a web URL, type out the domain, including the `https://` prefix, for example, https://sourcegraph.com. For dynamic context that adapts based on what the user is working on, the prompt editor provides special mentions for the current selection, current file, current repository, current directory, and open tabs. When a user runs a prompt template containing dynamic context mentions, they are automatically resolved to the appropriate specific context based on the user's current workspace state. To add dynamic context, click on one of the buttons below the prompt editor. We will soon move the buttons into the `@` mention menu as well. This powerful combination allows prompt authors to create templates that can intelligently access both explicitly defined context and contextually relevant information at runtime. ## Run prompts You can run prompts via: - Clicking the play icon next to a prompt in the Prompt Library list - From the **Prompts** dropdown in the Cody chat panel both in the editor and on the web However, prompts marked with the **Edit code** mode can only run from the IDE editor. You cannot run these prompts from the Prompt Library in the web UI. For example, the **document-code** built-in prompt can only run the IDE editor. ![run-prompt-web](https://storage.googleapis.com/sourcegraph-assets/Docs/run-prompt-web-2025.png) ## Promoted prompts Promoted prompts are supported in VS Code and Cody Web. **Site admins** can promote a prompt by enabling the **Promote prompt** checkbox. This setting allows admins to highlight prompts they want users to use. Promoted prompts are marked with an icon next to their name and appear at the top of the prompt list in the Cody chat. ![icon-recommended-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/recommended-prompts-icon-2025.png) Prompt Library replaces the default and custom commands in Cody. Custom Commands (legacy) have been deprecated and will no longer be supported. If you have custom commands, VS Code automatically detects them and notifies you to migrate them to the Prompts Library. There is a **Migrate commands** button in the Cody chat panel. Click it, and your custom commands will be migrated to the Prompts Library. Once migrated, you can run it like any other prompt. However, you **cannot** edit the migrated custom command in the Prompts Library.
# OpenCtx Context Providers

Use additional context sources from outside of your codebase by leveraging OpenCtx providers.

OpenCtx context providers are in the Experimental stage for all Cody users. Enterprise users can also use this, but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10). [OpenCtx](https://openctx.org/) is an open standard for bringing contextual info about code into your dev tools. Cody Free and Pro users can use OpenCtx providers to fetch and use context from the following sources: - [Webpages (via URL)](https://openctx.org/docs/providers/web) (enabled in Cody by default) - [Jira tickets](https://openctx.org/docs/providers/jira) - [Linear issues](https://openctx.org/docs/providers/linear-issues) - [Notion pages](https://openctx.org/docs/providers/notion) - [Google Docs](https://openctx.org/docs/providers/google-docs) - [Slack](https://openctx.org/docs/providers/slack) - [Storybook](https://openctx.org/docs/providers/storybook) - [Sourcegraph code search](https://openctx.org/docs/providers/sourcegraph-search) ## Enable OpenCtx context providers OpenCtx context providers are only supported with Cody VS Code extension. To try OpenCtx context providers with Cody, you must add to your VS Code extension settings. Go to Cody Settings, and check the box for **OpenCtx: Enable**. This will enable OpenCtx. You don't need the OpenCtx VS Code extension to use context fetching with OpenCtx. You should uninstall the extension before using this feature in Cody. For example, to use the [DevDocs provider](https://openctx.org/docs/providers/devdocs), add the following to your `settings.json`: ```json "openctx.providers": { "https://openctx.org/npm/@openctx/provider-devdocs": { "urls": ["https://devdocs.io/go/", "https://devdocs.io/angular~16/"] } }, ``` Please refer to the [context providers docs](https://openctx.org/) for instructions and examples of configuring other providers such as Confluence, Jira, GitHub, Slack, Notion, Linear Issues, Linear Docs, Google Docs, and more.
# Supported local Ollama models with Cody {/* Internal docs only. Offloading from our production docs for now. */} Compatibility with Ollama is currently in the Experimental stage and is available for Cody Free and Pro plans. The support is for Ollama is limited feel free to contact us for any questions or feedback. ## Cody Autocomplete with Ollama To get autocomplete suggestions from Ollama locally, follow these steps: - Install and run [Ollama](https://ollama.ai/) - Download one of the supported local models using `pull`. The `pull` command is used to download models from the Ollama library to your local machine. - `ollama pull deepseek-coder-v2` for [deepseek-coder](https://ollama.com/library/deepseek-coder-v2) - `ollama pull codellama:13b` for [codellama](https://ollama.ai/library/codellama) - `ollama pull starcoder2:7b` for [starcoder2](https://ollama.ai/library/starcoder2) - Update Cody's VS Code settings to use the `experimental-ollama` autocomplete provider and configure the right model: ```json "cody.autocomplete.advanced.provider": "experimental-ollama", "cody.autocomplete.experimental.ollamaOptions": { "url": "http://localhost:11434", "model": "deepseek-coder-v2" } ``` - Confirm Cody uses Ollama by looking at the Cody output channel or the autocomplete trace view (in the command palette) ## Cody chat with Ollama Chat model selector To generate chat with Ollama locally, follow these steps: - Download [Ollama](https://ollama.com/download) - Start Ollama (make sure the Ollama logo is showing up in your menu bar) - Select a chat model (model that includes instruct or chat, for example, [gemma:7b-instruct-q4_K_M](https://ollama.com/library/gemma:7b-instruct-q4_K_M)) from the [Ollama Library](https://ollama.com/library) - Pull (download) the chat model locally (for example, `ollama pull gemma:7b-instruct-q4_K_M`) - Once the chat model is downloaded successfully, open Cody in VS Code - Open a new Cody chat - In the new chat panel, you should see the chat model you've pulled in the dropdown list - Currently, you will need to restart VS Code to see the new models You can run `ollama list` in your terminal to see what models are currently available on your machine. ### Run Cody offline with local Ollama models You can use Cody with or without an internet connection. The offline mode does not require you to sign in with your Sourcegraph account to use Ollama. Click the button below the Ollama logo and you'll be ready to go. ![offline-cody-with-ollama](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-offline-ollama.jpg) You still have the option to switch to your Sourcegraph account whenever you want to use Claude, OpenAI, Gemini, etc. # Cody Capabilities

Cody offers a rich set of capabilities and features that help you write better code faster. Learn and understand more about Cody's features and core AI functionality in this section.

# Manage Cody Context

You can control and manage what context from your codebase is used by Cody. You can do this by using Cody Context Filters.

Cody Context Filters is available only for Enterprise users on all supported [clients](/cody/clients). ## Context Filters Admins on the Sourcegraph Enterprise instance can use the Cody Context Filters to determine which repositories Cody can use as the context in its requests to third-party LLMs. You can use Context Filters if you have: - A valid Cody Enterprise license running on Sourcegraph instance version `>=5.4.0` - Running the supported Cody client versions: VS Code `>=1.20.0` and JetBrains `>=6.0.0` - Setting the `cody-context-filters-enabled` feature flag to `true` Site admins can customize the `cody.contextFilters` field in the site configuration to specify which repositories Cody should `include` or `exclude`, using the following structure: ```json { // Optional. If defined, it must have at least one // field set (either `include` or `exclude`). "cody.contextFilters": { // Optional. If defined, it must have at least one item. "include": [ { // Required. Should follow the RE2 syntax. "repoNamePattern": "^github\\.com\\/sourcegraph\\/.*" } ], // Optional. If defined, it must have at least one item. "exclude": [ { // Required. Should follow the RE2 syntax. "repoNamePattern": ".*analytics.*" } ] } } ``` ## How `include` and `exclude` rules work The `include` and `exclude` rules define the repositories Cody can use as context. The rules can be defined in the following combination: ### `cody.contextFilters` field is not defined By default, Cody can access all repositories for context when making requests to third-party LLMs, with no restrictions on inclusion or exclusion. ### Only `include` rules are specified Cody is restricted to using content only from repositories whose names match the patterns specified in the `include` field. No repositories are explicitly excluded if no `exclude` rules are defined. The `include` field can also contain a catch-all pattern (e.g., a `regexp` that matches any string), allowing Cody to access content from all repositories. A single match in the `include` rules is enough for a repository to be included. For example: ```json { "cody.contextFilters": { // Only repositories whose names either start with "github.com/sourcegraph/" // or contain "cody" are allowed. "include": [ { "repoNamePattern": "^github\\.com\\/sourcegraph\\/.+" }, { "repoNamePattern": ".*cody.*" } ] } } ``` These `include` rules allow Cody only to utilize the repository matching the `regexp` with full access to fetch context. ### Only `exclude` rules are specified By default, all repositories are included unless specific `include` rules are defined. If **only** `exclude` rules are specified, Cody will not use content from any repository whose name matches at least one pattern in the `exclude` field. The `exclude` field can also include a catch-all condition, such as a `regexp` that matches any string. When such a condition is present, Cody is entirely restricted from accessing content from any repository. For example: ```json { "cody.contextFilters": { // All repositories are allowed except for "github.com/sourcegraph/cody-analytics" // or the ones containing "secret" in their name. "exclude": [ { "repoNamePattern": "^github\\.com\\/sourcegraph\\/cody-analytics$" }, { "repoNamePattern": ".*secret.*" } ] } } ``` #### Chat behavior when exclude rules are defined Some Cody features, such as using **Prompts**, will not work if the `exclude` rules are defined. They appear to be disabled in the Cody chat interface. If you try running any of these, you'll be prompted with an error message. However, Cody chat will still work; you can use it to ask questions. ### Both `include` and `exclude` rules are specified When requesting third-party LLMs, Cody can use content from a repository if its name matches any of the `include` patterns and does not match any of the `exclude` patterns. Thus, the `exclude` rules filter only the repositories allowed by the `include` rules. For example, ```json { "cody.contextFilters": { // All repositories starting with "github.com/sourcegraph/" are allowed "include": [ { repoNamePattern: "^github\\.com\\/sourcegraph\\/.+" } ], // except for "github.com/sourcegraph/cody-analytics" // and the ones containing "cody" in their name. "exclude": [ { "repoNamePattern": "^github\\.com\\/sourcegraph\\/cody-analytics$" }, { "repoNamePattern": ".*cody.*" } ] } } ``` In this case, Cody can access content from repositories whose names start with `github.com/sourcegraph/`. However, it excludes files from repositories with `cody` in their name. ## Cody Context Filters Compatibility Matrix Cody Context Filters work only on Sourcegraph versions `>=5.4.0`, VS Code `>=1.20.0` and JetBrains `>=6.0.0` for Enterprise users. Depending on the client type, here's a breakdown of versions supported and the behavior for unsupported versions: | **Client** | Client version | Sourcegraph `v<5.4.0` | Sourcegraph `v=5.4.0` | Sourcegraph `v=5.4.12303` | Sourcegraph `v>=5.4.0` | | ------------- | ------------------------- | --------------------- | --------------------- | ------------------------------- | ---------------------- | | **VS Code** | `< 1.16.X` | N/A | Cody not compatible | Respects policy, ask to upgrade | Not affected | | | `1.18.0 <` and `< 1.20.0` | N/A | Cody not compatible | Respects policy, ask to upgrade | Not affected | | | `>= 1.20.0` | N/A | Respects policy | Respects policy | Not affected | | **JetBrains** | `<= 5.5.9` | N/A | Cody not compatible | Respects policy, ask to upgrade | Not affected | | | `5.5.10 <=` and `< 6.0.0` | N/A | Cody not compatible | Respects policy, ask to upgrade | Not affected | | | `>= 6.0.0` | N/A | Respects policy | Respects policy | Not affected |
# Debug Code

Learn how Cody helps you identify errors in your code and provides code fixes.

Cody is optimized to identify and fix errors in your code. Its debugging capability and autocomplete suggestions can significantly accelerate your debugging process, increasing developer productivity. All Cody IDE extensions (VS Code, JetBrains) support code debugging and fixes capabilities. ## Use chat for code fixes When you encounter a code error, you can use the chat interface and ask Cody about it. You can paste the faulty code snippets directly in the chat window, and Cody will provide a fix. The suggestions can be a corrected code snippet you can copy and paste into your code. Or you can ask a follow-up question for additional context to help debug the code. Moreover, you can paste an error message in the chat and ask Cody to provide a list of possible solutions. Let's look at a simple example to understand how Cody can help you debug your code. The following code snippet should print the sum of two numbers. ```js function sum(a, b) { var result = a + b; console.log('The sum is: ' + $result); } sum(3 , 4); ``` When you try to `console.log` the `result`, it does not print the correct summed value. Cody can help you both identify the error and provide a solution to fix it. Let's debug the code snippet. Paste the code snippet inside the Cody chat window and ask Cody to fix it. In addition, Cody helps you reduce the chances of getting syntax and typo errors. The Cody IDE extensions provide context-aware suggestions based on your codebase, helping you avoid common mistakes and reduce debugging time. ## Detecting code smell Cody can detect early code smells to ensure coding best practices and quality and provide suggestions to improve your code. By detecting such potential errors early on, you can avoid scalability and code maintainability issues that might arise in the future. You can detect code smells by the **find-code-smells** prompt from the Prompts drop-down menu in the chat panel. If you want to refine your debugging process, you can create a new prompt from the Prompt Library and use it to debug your code. ## Code Actions Code Actions are available only in Cody VS Code extension. When you make a mistake while writing code, Cody's **Code Actions** come into play and a red warning triggers. Along with this, you get a lightbulb icon. If you click on this lightbulb icon, there is an **Ask Cody to fix** option. - Click the lightbulb icon in the project file - Select **Ask Cody to fix** option - **Cody is working** notice will appear and provide a quick fix that you can **Accept**, **Reject**, or **Open Diff** view to see the changes ![code-actions](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-code-actions-vscode-1124.png)
# Chat

Chat with the AI assistant in your code editor or via the Sourcegraph web app to get intelligent suggestions, code autocompletions, and contextually aware answers.

You can **chat** with Cody to ask questions about your code, generate code, and edit code. By default, Cody has the context of your open file and entire repository, and you can use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts. You can do it from the **chat** panel of the supported editor extensions ([VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains), [Visual Studio](/cody/clients/install-visual-studio)) or in the [web](/cody/clients/cody-with-sourcegraph) app. ## Prerequisites To use Cody's chat, you'll need the following: - [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing) - A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app ## How does chat work? Cody answers questions by searching your codebase and retrieving context relevant to your questions. Cody uses several methods to search for context, including Sourcegraph's native search and keyword search. Finding and using context allows Cody to make informed responses based on your code rather than being limited to general knowledge. When Cody retrieves context to answer a question, it will tell you which code files it reads to generate its response. Cody can assist you with various use cases, such as: - Generating an API call: Cody can analyze your API schema to provide context for the code it generates - Locating a specific component in your codebase: Cody can identify and describe the files where a particular component is defined - Handling questions that involve multiple files, like understanding data population in a React app: Cody can locate React component definitions, helping you understand how data is passed and where it originates ## Chat features There are several features that you can use to make your chat experience better. These features may vary depending on the [client](/cody/clients) you are using. You can learn more about the support for these functionalities in the [feature parity reference](/cody/clients/feature-reference#chat). ## Default context When you start a new Cody chat, the input window opens with a default `@-mention` context chips for the opened file and the current repository. ![context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/context-retrieval-repo-file-2025.png) At any point in time, you can edit these context chips or remove them entirely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new context source. When you have both a repository and files @-mentioned, Cody will search the repository for context while prioritizing the mentioned files. ## Add new context You can add new custom context by adding `@-mention` context chips to the chat. At any point, you can use `@-mention` a repository, file, line range, or symbol, to ask questions about your codebase. Cody will use this new context to generate contextually relevant code. ## OpenCtx context providers OpenCtx context providers are in the Experimental stage for all Cody VS Code users. Enterprise users can also use this but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10). [OpenCtx](https://openctx.org/) is an open standard for bringing contextual info about code into your dev tools. Cody Free and Pro users can use OpenCtx providers to fetch and use context from the following sources: - [Webpages](https://openctx.org/docs/providers/web) (via URL) - [Jira tickets](https://openctx.org/docs/providers/jira) - [Linear issues](https://openctx.org/docs/providers/linear-issues) - [Notion pages](https://openctx.org/docs/providers/notion) - [Google Docs](https://openctx.org/docs/providers/google-docs) - [Sourcegraph code search](https://openctx.org/docs/providers/sourcegraph-search) You can use `@-mention` web URLs to pull live information like docs. You can connect Cody to OpenCtx to `@-mention` non-code artifacts like Google Docs, Notion pages, Jira tickets, and Linear issues. ## LLM selection Cody allows you to select the LLM you want to use for your chat, which is optimized for speed versus accuracy. Cody Free and Pro users can select multiple models. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model. You can read about these supported LLM models [here](/cody/capabilities/supported-models#chat-and-commands). ![LLM-models-for-cody-free](https://storage.googleapis.com/sourcegraph-assets/Docs/llm-dropdown-options-free-pro-2025.png) ## Smart Apply and Execute code suggestions Cody lets you dynamically insert code from chat into your files with **Smart Apply**. Whenever Cody provides a code suggestion, you can click the **Apply** button. Cody will then analyze your open code file, find where that relevant code should live, and add a diff. For chat messages where Cody provides multiple code suggestions, you can apply each in sequence to go from chat suggestions to written code. Smart Apply also supports the executing of commands in the terminal. When you ask Cody a question related to terminal commands, you can now execute the suggestion in your terminal by clicking the `Execute` button in the chat window. ![smart-apply](https://storage.googleapis.com/sourcegraph-assets/Docs/smart-apply-2025.png) ## Chat history Cody keeps a history of your chat sessions. You can view it by clicking the **History** button in the chat panel. You can **Export** it to a JSON file for later use or click the **Delete all** button to clear the chat history. ## Prompts Cody offers quick, ready-to-use [prompts](/cody/capabilities/commands) for common actions to write, describe, fix, and smell code. Read more about [prompts](/cody/capabilities/commands) here. ## Ask Cody to write code Cody chat can also write code for your questions. For example, in VS Code, ask Cody to "write a function that sorts an array in ascending order". You are provided with code suggestions in the chat window and the following options for using the code. - The **Copy Code** icon to your clipboard and paste the code suggestion into your code editor - Insert the code suggestion at the current cursor location by the **Insert Code at Cursor** icon - The **Save Code to New File** icon to save the code suggestion to a new file in your project If Cody's answer isn't helpful, you can try asking again with a different context: - **Public knowledge only**: Cody will not use your own code files as context; it’ll only use knowledge trained into the base model. - **Current file only**: Re-run the prompt again using the current file as context. - **Add context**: Provides @-mention context options to improve the response by explicitly including files, symbols, remote repositories, or even web pages (by URL). The enhanced chat experience input can be accessed from the chat panel of the supported editor extensions (VS Code and JetBrains) and the web app. It combines light code search, AI-powered chat, and agentic capabilities into a unified developer interface. It's designed to accelerate the entire developer workflow by providing a more intuitive and powerful way to interact with code. ## Prerequisites To use Cody's chat, you'll need the following: - [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing) - A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app ## Key features The enhanced chat experience includes everything in the Free plan, plus the following: ## Smart search integration The smart search integration enhances Sourcegraph's chat experience by providing lightweight code search capabilities directly within the chat interface. This feature simplifies developer workflows by offering quick access to code search without leaving the chat environment. The integration delivers personalized search results ranked by your contribution history, with frequently accessed repositories appearing higher in results. Users can view code snippets with relevant context and open files directly in their editor. Search results automatically become available as context for follow-up queries, with flexible controls for selecting which results to include. While optimized for keyword-style queries and searching across a few repositories, this integration complements rather than replaces the full [Code Search](/code-search) product, which remains the recommended tool for comprehensive enterprise-wide code search. ## Context-aware responses Search results generated through smart search integration can be automatically used as context for follow-up queries. Here's what happens with each scenario: ### Search responses * Search results can be used directly as context for follow-up queries * Users can select which search results to include as context using checkboxes * By default, all search results are added as context * A context chip shows the number of search results being used (e.g., "10 code search results") * Users can remove the context chip if they don't want to use it for follow-ups ### Chat responses Executing terminal commands for additional context is an experimental feature. * Performs background searches for context * Retrieves full context from files, symbols, remote repos, and web pages * Can execute terminal commands (with permission) for additional context * Creates personal notes usable across chat sessions * Pulls in [OpenCtx](/cody/capabilities/openctx) providers for additional context ## How does chat work? The following is a general walkthrough of the chat experience: 1. The user enters a query in the chat interface 2. By default a user gets a chat response for the query 3. To get integrated search results, toggle to **Run as search** from the drop-down selector or alternatively use `Cmd+Opt+Enter` (macOS) 4. For search: - Displays ranked results with code snippets - Shows personalized repository ordering - Provides checkboxes to select context for follow-ups 5. For chat: - Delivers AI-powered responses - Can incorporate previous search results as context 6. Users can: - Switch between search and chat modes - Click on results to open files in their editor - Ask follow-up questions using selected context - Use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts
# Autocomplete

Learn how Cody helps you get contextually-aware autocompletion for your codebase.

Cody predicts what you're trying to write before you even type it. It offers single-line and multi-line suggestions based on the provided code context, ensuring accurate autocomplete suggestions. Cody autocomplete supports a [wide range of programming languages](/cody/faq#what-programming-languages-does-cody-support) because it uses LLMs trained on broad data. Code autocompletions are optimized for both server-side and client-side performance, ensuring seamless integration into your coding workflow. The **default** autocomplete model for Cody Free, Pro, and Enterprise users is **[DeepSeek V2](https://huggingface.co/deepseek-ai/DeepSeek-V2)**, which significantly helps boost both the responsiveness and accuracy of autocomplete. ## Cody's autocomplete capabilities The autocompletion model is designed to enhance speed, accuracy, and the overall user experience that offers: - **Increased speed and reduced latency**: The P75 latency is reduced by 350 ms, making the autocomplete function faster - **Improved accuracy for multi-line completions**: Completions across multiple lines are more relevant and accurately aligned with the surrounding code context - **Higher completion acceptance rates**: The average completion acceptance rate (CAR) is improved by more than 4%, providing a more intuitive user interaction ## How does autocomplete work? First, you'll need the following setup: - A Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise instance - A supported editor extension (VS Code, JetBrains, Visual Studio) The autocomplete feature is enabled by default on all IDE extensions, i.e., VS Code and JetBrains. Generally, there's a checkbox in the extension settings that confirms whether the autocomplete feature is enabled or not. In addition, some autocomplete settings are optionally and explicitly supported by some IDEs. For example, JetBrains IDEs have settings that allow you to customize colors and styles of the autocomplete suggestions. When you start typing, Cody will automatically provide suggestions and context-aware completions based on your coding patterns and the code context. These autocomplete suggestions appear as grayed text. Press the `Enter` or `Tab` to accept the suggestion. ## Configure autocomplete on an Enterprise Sourcegraph instance Users with admin access can only configure autocomplete settings. By default, a fully configured Sourcegraph instance picks a default LLM to generate code autocomplete. Custom models can be used for Cody autocomplete based on your specific requirements. To do so: - Go to the **Site admin** of your Sourcegraph instance - Navigate to **Configuration > Site configuration** - Here, edit the `completionModel` option inside the `completions` - Click the **Save** button to save the changes Cody supports and uses a set of models for autocomplete. Learn more about these [here](/cody/capabilities/supported-models#autocomplete). It's also recommended to read the [Enabling Cody on Sourcegraph Enterprise](/cody/clients/enable-cody-enterprise) docs. ## LLM models for autocomplete Cody uses a set of models for autocomplete. Learn more about these [here](/cody/capabilities/supported-models#autocomplete).
# Auto-edit

Auto-edit suggests code changes by analyzing cursor movements and typing. After you've made at least one character edit in your codebase, it begins proposing contextual modifications based on your cursor position and recent changes.

Auto-edit is currently supported in the VS Code extension with Sourcegraph v6.0+. It's available in Beta for Pro, Enterprise Starter and Enterprise users on Cody Gateway. Auto-edit requires Fireworks to be enabled as a provider. Enterprise customers without Fireworks enabled can [disable the feature flag](#auto-edit-access-for-enterprise-customers) ## Capabilities of auto-edit - Can automatically insert and delete text - Can modify code before and after the cursor position - Works with repetitive tasks, especially in test files - Can propose similar changes across multiple locations based on recent edits - Can handle complex refactoring operations like adding parameters and unpacking functions ## Enabling auto-edit Auto-edit is enabled by default for Cody Pro Enterprise Starter, and Enterprise users. You can opt out and switch back to **autocomplete** by selecting it from the suggestion mode in the Cody VS Code extension settings. Site admins can opt their organization out of the auto-edit feature by disabling it from their config settings. ### Auto-edit access for Enterprise customers Auto-edit is available for Enterprise customers with [Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway#sourcegraph-cody-gateway) access. Enabling the feature requires two steps: 1. Site administrators must: - Ensure the feature flag `cody-autoedit-experiment-enabled-flag` is enabled (enabled by default) - Add `fireworks::*` as an [allowed provider](https://sourcegraph.com/docs/cody/enterprise/model-configuration#model-filters) (see below) 2. Once enabled, auto-edit will become the default suggestion mode for all users 3. Users can optionally switch back to autocomplete from the Cody extension settings 4. Site admins can opt out of auto-edits using the `cody-autoedit-experiment-enabled-flag` feature flag The following example demonstrates how to add Fireworks as an allowed LLM provider: ```json "cody.enabled": true, "modelConfiguration": { "sourcegraph": { "modelFilters": { // Only allow "beta" and "stable" models. // Not "experimental" or "deprecated". "statusFilter": ["beta", "stable"], // Allow any models provided by Anthropic, OpenAI, Google and Fireworks. "allow": [ "anthropic::*", // Anthropic models "openai::*", // OpenAI models "google::*", // Google Gemini models "fireworks::*", // Open source models hosted by Sourcegraph ], } } } ``` ## How does auto-edit work? The system detects potential changes based on the following: - Cursor placement in the code - Recent changes made in similar contexts - Function usage patterns - Common refactoring patterns ## Auto-edit vs. Autocomplete In terms of feature-set and functionality, auto-edit and autocomplete have some key differences: | **Feature** | **Autocomplete** | **Auto-edit** | | ---------------------- | -------------------------------------- | -------------------------------------------------- | | **Text modification** | Can only insert text, not delete | Can both insert and delete text | | **Cursor position** | Only proposes content after the cursor | Can modify code before and after the cursor | | **Suggestion trigger** | Suggests on every character typed | Proposes changes based on context and recent edits | ## Use cases The auto-edit feature can help you with various repetitive tasks in your code: - **Function signature refactoring**: Automatically suggests adding error returns, new parameters, or changing return types across function definitions. For example, when you modify a function to return both a value and an error, auto-edit helps update the function signature. - **Call site updates**: When you change a function's signature, auto-edit detects all locations where the function is called and suggests necessary modifications to match the new signature. This includes updating parameter orders, adding error handling, and adjusting return value usage. - **Test file maintenance**: Helps with repetitive updates in test files, such as modifying test assertions, updating mock objects, or changing test data structures. Auto-edit recognizes patterns from your recent changes and suggests similar modifications across related tests. - **Parameter refactoring**: Assists in adding, removing, or reorganizing function parameters. When you unpack a function to handle more cases, auto-edit helps restructure the parameter list and suggests corresponding changes at call sites. - **Type system modifications**: Auto-edit identifies and suggests consistent changes across your codebase when updating type definitions or interfaces. This includes updating variable declarations, function parameters, and return types to maintain type consistency.
# Agentic chat

Learn about the agentic chat experience, an exclusive chat-based AI agent with enhanced capabilities.

Agentic chat (available in version 6.0) is currently in the Experimental stage for Cody Pro and Enterprise and is supported on VS Code, JetBrains, Visual Studio editor extensions and Web. Usage may be limited at this stage. Cody's agentic chat experience is an AI agent that can evaluate context and fetch any additional context (OpenCtx, terminal, etc.) by providing enhanced, context-aware chat capabilities. It extends Cody's functionality by proactively understanding your coding environment and gathering relevant information based on your requests before responding. These features help you get noticeably higher-quality responses. This agentic chat experience aims to reduce the learning curve associated with traditional coding assistants by minimizing users' need to provide context manually. It achieves this through agentic context retrieval, where the AI autonomously gathers and analyzes context before generating a response. ## Capabilities of agentic chat The agentic chat experience leverages several key capabilities, including: - **Proactive context gathering**: Automatically gathers relevant context from your codebase, project structure, and current task - **Agentic context reflection**: Review the gathered context to ensure it is comprehensive and relevant to your query - **Iterative context improvement**: Performs multiple review loops to refine the context and ensure a thorough understanding - **Enhanced response accuracy**: Leverages comprehensive context to provide more accurate and relevant responses, reducing the risk of hallucinations ## What can agentic chat do? Agentic chat can help you with the following: ### Tool Usage It has access to a suite of tools for retrieving relevant context. These tools include: - **Code Search**: Performs code searches - **Codebase File**: Retrieves the full content from a file in your codebase - **Terminal**: Executes shell commands in your terminal - **Web Browser**: Searches the web for live context - **OpenCtx**: Any OpenCtx providers could be used by the agent It integrates seamlessly with external services, such as web content retrieval and issue tracking systems, using OpenCtx providers. To learn more, [read the OpenCtx docs](/cody/capabilities/openctx). Terminal access is not supported on the Web. It currently only works with VS Code, JetBrains, and Visual Studio editor extensions. ## Terminal access Agentic chat can use the CLI Tool to request the execution of shell commands to gather context from your terminal. Its ability to execute terminal commands enhances its context-gathering capabilities. However, it’s essential to understand that any information accessible via your terminal could potentially be shared with the LLM. It's recommended not to request information that you don't want to share. Here's what you should consider: - **Requires user consent**: Agentic chat will pause and ask for permission each time before executing any shell command. - **Trusted workspaces only**: Commands can only be executed within trusted workspaces with a valid shell - **Potential data sharing**: Any terminal-accessible information may be shared with the LLM Commands are generated by the agent/LLM based on your request. Avoid asking it to execute destructive commands. ## Use cases Agentic chat can be helpful to assist you with a wide range of tasks, including: - **Improved response quality**: Helps you get better and more accurate responses than other LLMs, making up for the additional processing time for context gathering a non-issue - **Error resolution**: It can automatically identify error sources and suggest fixes by analyzing error logs - **Better unit tests**: Automatically includes imports and other missing contexts to generate better unit tests ## Enable agentic chat ### Getting agentic chat access for Pro users Pro users can find the agentic chat option in the LLM selector drop-down. ![agentic chat interface](https://storage.googleapis.com/sourcegraph-assets/Docs/agenti%20-chat.jpg) ### Getting agentic chat access for Enterprise customers Enterprise customers must opt-in to access this agentic chat feature (reach out to your account team for access). For the experimental release, agentic chat is specifically limited to using Claude 3.5 Haiku for the reflection steps and Claude 3.5 Sonnet for the final response to provide a good balance between quality and latency. Therefore, your enterprise instance must have access to both Claude 3.5 Sonnet and Claude 3.5 Haiku to use agentic chat. These models may be changed during the experimental phase to optimize for quality and/or latency. Additionally, enterprise users need to upgrade their supported client (VS Code, JetBrains, and Visual Studio) to the latest version of the plugin by enabling the following feature flags on their Sourcegraph Instance: - `agentic-chat-experimental` to get access to the feature - `agentic-chat-cli-tool-experimental` to allow [terminal access](#terminal-commands)
# Quickstart for code monitoring ## Introduction In this tutorial, we will create a new code monitor that monitors new appearances of the word "TODO" in your codebase. ## Creating a code monitor Prerequisite: Ensure [email notifications](/admin/observability/alerting#email) are configured in site configuration. 1. On your Sourcegraph instance, click the **Code monitoring** menu item at the top right of your page. Alternatively, go to `https://sourcegraph.example.com/code-monitoring` (where sourcegraph.example.com represents your unique Sourcegraph url). 2. Click the **Create new code monitor** button at the top right of the page. 3. Fill out the **Name** input with: "TODOs". 4. Under the **Trigger** section, click **When there are new search results**. 5. In the **Search query** input, enter the following search query: `TODO type:diff patternType:keyword`. (Note that `type:` and `patternType:` are required as part of the search query for code monitoring.) 1. You can click **Preview results** to see all previous additions or removals of TODO to your codebase. 2. Back in the code monitor form, click **Continue**. 3. Click **Send email notifications** under the **Actions** section. 4. Click **Done**. 5. Click **Create code monitor**. You should now be on `https://sourcegraph.example.com/code-monitoring`, and be able to see the TODO code monitor on the page. ## Sending a test email notification If you want to preview the email notification alerting you of a new result with TODO, follow these steps: 1. In the **Send email notifications** action, click "Send test email". 1. Within a few minutes, you should receive a test email from Sourcegraph with a preview of the email notification. If you want to test receiving an email with a real new result, follow these steps: 1. In any repository that's on your Sourcegraph instance (for purposes of this tutorial, we recommend a dummy or test repo that's not used), add `TODO` to any file. 1. Commit the change, and push it to your code host. 1. Within a few minutes, you should see an email from Sourcegraph with a link to the new result you just pushed. # Code monitoring Supported on [Enterprise](/pricing/enterprise) plans. Currently available via the Web app.

Keep on top of events in your codebase

Watch your code with code monitors and trigger actions to run automatically in response to events. ## Getting started ## Questions & Feedback We want to hear your feedback! [Share your thoughts](mailto:feedback@sourcegraph.com)
# Setting up Webhook notifications Webhook notifications provide a way to execute custom responses to a code monitor notification. They are implemented as a POST request to a URL of your choice. The body of the request is defined by Sourcegraph, and contains all the information available about the cause of the notification. ## Prerequisites - You must not have have the setting `experimentalFeatures.codeMonitoringWebHooks` disabled in your user, org, or global settings. - You must have a service running that can accept the POST request triggered by the webhook notification ## Creating a webhook receiver A webhook receiver is a service that can accept an HTTP POST request with the contents of the webhook notification. The receiver must be reachable from the Sourcegraph cluster using the URL that is configured below. The HTTP POST request sent to the receiver will have a JSON-encoded body with the following fields: - `monitorDescription`: The description of the monitor as configured in the UI - `monitorURL`: A link to the monitor configuration page - `query`: The query that generated `results` - `results`: The list of results that triggered this notification. Contains the following sub-fields - `repository`: The name of the repository the commit belongs to - `commit`: The commit hash for the matched commit. - `diff`: The matching diff in unified diff format. Only set if the result is a diff match. - `matchedDiffRanges`: The character ranges of `diff` that matched `query`. Only set if the result is a diff match. - `message`: The matching commit message. Only set if the result is a commit match. - `matchedMessageRanges`: The character ranges of `message` that matched `query`. Only set if the result is a commit match. Example payload: ```json { "monitorDescription": "My test monitor", "monitorURL": "https://sourcegraph.com/code-monitoring/Q29kZU1vbml0b3I6NDI=?utm_source=", "query": "repo:camdentest -file:id_rsa.pub BEGIN", "results": [ { "repository": "github.com/test/test", "commit": "7815187511872asbasdfgasd", "diff": "file1.go file2.go\n@ -97,5 +97,5 @ func Test() {\n leading context\n+matched added\n-matched removed\n trailing context\n", "matchedDiffRanges": [ [ 66, 73 ], [ 91, 98 ] ] }, { "repository": "github.com/test/test", "commit": "7815187511872asbasdfgasd", "message": "summary line\n\nsample\ncommit\nmessage\n", "matchedMessageRanges": [ [ 15, 19 ] ] } ] } ``` ## Configuring a code monitor to send Webhook notifications 1. In Sourcegraph, click on the "Code Monitoring" nav item at the top of the page. 1. Create a new code monitor or edit an existing monitor by clicking on the "Edit" button next to it. 1. Go through the standard configuration steps for a code monitor and select action "Call a webhook". 1. Paste your webhook URL into the "Webhook URL" field. 1. Click on the "Continue" button, and then the "Save" button. # Start monitoring your code This page lists code monitors that are commonly used and can be used across most codebases. ## Watch for consumers of deprecated endpoints ``` f:\.tsx?$ patterntype:regexp fetch\(['"`]/deprecated-endpoint ``` If you’re deprecating an API or an endpoint, you may find it useful to set up a code monitor watching for new consumers. As an example, the above query will surface fetch() calls to `/deprecated-endpoint` within TypeScript files. Replace `/deprecated-endpoint` with the actual path of the endpoint being deprecated. ## Get notified when a file changes ``` patterntype:regexp repo:^github\.com/sourcegraph/sourcegraph$ file:SourcegraphWebApp\.tsx$ type:diff ``` You may want to get notified when a given file is changed, regardless of the diff contents of the change: the above query will return all changes to the `SourcegraphWebApp.tsx` file on the `github.com/sourcegraph/sourcegraph` repo. ## Get notified when a specific function call is added ``` repo:^github\.com/sourcegraph/sourcegraph$ type:diff select:commit.diff.added Sprintf ``` You may want to monitor new additions of a specific function call, for example a deprecated function or a function that introduces a security concern. This query will notify you whenever a new addition of `Sprintf` is added to the `sourcegraph/sourcegraph` repository. This query selects all diff additions marked as "+". If a call of `Sprintf` is both added and removed from a file, this query will still notify due to the addition. # Slack notifications for code monitors You can set up [code monitors](/code_monitoring) to send notifications about new matching search results to Slack channels. ## Requirements - You must have permission to create apps in your organization's Slack workspace. ## Usage 1. In Sourcegraph, click on the "Code Monitoring" nav item at the top of the page. 1. Create a new code monitor or edit an existing monitor by clicking on the "Edit" button next to it. 1. Go through the standard steps for a code monitor (if it's a new one) and select the action **Send Slack message to channel**. 1. Paste your webhook URL into the "Webhook URL" field. (See "[Creating a Slack incoming webhook URL](#creating-a-slack-incoming-webhook-url)" below for detailed instructions.) 1. Click on the "Continue" button, and then the "Save" button. ### Creating a Slack incoming webhook URL 1. Go to https://api.slack.com/apps and sign in to your Slack account if necessary. 1. Click on the "Create an app" button. 1. Create your app "From scratch". 1. Give your app a name and select the workplace you want notifications sent to. # How-tos * [Starting points](/code_monitoring/how-tos/starting_points) * [Setting up Slack notifications](/code_monitoring/how-tos/slack) * [Setting up Webhook notifications](/code_monitoring/how-tos/webhook) # Explanations * [Core concepts](/code_monitoring/explanations/core_concepts) * [Best practices](/code_monitoring/explanations/best_practices) # Core concepts Code monitors allow you to keep track of and get notified about changes in your code. Some use cases for code monitors include getting notifications for potential secrets, anti-patterns, or common typos committed to your codebase. Code monitors are made up of two main elements: **Triggers** and **Actions**. ## Triggers A _trigger_ is an event which causes execution of an action. Currently, code monitoring supports one kind of trigger: "When new search results are detected" for a particular search query. When creating a code monitor, users will be asked to specify a query as part of the trigger. Sourcegraph will run the search query over every new commit for the searched repositories, and when new results for the query are detected, a trigger event is emitted. In response to the trigger event, any _actions_ attached to the code monitor will be executed. **Query requirements** A query used in a "When new search results are detected" trigger must be a diff or commit search. In other words, the query must contain `type:commit` or `type:diff`. This allows Sourcegraph to detect new search results periodically. ## Actions An _action_ is executed in response to a trigger event. Currently, code monitoring supports three different actions: * Sending a notification email to the owner of the code monitor * Sending a Slack message to a preconfigured channel (Beta) * Sending a webhook event to an endpoint of your choosing (Beta) ## Current flow To put it all together, a code monitor has a flow similar to the following: A user creates a code monitor, which consists of: * a name for the monitor * a trigger, which consists of a search query to run periodically, * and an action, which is sending an email, sending a Slack message, or sending a webhook event Sourcegraph runs the query periodically over new commits. When new results are detected, a notification will be sent with the configured action. It will either contain a link to the search that provided new results, or if the "Include results" setting is enabled, it will include the result contents. # Best practices There are some best practices we recommend when creating code monitors. ## Privacy and visibility ### Do not include confidential information in monitor names Every code monitor has a name that will be shown wherever the monitor is referenced. In notification actions this name is likely to be the only information about the event, so it’s important for identifying what was triggered, but also has to be “safe” to expose in plain text emails. ### Do not include results when the notification destination is untrusted Each code monitor action has the ability to include the result contents when sending a notification. This is often convenient because it lets you immediately see which results triggered the notification. However, because the result contents include the code that matched the search query, they may contain sensitive information. Care should be taken to only send result contents if the destination is secure. For example, if sending the results to a Slack channel, every user that can view that channel will also be able to view the notification messages. The channel should be properly restricted to users who should be able to view that code. ## Scale Code monitors have been designed to be performant even for large Sourcegraph instances. There are no hard limits on the number of monitors or the volume of code monitored. However, depending on a number of factors such as the number of code monitors, the number of repos monitored, the frequency of commits, and the resources allocated to your instance, it's still possible to hit soft limits. If this happens, your code monitor will continue to work reliably, but it may execute more infrequently. # Quickstart for Code Insights Get started and create your first [code insight](/code_insights/) in 5 minutes or less. ## Introduction In this guide, you'll create a Sourcegraph code insight that tracks the number of `TODOs` that appear in parts of your codebase. For more information about Code Insights see the [Code Insights](/code_insights/) documentation. ## Requirements - You are a Sourcegraph enterprise customer. (Want code insights but aren't enterprise? [Let us know](mailto:feedback@sourcegraph.com).) - Your Sourcegraph instance has at least 1 repository. (See "[Quickstart](/#quick-install)" on how to setup a Sourcegraph instance.) - Your Sourcegraph instance is deployed via [Docker Compose](/admin/deploy/docker-compose/) or [Kubernetes](/admin/deploy/kubernetes/). - You are running Sourcegraph version 3.31.1 (August 2021 release) or later. - Note: If you're on Sourcegraph version 3.24 to 3.28, you can instead follow [this gist](https://gist.github.com/Joelkw/f0582b164578aabc3ac936dee43f23e0) to create an insight. Due to the early stage of the product, it's more likely you'll run into trouble, though, so we recommend that you either upgrade your Sourcegraph or reach out to your Sourcegraph reps for help. ## Enable Code Insights ### 1. [If need be] Enable the experimental feature flag **If you're on Sourcegraph version 3.31 or earlier** and you don't already see the "Insights" item in your main nav bar, you'll need to add the following to either your Sourcegraph user settings `sourcegraph.example.com/users/[username]/settings` or organization settings `sourcegraph.example.com/organizations/[your_org]/settings` (and _not_ in your site configuration settings): ```json "experimentalFeatures": { "codeInsights": true }, "extensions": { "sourcegraph/code-stats-insights": true, "sourcegraph/search-insights": true } ``` If you put this in your organization settings, everyone on your Sourcegraph insights will be able to see the "Insights" navbar menu item and create their own code insights. If you put the flag in your user settings, only you will have those abilities. (Enabling code insights organization-wide doesn't mean that other users can automatically see the code insights you create, however – you can control that visibility per individual insight.) ### 2. Visit your example.sourcegraph.com/insights page and select "+ Create insight" ### 3. On the insight type selection page, select "Track changes" This creates a code insight tracking an arbitrary input that you could run a Sourcegraph search for. Your other options are to: * [create a "Detect and track" insight](/code_insights/explanations/automatically_generated_data_series) to automatically generate your data series according to capture group matching (3.35+). * [create a language-based insight](/code_insights/language_insight_quickstart) to show you language breakdown in your repositories. ### 4. Select the repositories you want to search If you want an insight running over a specific amount of repositories, enter the repositories in the repository URL format, like `github.com/sourcegraph/sourcegraph`. Separate multiple repositories with a comma. The form field will validate that you've entered the repository correctly. If you want to run an insight over all repositories, instead check the box to do so (available in Sourcegraph 3.31.1 and later). If you otherwise want to exclude specific repositories, you can do so after creating the insight by using filters (step 10). From Sourcegraph 4.5 you are able to define the repositories you want your insight to run over using a Sourcegraph search query. [Read the reference to learn more](/code_insights/references/repository_scope). ### 5. Define a data series to track the incidence of `TODO` A data series becomes a line on your graph. You can **Name** this data series something like `TODOs count`. To track the incidence of TODOs, you can set your **Search query** to be simply `TODO`. You can also select the color of your data series. ### 6. Add a title to the insight Enter a descriptive **Title** for the chart, like `Count of TODOs in [repository name]`. ### 7. Set the distance between data points Code insights give you twelve datapoints for each data series on insight creation. Setting it to one month means you'll see the results over the last year. ### 8. Click "create code insight" and view your insight. You'll be taken to the `example.sourcegraph.com/insights` page and can view your insight. ### 9. Filter your insight to explore it further Click the filter button in the top right of an insight card to open the filters panel. This allows you to filter the insight down to a subset of repositories through inclusion or exclusion using regular expressions. For more details, see [How to filter an insight](/code_insights/how-tos/filtering_an_insight). # Quickstart for Language Code Insights Get started and create your first [language code insight](/code_insights/) in 5 minutes or less. ## Introduction > This quickstart guide assumes that **you have already completed [step 1, enabling the feature flag](/code_insights/quickstart#1-enable-the-experimental-feature-flag)**, on the main code insights quickstart guide. In this guide, you'll create a Sourcegraph language code insight that shows the percentage of lines of code in a repository by language. For more information about Code Insights see the [Code Insights](/code_insights/) documentation. ### 1. Visit your Sourcegraph instance /Insights page and select "+ Create new insight" If you don't see the /Insights page you need to [enable code insights](quickstart#1-enable-the-experimental-feature-flag). ### 2. On the insight type selection page, select "Create language usage insight" This creates a code insight tracking how many lines of code you have in each language. If you are more interested tracking the historical or future result count of an arbitrary Sourcegraph search, [follow this tutorial](/code_insights/quickstart) instead. ### 3. Once on the "Set up new language usage insight" form fields page, enter the repository you want to analyze. Enter repositories in the repository URL format, like `github.com/sourcegraph/docs`. We recommend a small repository so that you get a quick result. The form field will validate that you've entered the repository correctly. In the current version, you can only set up a language insight for one repository at a time. (Want us to prioritize the ability to analyze multiple repositories in one pie chart? [Please do let us know](mailto:feedback@sourcegraph.com).) ### 4. Title your insight Title your language insight, generally something like the repository name or `Language usage in RepositoryName`. ### 5. Set the 'Other' category threshold This determines below what % the insight groups all other languages into an 'Other' languages category. Example: if the Threshold is set to 3%, and 2% of your code is in python and 2% of your code is in ruby, then both will be grouped into 'Other' and the value for 'Other' will be 4%. ### 6. Click "create code insight" to view and save your insight You'll be taken to the sourcegraph.example.com/insights page and can view your insight. # Code Insights Supported on [Enterprise](/pricing/enterprise) plans. Currently available via the Web app.

Anything you can search, you can track and analyze

Code Insights reveals high-level information about your codebase, based on both how your code changes over time and its current state. Code Insights is based on our universal code search, making it precise and configurable. Track anything that can be expressed with a Sourcegraph search query: migrations, package use, version adoption, code smells, codebase size and much more, across 1,000s of repositories. Code Insights will backfill years of historical data from your version control, so you can immediately reveal current trends and baselines.
# Search results aggregations use cases and recipes Here are some common use cases for the [in-search-results aggregations](/code_insights/explanations/search_results_aggregations) powered by code insights. ## Popular ### What versions of Go are we using most? See all the go versions in your codebase (group by capture group) ```sgquery file:go\.mod$ /go\s*(\d\.\d+)/ ``` ### What are the open source licenses most used in our codebase? See all the licenses included, by frequency (group by capture group) ```sgquery file:package.json /"license":\s(.*),/ ``` ### Which repositories use a specific internal library the most? See which repositories import a library (group by repository) ```sguqery from '@sourcegraph/wildcard' ``` ### Which directories have the longest eslint ignore file? See which files have the most linter override rules within a repository (group by file) ```sgquery file:^\.eslintignore /.\n/ repo:^github\.com/sourcegraph/sourcegraph$ ``` ### Who knows most about a library or component? See who has added the most uses of a component to a specific repository in the last three months ```sgquery nodeComponent type:diff select:commit.diff.added repo:sourcegraph/sourcegraph$ after:"3 months ago" ``` ## By capture group ### What versions of log4j exist in our codebase? See all the different subversions of log4j present in your code ```sgquery lang:gradle /org\.apache\.logging\.log4j['"].*?(2\.\d+\.\d+)/ ``` ### What breaks most commonly? See what topics most frequently appear in "fix [x]" commit messsages ```sgquery type:commit repo:^github\.com/sourcegraph/sourcegraph$ after:"5 days ago" /Fix (\\w+)/ ``` ### What are the most common email addresses we direct users to? See every email address hardcoded, by frequency ```sgquery /(\w+)\@sourcegraph\.com/ ``` ### How can we see all our different tracer calls to remove unnecessary ones or encourage proper usage? See all your tracer calls to track the growth of, or minimize spend on, tools like Datadog. ```sgquery /tracer\.trace\(([\s"'\w@\/:^.#,+-=]+)\)/ ``` ## By repository ### Which repositories use a specific internal library the most? See which repositories import a library ```sguqery /from\s'\@sourcegraph\/wildcard/ ``` ### Which teams (repositories) have the most usages of a vulnerable function or library? ```sgquery vulnerableFunc( ``` ### Which repositories have the longest top-level eslint ignore files? See which repositories are using the most linter overrides ```sgquery file:^\.eslintignore /.\n/ ``` ## By file ### Which files should we migrate first? See which files have the most usage of a library you want to deprecate, such as the log15 library ```sgquery repo:^github\.com/sourcegraph/sourcegraph$ /log15\.(?:Debug|Info|Warn|Error)/ ``` ### Which are our biggest package.json files? See which repositories have the most scripts or dependencies ```sgquery file:package\.json , ``` ### Which directories have the longest eslint ignore file? See which files have the most linter override rules within a repository ```sgquery file:^\.eslintignore /.\n/ repo:^github\.com/sourcegraph/sourcegraph$ ``` ## By author ### Who knows most about a library or component? See who has added the most uses of a component to a specific repository in the last three months ```sgquery nodeComponent type:diff select:commit.diff.added repo:sourcegraph/sourcegraph$ after:"3 months ago" ``` ### Who worked on a recent migration? See who most often had commits mentioning what you migrated away from (for example: migrating off bootstrap) ```sgquery bootstrap type:commit r:sourcegraph/sourcegraph$ after:"3 months ago" ``` # Requirements Code Insights has requirements for the Sourcegraph server version, its deployment type, and its connected code hosts. ## Sourcegraph server While the latest version of Sourcegraph server is always recommended: - Version 3.28 is the minimum version required to use Code Insights over individual repositories - Version 3.31.1 is the minimum version required to use Code Insights over all repositories ## Sourcegraph deployment You can only use Code Insights on a [Docker Compose](/admin/deploy/docker-compose/) or [Kubernetes](/admin/deploy/kubernetes/) Sourcegraph deployment. ## Code hosts Sourcegraph Code Insights is compatible with any [Sourcegraph-compatible code host](/admin/repo/), except: * Perforce repositories making use of sub-repo permissions are not supported # Code Insights repository scope A Code Insight runs on a list of repositories as specified on insight creation. The scope options are: * Manually specify a list of repositories * Run the insight over all repositories (Sourcegraph 3.31.1+). * From Sourcegraph 4.5 this is achieved through a `repo:.*` search query. * Run the insight over repositories as returned from a repository search query (Sourcegraph 4.5+) * This replaces the "Run your insight over all repositories" checkbox in prior versions ## Using the repository search query box ![Code Insights repository search box with a query for repo:sourcegraph](https://storage.googleapis.com/sourcegraph-assets/docs/images/code_insights/create_insight_repo_selection.png) The repository search query box allows you to search for repositories on your Sourcegraph instance using standard Sourcegraph `repo` filters, as well as boolean operators. Some example use cases might be: * I want my insight to run over all the repositories in the `sourcegraph` organisation, but not the `handbook` repository ```sgquery repo:sourcegraph/* -repo:sourcegraph/handbook$ ``` * I want my insight to run over all my repositories that have `github-actions` ```sgquery repo:has.file(github-actions) ``` The repository search box functions as the Sourcegraph search box, so it will suggest repository names as you type. ### Refining and previewing your repositories After writing your repository search query, the Code Insights creation UI will display how many repositories the query has resolved. If this number is unexpected, you can preview the repositories using the `Preview results` link. > NOTE: Repositories will include archived repositories and forks by default. ## How is the list of repositories resolved? If you are using a search query to define the list of repositories to run your insight over, then: 1. On insight creation the list of repositories that matches your search query is fetched. All the historical searches that are used to backfill your insight are ran against this unchanged list of repositories. 2. Every newer point added to your insight will then fetch results using (your_repo_search_query) (your_insight_search_query), so the repositories will be resolved against the global state of your instance. * For example, if you have a repo query for `repo:docs or repo:handbook` and a query for `lang:Markdown TODO`, every point will fetch results for the following query: ```sgquery (repo:docs or repo:handbook) (lang:Markdown TODO) ``` # Licensing and Limited Access ## License Instances need a license key with the `code-insights` tag to have full access to Code Insights features, or they need to be on the new 2022 "Business" or "Enterprise" plans. ## Limited Access If an instance does not have full access via the correct license key, then at most, an Enterprise plan instance can have a maximum of two global code insights for "free" without having a license. The in-search aggregations feature that appears on the search UI is available to all users on any license, but future features, like saving those aggregations to dashboards, would require an insights-including license. # References The following is a list of reference documents for Code Insights: - [Common use cases and recipes](/code_insights/references/common_use_cases) - [Common reasons code insights may not match search results](/code_insights/references/common_reasons_code_insights_may_not_match_search_results) - [Incomplete data points](/code_insights/references/incomplete_data_points) - [Licensing and limited access](/code_insights/references/license) - [Managing code insights with the API](/api/graphql/managing-code-insights-with-api) - [Requirements](/code_insights/references/requirements) - [Code Insight repository scope](/code_insights/references/repository_scope) # Incomplete data points There are a few cases when a Code Insight may return incomplete data. In all of these cases, if data is returned at all, it will be an undercount. See the below situations for tips on avoiding and troubleshooting these errors. ## Search Queries This guide applies to all types of Code Insights that use search queries. Language Stats Insights do not use search queries. ## Identify affected repositories Through the Code Insights you can only see an aggregated warning for incomplete datapoints. If you're running the Code Insight with more than one repository, you may want to identify which repositories are causing incomplete datapoints. To identify affected repositories you first need the series ID. Go to your insights dashboard, and click on the hamburger menu in the top right of your insight's widget. Click on "Get shareable link". It may look like the one below. The last part is the ID. ``` https://test.sourcegraph.com/insights/aW5zaWdodF92aWV3OiIyZ1ZmQzMxMjEwRGhKVkxvc1YybnBqbEduYnUi ``` With the ID, you can now use the GraphQL API Console through your user settings page, or navigate to `/api/console` on your Sourcegraph instance. Paste the GraphQL query below into the query field, and replace `MY_SERIES_ID` with the ID you copied from above. ``` { insightViews(id: "MY_SERIES_ID") { nodes { repositoryDefinition { ...on RepositorySearchScope { search } } dataSeries { status { incompleteDatapoints { time ...on TimeoutDatapointAlert { __typename repositories { name } } ...on GenericIncompleteDatapointAlert { __typename repositories { name } } } } } } } } ``` Running this query will give you a list of incomplete datapoints along with the repositories that are causing them. You can then follow the other recommendations on this page to address issues for those repositories. ## Timeout errors For searches that take a long time to complete, it's possible for them to timeout before the search ends, and before we can record the data value. To address this, try to minimize or avoid cases where your insight data series: 1. Runs over extra large sets of repositories (scope your insight further to fewer repositories) 1. Uses many boolean combinations (consider splitting into multiple data series) 1. Runs a complex search over an especially large monorepo (consider optimizing your search query to be more specific or include more filters, like `lang:` or `file:`) In addition: 1. Timeout errors on points that have been backfilled before the creation date of the insight are more likely to occur on single, large repositories, because backfill points are calculated by running many searches, repository by repository, individually. 1. Timeout errors on points that have been snapshot after the creation date of the insight are more likely to occur on insights running complex searches over large numbers of repositories, because snapshot points are calculated by running a single global search against the current index. You can read more about this case in our [limitations](/code_insights/explanations/current_limitations_of_code_insights#accuracy-considerations-for-an-insight-query-returning-a-large-result-set). If the data is available, the error alert will inform you which times the search has timed out. ## Strategies for very large repositories When dealing with large repositories, several strategies can help identify and manage search limitations effectively. The goal is to find a query that can execute successfully, and then ramp up complexity until we find the breaking point. ### Use Code Search to test your query You can use Code Search to verify if the query is able to complete within the given timeout. Once a query was executed the results may be indexed and you need to choose a different commit or date to achieve comparable results to Code Insights. #### Unlimited results Code Search limits the number of results by default. Code Insights however needs to count through all the results. Add `count:all` to your query to get comparable results. #### Picking the right commit When Code Insights runs a search query, it will do so for 12 commits spread out over the configured time range. This unindexed search can take longer the further back in time the search goes. To test that the slowest search will succeed in time, we recommend using the `rev:at.time(...)` (available from version 5.4.0) with the time range that you selected. E.g. if your Code Insight looks at the last 2 years you should use `rev:at.time(2y)`. For example the Code Insights query `file:.*\.md hello repo:^github\.com/my_org/my_repo count:all` should be written as `context:global file:.*\.md hello repo:^github\.com/my_org/my_repo count:all rev:at.time(2y)` in Code Search. If your Sourcegraph instance is on a version older than 5.4.0, you can pick a commit sha from e.g. 2 years ago. Here the query `file:.*\.md hello repo:^github\.com/my_org/my_repo count:all` becomes `context:global file:.*\.md hello repo:^github\.com/my_org/my_repo@my_commit_sha count:all`. #### Timeout If the query fails with a timeout before one minute has passed, add the parameter `timeout:1m`. ### Precise queries compute faster If your query is not able to compute results in a reasonable time, you can try to reduce the number of results returned by the query. For example, if you want to track the version of a NPM dependency in your code base, searching for `my_library file:package.json` will compute much faster because there are less files to look at and fewer results to return. We recommend to make your query as precise as possible and reduce the number of results until you reach a query that is able to compute fast enough. Here are some tips: - Search only files with a particular ending. E.g. use `file:.*\.md` to search for files with the `.md` ending. - Search for files with a certain language. E.g. use `lang:javascript` to search for all JavaScript files. Please note that this can be slower than the file ending filter, but may be necessary for ambiguous file endings (e.g. `.m` is used for Objective-C and Matlab). - Put quotes around literal terms, unless you want to search for multiple keywords. E.g. searching for `"hello world"` will only yield results where both words are connected by a whitespace, but `hello world` will yield results where either word appears. To learn more about writing precise queries, see our [search query syntax](/code-search/queries). ### Increase the timeout By default, search queries have a one minute timeout. This value is capped by the setting `search.limits.maxTimeoutSeconds` which by default is also one minute. Your site admin can change this value to increase the maximum timeout. Once it is increased, you can use the search parameter `timeout:` to give the query more time to run. Example: ``` timeout:10m ``` Note that very long searches can have a negative impact on performance, so it's important to use this parameter with caution. ## Other errors For other errors, please reach out to our support team through your usual channels or at support@sourcegraph.com. # Common Code Insights use cases and recipes Here are some common use cases for Code Insights and example data series queries you could use. For all use cases, you can also explore your insight by [filtering repositories in real time](/code_insights/how-tos/filtering_an_insight) or add any [Sourcegraph search filter](/code-search/queries/language#search-pattern) to the data series query to filter by language, directory, or content. Currently, the sample queries using commit and diff searches are only supported for insights running over explicit lists of specific repositories. *The sample queries below make the assumption you [do not want to search fork or archived](/code_insights/references/common_reasons_code_insights_may_not_match_search_results#not-including-fork-no-and-archived-no-in-your-insight-query) repositories. You can include those flags if you do.* ## Popular ### Terraform versions Detect and track which Terraform versions are present or most popular in your codebase ```sgquery app.terraform.io/(.*)\n version =(.*)1.1.0 patternType:regexp lang:Terraform ``` ```sgquery app.terraform.io/(.*)\n version =(.*)1.2.0 patternType:regexp lang:Terraform ``` ### Global CSS to CSS modules Tracking migration from global CSS to CSS modules ```sgquery select:file lang:SCSS -file:module patterntype:regexp ``` ```sgquery select:file lang:SCSS file:module patterntype:regexp ``` ### Vulnerable and fixed Log4j versions Confirm that vulnerable versions of log4j are removed and only fixed versions appear ```sgquery lang:gradle org\.apache\.logging\.log4j['"] 2\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)(\.[0-9]+) patterntype:regexp ``` ```sgquery lang:gradle org\.apache\.logging\.log4j['"] 2\.(17)(\.[0-9]+) patterntype:regexp ``` ### Yarn adoption Are more repos increasingly using yarn? Track yarn adoption across teams and groups in your organization ```sgquery select:repo file:yarn.lock ``` ### Java versions Detect and track which Java versions are most popular in your codebase *Uses the [detect and track](/code_insights/explanations/automatically_generated_data_series) capture groups insight type* ```sgquery file:pom\.xml$ (.*) ``` ### Linter override rules A code health indicator for how many linter override rules exist ```sgquery file:^\.eslintignore .\n patternType:regexp ``` ### Language use over time Track the growth of certain languages by file count ```sgquery select:file lang:TypeScript ``` ```sgquery select:file lang:JavaScript ``` ### Pinned vs Unpinned Docker Base Images Track how many unpinned images exist relative to pinned images ```sgquery ^FROM (\w+\/)?\w+:latest($|\s) file:Dockerfile patternType:regexp ``` ```sgquery ^FROM (\w+\/)?\w+:latest@sha file:Dockerfile patternType:regexp ``` ## Migration ### Config or docs file How many repos contain a config or docs file in a specific directory ```sgquery select:repo file:docs/*/new_config_filename ``` ### “blacklist/whitelist” to “denylist/allowlist” How the switch from files containing “blacklist/whitelist” to “denylist/allowlist” is progressing ```sgquery select:file blacklist OR whitelist ``` ```sgquery select:file denylist OR allowlist ``` ### Global CSS to CSS modules Tracking migration from global CSS to CSS modules ```sgquery select:file lang:SCSS -file:module patterntype:regexp ``` ```sgquery select:file lang:SCSS file:module patterntype:regexp ``` ### Python 2 to Python 3 How far along is the Python major version migration ```sgquery #!/usr/bin/env python3 ``` ```sgquery #!/usr/bin/env python2 ``` ### React Class to Function Components Migration What's the status of migrating to React function components from class components ```sgquery patternType:regexp const\s\w+:\s(React\.)?FunctionComponent ``` ```sgquery patternType:regexp extends\s(React\.)?(Pure)?Component ``` ## Adoption ### New API usage How many repos or teams are using a new API your team built ```sgquery select:repo ourApiLibraryName.load ``` ### Yarn adoption Are more repos increasingly using yarn? Track yarn adoption across teams and groups in your organization ```sgquery select:repo file:yarn.lock ``` ### Frequently used databases Which databases we are calling or writing to most often ```sgquery redis\.set patternType:regexp ``` ```sgquery graphql\( patternType:regexp ``` ### Large or expensive package usage Understand if a growing number of repos import a large/expensive package ```sgquery select:repo import\slargePkg patternType:regexp ``` ### React Component use How many places are importing components from a library ```sgquery from '@sourceLibrary/component' patternType:keyword ``` ### CI tooling adoption How many repos are using our CI system ```sgquery file:\.circleci/config.yml select:repo ``` ## Deprecation ### CSS class The removal of all deprecated CSS class ```sgquery deprecated-class ``` ### Icon or image The removal of all deprecated icon or image instances ```sgquery 2018logo.png ``` ### Structural code pattern Deprecating a structural code pattern in favor of a safer pattern, like how many tries don't have catches ```sgquery try {:[_]} catch (:[e]) { } finally {:[_]} lang:java patternType:structural ``` ### Tooling The progress of deprecating tooling you’re moving off of ```sgquery deprecatedEventLogger.log ``` ### Var keywords Number of var keywords in the code base (ES5 deprecation) ```sgquery (lang:TypeScript OR lang:JavaScript) var ... = patterntype:structural ``` ### Consolidation of Testing Libraries Which React test libraries are being consolidated ```sgquery from '@testing-library/react' ``` ```sgquery from 'enzyme' ``` ## Versions and patterns These examples are all for use with the [automatically generated data series](/code_insights/explanations/automatically_generated_data_series) of "Detect and track" Code Insights, using regular expression capture groups. ### Java versions Detect and track which Java versions are most popular in your codebase ```sgquery file:pom\.xml$ (.*) ``` ### License types in the codebase See the breakdown of licenses from package.json files ```sgquery file:package.json "license":\s"(.*)" ``` ### All log4j versions Which log4j versions are present, including vulnerable versions ```sgquery lang:gradle org\.apache\.logging\.log4j['"] 2\.([0-9]+)\. ``` ### Python versions Which python versions are in use or haven’t been updated ```sgquery #!/usr/bin/env python([0-9]\.[0-9]+) ``` ### Node.js versions Which node.js versions are present based on nvm files ```sgquery nvm\suse\s([0-9]+\.[0-9]+) ``` ### CSS Colors What CSS colors are present or most popular ```sgquery color:#([0-9a-fA-f]{3,6}) ``` ### Types of checkov skips See the most common reasons for why secuirty checks in checkov are skipped ```sgquery patterntype:regexp file:.tf #checkov:skip=(.*) ``` ### Tracer calls See all your tracer calls to minimize spend on, or track the growth of, tools like Datadog. ```sgquery tracer\.trace\(([\s"'\w@\/:^.#,+-=]+)\) ``` ## Code health ### TODOs How many TODOs are in a specific part of the codebase (or all of it) ```sgquery TODO ``` ### Linter override rules A code health indicator for how many linter override rules exist ```sgquery file:^\.eslintignore .\n patternType:regexp ``` ### Commits with “revert” How frequently there are commits with “revert” in the commit message ```sgquery type:commit revert ``` ### Deprecated calls How many times deprecated calls are used ```sgquery lang:java @deprecated ``` ### Storybook tests How many tests for Storybook exist ```sgquery patternType:regexp f:\.story\.tsx$ \badd\( ``` ### Repos with Documentation How many repos do or don't have READMEs ```sgquery repohasfile:readme select:repo ``` ```sgquery -repohasfile:readme select:repo ``` ### Ownership via CODEOWNERS files How many repos do or don't have CODEOWNERS files ```sgquery repohasfile:CODEOWNERS select:repo ``` ```sgquery -repohasfile:CODEOWNERS select:repo ``` ### CI tooling adoption How many repos are using our CI system ```sgquery file:\.circleci/config.yml select:repo ``` ## Security ### Vulnerable open source library Confirm that a vulnerable open source library has been fully removed, or see the speed of the deprecation ```sgquery vulnerableLibrary@14.3.9 ``` ### API keys How quickly we notice and remove API keys when they are committed ```sgquery regexMatchingAPIKey patternType:regexp ``` ### Vulnerable and fixed Log4j versions Confirm that vulnerable versions of log4j are removed and only fixed versions appear ```sgquery lang:gradle org\.apache\.logging\.log4j['"] 2\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)(\.[0-9]+) patterntype:regexp ``` ```sgquery lang:gradle org\.apache\.logging\.log4j['"] 2\.(17)(\.[0-9]+) patterntype:regexp ``` ### How many tests are skipped See how many tests have skip conditions ```sgquery (this.skip() OR it.skip) lang:TypeScript ``` ### Tests amount and types See what types of tests are most common and total counts ```sgquery patternType:regexp case:yes \b(it|test)\( f:/end-to-end/.*\.test\.ts$ ``` ```sgquery patternType:regexp case:yes \b(it|test)\( f:/regression/.*\.test\.ts$ ``` ```sgquery patternType:regexp case:yes \b(it|test)\( f:/integration/.*\.test\.ts$ ``` ### Types of checkov skips See the most common reasons for why secuirty checks in checkov are skipped *Uses the [detect and track](/code_insights/explanations/automatically_generated_data_series) capture groups insight type* ```sgquery patterntype:regexp file:.tf #checkov:skip=(.*) ``` ## Other ### Typescript vs. Go Are there more Typescript or more Go files ```sgquery select:file lang:TypeScript ``` ```sgquery select:file lang:Go ``` ### iOS app screens What number of iOS app screens are in the entire app ```sgquery struct\s(.*):\sview$ patternType:regexp lang:swift ``` ### Adopting new API by Team Which teams or repos have adopted a new API so far ```sgquery file:mobileTeam newAPI.call ``` ```sgquery file:webappTeam newAPI.call ``` *Or [filter teams by repositories](/code_insights/how-tos/filtering_an_insight) in real time* ### Problematic API by Team Which teams have the most usage of a problematic API ```sgquery problemAPI file:teamOneDirectory ``` ```sgquery problemAPI file:teamTwoDirectory ``` *Or [filter teams by repositories](/code_insights/how-tos/filtering_an_insight) in real time* ### Data fetching from GraphQL What GraphQL operations are being called often ```sgquery patternType:regexp requestGraphQL(\(|<[^>]*>\() ``` ```sgquery patternType:regexp (query|mutate)GraphQL(\(|<[^>]*>\() ``` ```sgquery patternType:regexp use(Query|Mutation|Connection|LazyQuery)(\(|<[^>]*>\() ``` # Common reasons code insights may not match search results There are a few reasons why chart data series' most recent datapoint may show you a different number of match counts than the same search query run in Sourcegraph manually. ## If the chart data point shows *higher* counts than a manual search ### [For versions pre-3.40] Not including `fork:no` and `archived:no` in your insight query Because code insights historical search defaults to `fork:yes` and `archived:yes`, but a Sourcegraph search via the web interface or CLI does not, it may be that your insight data series is including results from repositories that are excluded from a Sourcegraph search. Try running the same search again manually with `fork:yes` and `archived:yes` filters. > NOTE: 3.40+ version defaults to `fork:no` and `archived:no`, the same way the search UI does. ### Manual search will not include unindexed repositories All repositories in a historical search are unindexed, but a manual Sourcegraph search only includes indexed repositories. It's possible your manual searches are missing results from unindexed repositories. To investigate this, one can compare the list of repositories in the manual search (use a `select:repository` filter) with the list of repositories in the insight `series_points` database table. To see why a repository may not be indexing, refer to [this guide](/admin/troubleshooting#sourcegraph-is-not-returning-results-from-a-repository-unless-repo-is-included). ## If the chart data point shows *lower* counts than a manual search ### New matches created since the insight datapoint ran Currently, a data series' most recent datapoint defaults to the end of the prior month. It's possible that in the time between when your insight ran and when you ran a manual search, new matches have been added to your codebase. To confirm this, you can run `type:diff` or `type:commit` searches using the `after:` filter, but note that those filters only support up to 10,000 repositories, so you may first need to limit your search repository set. > NOTE: Future releases of Code Insights may include [an always-up-to-date present-time point](https://github.com/sourcegraph/sourcegraph/issues/24186). ### Repository timeouts caused a datapoint to miss results If your code insight is very large, it is possible that a few (\<1% in 100+ manual tests over 26,000 repositories) repositories failed to return match counts due to timing out while searching. To check this, you can run the following GraphQL query in the Sourcegraph GraphQL API: ```graphql query debug { insightViews(id: "INSIGHT_ID") { nodes { dataSeries { label status { pendingJobs completedJobs failedJobs } } } } insightViewDebug(id: "INSIGHT_ID") { raw } } ``` where `INSIGHT_ID` can be found in the "edit" page for the insight (selectable from the three-dot dropdown on the insight) after `...edit/`. It will look like `https://yourdomain.sourcegraph.com/insights/edit/INSIGHT_ID?dashboardId=all`. The `INSIGHT_ID` can also be found in the url of the single insight view found by clicking on the title of the insight. The ID will be in the url, for example, `https://sourcegraph.yourdomain.com/insights/insight/{INSIGHT_ID}` If there are `failedJobs`, there may be timeouts or similar issues affecting your insight. `insightViewDebug` was added in 4.2 to give you more raw information on your insight. # How-tos The following is a list of how-tos that show how to use Code Insights. - [Creating a dashboard of Code Insights](/code_insights/how-tos/creating_a_custom_dashboard_of_code_insights) - [Filtering an Insight](/code_insights/how-tos/filtering_an_insight) - [Troubleshooting Code Insights](/code_insights/how-tos/Troubleshooting) # Filtering a code insight This how-to assumes that you already have [created some search insights](/code_insights/quickstart). > NOTE: filters are not yet available on language statistics insights. ### 1. Click the filter icon button for the insight you want to filter While viewing the insight you want to filter, click the filter icon in the upper right corner of the insight. This will open the filter popover. ### 2. Filter to include or exclude repositories using a regular expression The filter popover gives you two inputs that allow you to to filter the repositories contributing to the insight, either via inclusion with `repo:` or exclusion with `-repo:`. Enter a regular expression for repository names that you'd like to include or exclude. Inclusion filters limit your insight to show data from only given repository matches. Exclusion filters filter out results from the repository matches. ([More details on how repo filters are applied](/code_insights/explanations/code_insights_filters#repo-repo-filters).) The regular expression to filter for a repository works the same as the [`repo:` filter in the search box](/code-search/queries#filters-all-searches). Examples: | Pattern | Explanation | | | | --------------------------------------- | --------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | `^github\.com/sourcegraph/sourcegraph$` | Filter the specific repository `github.com/sourcegraph/sourcegraph` | | | | `^github\.com/sourcegraph/(sourcegraph\ | about\ | docsite)$` | Filter the specific repositories `github.com/sourcegraph/sourcegraph`, `github.com/sourcegraph/about` and `github.com/sourcegraph/docsite` | | `^github\.com/sourcegraph/go-` | Filter all repositories that start with `github.com/sourcegraph/go-` | | | | `service` | Filter all repositories that contain the word `service` in their name | | | | `\.js$` | Filter all repositories that end in `.js` | | | ### 3. Or, filter to include a reusable group of repositories using a query-based search context In the `context:` field of the filter panel, you can use a [query-based search context](/code-search/working/search_contexts#beta-query-based-search-contexts) to filter your insights to only results matching repositories that match the query-based context's `repo:` filter. First, if you haven't already created a search context, create a [query-based search context](/code-search/working/search_contexts#beta-query-based-search-contexts). You can define any group of repos using the syntax `repo:(^github\.com/sourcegraph/sourcegraph$|^github\.com/sourcegraph/about$...)`. Then, in the context field, reference the search context's name, usually `@owner/name-of-context`. ([More details on using search contexts as filters, and currently supported search filters](/code_insights/explanations/code_insights_filters#context-query-based-search-context-filters).) ### 4. Close the filter panel You can safely click outside the panel to close it and your filters will remain (until a page reload). A dot next to the filter icon indicates that an insight currently has filters applied. ### 5. Edit or reset filters Click the filter button again to edit or reset filters. ### 6. Save your filters as defaults on this insight (optional) By default, the filter will only be visible to you locally and will reset after a page reload. To persist the filter so that anyone who views the insight will have the filters applied by default, click "Save/update default filters". ### 7. Save as new view (optional) If you don't want to modify the insight for all future viewers, but still want to preserve your filtered view, you can select "save as new view." This will fork the insight and create a separate chart on the dashboard with these filters applied by default. The original insight will be unmodified, and future edits to either insight will be independent. # Creating a custom dashboard of code insights This how-to assumes that you already have created some code insights to add to a dashboard. If you have yet to create any code insights, start with the [quickstart](/code_insights/quickstart) guide. ## 1. Navigate to the Code Insights page Start on the code insights page by clicking the Code Insights navbar item or going to `/insights/all`. ## 2. Create and name a new dashboard Click "Create new dashboard" in the top right corner and name your dashboard. Dashboard names must be unique. ## 3. Select a visibility level Set a visibility level for your dashboard. Dashboards [respect insights' permissions](/code_insights/explanations/viewing_code_insights#dashboard-visibility-respects-insights-visibility), so don't create an organization-shared dashboard if you have private insights you want to attach to it. - Private: visible only to you - Shared with [an organization](/admin/organizations): visible to everyone in the organization - Global: visible to everyone on the Sourcegraph instance Then click "Create dashboard." ## 4. Add insights to your new, empty dashboard Click the "Add insight" box on the empty dashboard view to pull up the add insights modal. You can also always pull this modal up with the contextual three-dots click to the right of the dashboard dropdown picker, via the "Add or remove insights" option. Select which insights you want to add. Insights won't be added until you click save. Un-checking an insight will remove that insight after you click save. ## 5. Share your dashboard You can share your dashboard via the url, or by copying this same url in the "copy link" menu item next to the dashboards picker. # Troubleshooting Code Insights This is a collection of issues or other information that might be helpful when troubleshooting a problem with Code Insights. ## Recurring OOM (out of memory) alerts from the `frontend` service This may be the result of an excessively large query being executed by code insights. Code Insights processes some queries in the background of the `worker` service. These queries use the GraphQL API, which means they are aggregated entirely on the `frontend` service. Large result sets can cause the `frontend` service to run out of memory and crash with an OOM error. These queries can get stuck in an error loop until they hit the maximum retry value, causing repeated `frontend` crashes. Queries such as matching on every line in every repository or other queries with a similar scale may be responsible. ### Diagnose 1. Check the `frontend` dashboards (General / Frontend) in Grafana 1. Check for individual instances with spiked (to 100%) memory usage on `Container monitoring` - `Container memory by instance` 2. Check the background `worker` dashboards for Code Insights (General / Worker) in Grafana 1. Check for elevated error rates on `Codeinsights: dbstore stats` - `Aggregate store operation error rate over 5m` 2. Check for a queue size greater than zero on `Codeinsights: Query Runner Queue` - `Code insights query runner queue size` 3. (admin-only) Check the queries currently in background processing using the GraphQL query ``` gql query seriesStatus { insightSeriesQueryStatus { seriesId query enabled completed errored processing failed queued } } ``` 1. Inspecting queries with `errored` or `failed` counts may provide a hint to which query is responsible. 4. Check Postgres `pgsql` for any queries stuck in a retry loop ``` sql select * from insights_query_runner_jobs where state = 'errored' and started_at > current_timestamp - INTERVAL '1 day' order by insights_query_runner_jobs.started_at desc; ``` ### Resolution Options 1. Increase the memory available to the `frontend` pods until it is sufficiently large enough to execute the responsible query. 1. The error rate on the Code Insights dashboards should return to zero. 2. (admin-only) Disable any specific queries identified to be problematic using the GraphQL operation by providing a specific `SeriesId`. ``` gql mutation updateInsightSeries($input: UpdateInsightSeriesInput!) { updateInsightSeries(input:$input) { series { seriesId query enabled } } } { "input": { "seriesId": "s:5FE04D15D1150A134407E7EF078028F6DA5224BBADB1718A92E46046AC9F2E0B", "enabled": false } } ``` 3. Disable any problematic queries stuck in an error loop in Postgres `pgsql` ```sql update insights_query_runner_jobs set state = 'failed' where id = ?; ``` ## OOB Migration has made progress, but is stuck before reaching 100% This out-of-band migration is titled: **Migrating insight definitions from settings files to database tables as a last stage to use the GraphQL API.** The out-of-band migration shouldn't take more than an hour to complete. (It really shouldn't take more than a few minutes.) If the progress hasn't reached 100% in this duration some records may be stuck due to errors. Known issues: - Deleted users/orgs will cause processing errors, and those jobs will need to be manually marked as complete. ### Diagnose and Resolve 1. First check the Recent Errors under the migration in the UI. 1. If the error messages are all: `UserStoreGetById: user not found` - This is caused by deleted users. It will be safe to mark these rows as completed by running the following against `pgsql`: ```sql UPDATE insights_settings_migration_jobs SET completed_at = NOW() WHERE completed_at IS NULL; ``` 2. If the error messages are all: `OrgStoreGetByID: org not found` - This is caused by deleted orgs. In this case, mark just the org rows as completed by running the following against `pgsql`: ```sql UPDATE insights_settings_migration_jobs SET completed_at = NOW() WHERE completed_at IS NULL AND org_id IS NOT NULL; ``` - Note: this only completes the failing org jobs. You may then see the `user not found` error above, and will still need to mark the rest of the jobs as complete. 3. If the error messages are neither of those two things, this is not currently a known issue. Contact support and we can help! ## Clicking on Code Insight data points leads to invalid search queries ### Issue When clicking on a data point in a Code Insight, users are redirected to the search results page with an invalid search query, resulting in no results or an error message. ### Symptoms - Clicking on a Code Insight data point leads to a search query with too many slashes - The search query fails with an error message like: "Unable To Process Query Error parsing regexp: missing closing ): (/" - No search results are displayed ### Workaround Modify your Code Insight query to use the new syntax style. For example: Instead of: ``` select:file patterntype:regexp file:.php content:class\s(.)\sextends\sModelRepo\s{ ``` Use: ``` select:file file:.php /class\s(.)\sextends\sModelRepo\s{/ ``` ### Steps to apply the workaround 1. Navigate to your Code Insight 2. Locate the query causing the issue 3. Update the query using the new syntax style as shown above 4. Save the changes to your Code Insight After applying this workaround, clicking on data points should lead to valid search queries and display the expected results. # Viewing Code Insights ## Insights dashboards The main way to view code insights is on a dashboard page. Dashboards have a unique name and visibility level. There are three possible visibility levels: - Private: visible only to you - Shared with [an organization](/admin/organizations): visible to everyone in the organization - Global: visible to everyone on the Sourcegraph instance ## Sharing links to individual insights You can share links to individual insights by clicking the three-dots context menu on an insight and selecting the shareable link. In order to share a code insight with someone else, the insight must already be on a dashboard visible to them: either a global or organization's dashboard. The share link box will indicate which other users will be able to view the insight, or if the insight is private and must first be added to a more public dashboard in order to share it. ### Built-in dashboards A default "dashboard" of all insights visible to a user appears as the homepage for the Insights navigation bar item. To add insights to your own custom dashboard, see [Creating a custom dashboard of code insights](/code_insights/how-tos/creating_a_custom_dashboard_of_code_insights). ### Dashboard visibility A Dashboard's visibility level owns the visibility of code insights on the dashboard. If you add an Insight that was on a private dashboard to an organization or global dashboard, now people with access to that dashboard can view the insight. When you first create an insight, it defaults to appearing on the dashboard from which you clicked the "create" button, and inherits that original dashboard's permissions. Everyone who can access an insight to view it can also edit it. If you create an insight directly on the create page or from the default dashboard, it will appear on the default dashboard and default to "private" permissions. There's one exception: if the instance has no code insights license, then private dashboards and insights are disallowed, and all limited access mode insights are global. ### Insights still enforce individual permissions regardless of dashboard visibility The dashboard visibility levels have no impact on the data in the insight itself that is displayed to an individual user: insights [enforce the viewer's permissions](/code_insights/explanations/administration_and_security_of_code_insights#code-insights-enforce-user-permissions). This means that two organization users with different repo read permission sets might see different values for the same insights on the same dashboards, if it contains results from a repository only one user can view. If you change a private-visible dashboard so that the dashboard is now visible to an organization (or globally), then the organization (or entire instance) can now see all insights on the dashboard, though the result counts will still be filtered to count from only repos that the individual organization member can view. ### Insights can be on multiple dashboards You can attach insights to multiple dashboards. # Search results aggregations In version 4.0 and later, Code Insights provides aggregations shown on the search screen. This lets you track version and license spread, library adoption, common commit messages, lengths of specific files, usage frequencies, and the [many common use case examples here](../references/search_aggregations_use_cases.md). ## Available aggregations: You can aggregate any search by: 1. The repositories with search results 1. The files with search results (for non-commit and non-diff searches) 1. The authors who created the search results (for commit and diff searches) 1. All found matches for the first capture group pattern (for regexp searches with a capture group) Aggregations are returned in order of greatest to least results count. Aggregations are exhaustive across all repositories the user running the search has access to, unless the chart notes otherwise (see [Limitations](#limitations) below). We may continue adding new aggregation categories, like date and code host, based on feedback. If there are categories you'd like to see, please [let us know](mailto:feedback@sourcegraph.com). ## Feature visibility You can turn the aggregations on with the experimental feature setting: `searchResultsAggregations` in your user, org, or site settings. You can turn off just the proactive aggregations by setting `proactiveSearchResultsAggregations` to `false`. This prevents aggregations from running on every search and requires users to explicitly click to run them. (The main reason to consider disabling proactive aggregations is if you're seeing a heavy or unexpected load on your instance, but as noted below in [Limitations](#limitations) there are limits that keep the overall resource needs low to begin with.) ## Drilldowns You can drilldown into a search aggregation by clicking a result in the chart. Your original search query will be updated with a `repo`, `file`, `author` filter or a regexp pattern depending on the aggregation mode. ## Limitations ### Mode limitations If you attempt to run a query for which a given mode is not supported, the tooltip will inform you why that mode is not available. ### Timeout limits At the moment all aggregations search queries are run with a 2-second timeout, even if your search specified a timeout. If the aggregation times out, you will be able to trigger a longer search with a 1-minute timeout by clicking `Run aggregation`. The extended timeout can be configured by changing the number of seconds in global settings `insights.aggregations.extendedTimeout`. If configuring this to greater than 60 seconds please see [More information on timeouts](../../code_search/how-to/exhaustive.md#timeouts). After adding new repositories it can be common for aggregations to experience timeouts while those repositories await initial indexing. This is due to aggregations running exhaustive searches over all repositories and will resolve once that indexing is complete. ### Count limits Aggregation search queries that run proactively are run with `count:50000`. This default can be changed using the site setting `insights.aggregations.proactiveResultLimit`. If the number of results exceeds this limit, the user can choose to explicitly run the aggregation, and these explicitly-run aggregations use `count:all`. ### Best effort aggregation Results are aggregated in a best-effort approach using a limited-size buffer to hold group labels in order not to strain the webapp when these aggregations are run. This means that in some cases we might miss some high-count results. Aggregations that hit such non-exhaustive paths are reported back to the user. You can control the size of the buffer using the site setting `insights.aggregations.bufferSize`. It is set to 500 by default. Note that if increasing this you might notice decreased performance on your instance. ### Number of bars displayed The side panel will display a maximum of 10 bars. If expanded, a maximum of 30 bars will be displayed. If there are more results this will be displayed on the panel. ### Single capture group Aggregations by capture group will match on the first capture group in the search query only. For example, for a query: ```sgquery hello-(\w+)-(\w+) ``` and a match like `hello-beautiful-world` only `beautiful` will be shown as a result. ### Files with the same paths in distinct repositories The "file" aggregation groups only by path, not by repository, meaning files with the same path but from different repos will be grouped together. Attach a `repo:` filter to your search to focus on a specific repo. ### Saving aggregations to a code insights dashboard Saving aggregations to a dashboard of code insights is not yet available. ### Slower diff and commit queries Running aggregations by author is only allowed for `type:diff` and `type:commit` queries, which are likely not to complete within a 2-second timeout. You can trigger an explicit search with an extended 1-minute timeout, or you can limit your query using a single-repo filter (like `repo:^github\.com/sourcegraph/sourcegraph$`) combined with a `before` or `after` filter. ### Structural searches Aggregations for structural searches are unlikely to complete within a 2-second timeout. You can try to trigger an explicit aggregation for such cases. ### Standard searches with embedded regexp Standard searches with embedded regexp such as below do not support aggregation by capture group. This is because they are functionally similar to a query with an `or` operator. ```sgquery database /(\w+)/ ``` # Explanations The following articles explain different parts of Sourcegraph Code Insights in depth: - [Administration and Security of Code Insights](/code_insights/explanations/administration_and_security_of_code_insights) - [Automatically generated data series for version or pattern tracking](/code_insights/explanations/automatically_generated_data_series) - [Code Insights filters](/code_insights/explanations/code_insights_filters) - [Current limitations of Code Insights](/code_insights/explanations/current_limitations_of_code_insights) - [Search-screen search results aggregations](/code_insights/explanations/search_results_aggregations) - [Viewing code insights](/code_insights/explanations/viewing_code_insights) - [Data retention](/code_insights/explanations/data_retention) # Code Insights data retention > NOTE: This reference is only relevant from the 4.5 release. On creation a Code Insight will show you 12 data points per series. Your Code Insight will then get an additional ephemeral data point daily, and a persisted additional data point at every interval that was specified on insight creation. Prior to release 4.5, this growth was unbound. From 4.5, the oldest data points will be truncated and stored separately according to the sample size specified in the site configuration with the setting shown below. This means that if you have an insight with 50 data points, and a maximum sample size of 30, the oldest 20 points will be truncated and archived in a separate table. ```json { "insights.maximumSampleSize": 30 } ``` The sample size value is set to 30 by default and can only be increased to a maximum of 90. A background routine will periodically go over Code Insights and move the oldest data points to a separate table. If you want to access this data, you are given the option to export all data for a Code Insight, which will include archived data. > IMPORTANT: Your data is never deleted. It is only moved to a separate database table. ## Data exporting You can download all data for a Code Insight, including data that has been archived. You can do this: - From the insight card menu - From the standalone page - By curling the API endpoint ```shell curl \ -H 'Authorization: token {SOURCEGRAPH_TOKEN}' \ https://yourinstance.sourcegraph.com/.api/insights/export/{YOUR_INSIGHT_ID} -O -J ``` The data will be exported as a CSV file. Only data that you are permitted to see will be excluded (i.e. repository permissions are enforced). If you have filtered your Code Insight using repository filters or a search context, the data exported will be filtered according to those. ## Dynamic filtering The option now exists on Code Insights filters to limit the number of samples loaded per series. There is one setting per insight that applies to all series on that insight. Adjusting this setting will only apply to one insight and will not have any impact on stored Code Insights data. ## Benefits - Code Insights should be faster to load. - Code Insights with a lot of data points that were previously hard to read or hover over will now be more legible. - Code Insights data can now be exported in CSV format. ## Accessing this feature prior to 4.5 You can enable this retention procedure from Sourcegraph *4.4* if you are a site admin with the following setting: ```json { "experimentalFeatures": { "insightsDataRetention": true } } ``` You will however **only be able to export all the code insights data from the 4.5 release**, so use the experimental version at your own risk. # Current limitations of Code Insights There are a few existing limitations. If you have strong feedback, please do [let us know](mailto:feedback@sourcegraph.com). _Limitations that are no longer current are [documented at the bottom](#older-versions-limitations) for the benefit of customers who have not yet upgraded._ ## Insight chart position and size do not persist You can resize and reorder charts on the dashboard for the purpose of taking a screenshot or presenting information, but that order will revert on a page refresh. If the ordering of insights is important, you can remove and then re-add the insights in the order you'd like via the add/remove insights to dashboard flow. If the size is important, you can use the single-insight view page to consistently view an insight at a larger size, reachable by clicking the insight title or from the context three dots menu on the insight card under "Get shareable link". ## Performance speed considerations for a data series running over many repositories To accurately return historical data for insights running over many repositories, the backend service must run a large number of Sourcegraph searches. This means that unlike code insights running over just a few repositories, results are not returned instantly, but more often on the scale of 20-120 minutes, depending on: * How many and how large the repositories you have connected to your instance * The performance and resources of your Sourcegraph code insights instance in queries-per-second * How well we can "compress" repositories so we don't need to run queries for each historic data point (e.g., if a repository hasn't changed in several months) The number of insights you have does not affect the overall speed at which they run: it will take the same total time to run all of them whether or not you let each one finish before creating the next one. As of version 4.4.0 Insights prioritize completing the backfills for the insights that will complete the fastest. In general this means that insights over many repositories will pause to allow insights over a few repositories to complete. ## Creating language insights for a very large repository > NOTE: This applies to Sourcegraph versions greater than `5.3` Similar to [insights in general](#creating-insights-over-very-large-repositories), creating a language insight over a very large repository can be slow. Language insights become faster as the internal cache populates, but depending on your Sourcegraph instance and repository size this may take a few attempts. By default the dashboard attempts three queries that take up to 5 minutes. It will automatically retry until the three attempts are exhausted. Apart from waiting and retrying you may also reach out to your Sourcegraph administrator to [increase the number of concurrent queries or increase the timeout for the query](/code_insights/explanations/administration_and_security_of_code_insights). ## Creating insights over very large repositories > NOTE: The feature applies on Sourcegraph version greater than `3.42` In some cases, depending on the size of the Sourcegraph instance and the size of the repo, you may see odd behavior or timeout errors if you try to create a code insight running over a single large repository. In this case, it's best to try: 1. Create the insight, but check the box to "run over all repositories." (This sends the Insight backfilling jobs to the backend Sourcegraph instance worker which will handle them datapoint-by-datapoint. Running over an individual repository otherwise currently runs the jobs in bulk to generate its live preview.) 2. After the insight has finished running, [filter the insight](/code_insights/explanations/code_insights_filters#filter-options) to the specific repo you originally wanted to use. The filter resolves instantly. If this does not solve your problem, please reach out directly to your Sourcegraph contact or in your shared slack channel, as there are experimental solutions we are currently working on to further improve our handling of large repositories. ## Accuracy considerations for an insight query returning a large result set If you create an insight with a search query that returns a large result set that exceeds the search timeout (generally when there are over 1,000,000 results), non-historical data points may report undercounted numbers. This behaviour is tracked in [this issue](https://github.com/sourcegraph/sourcegraph/issues/37859). This is because non-historical data points are recorded with a global search query as opposed to per-repo queries we run for backfilling. For a large result set (e.g. a query for `test` with millions of results) the global query will be disadvantaged by the global search timeout. You can find more information on search timeouts in the [docs](/code-search/queries/language#timeout). You can determine if this issue may be affecting your query by just running the query in the Search UI on `/search` with a `count:all` – if your search is returning `x results in 60s` (or the upper limit max timeout is configured to) then the search will time out on insights as well. Note that the duration could be more or less `60s`, e.g. you could encounter `60.02s` as well. In this case, you may want to try: * Using a more granular query * Changing your site configuration so that the timeout is increased, provided your instance setup allows it. [More information on timeouts](/code-search/queries/language#timeout). ## General scale limitations Code Insights is disabled by default on single-docker deployment methods. There are a few factors to consider with respect to scale and expected performance. 1. General permissiveness - instances that are more open (users can see most repos) will perform better than instances that are more restricted. Insights have been tested with users having up to 100k restricted repositories. 2. Number of repositories - Code Insights is well tested with insights running over ~35,000 repositories. It is recommended that users should scope their insights to the smallest set of repositories needed. Users should expect at least linear degradation as repository count grows in both time to calculate insights, and render performance. 3. Large monorepos - Code Insights allocates a fixed amount of time for each query, so large repositories that cause query timeouts will likely not have exhaustive (and therefore accurate) results. As of version 4.4.0 we added visibility to this state via an icon on the insight. Prior to the 4.4.0 version a heuristic indicator for if this is a problem is seeing values "jump" (either a significant increase or decrease) between the backfilled datapoints on creation and the up-to-date datapoints added after creation. 4. High cardinality capture groups - When using a capture group insight, high cardinality matches (for example 1000 distinct matches per repository) will cause significant increase in loading times of charts. It is possible to exceed request timeouts if there are too many distinct matches. 5. Concurrent usage 1. If there are many insight creators the insights will take longer to calculate. 2. If there are more insight viewers loading times of charts may be impacted. ## Creating insights over specific branches and revisions Code Insights does not yet support running over specific revisions. ## VCS limitations Code Insights only supports git based repositories and does not support perforce repositories that have sub-repo permissions enabled. Perforce depots converted to git are also currently not supported for Code Insights. ## Feature parity limitations ### Features currently available only on insights over all your repositories * **[Filtering insights](/code_insights/explanations/code_insights_filters)**: available in 3.41+ ~~we do not yet allow filtering for insights that run over explicitly defined lists of repositories, except for "detect and track" insights.~~ ### Features currently available only on insights over explicitly defined repository lists Because these insights need to run dramatically fewer queries than insights over thousands of repositories, you will have access to a number of features not _yet_ supported for insights over all repositories. These are: * **Live previews**: showing the preview of your insight in real time * **[Released] Dynamic x-axis ranges**: available in 3.35+ ~~set a custom amount of historical data you care about~~ * **[Released] Editing data series queries after creation**: available in 3.35+ ~~for insights over all repositories, you must make a new insight if you wish to run a different query~~ * **[Released] "Diff click"**: available in 3.36+ ~~click a datapoint on your insight and be taken to a diff search showing any changes contributing to the difference between a datapoint and the prior one~~ > NOTE: many of the above-listed features will become available for insights over all repositories as well. The above list is ordererd top-down, where items on the top of the list will arrive roughly sooner than items on the bottom. ### Limitations specific to "Detect and track patterns" insights (automatically generated data series) Please see [Current limitations of automatically generated data series](/code_insights/explanations/automatically_generated_data_series#current-limitations). ## In certain cases, chart datapoints don't match the result count of a Sourcegraph search There are currently a few subtle differences in how code insights and Sourcegraph web app searches handle defaults when searching over all repositories. Refer to [Common reasons code insights may not match search results](/code_insights/references/common_reasons_code_insights_may_not_match_search_results). ## Known bugs Known bugs we plan to fix are tracked in our [GitHub repository here](https://github.com/sourcegraph/sourcegraph/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Ateam%2Fcode-insights). ## Older versions' limitations ### Version 3.30 (July 2021) or older #### Search-based Code Insights can only run over ~50-70 repositories Because this version of the prototype runs on frontend API calls to Sourcegraph searches, it may run slowly (or possibly timeout) if you're using it over many repositories or with many data series for each insight. #### The max match count is 5,000 matches per repository The current limit on searching over historical versions of repositories, which is an unindexed search, is 5,000 results per repository. If there are more than 5,000 matches, the search stops and returns a count of 5,000, and the code insight graph will calculate the overall chart using 5,000 as the match count for that repository. (This means if you query over two repositories and one of them hits this limit, the value shown on the graph will be 5,000 + [the match count in the other repository]). _This limit was lifted in the August 2021 release of Sourcegraph `3.31` # Code Insights filters Code insights filters allow you to filter a search insight to a subset of repositories. Each search insight has a filter icon that opens the filtering options. Filters take effect immediately, without needing to re-process the data series of the insight. > NOTE: filters are not yet available on language statistics insights. ## Filter options ### `repo:` Repo filters You can include or exclude repositories from your insight using regular expressions, the same way you can with the `repo:` filter in [Sourcegraph searches](/code-search/queries#filters-all-searches). Only repository regex expressions are supported: unlike search, you cannot specify repository revisions using the syntax `repo:regexp-pattern@rev`. Predicate filters like `repo:has.path(...)` are also not supported. For inclusion, only repositories that have a repository name matching the regular expression will be counted. For exclusion, only repositories that have a repository name **not** matching the regular expression will be counted. If you combine both filters, the inclusion pattern will be applied first, then the exclusion pattern. ### `context:` Query-based search context filters You can use a [query-based search context](/code-search/working/search_contexts#beta-query-based-search-contexts) to filter your insights to only results matching repositories that match the `repo:` or `-repo:` filter of the query-based context. You can use this to filter multiple insights to a group of repositories that need only be maintained in one location. When you update a context that's being used as a filter, the next time you load the page, the filtered insight will reflect the updated context. As with explicit `repo:` filters, only repository regex expressions are allowed: you cannot specify repository revisions or predicate filters. At this time, all other filters are not yet supported – only the `repo:` and `-repo:` filters of a context are recognized. When creating your context, you can define any group of repos using the syntax `repo:(^github\.com/sourcegraph/sourcegraph$|^github\.com/sourcegraph/about$...)`. ### Setting more than one filter Filters are intersected. This means if you use the search context `context:` filter that narrows your insight down from all repositories to some repo A, repo B, and repo C, and then you use the `repo:` filter that's set only to repo A, your insight will show only results from repo A. Similarly, if you were to use the same `context:` and then also use the `-repo:` exclusion filter set to repo C, your insight would show results from repo A and repo B. ### Other filtering options We're currently exploring additional filters that would be valuable. If you have feedback about a particular filter you'd like for code insights, we would [love to hear your feedback](mailto:feedback@sourcegraph.com). ## Filter persistance and sharing ### Filters are temporary by default By default, filters are temporary (present until you refresh the page or switch to a different dashboard) and local (no one else can see them). You can modify filters without affecting what others see, unless or until you save the filters. ### Saving filters as defaults You can set filters to be persistent, or default, even after a page reload on a code insights in two ways: 1. Create a filter and click "save/update default filters": this will save the filters so they persist for all viewers of this insight, on any dashboard page the insight appears. 1. Create a filter and "save as new view": this will create a new insight chart with your filter applied as the default filter on that insight. It will _not_ also save these filters to the existing insight unless you also select "save/update default filters". ### Filter indicator Insights that have any filters applied will have a small dot on their filter icon. The filter can always be reset by opening the filter panel again and clicking "Reset" above each filter – but note that, like any filter edit, you must also then "update default filters" to save that reset state if you want it to persist. ### Saving a filter as a new view When you create a filter and "save as new view," it will create a new insight chart with this filter saved as the default filters. Except the title and filters, all other configuration options will be cloned from the original insight. Filters and all other configuration options for the newly created view and the original insight are indpendent. Editing the forked insight (e.g. changing the data series query) will not change the original insight. # Detect and track patterns with automatically generated data series Detect and track patterns' insights are available in Sourcegraph v3.35 and above. In Sourcegraph v3.35 this feature is in its earliest version. Stability and additional features coming in following releases. Code Insights with automatically generated data series allow you to "detect and track patterns" and versions within your codebase. You can use these insights to track versions of languages, packages, terraform, docker images, or anything else that can be captured with a [regular expression capture group](#regular-expression-capture-group-resources). ## Automatic generation of individual series Match patterns can be returned with a regular expression containing a capture group, or a pattern within parentheses. For example, `file:pom\.xml|\.pom$ (.*)` will match all of: ```shell 1.5 1.7 1.8 ``` Code Insights will find all matches, and then automatically generate a data series and color for each unique value of the capture group. In this case, the chart would show data series for 1.5, 1.7, and 1.8, with the values being the number of matches for each unique value. ## New matching data gets automatically added Capture groups will automatically create new data series for new matches as they appear in your codebase. You do not need to update or manually re-create the insights to track newly added versions or patterns. For the above example, this means that if `1.9` was committed to the codebase in the future, it would appear on the insight without any additional action, and you would see a series for `1.9`. ## Current limitations This feature has some yet-released limitations. In rough order, with limitations listed first likely to be removed soonest, they are: ### Limited to 20 matches Capture groups will only display 20 returned match values to prevent extremely large result sets from being rendered. As of version 3.41.0 controls are available to make this deterministic and configurable. ### No capture groups in filter strings This type of Code Insight only supports capture groups in the main query string. You cannot use a capture group in a filter, like a `repo:` or `file:` filter. ### No multiline matches >Note: Feature supported only on version greater than 3.43. On Sourcegraph instances on earlier versions than 3.43, you can only use a single-line regular expression. This means that `^` and `$` characters are still valid but needing to match on a `\n` is not. As a potential workaround to get more granularity, you can still use `file:has.content()` and other [search predicates](/code-search/queries/language#built-in-file-predicate). ### No combinations of capture groups You cannot combinatorially combine capture groups. Queries containing multiple capture groups will return data series with a label for a single capture group only. For example, `([0-9])\.([0-9])\.([0-9])` will match results like 1.2.3, 4.5.6, and 4.5.7, but will return data series for 1, 2, 3, 4, 5, 6, and 7 individually. (If you made the string one capture group `([0-9]\.[0-9]\.[0-9])` instead, it would return series and counts for 1.2.3, 4.5.6, and 4.5.7). ### Searches are limited to file content You can't use capture groups in queries for `type:commit`, `type:repo`, `type:path`, `type:diff`, or `type:symbol`. ### Match values are limited to a 100 characters Any matches that return values over a 100 characters will be truncated. This is to avoid issues when storing the data. ### Regular expression capture group resources - [Example regular expressions for common use cases](/code_insights/references/common_use_cases#automatic-version-and-pattern-tracking) - [General additional capture groups documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Groups_and_Ranges) # Administration and security of Code Insights ## Code Insights enforce user permissions Users can only create code insights that include repositories they have access to. Moreover, when creating code insights, the repository field will *not* validate nor show users repositories they would not have access to otherwise. When a user is viewing an insight, any repositories they do not have access to will not be included in the total counts. ## Security of native Sourcegraph Code Insights (Search-based and Language Insights) Sourcegraph search-based and language insights run natively on a Sourcegraph instance using the instance's Sourcegraph search API. This means they don't send any information about your code to third-party servers. ## Insight and Dashboard permissions Note: there are no separate read/write permissions. If a user can view an insight or dashboard, they can also edit it. A user can view an insight if at least one of the following is true: 1. The user created the insight. 2. The user has permission to view a dashboard that the insight is on. Except for the singular, non-transferable creator's permission noted in case 1 above, permissions can be thought of as belonging to a dashboard. Dashboards have 3 permission levels: - User: only this specific user can view this dashboard. - Organization: only users within this organization can view this dashboard. - Global: any user on the Sourcegraph instance can view this dashboard. ### Changing permission levels Because there are no separate read/write permissions and no dashboard owners, any user who can view a dashboard can change its permission level or add/remove insights from the dashboard. The only way to guarantee continued access to an insight that you did not create is to add it to a private dashboard. If a user gets deleted, any insights they created will still be visible to other users via the dashboards they appear on. However, if one of these insights is removed from all dashboards, it will no longer be accessible. ## Code Insights Admin (>=5.0) Sourcegraph administrators can view and manage the background jobs that Code Insights runs when historically backfilling an insight. The following functionality is available under _Code Insights jobs_ in the _Maintenance_ section within the Site Admin (`/site-admin/code-insights-jobs`): - See a list of the jobs that backfill an insight and their current state - See any errors that occurred when backfilling an insight - Retry a failed backfill - Move a backfill job to the front or back of the processing queue The jobs can be searched by state and by an insight's title or the label of any of its series. ## Code Insights Site Configuration While the default configuration is appropriate for most deployments, in the site configuration there are values that allow admins more control over the rate at which insights runs in the background. Raising these values will increase the speed at which insights are populated however will it cause insights to consume more system resources. Care should be taken when changing these values and it is recommended to update them in small increments. The following settings apply when backfilling data for a Code Insight: - `insights.historical.worker.rateLimit` - Maximum number of historical Code Insights data frames that may be analyzed per second. - `insights.backfill.interruptAfter` - The amount of time an Code Insights will spend backfilling a series before checking if there is higher priority work. - `insights.backfill.repositoryGroupSize` - The number of repositories that Code Insights will pull as a batch to backfill in one iteration. - `insights.backfill.repositoryConcurrency` - The number of repositories that Code Insights will backfill at once. The following setting(s) apply to adding new data to a previously backfilled Code Insight: - `insights.query.worker.concurrency` - Number of concurrent executions of a code insight query on a worker node. The following setting(s) apply to both backfilling data and adding new data - `insights.query.worker.rateLimit` - Maximum number of Code Insights queries initiated per second on a worker node. ## Language Stats Performance Configuration This feature is supported for Sourcegraph versions 5.4 or more. To create language stats for a repository the Sourcegraph instance analyzes all files from the target repository. Depending on the repository's size this can take from a few seconds to multiple minutes. If you need to analyze a repository that's larger than 10GB feel free to reach out to Sourcegraph support. If a query completes the result is stored in an API-level cache and subsequent queries complete within one second. If the query does not complete in time, an internal cache is stays partially populated. This cache will be reused on subsequent queries which then have less work to do and may resolve faster. With the May 2024 Release we increased the default number of concurrent requests to the gitserver from 1 to 4, and raised the timeout for each language stats query from 3 minutes to 5 minutes. ### Concurrent Requests This concurrent requests to the gitserver are configurable through the `GET_INVENTORY_GIT_SERVER_CONCURRENCY` environment variable ([#62011](https://github.com/sourcegraph/sourcegraph/pull/62011)). We recommend increasing this carefully, as an increase in concurrency may cause the gitserver to become overloaded and slow down responses. Example: ``` GET_INVENTORY_GIT_SERVER_CONCURRENCY=4 ``` To understand how this configuration impacts your language stats queries you can use [tracing](/admin/observability/tracing). ### Language Stats Timeout The timeout in minutes for language stats queries is configurable through the `GET_INVENTORY_TIMEOUT` environment variable ([#62011](https://github.com/sourcegraph/sourcegraph/pull/62011)). Example: ``` GET_INVENTORY_TIMEOUT=5 ``` # Code Search Supported on [Enterprise Starter](/pricing/enterprise-starter) and [Enterprise](/pricing/enterprise) plans. Available via VS Code and JetBrains editor extensions and the Web.

Learn how to search code across all your repositories and code hosts.

**Code Search** allows you to find, fix, and navigate code with any code host or language across multiple repositories with real-time updates. It deeply understands your code, prioritizing the most relevant results for an enhanced search experience. Sourcegraph's Code Search empowers you to: - Utilize regular expressions, boolean operations, and keyboard shortcuts to help you unleash the full potential of your searches - With the symbol, commit, and diff search capabilities, it identifies code vulnerabilities in milliseconds and quickly helps you resolve issues and incidents - Offers innovative code view with seamless code navigation for a comprehensive coding experience ## Getting started ## Features Code Search main features include: - Use regular expressions and keyword queries to perform full-text searches - Search any branch and commit, with no indexing required - Search [commit diffs](/code-search/features#commit-diff-search) and [commit messages](/code-search/features#commit-message-search) to see how code has changed - Narrow your search by repository and file pattern - Use [search contexts](/code-search/features#search-contexts) to search across a set of repositories at specific revisions - Curate [saved searches](/code-search/features#saved-searches) for yourself or your org - Use [code monitoring](/code_monitoring/) to set up notifications for code changes that match a query - View [language statistics](/code-search/features#statistics) for search results Read more in detail about the [Code Search features here →](/code-search/features) ## FAQs ### Does Code Search work with my repositories? Code Search works with all your repositories. Likewise, you can also [search through our public code](https://sourcegraph.com/search) that has a 2 million+ open source codebase. ### Do I need to enable Code Navigation? No, the default search-based code navigation works out of the box without any configuration. However, for an advanced and customized navigation experience your site admin will set up precise code navigation. ### What is the max file size limit for Code Search? By default, files larger than **1 MB** are excluded from search results. Read more in detail about other [Code Search FAQs here →](/code-search/faq) ## Join our community If you have any questions about Code Search, ask in [our community forum](https://community.sourcegraph.com).
# Code Search Capabilities

Learn and understand more about Sourcegraph's Code Search features and core functionality.

## Powerful, flexible queries Sourcegraph code search performs full-text searches and supports both regular expression and exact queries. By default, Sourcegraph searches across all your repositories. Our search query syntax allows for advanced queries, such as searching over any branch or commit, narrowing searches by programming language or file pattern, and more. See the [search query syntax](/code-search/queries) documentation for a comprehensive overview of supported syntax. ## Data freshness Searches scoped to specific repositories are always up-to-date. Sourcegraph automatically fetches repository contents with any user action specific to the repository and makes new commits and branches available for searching and browsing immediately. Unscoped search results over large repository sets may trail latest default branch revisions by some interval of time. This interval is a function of the number of repositories and the computational resources devoted to search indexing. ## Commit diff search Search over commit diffs using `type:diff` to see how your codebase has changed over time. This is often used to find changes to particular functions, classes, or areas of the codebase when debugging. You can also search within commit diffs on multiple branches by specifying the branches in a `repo:` field after the `@` sign. After the `@`, separate Git refs with `:`, specify Git ref globs by prefixing them with `*`, and exclude a commit reachable from a ref by prefixing it with `^`. Diff searches can be further narrowed down with parameters that filter by author and time. See the [query syntax](/code-search/queries#filters-diff-and-commit-searches-only) documentation for a comprehensive list of supported parameters. ## Commit message search Searching over commit messages is supported in Sourcegraph by adding `type:commit` to your search query. Separately, you can also use the `message:"any string"` parameter to filter `type:diff` searches for a given commit message. Commit message searches can narrowed down further with filters such as author and time. See our [query syntax](/code-search/queries#diff-and-commit-searches-only) documentation for a comprehensive list of supported parameters. ## Symbol search Searching for symbols makes it easier to find specific functions, variables, and more. Use the `type:symbol` filter to search for symbol results. Symbol results also appear in typeahead suggestions, so you can jump directly to symbols by name. When on an [indexed](/admin/search#indexed-search) commit, it uses Zoekt. Otherwise it uses the [symbols service](/code-search/types/symbol) ## Saved searches Saved searches let you save and describe search queries so you can easily monitor the results on an ongoing basis. You can create a saved search for anything, including diffs and commits across all branches of your repositories. Saved searches can be an early warning system for common problems in your code and a way to monitor best practices, the progress of refactors, etc. ## Search contexts Search contexts help you search the code you care about on Sourcegraph. A search context represents a set of repositories at specific revisions on a Sourcegraph instance that will be targeted by search queries by default. Every search on Sourcegraph uses a search context. Search contexts can be defined with the contexts selector shown in the search input, or entered directly in a search query. If you currently use version contexts, you can automatically [convert your existing version contexts to search contexts](/admin/how-to/converting-version-contexts-to-search-contexts). We recommend migrating to search contexts for a more intuitive, powerful search experience and the latest improvements and updates. See the [search contexts](/code-search/working/search_contexts) documentation to learn how to use and create search contexts. ## Multi-branch indexing The most common branch to search is your default branch. To speed up this common operation, Sourcegraph maintains an index of the source code on your default branch. Some organizations have other branches that are regularly searched. To speed up search for those branches, Sourcegraph can be configured to index up to 64 branches per repository. Your site admin can configure multi-branch indexing through [site configuration](/admin/search#multi-branch-indexing). ## Exclude files and directories You can exclude files and directories from search by adding the file `.sourcegraph/ignore` to the root directory of your repository. Files or directories matching the glob patterns will not show up in the search results. For more information on creating `.sourcegraph/ignore` files, see the [configuration reference](/admin/search#exclude-files-and-directories). ## RE2 Regular Expressions The Sourcegraph search language supports [RE2](https://golang.org/s/re2syntax) syntax. If you're used to tools like Perl which uses [PCRE syntax](https://www.pcre.org/original/doc/html/pcresyntax.html), you may notice that there are some features that are missing from RE2 like backreferences and lookarounds. We choose to use RE2 for a few reasons: - It makes it possible to build [worst-case linear](https://swtch.com/~rsc/regexp/regexp1.html) evaluation engines, which is very desirable for building a production-ready regex search engine. - It's well-supported in Go, allowing us to take advantage of a rich ecosystem (notably including [Zoekt](https://github.com/sourcegraph/zoekt)) - Our API and tooling makes it straightforward to use Sourcegraph with other tools that provide facilities not built in to the search language. As an example of how you can use Sourcegraph tooling with other tools, we can use `jq` (which supports Perl regexes) along with `src` to post-filter search results. In this case, we want to use backreferences to find go functions that take a single pointer argument and return a non-pointer of the same type as the input. ```shell re2_regex='func \w+\(\w+ \*\w+\) \w+' pcre2_regex='func \w+\(\w+ \*(\w+)\) \1' src search --json --stream -- "/$re2_regex/" \ | jq ' //Filter to only content events select(.type == "content") # Filter to only content events //Flatten to a single object per match | {content: .chunkMatches[].content} + del(.chunkMatches) //Select only matches that match the PCRE regex | select(.content | test($ARGS.positional[0])) ' --args "$pcre2_regex" ``` ## Search experience Users on Sourcegraph instance `v5.9.0` or more get the improved and new Code Search experience set by default. Sourcegraph Enterprise users' site admins can optionally opt-out and revert to the old view. You get the following improvements: - **In-line diff view**: Easily compare commits and see how a file changed over time, all in-line - **Revamped code navigation**: Quickly find a list of references of a given symbol, or immediately jump to the definition - **Reworked fuzzy finder ⌘K**: Find files and symbols quickly and easily with our whole new fuzzy finder - **File actions**: Like open in editor and open on code host ## Other search tips - When viewing a file or directory, press the `y` key to expand the URL to its canonical form (with the full 40-character Git commit SHA). - To share a link to multi-line range in a file, click on the starting line number and shift-click on the ending line number (in the left-hand gutter).
# FAQs

Learn about some of the most commonly asked questions about Code Search.

## Code Search ### Does Code Search work with my repositories? Code Search works with all your repositories. Likewise, you can also [search through our public code](https://sourcegraph.com/search) that has a 2 million+ open source codebase. ### Who can search my code? Public code is searchable by anyone, but your private code can be searched only by users who have access to it. ### Do I need to enable Code Navigation? No, the default search-based code navigation works out of the box without any configuration. However, for an advanced and customized navigation experience your site admin will set up precise code navigation. ### What is the max file size limit for Code Search? By default, files larger than **1 MB** are excluded from search results. ### What programming languages are supported? Code Search supports almost all programming languages: Java, Python, Go, JavaScript, TypeScript, C#/C/C++, Swift, Objective-C, Kotlin, Ruby, Scala, Rust, Perl, Dart, Erlang, COBOL, Clojure, Lisp, Shell, Terraform, Lua, GraphQL, Thrift, Protobuf, YAML, JSON, Jsonnet, R, PHP, Elixir, Haskell, PowerShell, OCaml, CUDA, Pascal, Verilog, VHDL, Groovy, and Tcl. ### What deployment options are available with Code Search? Code Search supports the following deployment options: Kubernetes cluster, Amazon EKS or EC2, Google GKE, Microsoft, Azure AKS, Docker Compose, and Docker Compose in GCP. Read more about our [deployment docs here](/admin/deploy). ## Code Navigation ## Why are my results sometimes incorrect? If an index is not found for a particular file in a repository, Sourcegraph will fall back to search-based code navigation. You may occasionally see results from search-based code navigation even when you have uploaded an index. This can happen in the following scenarios: The line containing the symbol was created or edited between the nearest indexed commit and the commit being browsed. The Find references panel may include search-based results, but only after all of the precise results have been displayed. This ensures every symbol has useful code navigation. ## What languages are supported? Search-based code navigation supports 40 programming languages, including all of the most popular ones: Apex, Clojure, Cobol, C++, C#, CSS, Cuda, Dart, Elixir, Erlang, Go, GraphQL, Groovy, Haskell, Java, JavaScript, Jsonnet, Kotlin, Lisp, Lua, OCaml, Pascal, Perl, PHP, PowerShell, Protobuf, Python, R, Ruby, Rust, Scala, Shell, Starlark, Strato, Swift, Tcl, Thrift, TypeScript, Verilog, VHDL. ### Why does it sometimes time out? The [symbol search](/code-search/types/symbol) performance section describes query paths and performance. Consider using [Rockskip](/code-search/code-navigation/rockskip) if you're experiencing frequent timeouts.
# Search Snippets

This page provides docs about how Search Snippets work with Sourcegraph.

Every project and team has a different set of repositories they commonly work with and queries they perform regularly. Custom search snippets enable users and organizations to quickly filter existing search results with search fragments matching those use cases. A search snippet is any valid query. For example, a search snippet that defines all repositories in the "example" organization would be `repo:^github\.com/example/`. After adding this snippet to your settings, it would appear in the search snippet panel in the search sidebar under a label of your choosing (as of v3.29). Search snippets are temporarily named search.scopes in site configuration files. ## Creating custom search snippets Custom search snippets can be specified at 3 different levels: - By site admins for all users: in the **Global settings** in the site admin area. - By organization admins for all organization members: in the organization profile **Settings** section - By users for themselves only: in the user profile **Settings** section You can configure search snippets by setting the `search.scopes` to a JSON array of `{name, value}` objects. The `value` of a search snippet can be any valid query and can include any [search token](/code-search/queries) (such as `repo:`, `file:`, etc.). For example, this JSON will create two search snippets: ```json { // ... "search.scopes": [ { "name": "Test code", "value": "file:(test|spec)" }, { "name": "Non-vendor code", "value": "-file:vendor/ -file:node_modules/" } ] // ... } ``` After editing and saving the configuration settings JSON in the profile page, your search snippets will be shown as suggested filters on search results pages. ![Snippets are in the search side panel](https://storage.googleapis.com/sourcegraph-assets/Docs/search-snippets.png)
# Search Subexpressions

This page provides docs about using Search Subexpressions in Sourcegraph's Code Search.

Search subexpressions combine groups of [filters](/code-search/queries#filters-all-searches) like `repo:` and [operators](/code-search/queries#boolean-operators) like `or`. Compared to [basic examples](/code-search/queries/examples), search subexpressions allow more sophisticated queries. Here are examples of how they can help you: 1. [Noncompliant spelling where case-sensitivity differs depending on the word](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+%28%28Github+case:yes%29+or+%28organisation+case:no%29%29&patternType=keyword). ```sgquery repo:sourcegraph ((Github case:yes) or (organisation case:no)) ``` The about code finds places to change the spelling of `Github` to `GitHub` (case-sensitivity matters) or change the spelling of `organisation` to `organization` (case-sensitivity does not matter). 2. [Search for either a file name or file contents scoped to the same repository](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+-file:html+%28file:router+or+newRouter%29&patternType=keyword). ```sgquery repo:sourcegraph -file:html (file:router or newRouter) ``` The above code finds both files containing the word `router` or file contents matching `newRouter` in the same repository, while excluding `html` files. Useful when exploring files or code that interact with a general term like `router`. 3. [Scope file content searches to particular files or repositories](https://sourcegraph.com/search?q=+repo:sourcegraph+%28%28file:schema%5C.graphql+hover%28...%29%29+or+%28file:codeintel%5C.go+%28Line+or+Character%29%29%29&patternType=structural) ```sgquery repo:sourcegraph ( (file:schema.graphql hover(...)) or (file:codeintel.go (Line or Character)) ) patterntype:structural ``` Combine matches of `hover(...)` in the `schema.graphql` file and matches of `Line` or `Character` in the `codeintel.go` file in the same repository. Useful for crafting queries that precisely match related fragments of a codebase to capture context and e.g., share with coworkers. The query is formatted for readability, it is valid as a single line query. 4. [Search across multiple repositories at multiple revisions](https://sourcegraph.com/search?q=%28repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24%40v3.22.0:v3.22.1+or+repo:%5Egithub%5C.com/sourcegraph/src-cli%24%403.22.0:3.22.1%29+file:CHANGELOG+campaigns&patternType=keyword). ```sgquery ( repo:^github\.com/sourcegraph/sourcegraph$@v3.22.0:v3.22.1 or repo:^github\.com/sourcegraph/src-cli$@3.22.0:3.22.1 ) file:CHANGELOG campaigns ``` Finds the word `campaigns` in `CHANGELOG` files for two repositories, `sourcegraph/sourcegraph ` or `sourcegraph/src-cli`, at specific revisions. Useful for searching across a larger scope of repositories at particular revisions. ## General tips for crafting queries with subexpressions ### Fully parenthesize subexpressions It's best practice to parenthesize queries to avoid confusion. For example, there are multiple ways to group the query, which is not fully parenthesized: ```sgquery repo:sourcegraph (Github case:yes) or (organisation case:no) ``` It could mean either of these: ```sgquery (repo:sourcegraph (Github case:yes)) or (organisation case:no) ``` ```sgquery repo:sourcegraph ((Github case:yes) or (organisation case:no)) ``` When parentheses are absent, we use the convention that operators divide sequences of terms that should be grouped together. That is: `file:main.c char c or (int i and int j)` generally means `(file:main.c char c) or (int i and int j)`. This convention means we would pick the following meaning of the original query, but it may not be what you intended: ```sgquery (repo:sourcegraph (Github case:yes)) or (organisation case:no) ``` Fully parenthesizing subexpressions makes it clear what the intent is, so that you can avoid relying on conventions that may not interpret the query the way you intended. ### Subexpression expansion If you're unsure whether a subexpression is valid, it may be useful to think in terms of how a subexpression expands to multiple independent queries. Expansion relies on a distributive property over `or`-expressions. For example: ```sgquery repo:sourcegraph ((Github case:yes) or (organisation case:no)) ``` This is equivalent to expanding the query by putting `repo:sourcegraph` inside each subexpression: ```sgquery (repo:sourcegraph Github case:yes) or (repo:sourcegraph organisation case:no) ``` This query is valid because each side of the `or` operator is a valid query. On the other hand, the following query is **invalid**: ```sgquery repo:sourcegraph case:yes (Github or (case:no organisation)) ``` Because after expanding it is equivalent to: ```sgquery (repo:sourcegraph case:yes Github) or (repo:sourcegraph case:yes case:no organisation) ``` After expanding, the right-hand side contains both `case:yes` and `case:no`. Since this subpart of the query is invalid, the original query is also invalid.
# Search Filters This page provides docs about how Search Filters UI works with Sourcegraph. Note: if you're looking for the filters search query syntax documentation you can find it in [search query syntax filters section](/code-search/queries#filters-all-searches) Search Query Syntax might not be that straightforward for new Sourcegraph users. It has a lot of query filters and operators, and it isn't easy sometimes to figure out how to use filters properly. With Search Filters UI, you can filter down your search results through the UI panel without manually modifying your query. ![Search filters are in the search result side panel](https://storage.googleapis.com/sourcegraph-assets/Docs/search-results-with-filters.png) The search filters UI panel tries to represent the most important filters in the search query syntax, and it should be straightforward enough to use without any additional knowledge about search query filters. However, here is a short list of facts to help you use them more effectively. ## 1. Search filters are derived from search results All filters that you can see in the panel are calculated from search matches that Sourcegraph found based on your query. This means that if your query doesn't return any symbols, diff or commit matches, there won't be a symbol, commit, diff related filters in the panel. ## 2. Default search filters If you try to run a search query without any `type:` filters, Sourcegraph will search results within three search types - `type:file` matches within file content - `type:repo` matches with repositories names - `type:path` matches with file names ![Snippets are in the search side panel](https://storage.googleapis.com/sourcegraph-assets/Docs/search-filters-by-type.png) If you want to search within some specific type, you can pick this type in the "By Type" filter section. ## 3. Search filters are not exhaustive By default, if your query has no `count:` filter Sourcegraph provides only 10k first results. This means that it is possible that you won't see some repositories in the "By repository" section if the search result limit is hit, even if this repository exists on your Sourcegraph's instance. To increase this limit and make sure your query and filters are exhaustive, include `count:all` in your query or select this option in the filter panel UI. ![Snippets are in the search side panel](https://storage.googleapis.com/sourcegraph-assets/Docs/search-filters-exhastive.png) ## 4. Move filters to the query Selected filters are preserved in the URL so you can easily share URl with other Sourcegraph users, and they will see selected filters. However, search query is still our first-class entity in Sourcegraph's ecosystem (code monitoring, batch changes, code insights). There is a way to convert your selected filters into your query by clicking the "Move filters to the query" button. ## 5. Filters are global `End query = Search Bar's query + Filters Panel UI query` The Filters panel works in a way that adds search query syntax filter operators to the original query in the search bar. This means that selected through filter UI panel filters are global, and this works just fine with simple queries, but if your query has complex parts and contains multiple operands and has `AND` and/or `OR` operators, we suggest using filters UI panel with caution since it may produce incorrect query. For example if your original query is `(test1 repo:sourcegraph/sourcegraph) OR (test2 repo:sourcegraph/about)` and you select `sourcegraph/sourcegraph` filter in the filters UI panel this filter will be applied for both operands `test1 repo:sourcegraph/sourcegraph` and `test2 repo:sourcegraph/about` # Search Contexts

This page provides docs about Search Contexts in Sourcegraph's Code Search.

Search Contexts help you search the code you care about on Sourcegraph. A search context represents a set of repositories at specific revisions on a Sourcegraph instance that will be targeted by search queries by default. Every search on Sourcegraph uses a search context. Search contexts can be defined with the contexts selector shown in the search input, or entered directly in a search query. ## Available contexts **Sourcegraph.com** supports a [set of predefined search contexts](https://sourcegraph.com/contexts?order=spec-asc&visible=17&owner=all) that include: - The global context, `context:global`, which includes all repositories on Sourcegraph.com. - Search contexts for various software communities like [CNCF](https://sourcegraph.com/search?q=context:CNCF), [crates.io](https://sourcegraph.com/search?q=context:crates.io), [JVM](https://sourcegraph.com/search?q=context:JVM), and more. If no search context is specified, `context:global` is used. **Private Sourcegraph instances** support custom search contexts: - Contexts owned by a user, such as `context:@username/context-name`, which can be private to the user or public to all users on the Sourcegraph instance. - Contexts at the global level, such as `context:example-context`, which can be private to site admins or public to all users on the Sourcegraph instance. - The global context, `context:global`, which includes all repositories on the Sourcegraph instance. ## Using search contexts The search contexts selector is shown in the search input. All search queries will target the currently selected search context. To change the current search context, press the contexts selector. All of your search contexts will be shown in the search contexts dropdown. Select or use the filter to narrow down to a specific search context. Selecting a different context will immediately re-run your current search query using the currently selected search context. Search contexts can also be used in the search query itself. Type `context:` to begin defining the context as part of the search query. When a context is defined in the search query itself, it overrides the context shown in the context selector. You can also search across multiple contexts at once using the `OR` [boolean operator](/code-search/queries#boolean-operators). For example: `(context:release1 OR context:release2 OR context:release3) someTerribleBug` ## Organizing search contexts To organize your search contexts better, you can use a specific context as your default and star any number of contexts. This affects what context is selected when loading Sourcegraph and how the list of contexts is sorted. ### Default context Any authenticated user can use a search context as their default. To set a default, go to the search context management page, open the "..." menu for a context, and click on "Use as default". If the user doesn't have a default, `global` will be used. If a user ever loses access to their default search context (eg. the search context is made private), they will see a warning at the top of the search contexts dropdown menu list and `global` will be used. If a user's default search context is deleted, `global` will immediately be set as their default. The default search context is always selected when loading the Sourcegraph webapp. The one exception is when opening a link to a search query that does not contain a `context:` filter, in which case the `global` context will be used. ### Starred contexts Any authenticated user can star a search context. To star a context, click on the star icon in the search context management page. This will cause the context to appear near the top of their search contexts list. The `global` context cannot be starred. ### Sort order The order of search contexts in the search results dropdown menu list and in the search context management page is always the following: - The `global` context first - The user's default context, if set - All of the user's starred contexts - Any remaining contexts available ## Creating search contexts When search contexts are [enabled on your private Sourcegraph instance](/code-search/features#search-contexts), you can create your own search contexts. A search context consists of a name, description, and a set of repositories at one or many revisions. Contexts can be owned by a user, and can be private to the user or public to all users on the Sourcegraph instance. Contexts can also be at the global instance level, and can be private to site admins or public to all users on the Sourcegraph instance. ### Creating search contexts from header navigation - Go to **User menu > Search contexts** in the top navigation bar. - Press the **+ Create search context** button. - In the **Owner** field, choose whether you will own the context or if it will be global to the Sourcegraph instance. **Note**: At present, the owner of a search context cannot be changed after being created. - In the **Context name** field, type in a short, semantic name for the context. The name can be 32 characters max, and contain alphanumeric and `.` `_` `/` `-` characters. - Optionally, enter a **Description** for the context. Markdown is supported. - Choose the **Visibility** of this context. - Public contexts are available to everyone on the Sourcegraph instance. Note that private repositories will only be visible to users that have permission to view the repository via the code host. - Private contexts can only be viewed by their owner, or in the case being globally owned, by site admins. - In the **Repositories and revisions** configuration, define which repositories and revisions should be included in the search context. Press **Add repository** to quickly add a template to the configuration. - Define repositories with valid URLs. - Define revisions as strings in an array. To specify a default branch, use `"HEAD"`. For example: ```json [ { "repository": "github.com/sourcegraph/sourcegraph", "revisions": [ "3.15" ] }, { "repository": "github.com/sourcegraph/src-cli", "revisions": [ "3.11.2" ] } ] ``` - Press **Test configuration** to validate the repositories and revisions. - Press **Create search context** to finish creating your search context. You will be returned to the list of search contexts. Your new search context will appear in the search contexts selector in the search input, and can be [used immediately](#using-search-contexts). ## Query-based search contexts As of release 3.36, search contexts can be defined with a restricted search query as an alternative to a specific list of repositories and revisions. Allowed filters are: `repo`, `rev`, `file`, `lang`, `case`, `fork`, and `visibility`. `OR` and `AND` expressions are also allowed. Currently, repo built in predicates for example `repo:has.file`, `repo:has.content` etc, aren't currently supported in search contexts. If you're an admin, to enable this feature for all users set `experimentalFeatures.searchContextsQuery` to `true` in your global settings (for regular users, just use the normal settings menu). You'll then see a "Create context" button from the search results page and a "Query" input field in the search contexts form. If you want revisions specified in these query based search contexts to be indexed, set `experimentalFeatures.search.index.query.contexts` to `true` in site configuration. ### Creating search contexts from search results You can now create new search contexts right from the search results page. Once you've enabled query-based search contexts you'll see a Create context button above the search results. ## Managing search contexts with the API Learn how to [manage search contexts with the GraphQL API](/api/graphql/managing-search-contexts-with-api).
# Saved Searches

This page provides docs about how Saved Searches work with Sourcegraph.

Saved Searches lets you reuse and share search queries. You can create a saved search for anything, including diffs and commits across all branches of your repositories. Saved Searches functionality is available to both Free and Enterprise Code Search users. To access or create new Saved Searches in the Sourcegraph web app, click the **Tools > Saved Searches** in the top navigation bar. ![saved-searhces](https://storage.googleapis.com/sourcegraph-assets/Docs/saved-searches-2025.png) ## Creating saved searches To create a new saved search: - Go to the Saved Searches section and click the **New saved search** button - Fill out the description field and enter the search query - While writing the query syntax, ensure to include the `patternType:` field A `patternType:` filter is required in the query for all saved searches. `patternType` can be `keyword`, `standard`, `literal`, or `regexp`. You cannot create a saved search without defining the `patternType:` field. ![create-new-saved-search](https://storage.googleapis.com/sourcegraph-assets/Docs/create-new-saved-search-2025.png) Enable the checkbox for **Draft** if you don't want other users to use your saved search. This is useful for testing the query before sharing it with others. Once done, click the **Create saved search** button to be redirected to the Saved Searches page. Your saved search will appear with a `Secret` label, which means that only you can view and use it. To let others use your saved search, you need to transfer it to an organization and ask the site admin to make it public. In addition, you can also search within your saved searches and sort your saved searches by name, recently updated, and description. ![view-saved-searches](https://storage.googleapis.com/sourcegraph-assets/Docs/view-saved-searches-0824.png) ### Transfer ownership To transfer ownership of a saved search, click the **Edit** button next to it, click the **Transfer ownership** button, and select the organization to which you want to transfer the saved search. ![transfer-ownership](https://storage.googleapis.com/sourcegraph-assets/Docs/transfer-ownership-saved-search-2025.png) ## Example saved searches See the [search examples page](/code-search/queries/examples) for a useful list of searches to save.
# Symbol search Supported on [Enterprise Starter](/pricing/enterprise-starter) and [Enterprise](/pricing/enterprise) plans. Available via VS Code and JetBrains editor extensions and the Web. We use [Ctags](https://github.com/universal-ctags/ctags) to index the symbols of a repository on demand. These symbols are used to implement symbol search, matching declarations instead of plain text. ![symbol-search](https://storage.googleapis.com/sourcegraph-assets/Docs/Symbols.png) ## Symbol sidebar The extracted `ctags` symbols are also used for the symbol sidebar, which categorizes declarations by type (variable, function, interface, etc). Clicking on a symbol in the sidebar jumps you to the line where it is defined. ![symbol-sidebar](https://storage.googleapis.com/sourcegraph-assets/Docs/SymbolSidebar.png) ## Symbol search behavior and performance Here is the query path for symbol searches: - **Zoekt**: if [indexed search](/admin/search#indexed-search) is enabled and the search is for the tip commit of an indexed branch, then Zoekt will service the query and it should respond quickly. Zoekt indexes the default branch (usually `master` or `main`) and can be configured for [multi-branch indexing](/code-search/features#multi-branch-indexing-experimental). The high commit frequency of monorepos reduces the likelihood that Zoekt will be able to respond to symbol searches. Zoekt **eagerly** indexes by listening to repository updates, whereas the symbols service **lazily** indexes the commit being searched. - **Symbols service with Rockskip enabled**: if [Rockskip](/code-search/code-navigation/rockskip) is enabled, it'll search for symbols stored in Postgres. After initial indexing, queries should be resolved quickly. - **Symbols service with an index for the commit**: if the symbols service has already indexed this commit (i.e. someone has visited the commit before) then the query should be resolved quickly. Indexes are deleted in LRU fashion to remain under the configured maximum disk usage which [defaults to 100GB](/code-search/code-navigation/search_based_code_navigation#what-configuration-settings-can-i-apply). - **Symbols service with an index for a different commit**: if the symbols service has already indexed a **different** commit in the same repository, then it will make a copy of the previous index on disk then run [ctags](https://github.com/universal-ctags/ctags#readme) on the files that changed between the two commits and update the symbols in the new index. This process takes roughly 20 seconds on a monorepo with 40M LOC and 400K files. - **Symbols service without any indexes (cold start)**: if the symbols service has never seen this repository before, then it needs to run ctags on all symbols and construct the index from scratch. This process takes roughly 20 minutes on a monorepo with 40M LOC and 400K files. Once the symbols service has built an index for a commit, here's the query performance: - Exact matches `^foo$` are optimized to use an index - Prefix matches `^foo` are optimized to use an index - General regex queries `foo.*bar` are optimized to use an index when using [Rockskip](/code-search/code-navigation/rockskip), otherwise the default implementation needs to scan every symbol - Path filtering `file:^cmd/` helps narrow the search space Search-based code navigation uses exact matches `^foo$` and the symbols sidebar uses prefix matches on paths `file:^cmd/` to respond quickly. # Structural Search

Learn and understand about Sourcegraph's Structural Search and core functionality.

Changed in version 5.3. Structural search is disabled by default. To enable it, ask your site administrator to set experimentalFeatures.structuralSearch = "enabled" in site configuration. Structural search has performance limitations and is not actively developed. We recommend using regex search or a combination of [Search Jobs](./search-jobs.mdx) and custom scripts instead. Please reach out to [support@sourcegraph.com](mailto:support@sourcegraph.com) for guidance on alternative approaches. With structural search, you can match richer syntax patterns specifically in code and structured data formats like JSON. It can be awkward or difficult to match code blocks or nested expressions with regular expressions. To meet this challenge we've introduced a new and easier way to search code that operates more closely on a program's parse tree. We use [Comby syntax](https://comby.dev/docs/syntax-reference) for structural matching. Below you'll find examples and notes for this language-aware search functionality. ## Example The `fmt.Sprintf` function is a popular print function in Go. Here is a pattern that matches all the arguments in `fmt.Sprintf` calls in our code: ```go fmt.Sprintf(...) ``` The `...` part is special syntax that matches all characters inside the _balanced_ parentheses `(...)`. Let's look at two interesting variants of matches in our codebase. Here's one: ```go fmt.Sprintf("must be authenticated as an admin (%s)", isSiteAdminErr.Error()) ``` Note that to match this code, we didn't have to do any special thinking about handling the parentheses `(%s)` that happen _inside_ the first string argument, or the nested parentheses that form part of `Error()`. Unlike regular expressions, no "overmatching" can happen and the match will always respect balanced parentheses. With regular expressions, taking care to match the closing parentheses for this call could, in general, really complicate matters. Here is a second match: ```go fmt.Sprintf( "rest/api/1.0/projects/%s/repos/%s/pull-requests/%d", pr.ToRef.Repository.Project.Key, pr.ToRef.Repository.Slug, pr.ID, ) ``` Here we didn't have to do any special thinking about matching contents that spread over multiple lines. The `...` syntax by default matches across newlines. Structural search supports balanced syntax like `()`, `[]`, and `{}` in a language-aware way. This allows it to match large, logical blocks or expressions without the limitations of typical line-based regular expression patterns. ## Syntax reference The syntax `...` above is an alias for a canonical syntax `:[hole]`, where `hole` is a descriptive identifier for the matched content. Identifiers are useful when expressing that matched content should be equal (see the [`return :[v.], :[v.]`](#match-equivalent-expressions) example below). Here is a table of additional syntax. | **Syntax** | **Alias** | **Description** | | ------------------------ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `...` | `:[hole]`
`:[_]` | Match zero or more characters in a lazy fashion. When `:[hole]` is inside delimiters, as in `{:[h1], :[h2]}` or `(:[h])`, holes match within that group or code block, including newlines. | | `:[~regexp]` | `:[hole~regexp]` | Match an arbitrary [regular expression](https://golang.org/s/re2syntax) `regexp`. A descriptive identifier like `hole` is optional. Avoid regular expressions that match special syntax like `)` or `.*`, otherwise your pattern may fail to match balanced blocks. | | `:[[_]]`
`:[[hole]]` | `:[~\w+]`
`:[hole~\w+]` | Match one or more alphanumeric characters and underscore. | | `:[hole\n]` | `:[~.*\n]`
`:[hole~.*\n]` | Match zero or more characters up to a newline, including the newline. | | `:[ ]`
`:[ hole]` | `:[~[ \t]+]`
`:[hole~[ \t]+]` | Match only whitespace characters, excluding newlines. | | `:[hole.]` | `[_.]` | Match one or more alphanumeric characters and punctuation like `.`, `;`, and `-` that do not affect balanced syntax. Language dependent. | To match the string `...` literally, use regular expression patterns like `:[~[.]{3}]` or `:[~\.\.\.]`. ### Rules [Comby supports rules](https://comby.dev/docs/advanced-usage) to express equality constraints or pattern-based matching. Comby rules are not officially supported in Sourcegraph yet. We are in the process of making that happen and are taking care to address stable performance and usability. That said, you can explore rule functionality with an experimental `rule:` parameter. For example: [`buildSearchURLQuery(:[first], ...) rule:'where match :[first] { | " query: string" -> true }'`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:.ts+buildSearchURLQuery%28:%5Bfirst%5D%2C+...%29+rule:%27where+match+:%5Bfirst%5D+%7B+%7C+%22+query:+string%22+-%3E+true+%7D%27&patternType=structural) ## More examples Here are some additional examples. ### Match stringy data Taking the original `fmt.Sprintf(...)` example, let's modify the original pattern slightly to match only if the first argument is a string. We do this by adding string quotes around `...`. Adding quotes communicates _structural context_ and changes how the hole behaves: it will match the contents of a single string delimited by `"`. It _won't_ match multiple strings like `"foo", "bar"`. ```go fmt.Sprintf("...", ...) ``` Some matched examples are: ```go fmt.Sprintf("external service not found: %v", e.id) ``` ```go fmt.Sprintf("%s/campaigns/%s", externalURL, string(campaignID)) ``` Holes stop matching based on the first fragment of syntax that comes after it, similar to lazy regular expression matching. So, we could write: ```go fmt.Sprintf(:[first], :[second], ...) ``` To match all functions with three or more arguments, matching the `first` and `second` arguments based on the contextual position around the commas. ### Match equivalent expressions Using the same identifier in multiple holes adds a constraint that both of the matched values must be syntactically equal. So, the pattern: ```go return :[v.], :[v.] ``` Will match code where two identifier-like tokens in the `return` statement are the same. For example, `return true, true`, `return nil, nil`, or `return 0, 0`. ### Match JSON Structural search also works on structured data, like JSON. Use patterns to declaratively describe pieces of data to match. For example, the pattern: ```json "exclude": [...] ``` Matches all parts of a JSON document that have a member `"exclude"` where the value is an array of items. Visit our [structural search blog post](https://about.sourcegraph.com/blog/going-beyond-regular-expressions-with-structural-code-search) for more. ### Current functionality and configuration Structural search behaves differently to plain text search in key ways. We are continually improving the functionality of this new feature, so please note the following: - **Only indexed repos.** Structural search can currently only be performed on _indexed_ repositories. See [configuration](/admin/search) for more details if you host your own Sourcegraph installation. Our service hosted at [sourcegraph.com](https://sourcegraph.com/search) indexes approximately 200,000 of the most popular repositories on GitHub. Other repositories are currently unsupported. To see whether a repository on your instance is indexed, visit `https://.com/repo-org/repo-name/-/settings/index`. - **The `lang` filter is semantically significant.** Adding the `lang` [filter](/code-search/queries) informs the parser about language-specific syntax for comments, strings, and code. This makes structural search more accurate for that language. For example, `fmt.Sprintf(...) lang:go`. If `lang` is omitted, Sourcegraph will attempt a best-effort inference of the language based on matching file extensions or fall back to a generic structural matcher. - **Saved searches are not supported.** It is not currently possible to save structural searches. - **Matching blocks in indentation-sensitive languages.** It's not currently possible to match blocks of code that are indentation-sensitive. This is a feature planned for future work.
# Search Jobs Supported on [Enterprise](/pricing/enterprise) plans. Currently available via the Web app. Use Search Jobs to search code at scale for large-scale organizations. Search Jobs allows you to run search queries across your organization's codebase (all repositories, branches, and revisions) at scale. It enhances the existing Sourcegraph's search capabilities, enabling you to run searches without query timeouts or incomplete results. With Search Jobs, you can start a search, let it run in the background, and then download the results from the Search Jobs UI when it's done. Site administrators can **enable** or **disable** the Search Jobs feature, making it accessible to all users on the Sourcegraph instance. ## Using Search Jobs To use Search Jobs, you need to: - Run a search query from your Sourcegraph instance - Click the result menu below the search bar to see if your query is supported by Search Jobs ![run-query-for-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-create.png) - If your query is valid, click **Create a search job** to initiate the search job - You will be redirected to the "Search Jobs UI" page at `/search-jobs`, where you can view all your created search jobs. If you're a site admin, you can also view search jobs from other users on the instance - For each search job, you can download the results by clicking the **Download** button. The results are formatted as JSON lines, see [Search results format](#search-results-format) for more details. ![view-search-jobs](https://storage.googleapis.com/sourcegraph-assets/Docs/search-jobs/search-jobs-manage-with-frame.png) ## Search results format The downloaded results are formatted as [JSON lines](https://jsonlines.org). The JSON objects have the same format as the (event-type) matches served by the [Stream API](/api/stream_api#event-types). Here is an example of a JSON lines results file for a search job that ran the query `r:github.com/sourcegraph/sourcegraph handlePanic`. The search returned 4 results in 2 files: ```json lines {"type":"content","path":"cmd/symbols/shared/main.go","repositoryID":399,"repository":"github.com/sourcegraph/sourcegraph","branches":["HEAD"],"commit":"9b47c6430cc3c9cb16695b4fa0a1a277cbbdb327","hunks":null,"chunkMatches":[{"content":"func handlePanic(logger log.Logger, next http.Handler) http.Handler {","contentStart":{"offset":4526,"line":129,"column":0},"ranges":[{"start":{"offset":4531,"line":129,"column":5},"end":{"offset":4542,"line":129,"column":16}}]},{"content":"\thandler = handlePanic(logger, handler)","contentStart":{"offset":3570,"line":98,"column":0},"ranges":[{"start":{"offset":3581,"line":98,"column":11},"end":{"offset":3592,"line":98,"column":22}}]}],"language":"Go"} {"type":"content","path":"cmd/embeddings/shared/main.go","repositoryID":399,"repository":"github.com/sourcegraph/sourcegraph","branches":["HEAD"],"commit":"9b47c6430cc3c9cb16695b4fa0a1a277cbbdb327","hunks":null,"chunkMatches":[{"content":"func handlePanic(logger log.Logger, next http.Handler) http.Handler {","contentStart":{"offset":6585,"line":190,"column":0},"ranges":[{"start":{"offset":6590,"line":190,"column":5},"end":{"offset":6601,"line":190,"column":16}}]},{"content":"\thandler = handlePanic(logger, handler)","contentStart":{"offset":2844,"line":81,"column":0},"ranges":[{"start":{"offset":2855,"line":81,"column":11},"end":{"offset":2866,"line":81,"column":22}}]}],"language":"Go"} ``` ## Configure Search Jobs Search Jobs requires an object storage to store the results of your search jobs. By default, Search Jobs stores results using our bundled `blobstore` service. If the `blobstore` service is deployed, and you want to use it to store results from Search Jobs, you don't need to configure anything. To use a third party managed object storage service, see instructions in [externalizing object storage](../../admin/external_services/object_storage#search-job-results). ## Supported result types Search jobs supports the following result types: - `file` - `path` - `diff` - `commit` The following result types are not supported: - `symbol` - `repo` ## Limitations The following elements of our query language are not supported: - file predicates, such as `file:has.content`, `file:has.owner`, `file:has.contributor`, `file:contains.content` - catch-all `.*` regexp search - Multiple `rev` filters - Queries with `index: filter` Alternatively, the search bar supports the `count:all` operator which increases result limits and timeouts. This works well if the search completes within a few minutes and the number of results is less than the configured display limit. For longer running searches and searches with huge result sets, Search Jobs is the better choice. ## Disable Search Jobs To disable Search Jobs, set `DISABLE_SEARCH_JOBS=true` in your frontend and worker services. ## FAQ ### How can I run a search job against all branches and all repositories? You can use a combination of the `repo:` and `rev:` filter to search across all branches and repositories. For example, `r: rev:*/refs/heads/* foo` will search for `foo` across all branches and all repositories. See the [search syntax documentation](/code-search/queries#repository-revisions) for more details. ### Is there a time limit for a search job? We break down a search job into smaller tasks and run them in parallel. Each task is limited to a single revision and a single repository. This allows us to run searches across large codebases. The chance of hitting timeouts is very low, but it's not impossible. If you do hit a timeout, please reach out to support and we will help you troubleshoot the issue. As an immediate measure, you can break down your search query into smaller queries and run them separately. ### A search job failed, how can I find out what went wrong? We mark a search job as failed if any of the tasks fail. You can access the log of a search job from the search jobs UI. The log contains one line per task. If a task fails, the log will contain the error message. # Fuzzy Finder

Learn and understand about Sourcegraph's Fuzzy Search and core functionality.

Use the fuzzy finder to quickly navigate to a repository, symbol, or file. To open the fuzzy finder, press `Cmd+K` (macOS) or `Ctrl+K` (Linux/Windows) from any page. Use the dedicated Repos, Symbols, and Files tabs to search only for a repository, symbol, or file. Each tab has a dedicated shortcut: - **Repos**: Cmd+I (macOS), Ctrl+K (Linux/Windows) - **Symbols**: Cmd+O (macOS), Cmd+Shift+O (macOS Safari), Ctrl+O (Linux/Windows) - **Files**: Cmd+P (macOS), Ctrl+P (Linux/Windows) Fuzzy finder Use the **Searching everywhere** or **Searching in this repo** filter to determine whether to search for results only in the active repository or globally. Fuzzy finder
# Search Query Language Reference

This page provides a visual breakdown of the Search Query Language with some examples to get you started.

It is complementary to our [Search Query Syntax](/code-search/queries) and illustrates syntax using railroad diagrams instead of tables. ## How to read railroad diagrams? Follow the lines in these railroad diagrams to see how pieces of syntax combine. When a line splits, it means there are multiple options available. When it is possible to repeat a previous syntax, the split line will loop back on itself like this: ![repeatable](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repeatable-lang.png) ## Basic query ![basic-query](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/basic-query.png) At a basic level, a query consists of [search patterns](#search-pattern) and [parameters](#parameter). Typical queries contain one or more space-separated search patterns that describe what to search, and parameters refine searches by filtering results or changing search behavior. For example, - [`repo:github.com/sourcegraph/sourcegraph file:schema.graphql The result`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:schema.graphql+%22The+result%22&patternType=keyword) ## Expression ![expression](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/expression.png) Build query expressions by combining [basic queries](#basic-query) and operators like `AND` or `OR`. Group expressions with parentheses to build more complex expressions. If there are no balanced parentheses, `AND` operators bind tighter, so `foo or bar and baz` means `foo or (bar and baz)`. You may also use lowercase `and` or `or`. For example, - [`repo:github.com/sourcegraph/sourcegraph rtr AND newRouter`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rtr+AND+newRouter&patternType=keyword) ## Search pattern ![search-pattern](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/search-pattern.png) A pattern to search. By default, the pattern is searched literally. The kind of search may be toggled to change how a pattern matches: Perform a [regular expression search](/code-search/queries#regular-expression-search). We support [RE2 syntax](https://golang.org/s/re2syntax). Quoting a pattern will perform a literal search. For example, - [`foo.*bar.*baz`](https://sourcegraph.com/search?q=foo.*bar.*baz&patternType=regexp) - [`"foo bar"`](https://sourcegraph.com/search?q=%22foo+bar%22&patternType=regexp) ## Parameter ![parameter](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/parameter.png) Search parameters allow you to filter search results or modify search behavior. ### Repo ![repo](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo.png) Search repositories that match the regular expression. A `-` before `repo` excludes the repository. By default, the repository will be searched at the `HEAD` commit of the default branch. You can optionally change the [revision](#revision). For example, - [`repo:gorilla/mux testroute`](https://sourcegraph.com/search?q=repo:gorilla/mux+testroute&patternType=regexp) - [`-repo:gorilla/mux testroute`](https://sourcegraph.com/search?q=-repo:gorilla/mux+testroute&patternType=regexp) ### Revision ![revision](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/revision.png) Search a repository at a given revision, for example, a branch name, commit hash, or Git tag. For example, - [`repo:^github\.com/sourcegraph/sourcegraph$@75ba004 get_embeddings`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24%4075ba004+get_embeddings+&patternType=keyword) - [`repo:^github\.com/sourcegraph/sourcegraph$ rev:v5.0.0 get_embeddings`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:v5.0.0+get_embeddings&patternType=keyword) You can search multiple revisions by separating the revisions with `:`. Specify `HEAD` for the default branch. For example, - [`repo:^github\.com/sourcegraph/sourcegraph$ rev:v4.5.0:v5.0.0 disableNonCriticalTelemetry`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:v4.5.0:v5.0.0+disableNonCriticalTelemetry&patternType=keyword) - [`repo:^github\.com/sourcegraph/sourcegraph$@v4.5.0:v5.0.0 disableNonCriticalTelemetry`](https://sourcegraph.com/search?q=context%3Aglobal+repo%3A%5Egithub%5C.com%2Fsourcegraph%2Fsourcegraph%24%40v4.5.0%3Av5.0.0+disableNonCriticalTelemetry&patternType=keyword) ### Revision at time This feature is only supported for Sourcegraph versions 5.4 or more. Search a repository at a given time. Optionally, a second parameter can be used to specify a revision which will be used as the starting point of the search. For example, - [`repo:^github\.com/sourcegraph/sourcegraph$ rev:at.time(2 years ago) handbook`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:at.time%282+years+ago%29+handbook&patternType=keyword&sm=0) - [`repo:^github\.com/sourcegraph/sourcegraph$ rev:at.time(2021-01-30, v5.0.0) popular`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:at.time%282021-01-30%2C+v5.0.0%29+popular&patternType=keyword&sm=0) ### File ![file](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/files.png) Search files whose full path matches the regular expression. A `-` before `file` excludes the file from being searched. For example, - [`file:\.js$ httptest`](https://sourcegraph.com/search?q=file:%5C.js%24+httptest&patternType=regexp) - [`file:\.js$ -file:test http`](https://sourcegraph.com/search?q=file:%5C.js%24+-file:test+http&patternType=regexp) ### Language ![language](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/language.png) Only search files in the specified programming language, like `typescript` or `python`. For example, - [`lang:typescript encoding`](https://sourcegraph.com/search?q=lang:typescript+encoding&patternType=regexp) #### Content-based language detection (Beta) Language filters work by checking the file name and extension. They can behave unexpectedly when a language's extension is ambiguous: for example `lang:Objective-C` may also match Matlab files, since both languages use the `.m` extension. If this is an issue, you can enable the feature flag `search-content-based-lang-detection`. When enabled, Sourcegraph more accurately detects a file's language by checking the file contents in addition to the name and extension. ### Content ![content](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/content.png) Set the search pattern to search using a dedicated parameter. Useful, for example, when searching literally for a string like `repo:my-repo` that may conflict with the syntax of parameters in this Sourcegraph language. For example, - [`repo:sourcegraph content:"repo:sourcegraph"`](https://sourcegraph.com/search?q=repo:sourcegraph+content:%22repo:sourcegraph%22&patternType=keyword) ### Select ![select](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/select.png) Selects the specified result type from the set of search results. If a query produces results that aren't of the selected type, the results will be converted to the selected type. For example, the query `file:package.json lodash` will return content matches for `lodash` in `package.json` files. If `select:repo` is added, the containing repository will be selected and the _repositories_ that contain `package.json` files that contain the term `lodash` will be returned. All selected results are deduplicated, so if there are multiple content matches in a repository, `select:repo` will still only return unique results. A query like `type:commit example select:symbol` will return no results because commits have no associated symbol and cannot be converted to that type. For example, - [`fmt.Errorf select:repo`](https://sourcegraph.com/search?q=fmt.Errorf+select:repo&patternType=keyword) - [`zoektSearch select:file`](https://sourcegraph.com/search?q=zoektSearch+select:file&patternType=keyword) #### Symbol kind ![symbol-kind](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/symbol-kind.png) Select a specific kind of symbol. For example `type:symbol select:symbol.function zoektSearch` will only return functions that contain the literal `zoektSearch`. For example, - [`type:symbol zoektSearch select:symbol.function`](https://sourcegraph.com/search?q=type:symbol+zoektSearch+select:symbol.function&patternType=keyword) #### Modified lines ![modified-lines](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/modified-lines.png) When searching commit diffs, select only diffs where the pattern matches on `added` or `removed` lines. For example, search for recent commits that removed `TODO`s in your code. If any line exists that satisfies the condition, the entire diff is included in the result set. `type:diff` must be specified in the query. For example, - [`repo:^github\.com/sourcegraph/sourcegraph$ type:diff TODO select:commit.diff.removed`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type:diff+TODO+select:commit.diff.removed+&patternType=keyword) #### File kind ![file-kind](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/file-kind.png) Select only directory paths of file results with `select:file.directory`. This is useful for discovering the directory paths that specify a `package.json` file, for example. `select:file.path` returns the full path for the file and is equivalent to `select:file`. It exists as a fully-qualified alternative. For example, - [`file:package\.json select:file.directory`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:package%5C.json+select:file.directory&patternType=keyword) #### File owners ![file-owners](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/file-owners.png) Select owners associated with the results of a query. For example, `lang:TypeScript select:file.owners` displays owners of all TypeScript files. ### Type ![type](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/type.png) Set whether the search pattern should perform a search of a certain type. Notable search types are symbol, commit, and diff. For example, - [`type:symbol path`](https://sourcegraph.com/search?q=type:symbol+path)  - [`type:commit author:nick`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph%24+type:commit+author:nick&patternType=regexp) ### Case ![case](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/case.png) Set whether the search pattern should be treated case-sensitively. This is synonymous with the **toggle** button. For example, - [`OPEN_FILE case:yes`](https://sourcegraph.com/search?q=OPEN_FILE+case:yes) ### Fork ![fork](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/fork.png) Set to `yes` if repository forks should be included or `only` if only forks should be searched. Repository forks are excluded by default. For example, - [`fork:yes repo:sourcegraph`](https://sourcegraph.com/search?q=fork:yes+repo:sourcegraph&patternType=regexp) ### Archived ![archived](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/archived.png) Set to `yes` if archived repositories should be included or `only` if only archives should be searched. Archived repositories are excluded by default. For example, - [`archived:only repo:sourcegraph`](https://sourcegraph.com/search?q=archived:only+repo:sourcegraph&patternType=regexp) ### Count ![count](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/count.png) Retrieve N results. By default, Sourcegraph stops searching early and returns if it finds a full page of results. This is desirable for most interactive searches. To wait for all results, use **count:all**. For example, - [`count:1000 function`](https://sourcegraph.com/search?q=count:1000+repo:sourcegraph/sourcegraph%24+function&patternType=regexp) - [`count:all err`](https://sourcegraph.com/search?q=repo:github.com/sourcegraph/sourcegraph+err+count:all&patternType=keyword) ### Timeout ![timeout](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/timeout.png) Set a search timeout. The time value is a string like 10s or 100ms, which is parsed by the Go time package's [ParseDuration](https://golang.org/pkg/time/#ParseDuration). By default, the timeout is set to 10 seconds, and the search will optimize for returning results as soon as possible. The timeout value cannot be set to longer than 1 minute. For example, - [`timeout:15s count:10000 func`](https://sourcegraph.com/search?q=repo:%5Egithub.com/sourcegraph/+timeout:15s+func+count:10000) sets a longer timeout for a search that contains a lot of results. Sourcegraph admins can increase the maximum timeout of 1 minute through [site configuration](/admin/search#maximum-timeout). The maximum timeout can also depend on the HTTP load balancer in front of Sourcegraph (nginx/ELB/Cloudflare/etc). Sourcegraph admins may need to increase timeouts for Sourcegraph paths, particularly the `.api/search/stream` path. This uses [SSE](https://en.wikipedia.org/wiki/Server-sent_events), so your reverse proxy may have specific support for these requests. ### Visibility ![visibility](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/visibility.png) Filter results to only public or private repositories. The default is to include both private and public repositories. For example, - [`type:repo visibility:public`](https://sourcegraph.com/search?q=type:repo+visibility:public&patternType=regexp) ### Pattern type ![pattern-type](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/pattern-type.png) Set whether the pattern should run a [keyword search](/code-search/queries#keyword-search-default) or [regular expression search](/code-search/queries#regular-expression-search). This parameter is available as a command-line and accessibility option and is synonymous with the visual [search pattern](#search-pattern) toggles. ## Built-in repo predicate ![builtin-repo-predicate](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/builtin-repo-predicate.png) ### Repo has meta Tagging repositories with key-value pairs is GA as of 5.1.0, but can be disabled by creating the feature flag `repository-metadata` and setting it to `false`. Add metadata by [following the instructions](/admin/repo/metadata). ![repo-has-meta](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-meta.png) Search only inside repositories that are associated with the provided key-value pair, key, or tag. Keys and value patterns can be literal strings which match the key and value exactly, or they can be slash-delimited regex patterns. For example, - [`repo:has.meta(team:sourcegraph)`](https://sourcegraph.com/search?q=context:global+repo:has.meta%28team:sourcegraph%29&patternType=regexp&sm=1&groupBy=repo) - [`repo:has.meta(team:/[source]{5}graph/)`](https://sourcegraph.com/search?q=context:global+repo:has.meta%28team:/%5Bsource%5D%7B5%7Dgraph/%29&patternType=regexp&sm=1) - [`repo:has.meta(language)`](https://sourcegraph.com/search?q=context%3Aglobal+repo%3Ahas.meta%28language%29&patternType=regexp&sm=1&groupBy=repo) ### Repo has file and content ![repo-has-file-and-content](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-file-and-content.png) Search only inside repositories that contain a file matching the `path:` with `content:` filters. For example, - [`repo:has.file(path:CHANGELOG content:fix)`](https://sourcegraph.com/search?q=context:global+repo:github%5C.com/sourcegraph/.*+repo:has.file%28path:CHANGELOG+content:fix%29&patternType=keyword) `repo:contains.file(...)` is an alias for `repo:has.file(...)` and behaves identically. ### Repo has path ![repo-has-path](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-path.png) Search only inside repositories that contain a file path matching the regular expression. For example, - [`repo:has.path(README)`](https://sourcegraph.com/search?q=context:global+repo:github%5C.com/sourcegraph/.*+repo:has.path%28README%29&patternType=keyword) `repo:contains.path(...)` is an alias for `repo:has.path(..)` and behaves identically. ### Repo has content ![repo-has-content](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-content.png) Search only inside repositories that contain file content matching the regular expression. For example, - [`repo:github\.com/sourcegraph/.*$ repo:has.content(TODO)`](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/.*%24+repo:has.content%28TODO%29&patternType=keyword) `repo:contains.content(...)` is an alias for `repo:has.content(...)` and behaves identically. ### Repo has topic ![repo-has-topic](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-topic.png) Search only inside repositories that have the given GitHub/GitLab topic. For example, - [`repo:has.topic(code-search)`](https://sourcegraph.com/search?q=context%3Aglobal+repo%3Ahas.topic%28code-search%29&patternType=keyword&groupBy=repo) Topic search is currently only supported for GitHub and GitLab repos. ### Repo has commit after ![repo-has-commit-after](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-commit-after.png) Search only inside repositories that contain a commit after some specified time. See [git date formats](https://github.com/git/git/blob/master/Documentation/date-formats.txt) for accepted formats. Use this to filter out stale repositories that don’t contain commits past the specified time frame. This parameter is experimental. For example, - [`repo:has.commit.after(1 month ago)`](https://sourcegraph.com/search?q=context:global+repo:.*sourcegraph.*+repo:has.commit.after%281+month+ago%29&patternType=keyword) `repo:contains.commit.after(...)` is an alias for `repo:has.commit.after(...)` and behaves identically. ### Repo has description ![repo-has-description](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/repo-has-description.png) Search only inside repositories having a description matching the given regular expression. For example, - [`repo:has.description(go package)`](https://sourcegraph.com/search?q=context:global+repo:has.description%28go.*package%29+&patternType=keyword) ## Built-in file predicate ![builtin-file-predicate](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/builtin-file-predicate.png) ### File has content ![file-has-content](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/file-has-content.png) Search only inside files that contain content matching the provided regexp pattern. For example, - [`file:has.content(test)`](https://sourcegraph.com/search?q=context:global+repo:github%5C.com/sourcegraph/.*+file:has.content%28test%29&patternType=keyword) `file:contains.content(...)` is an alias for `file:has.content(...)` and behaves identically. ### File has owner ![file-has-owner](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/file-has-owner.png) Search only inside files that have an owner associated matching given string. When no parameter is supplied, the predicate only includes files with any owner assigned to them: `file:has.owner()` will include files with any owner assigned and `-file:has.owner()` will only include files without an owner. ### File has contributor ![file-has-contributor](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/file-has-contributor.png) Search only inside files that have a contributor whose name or email matches the provided regex pattern. ## Regular expression ![regular-expression](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/regular-expression.png) A string that is interpreted as a [RE2](https://golang.org/s/re2syntax) regular expression. ## String ![string](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/string.png) An unquoted string is any contiguous sequence of characters not containing whitespace. ## Quoted string ![quoted-string](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/quoted-string.png) Any string, including whitespace, may be quoted with single `'` or double `"` quotes. Quotes can be escaped with `\`. Literal `\` characters will need to be escaped, for example, `\\`. ## Commit parameter ![commit-parameter](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/commit-parameter.png) Set parameters that apply only to commit and diff searches. ### Author ![author](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/author.png) Include commits or diffs that are authored by the user. ### Before ![before](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/before.png) Include results having a commit date before the specified time frame. Times are interpreted as UTC by default. Many forms are accepted for the argument, such as: - `november 1 2019` - `1 november 2019` - `2019.11.1` - `11/1/2019` - `01.11.2019` - `Thu, 07 Apr 2005 22:13:13 +0200` - `2005-04-07` - `2005-04-07T22:13:13` - `2005-04-07T22:13:13+07:00` - `yesterday` - `5 days ago` - `20 minutes ago` - `2 weeks ago` - `3:00` - `3pm` - `1632782809` - `1632782809 -0600` For example, - [`before:"last thursday"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph%24+type:diff+author:nick+before:%22last+thursday%22&patternType=regexp) - [`before:"november 1 2019"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+before:%22november+1+2019%22) ### After ![after](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/after.png) Include results having a commit date after the specified time frame. Times are interpreted as UTC by default. Many forms are accepted for the argument, such as: - `november 1 2019` - `1 november 2019` - `2019.11.1` - `11/1/2019` - `01.11.2019` - `Thu, 07 Apr 2005 22:13:13 +0200` - `2005-04-07` - `2005-04-07T22:13:13` - `2005-04-07T22:13:13+07:00` - `yesterday` - `5 days ago` - `20 minutes ago` - `2 weeks ago` - `3:00` - `3pm` - `1632782809` - `1632782809 -0600` For example, - [`after:"6 weeks ago"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph%24+type:diff+after:%226+weeks+ago%22&patternType=keyword) - [`after:"november 1 2019"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+after:%22november+1+2019%22) ### Message ![message](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/message.png) Include results having a commit message containing the string. For example, - [`type:commit message:"testing"`](https://sourcegraph.com/search?q=type:commit+message:%22testing%22+repo:sourcegraph/sourcegraph%24+&patternType=regexp) ## Whitespace ![whitespace](https://storage.googleapis.com/sourcegraph-assets/Docs/CS-LANG/whitespace.png)
# Search Query Syntax

This page describes the query syntax for Code Search.

A typical search consists of two parts: * A [search pattern](#search-patterns) containing the terms you want to search, for example `println` * [Search filters](#filters-all-searches) that scope the search to certain repositories, languages, etc., for example `lang:java` For a graphical view of Sourcegraph's query syntax, see the [search language reference](/code-search/queries/language). ## Search patterns This section documents the search pattern syntax in Sourcegraph. To match file content, you need to specify a search pattern. Search patterns are optional when searching [commits](#filters-diff-and-commit-searches-only), [filenames](#filename-search), or [repository names](#repository-name-search). ### Keyword search (default) Keyword search matches individual terms anywhere in the document or the filename. Use `"..."` to match phrases exactly. Specify regular expressions inside `/.../`. | Search pattern syntax | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | | [`foo bar`](https://sourcegraph.com/search?q=foo+bar&patternType=keyword) | Match documents containing both `foo` and `bar` anywhere in the document. | | [`"foo bar"`](https://sourcegraph.com/search?q=%22foo+bar%22&patternType=keyword) | Match the string `foo bar` exactly. The space between the terms is interpreted literally. The quotes are not matched. | | [`"foo \"bar\""`](https://sourcegraph.com/search?q=context:global+%22foo+%5C%22bar%5C%22%22&patternType=keyword) | Match the string `foo "bar"` exactly. | | [`/foo.*bar/`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+/foo.*bar/&patternType=keyword) | Match the **regular expression** `foo.*bar`. We support [RE2 syntax](https://golang.org/s/re2syntax). | | [`foo OR bar`](https://sourcegraph.com/search?q=context:global+foo+OR+bar&patternType=keyword) | Match documents containing `foo` _or_ `bar` anywhere in the document. | Matching is case-insensitive by default (toggle the `Aa` button to change). In version 5.4, `keyword` replaced `standard` as the new default pattern type. ### Regular expression search Clicking the (.*) toggle interprets all search patterns as regular expressions. In [Keyword search](#keyword-search-default), use `/.../` to perform regular expression searches. Use this mode if you prefer writing out regular expressions without enclosing them. In this mode spaces between patterns mean **match anything**. Patterns inside quotes mean **match exactly**. | **Search Syntax** | **Description** | | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`foo bar`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+foo+bar&patternType=regexp) | Search for the regexp `foo(.*?)bar`. Spaces between non-whitespace strings becomes `.*?` to create a fuzzy search | | [`foo\ bar`](https://sourcegraph.com/search?q=foo%5C+bar&patternType=regexp) or [`/foo bar/`](https://sourcegraph.com/search?q=/foo+bar/&patternType=regexp) | Search for the regexp `foo bar`. The `\` escapes the space and treats the space as part of the pattern. Use `/.../` to avoid escaping spaces | | [`foo\nbar`](https://sourcegraph.com/search?q=foo%5Cnbar&patternType=regexp) | Perform a multiline regexp search. `\n` is interpreted as a newline | | [`"foo bar"`](https://sourcegraph.com/search?q=%22foo+bar%22&patternType=regexp) | Match the string `foo bar` exactly. The space between the terms is interpreted literally. The quotes are not matched. | We support [RE2 syntax](https://golang.org/s/re2syntax). Matching is case-insensitive by default (toggle the `Aa` button to change). ## Filters (all searches) The following filters can be used on all searches (using [RE2 syntax](https://golang.org/s/re2syntax) any place a regex is accepted): | **Filters** | **Description** | **Examples** | |----------|----------|----------| | **repo:regexp-pattern**
**repo:regexp-pattern@rev**
**repo:regexp-pattern rev:rev**
_alias: r_ | Include results from repos whose path matches a specified regexp-pattern. The repo path is `github.com/myteam/abc` or `code.example.com/xyz` depending on your repo host. If the regexp ends in `@rev`, search that revision instead of the default `main` branch. `repo:regexp-pattern@rev` is equivalent to `repo:regexp-pattern rev:rev` | [`repo:gorilla/mux testroute`](https://sourcegraph.com/search?q=repo:gorilla/mux+testroute)
[`repo:^github\.com/sourcegraph/sourcegraph$@v3.14.0 mux`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24%40v3.14.0+mux&patternType=keyword) | |**-repo:regexp-pattern**
_alias: -r_ | Exclude results from repositories whose path matches the regexp | `repo:alice/ -repo:old-repo` | | **rev:revision-pattern**
_alias: revision_ | Search a revision instead of the default branch. `rev:` can only be used in conjunction with `repo:` and may not be used more than once. See our [revision syntax](#repository-revisions) documentation to learn more | [`repo:sourcegraph/sourcegraph rev:v3.14.0 mux`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph+rev:v3.14.0+mux&patternType=keyword) | | **file:regexp-pattern**
_alias: f_ | Only include file results whose full path matches the regexp. The regexp is unanchored by default: to match against the entire path, use regexp anchors like `^README.md$`. | [`file:\.js$ httptest`](https://sourcegraph.com/search?q=file:%5C.js%24+httptest)
[`file:internal/ httptest`](https://sourcegraph.com/search?q=file:internal/+httptest) | | **-file:regexp-pattern**
_alias: -f_ | Exclude file results whose full path matches the regexp. The regexp is unanchored by default: to match against the entire path, use regexp anchors like `^README.md$`. | [`file:\.js$ -file:test http`](https://sourcegraph.com/search?q=file:%5C.js%24+-file:test+http) | | **content:"pattern"** | Set the search pattern with a dedicated parameter. Useful when searching literally for a string that may conflict with the [search pattern syntax](#search-pattern-syntax). In between the quotes, the `\` character will need to be escaped (`\\` to evaluate for `\`) | [`repo:sourcegraph content:"repo:sourcegraph"`](https://sourcegraph.com/search?q=repo:sourcegraph+content:"repo:sourcegraph"&patternType=keyword) | | **-content:"pattern"** | Exclude results from files whose content matches the pattern. | [`file:Dockerfile alpine -content:alpine:latest`](https://sourcegraph.com/search?q=file:Dockerfile+alpine+-content:alpine:latest&patternType=keyword) | | **select:_result-type_**
**select:repo**
**select:commit.diff.added**
**select:commit.diff.removed**
**select:file**
**select:content**
**select:symbol._symbol-type_**
**select:file.owners** _(Experimental)_ | Shows only query results for a given type. For example, `select:repo` displays only distinct repository paths from search results, and `select:commit.diff.added` shows only added code matching the search. See [language definition](/code-search/queries/language#select) for full list of possible values | [`fmt.Errorf select:repo`](https://sourcegraph.com/search?q=fmt.Errorf+select:repo&patternType=keyword) | | **language:language-name**
_alias: lang, l_ | Only include results from files in the specified programming language | [`language:typescript encoding`](https://sourcegraph.com/search?q=language:typescript+encoding) | | **-language:language-name**
_alias: -lang, -l_ | Exclude results from files in the specified programming language | [`-language:typescript encoding`](https://sourcegraph.com/search?q=-language:typescript+encoding) | | **type:symbol** | Perform a symbol search | [`type:symbol path`](https://sourcegraph.com/search?q=type:symbol+path) | | **case:yes** | Perform a case sensitive query. Without this, everything is matched case insensitively | [`OPEN_FILE case:yes`](https://sourcegraph.com/search?q=OPEN_FILE+case:yes) | | **fork:yes, fork:only** | Include results from repository forks or filter results to only repository forks. Results in repository forks are excluded by default | [`fork:yes repo:sourcegraph`](https://sourcegraph.com/search?q=fork:yes+repo:sourcegraph) | | **archived:yes, archived:only** | The yes option, includes archived repositories. The only option, filters results to only archived repositories. Results in archived repositories are excluded by default | [`repo:sourcegraph/ archived:only`](https://sourcegraph.com/search?q=repo:%5Egithub.com/sourcegraph/+archived:only) | | **repo:has.meta(...)** | **Experimental** Conditionally search inside repositories only if they are associated with a specified metadata:
1. key-value pair, or
2. key with any value, or
3. key with no value
See [built-in predicates](/code-search/queries/language#built-in-repo-predicate) for more | 1. `repo:has.meta(owning-team:security)`
2. `repo:has.meta(owning-team)`
3. `repo:has.meta(archived:)` | | **repo:has.path(...)** | Conditionally search inside repositories only if they contain a file path matching the regular expression. See [built-in predicates](/code-search/queries/language#built-in-repo-predicate) for more | [`repo:has.path(\.py) file:Dockerfile pip`](https://sourcegraph.com/search?q=context:global+repo:has.path%28%5C.py%29+file:Dockerfile+pip&patternType=keyword) | | **repo:has.topic(...)** | Search only in repos repositories if they have the given GitHub or GitLab topic. See [built-in predicates](/code-search/queries/language#built-in-repo-predicate) for more | [`repo:has.topic(code-search) rank`](https://sourcegraph.com/search?q=context:global+repo:sourcegraph/sourcegraph%24+rank&patternType=keyword&sm=1&groupBy=repo) | | **repo:has.commit.after(...)** | Filter out stale repositories that don't contain commits past the specified time frame. See [built-in predicates](/code-search/queries/language#built-in-repo-predicate) for more | [`repo:has.commit.after(yesterday)`](https://sourcegraph.com/search?q=context:global+repo:.*sourcegraph.*+repo:has.commit.after%28yesterday%29&patternType=keyword)
[`repo:has.commit.after(june 25 2017)`](https://sourcegraph.com/search?q=context:global+repo:.*sourcegraph.*+repo:has.commit.after%28june+25+2017%29&patternType=keyword) | | **rev:at.time(...)** | Search a repo or a branch at a specific point in time. | [`rev:at.time(1 year ago)`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:at.time%281+year+ago%29+&patternType=keyword&sm=0)
[`rev:at.time(2021-01-01)`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+rev:at.time%282021-01-01%2C+v5.0.0%29+&patternType=keyword) | | **file:has.content(...)** | Conditionally search files only if they contain contents that match the provided regex pattern. See [built-in predicates](/code-search/queries/language#built-in-repo-predicate) for more | [`file:has.content(Copyright) Sourcegraph`](https://sourcegraph.com/search?q=context:global+file:has.content%28Copyright%29+Sourcegraph&patternType=keyword) | | **file:has.owners(...)** | **Beta** Conditionally search files only if they are owned by the given owner. Empty means _any owner_. See [code ownership documentation](/own) for more | [`file:has.owner(alice@sourcegraph.com) Sourcegraph`](https://sourcegraph.com/search?q=context:global+file:has.owner%28alice@sourcegraph.com%29+Sourcegraph&patternType=keyword) | | **file:has.contributor(...)** | Conditionally search files only if a file contributor's name or email matches the provided regex pattern. See [built-in predicates](/code-search/queries/language#built-in-file-predicate) for more | [`file:has.contributor(alice@sourcegraph.com) Sourcegraph`](https://sourcegraph.com/search?q=context:global+file:has.owner%28alice@sourcegraph.com%29+Sourcegraph&patternType=keyword) | | **count:_N_,< /> count:all** | Retrieve N results. By default, Sourcegraph stops searching early and returns if it finds a full page of results. This is desirable for most interactive searches. To wait for all results, use **count:all** | [`count:1000 function`](https://sourcegraph.com/search?q=count:1000+repo:sourcegraph/sourcegraph$+function)
[`count:all err`](https://sourcegraph.com/search?q=repo:github.com/sourcegraph/sourcegraph+err+count:all&patternType=keyword) | | **timeout:_go-duration-value_** | Customizes the timeout for searches. The value of the parameter is a string that can be parsed by the [Go time package's `ParseDuration`](https://golang.org/pkg/time/#ParseDuration) (e.g. 10s, 100ms). By default, the timeout is set to 10 seconds, and the search will optimize for returning results as soon as possible. The timeout value cannot be set longer than 1 minute. When provided, the search is given the full timeout to complete | [`repo:^github.com/sourcegraph timeout:15s func count:10000`](https://sourcegraph.com/search?q=repo:%5Egithub.com/sourcegraph/+timeout:15s+func+count:10000) | | **patterntype:keyword, patterntype:regexp** | Configure your query to be interpreted as a keyword search, or a regular expression. Note: this filter is available as an accessibility option in addition to the visual toggles | [`test. patternType:keyword`](https://sourcegraph.com/search?q=test.+patternType:keyword)
[`(open/close)file patternType:regexp`](https://sourcegraph.com/search?q=%28open%7Cclose%29file&patternType=regexp) | | **visibility:any, visibility:public, visibility:private** | Filter results to only public or private repositories. The default is to include both private and public repositories | [`type:repo visibility:public`](https://sourcegraph.com/search?q=type:repo+visibility:public) | Multiple or combined **repo:** and **file:** filters are intersected. For example, `repo:foo repo:bar` limits your search to repositories whose path contains **both** `foo` and `bar` (such as `github.com/alice/foobar`). To include results from repositories whose path contains **either** `foo` or `bar`, use `repo:foo|bar`. The `rev:at.time(...)` filter is only supported for Sourcegraph versions 5.4 or more. ## Boolean operators Use boolean operators to create more expressive searches. | **Operator** | **Example** | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `and`, `AND` | [`conf.Get( and log15.Error(`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+conf.Get%28+and+log15.Error%28&patternType=regexp), [`conf.Get( and log15.Error( and after`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+conf.Get%28+and+log15.Error%28+and+after&patternType=regexp) | Returns results for files containing matches on the left _and_ right side of the `and` (set intersection). | **Operator** | **Example** | | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `or`, `OR` | [`conf.Get( or log15.Error(`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+conf.Get%28+or+log15.Error%28&patternType=regexp), [conf.Get( or log15.Error( or after ](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+conf.Get%28+or+log15.Error%28+or+after&patternType=regexp) | Returns file content matching either on the left or right side, or both (set union). The number of results reports the number of matches of both strings. Note the regex or operator `|` may not work as expected with certain operators for example `file:(internal/repos)|(internal/gitserver)`, to receive the expected results use [subexpressions](/code-search/working/search_subexpressions), `(file:internal/repos or file:internal/gitserver)` | **Operator** | **Example** | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `not`, `NOT` | [`lang:go not file:main.go panic`](https://sourcegraph.com/search?q=lang:go+not+file:main.go+panic&patternType=keyword), [`panic NOT ever`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+panic+not+ever&patternType=keyword) | `NOT` can be used in place of `-` to negate filters, such as `file`, `content`, `lang`, `repohasfile`, and `repo`. For search patterns, `NOT` excludes documents that contain the term after `NOT`. For readability, you can also include the `AND` operator before a `NOT` (i.e. `panic NOT ever` is equivalent to `panic AND NOT ever`). If you want to search for reserved keywords like `OR` in your code use `content` like this: `content:"query with OR"`. ### Operator precedence and groups Operators may be combined. `and` expressions have higher precedence (bind tighter) than `or` expressions so that `a and b or c and d` means `(a and b) or (c and d)`. Expressions may be grouped with parentheses to change the default precedence and meaning. For example: `a and (b or c) and d`. ### Filter scope When parentheses are absent, we use the convention that operators divide sequences of terms that should be grouped together. That is: `file:main.c char c or (int i and int j)` generally means `(file:main.c char c) or (int i and int j)` To apply the scope of the `file` filter to the entire subexpression, fully group the subexpression: `file:main.c (char c or (int i and int j))`. Browse the [search subexpressions examples](/code-search/working/search_subexpressions) to learn more about use cases. ## Filters (diff and commit searches only) The following filters are only used for **commit diff** and **commit message** searches, which show changes over time: | **Filter** | **Description** | **Examples** | | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **repo:regexp-pattern@rev** | Specifies which Git revisions to search for commits. See our [repository revisions](#repository-revisions) documentation to learn more about the revision syntax. | [`repo:vscode@*refs/heads/:^refs/heads/master type:diff task`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/Microsoft/vscode%24%40*refs/heads/:%5Erefs/heads/master+type:diff+after:%221+month+ago%22+task#1) (unmerged commit diffs containing `task`) | | **type:diff**
**type:commit** | Specifies the type of search. By default, searches are executed on all code at a given point in time (a branch or a commit). Specify the `type:` if you want to search over changes to code or commit messages instead (diffs or commits). | [`type:diff func`](https://sourcegraph.com/search?q=type:diff+func+repo:sourcegraph/sourcegraph$)
[`type:commit test`](https://sourcegraph.com/search?q=type:commit+test+repo:sourcegraph/sourcegraph$) | | **author:name** | Only include results from diffs or commits authored by the user. Regexps are supported. Note that they match the whole author string of the form `Full Name `, so to include only authors from a specific domain, use `author:example.com>$`. You can also use `author:@SourcegraphUserName` to search on a Sourcegraph user's list of verified emails.

You can also search by `committer:git-email`. _Note: there is a committer only when they are a different user than the author._ | [`type:diff author:nick`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick) | | **-author:name** | Exclude results from diffs or commits authored by the user. Regexps are supported. Note that they match the whole author string of the form `Full Name `, so to exclude authors from a specific domain, use `author:example.com>$`. You can also use `author:@SourcegraphUserName` to search on a Sourcegraph user's list of verified emails.

You can also search by `committer:git-email`. _Note: there is a committer only when they are a different user than the author._ | [`type:diff author:nick`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick) | | **before:"string specifying time frame"** | Only include results from diffs or commits which have a commit date before the specified time frame | [`before:"last thursday"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+before:%22last+thursday%22)
[`before:"november 1 2019"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+before:%22november+1+2019%22) | | **after:"string specifying time frame"** | Only include results from diffs or commits which have a commit date after the specified time frame | [`after:"6 weeks ago"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+after:%226+weeks+ago%22)
[`after:"november 1 2019"`](https://sourcegraph.com/search?q=repo:sourcegraph/sourcegraph$+type:diff+author:nick+after:%22november+1+2019%22) | | **message:"any string"** | Only include results from diffs or commits which have commit messages containing the string | [`type:commit message:"testing"`](https://sourcegraph.com/search?q=type:commit+repo:sourcegraph/sourcegraph$+message:%22testing%22)
[`type:diff message:"testing"`](https://sourcegraph.com/search?q=type:diff+repo:sourcegraph/sourcegraph$+message:%22testing%22) | | **-message:"any string"** | Exclude the results from diffs or commits which have commit messages containing the string | [`type:commit message:"testing"`](https://sourcegraph.com/search?q=type:commit+repo:sourcegraph/sourcegraph$+message:%22testing%22)
[`type:diff message:"testing"`](https://sourcegraph.com/search?q=type:diff+repo:sourcegraph/sourcegraph$+message:%22testing%22) | ## Repository Search ### Repository Revisions To search revisions other than the default branch, specify the revisions by either appending them to the `repo:` filter or by listing them separately with the `rev:` filter. This means: `repo:github.com/myteam/abc@` is equivalent to `repo:github.com/myteam/abc rev:`. The `` part refers to repository revisions (branches, commit hashes, and tags) and may take on the following forms: (All examples apply to `@` as well as `rev:`) - `@branch` - a branch name - `@1735d48` - a commit hash - `@3.15` - a tag You can separate revisions by a colon to search multiple revisions at the same time, `@branch:1735d48:3.15`. Per default, we match revisions to tags, branches, and commits. You can limit the search to branches or tags by adding the prefix `refs/tags` or `refs/heads`. For example `@refs/tags/3.18` will search the commit tagged with `3.18`, but not a branch called `3.18` and vice versa for `@refs/heads/3.18`. **Glob patterns** allow you to search over a range of branches or tags. Prepend `*` to mark a revision as glob pattern and add the glob-pattern after it like this `repo:@*`. For example: - [`@*refs/heads/*`](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/docker/machine%24%40*refs/heads/*+middleware&patternType=keyword) - search across all branches - [`@*refs/tags/*`](https://sourcegraph.com/search?q=repo:github.com/docker/machine%24%40*refs/tags/*+server&patternType=keyword) - search across all tags We automatically add a trailing `/*` if it is missing from the glob pattern. You can negate a glob pattern by prepending `*!`, for example: - [`@*refs/heads/*:*!refs/heads/release* type:commit `](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/kubernetes/kubernetes%24%40*refs/heads/*:*%21refs/heads/release*+type:commit+&patternType=keyword) - search commits on all branches except on those that start with "release" - [`@*refs/tags/v3.*:*!refs/tags/v3.*-* context`](https://sourcegraph.com/search?q=repo:%5Egithub.com/sourcegraph/sourcegraph%24%40*refs/tags/v3.*:*%21refs/tags/v3.*-*+context&patternType=keyword) - search all versions starting with `3.` except release candidates, alpha and beta versions. ### Repository names A query with only `repo:` filters returns a list of repositories with matching names. - Example: [`repo:docker repo:registry`](https://sourcegraph.com/search?q=repo:docker+repo:registry) matches repositories with names that contain both `docker` and `registry` substrings - Example: [`repo:docker OR repo:registry`](https://sourcegraph.com/search?q=repo:docker+OR+repo:registry&patternType=keyword) matches repositories with names that contain either `docker` or `registry` substrings ### Commit and Diff searches Commit and diff searches act on sets of commits. A set is defined by a revision (branch, commit hash, or tag), and it contains all commits reachable from that revision. A commit is reachable from another commit if it can be reached by following the pointers to parent commits. For commit and diff searches it is possible to exclude a set of commits by prepending a caret `^`. The caret acts as a set difference. For example, `repo:github.com/myteam/abc@main:^3.15 type:commit` will show all commits in `main` minus the commits reachable from the commit tagged with `3.15`. ## Filename Search A query with `type:path` restricts terms to matching filenames only (not file contents). - Example: [`type:path repo:/docker/ registry`](https://sourcegraph.com/search?q=type:path+repo:/docker/+registry) ## Content Search A query with `type:file` restricts terms to matching file contents only (not filenames). - Example: [`type:file repo:^github\.com/sourcegraph/about$ website`](https://sourcegraph.com/search?q=type:file+repo:%5Egithub%5C.com/sourcegraph/about%24+website&patternType=keyword)
# Search Examples

Learn and walkthrough some of the handy Code Search examples.

## Sourcegraph Search Examples on GitHub Pages Check out the [Sourcegraph Search Examples](https://sourcegraph.github.io/sourcegraph-search-examples/) site for filterable search examples with links to results on sourcegraph.com. Below are some additional examples that search repositories on [Sourcegraph.com](https://sourcegraph.com/search), our open source code search solution for GitHub and GitLab. You can copy and adapt the following search queries for use on your company’s private instance. See [search query syntax](/code-search/queries) reference. [Search through all the repositories in an organization](https://sourcegraph.com/search?q=context:global+r:hashicorp/+terraform&patternType=keyword&groupBy=repo) ```sgquery context:global r:hashicorp/ terraform ``` [Search a subset of repositories in an organization by language](https://sourcegraph.com/search?q=context:global+r:hashicorp/vault*+lang:yaml+terraform&patternType=keyword&groupBy=repo) ```sgquery context:global r:hashicorp/vault* lang:yaml terraform ``` [Search for one term or another in a specific repository](https://sourcegraph.com/search?q=context:global+r:hashicorp/vault%24+print%28+OR+log%28&patternType=keyword&groupBy=repo) ```sgquery context:global r:hashicorp/vault$ print( OR log( ``` [Find private keys and GitHub access tokens checked in to code](https://sourcegraph.com/search?q=context:global+%28-----BEGIN+%5BA-Z+%5D*PRIVATE+KEY------%29%7C%28%28%22gh%7C%27gh%29%5Bpousr%5D_%5BA-Za-z0-9_%5D%7B16%2C%7D%29&patternType=regexp&case=yes) ```sgquery (-----BEGIN [A-Z ]*PRIVATE KEY------)|(("gh|'gh)[pousr]_[A-Za-z0-9_]{16,}) patternType:regexp case:yes ``` [Recent security-related changes on all branches](https://sourcegraph.com/search?q=type:diff+repo:github%5C.com/kubernetes/kubernetes%24+repo:%40*refs/heads/+after:"5+days+ago"+%5Cb%28auth%5B%5Eo%5D%5B%5Er%5D%7Csecurity%5Cb%7Ccve%7Cpassword%7Csecure%7Cunsafe%7Cperms%7Cpermissions%29&patternType=regexp) ```sgquery type:diff repo:@*refs/heads/ after:"5 days ago" \b(auth[^o][^r]|security\b|cve|password|secure|unsafe|perms|permissions) ``` [Admitted hacks and TODOs in app code](https://sourcegraph.com/search?q=-file:%5C.%28json%7Cmd%7Ctxt%29%24+hack%7Ctodo%7Ckludge%7Cfixme&patternType=regexp) ```sgquery -file:\.(json|md|txt)$ hack|todo|kludge|fixme ``` [Removal of TODOs in the repository commit log](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type:diff+TODO+select:commit.diff.removed+&patternType=keyword) ```sgquery repo:^github\.com/sourcegraph/sourcegraph$ type:diff select:commit.diff.removed TODO ``` [New usages of a function](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/+type:diff+after:%221+week+ago%22+%5C.subscribe%5C%28+lang:typescript&patternType=regexp) ```sgquery type:diff after:"1 week ago" \.subscribe\( lang:typescript ``` [Find multiple terms in the same file, like testing of HTTP components](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/sourcegraph%24+%28test+AND+http+AND+NewRequest%29+lang:go&patternType=regexp) ```sgquery repo:github\.com/sourcegraph/sourcegraph$ (test AND http AND NewRequest) lang:go ``` [Recent quality related changes on all branches (customize for your linters)](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/+repo:%40*refs/heads/:%5Emaster+type:diff+after:"1+week+ago"+%28eslint-disable%29&patternType=regexp) ```sgquery repo:@*refs/heads/:^master type:diff after:"1 week ago" (eslint-disable) ``` [Recent dependency changes](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/+file:package.json+type:diff+after:%221+week+ago%22) ```sgquery file:package.json type:diff after:"1 week ago" ``` [Files that are Apache licensed](https://sourcegraph.com/search?q=context:global+%22licensed+to+the+apache+software+foundation%22+select:file&patternType=keyword) ```sgquery licensed to the apache software foundation select:file ``` [Only _repositories_ with recent dependency changes](https://sourcegraph.com/search?q=repo:github%5C.com/sourcegraph/+file:package.json+type:diff+after:%221+week+ago%22+select:repo&patternType=regexp) ```sgquery file:package.json type:diff after:"1 week ago" select:repo ``` [Search changes in a files that contain a keyword](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type:diff+file:contains.content%28%22golang%5C.org/x/sync/errgroup%22%29+.Go&patternType=keyword) ```sgquery repo:^github\.com/sourcegraph/sourcegraph$ type:diff file:contains.content("golang\.org/x/sync/errgroup") .Go ``` ## When to use regex search mode Sourcegraph's default literal search mode is line-based and will not match across lines, so regex can be useful when you wish to do so: [Matching multiple text strings in a file](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/Parsely/pykafka%24+Not+leader+for+partition&patternType=regexp) ```sgquery repo:^github\.com/Parsely/pykafka$ Not leader for partition ``` Regex searches are also useful when searching boundaries that are not delimited by code structures: [Finding css classes with word boundary regex](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/+%5Cbbtn-secondary%5Cb&patternType=regexp) ```sgquery repo:^github\.com/sourcegraph/ \bbtn-secondary\b ``` More examples of regex searches are available [here](https://sourcegraph.com/docs/code-search/queries#regular-expression-search)
# Switching from Oracle OpenGrok to Sourcegraph > NOTE: This guide helps Sourcegraph users switch from using Oracle OpenGrok's search syntax to Sourcegraph's. See our [Oracle OpenGrok admin migration guide](/admin/migration/opengrok) for instructions on switching from an OpenGrok deployment to Sourcegraph. ## Related pages - [All Sourcegraph search documentation](/code-search/) - [Sourcegraph query syntax](/code-search/queries) - [Search product feature comparisons](https://about.sourcegraph.com/workflow) - [OpenGrok to Sourcegraph admin migration guide](/admin/migration/opengrok) ## Switching to Sourcegraph's query syntax ### Wildcards vs. regular expressions Oracle OpenGrok provides wildcard support for searches. For example, to find all strings beginning with `foo`, you can use the wildcard search `foo*`. Similarly, OpenGrok provides the `?` operator for single character wildcards. Sourcegraph, [provides full regular expression search](/code-search/queries#regexp-search), with support for the [RE2 syntax](https://golang.org/s/re2syntax). The same search above would take the form `foo.*` (or in this case, just `foo`, since Sourcegraph automatically supports partial matches). Much more powerful regexp expressions are available. (Note that Sourcegraph also provides a [literal search mode](/code-search/queries#Literal-search-default) by default, in which there's no need to escape special characters. This simplifies searches such as `foo(`, which would result in an error in regexp mode.) ### Selecting repositories and branches Oracle OpenGrok provides a multi-select dropdown box to allow users to select which repositories to include in a search. This scope is stored across sessions, until the user changes it. Sourcegraph provides a search filter (`repo:`) that supports regexp and partial matches for selecting repositories. As examples: - To search for the string "pattern" in all repositories in the github.com/org org, search for `pattern repo:github.com/org`. | - To search in a distinct list of repositories, you can use a ` | ` character as a regexp OR operator: `pattern repo:github.com/org/repository1 | github.com/org/repository2`. | | - Note this query could be simplified further using more advanced regexp matching if the two repos share part of their names, such as: `pattern repo:github.com/org/repository(1 | 2)`. | | Sourcegraph also allows site admins to create pre-defined repository groupings, using [version contexts](/code-search/features#version-contexts-experimental). ### Searching in non-master (unindexed) branches, tags, and commits Oracle OpenGrok can only search in the version of code that is stored on disk. To search across multiple revisions or branches, an OpenGrok administrator must explicitly add each of those copies of the code to OpenGrok. Sourcegraph allows users to search on any Git revision, even if it is not indexed. Users can append `@` to the end of any `repo:` filter to specify which version to search. For example, to search on `feature-branch`, use `pattern repo:github.com/org/repo@feature-branch`, and to search on a commit `abc123`, use `pattern repo:github.com/org/repo@abc123`. Sourcegraph also provides the ability to search on multiple Git revisions in a single repository at once, using `:` characters to separate revision names in the `repo:` field. For example, search both `feature-branch` and `abc123` in a single query using `pattern repo:github.com/org/repo@feature-branch:abc123`. ### Special characters Oracle OpenGrok doesn't index most single-character strings (such as for special characters like `{`, `}`, `[`, `]`, `+`, `-`, and more), and non-alpha-numeric characters generally. Sourcegraph indexes all characters, and can search for strings of any length. Using the default [literal search mode](/code-search/queries#Literal-search-default), any search (including those with special characters like `foo.bar`, `try {`, `i++`, `i-=1`, `foo->bar`, and more), will all be searchable without special handling. Using [regexp mode](/code-search/queries#regexp-search) would require escaping special charactes. The only exceptions are colon characters, which are by default used for specifying a [search keyword](#search-keywords) on Sourcegraph. Any search containing colons can be done using the `content:` keyword (for example, `content:"foo::bar"`) to explicitly mark it as the search string. ### Boolean operators Oracle OpenGrok provides three boolean operators — `AND`, `OR`, and `NOT` — for scoping searches to files that contain strings that match multiple patterns. Sourcegraph also provides [`AND`, `OR`, and `NOT` operators](/code-search/queries#boolean-operators). > NOTE: Operators are available as of Sourcegraph 3.17 ### Search filters Both Sourcegraph and OpenGrok allow users to add filters for scoping searches. Below is a mapping from OpenGrok syntax to Sourcegraph. | | OpenGrok | Sourcegraph | | -------------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------- | | Search text | `full:pattern` | `pattern` | | Search symbol definitions | `def:pattern` | `pattern type:symbol` | | Search symbol references | `def:pattern` | Available through hover tooltips and `Find references` panels on code pages | | Search for repository names | Not supported | `pattern type:repo` | | Search for file names | `file:pattern` | `file:pattern` | | Search commit messages | `hist:pattern` | `pattern type:commit` | | Search code changes (diff search) | Not supported | `pattern type:diff` | | Scope searches to a language | `pattern type:c` | `pattern lang:c` | | Case sensitivity | Not supported | `case:yes` or `case:no` | | Scope searches to forked repositories | Supported through the repository selector | `fork:yes`, `fork:no`, or `fork:only` | | Scope searches to archived repositories | Supported through the repository selector | `archived:yes`, `archived:no`, or `archived:only` | | Scope searches to repositories that contain a file | Not supported | `pattern repo:contains.file(README)` | | Scope searches to repositories that contain file content | Not supported | `pattern repo:contains.content(TODO)` | | Scope searches to recently updated repositories | Not supported | `pattern repo:contains.commit.after(3 months)` or `pattern repo:contains.commit.after(june 25 2017)` | Sourcegraph also provides keywords to [scope commit message and diff searches](/code-search/queries#filters-diff-and-commit-searches-only) to specific authors or timeframes in which a change was made. To see an exhaustive list of Sourcegraph's search filters, see the [search query syntax](/code-search/queries#filters-all-searches) page. # How-to guides - [Switch from Oracle OpenGrok to Sourcegraph](/code-search/how-to/opengrok) - [How to create a search context with the GraphQL API](/code-search/how-to/create_search_context_graphql) # How to create a search context with the GraphQL API This document will take you through how to create a search context for your user with Sourcegraph's GraphQL API. ## Prerequisites * This document assumes that you have a private Sourcegraph instance * Assumes you are creating a Private search context with a user namespace which is only available to the user * For more information on available permissions and ways to alter the following examples, please see [Managing search contexts with api - permissions and visibility overview](/api/graphql/managing-search-contexts-with-api#permissions-and-visibility-overview) ## Steps to create Step 1: Add to global configuration (must be site-admin): ```json { "experimentalFeatures": { "showSearchContext": true } } ``` Step 2: Make sure you have added code hosts: [Add repositories (from code hosts) to Sourcegraph](/admin/repo/add) Step 3: Follow the steps to [Generate an access token for GraphQL](/api/graphql#quickstart) if you already haven't Step 4: Navigate to the API console on your instance, replacing sourcegraph.example with the correct string for your instance URL. * Example: `https://sourcegraph.example.com/api/console` Step 5: Query your user namespace id and save the value * The name: will be your Sourcegraph instance login name Example: ```json query { namespaceByName(name: "my_login_name") { id } } ``` Step 6: Query your desired repo id and save the value. * It should be whatever the URL is for that repo. Example: ```json query { repository(name: "github.com/org_name/repo_name") { id } } ``` Step 7: Take the values from steps 5 and 6 and put them into the example variables from our docs here: * [Managing search contexts with API - Create a context](/api/graphql/managing-search-contexts-with-api#create-a-context) Run this with no changes: ```json mutation CreateSearchContext( $searchContext: SearchContextInput! $repositories: [SearchContextRepositoryRevisionsInput!]! ) { createSearchContext(searchContext: $searchContext, repositories: $repositories) { id spec } } ``` Then in the Query Variables section on the bottom of the GraphQL API page, use this variables example, changing at least the name and description: ```json { "searchContext": { "name": "MySearchContext", "description": "A description of my search context", "namespace": "user-id-from-step-5", "public": true }, "repositories": [ { "repositoryID": "repo-id-from-step-6", "revisions": ["main", "branch-1"] } ] } ``` Step 8: Run the query, that should create a search context and the output will look something like: ```json { "data": { "createSearchContext": { "id": "V2VhcmNoQ29udGV4dDoiQGdpc2VsbGUvTXlTZWFyY2hDb250ZXh0MiI=", "spec": "@my_login_name/MySearchContext" } } } ``` Step 9: Go to the main search page and you should see the new Search context as part of the search bar! ## Further resources * [Using and creating search contexts](/code-search/working/search_contexts) * [Sourcegraph - Administration Config](/admin/config) # Indexers

This page describes the process of writing an indexer and details all the recommended indexers that Sourcegraph currently supports.

## Writing an Indexer The following documentation describes the [SCIP Code Intelligence Protocol](https://github.com/sourcegraph/scip) and explains steps to write an indexer to emit SCIP. 1. Familiarize yourself with the [SCIP protobuf schema](https://github.com/sourcegraph/scip/blob/main/scip.proto) 2. Import or generate SCIP bindings 3. Generate minimal index with occurrence information 4. Test your indexer using [scip CLI](https://github.com/sourcegraph/scip/blob/main/docs/CLI.md)'s `snapshot` subcommand 5. Progressively add support for more features with tests If you run into problems or have questions for any of these steps, please open an issue on the [SCIP issue tracker](https://github.com/sourcegraph/scip/issues). Let's understand each of these steps in detail: ## Understanding the SCIP protobuf schema The [SCIP protobuf schema](https://github.com/sourcegraph/scip/blob/main/scip.proto) describes the structure of a SCIP index in a machine-readable format. The main structure is an [`Index`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/scip%24+%5Emessage+Index+%7B%5Cn%28.%2B%5Cn%29%2B%7D&patternType=regexp) which consists of a list of documents along with some metadata. Optionally, an index can also provide hover documentation for external symbols that will not be indexed. A [`Document`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/scip%24+message+Document+%7B...%7D&patternType=structural) has a unique path relative to the project root. It also has a list of occurrences, which attach information to source ranges, as well as a list of symbols that are defined in the document. The information covered by an [`Occurrence`](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/scip%24+message+Occurrence+%7B...%7D&patternType=structural) can be syntactic or semantic: - Syntactic information such as the `syntax_kind` field is used for highlighting - Semantic information such as the `symbol` and `symbol_role` fields are used to power code navigation features like Go to definition and Find references Occurrences also allow attaching diagnostic information, which can be used by static analysis tools. For more details, see the doc comments in the [SCIP protobuf schema](https://github.com/sourcegraph/scip/blob/main/scip.proto). You may also find it helpful to see how existing indexers emit information. For example, you can take a look at the [scip-typescript](https://github.com/sourcegraph/scip-typescript) or [scip-java](https://github.com/sourcegraph/scip-java) code to see how they emit SCIP indexes. ## Importing or generating SCIP bindings The SCIP repository contains bindings for several languages. Depending on your indexer's implementation language, you can import the bindings directly using your language's package manager, or by using git submodules. One benefit of this approach is that you do not need to have a protobuf toolchain to generate code from the schema. This also makes it easier to bump the version of SCIP to pick up newer changes to the schema. Alternately, you can vendor the SCIP protobuf schema into your repository and set up Protobuf generation yourself. This has the benefit of being able to control the process from end-to-end, at the cost of making updates a bit more cumbersome. Newer Sourcegraph versions will maintain backwards compatibility with older SCIP versions, so there is no risk of not being able to upload SCIP indexes if a vendored schema has not been updated in a while. ## Generating minimal index with occurrence information As a first pass, it's recommended generating occurrences for a subset of declarations and checking that the generation works from end-to-end. In the context of an indexer, this typically involves using a compiler frontend or a language server as a library. First, run the compiler pipeline until semantic analysis is completed. Next, perform a top-down traversal of ASTs for all files, recording information about different kinds of occurrences. At the end, write a conversion pass from the intermediate data to SCIP using the SCIP bindings. As a convention, indexers should use `index.scip` as the default filename for the output. The [Sourcegraph CLI](https://github.com/sourcegraph/src-cli) recognizes this filename and uses it as the default upload path. You can inspect the Protobuf output using `protoc`: ```sh # assuming scip.proto and index.scip are in the current directory protoc --decode=scip.Index scip.proto < index.scip ``` For robust testing, it's recommended making sure that the result of indexing is deterministic. One potential source of issues here is non-determinstic iteration over the key-value pairs of a hash table. If re-running your indexer changes the order in which occurrences are emitted, snapshot testing may report different results. ## Snapshot testing with scip CLI One of the key design criteria for SCIP was that it should be easy to understand an index file and test an indexer for correctness. The [scip CLI](https://github.com/sourcegraph/scip/blob/main/docs/CLI.md) has a `snapshot` subcommand which can be used for golden testing. It `snapshot` command inspects an index file and regenerates the source code, attaching comments describing occurrence information. Here is slightly cleaned up snippet from running `scip snapshot` on the index generated by running `scip-typescript` over itself: ```ts function scriptElementKind( // ^^^^^^^^^^^^^^^^^ definition scip-typescript npm @sourcegraph/scip-typescript 0.2.0 src/FileIndexer.ts/scriptElementKind(). node: ts.Node, // ^^^^ definition scip-typescript npm @sourcegraph/scip-typescript 0.2.0 src/FileIndexer.ts/scriptElementKind().(node) // ^^ reference local 1 // ^^^^ reference scip-typescript npm typescript 4.6.2 lib/typescript.d.ts/ts/Node# sym: ts.Symbol // ^^^ definition scip-typescript npm @sourcegraph/scip-typescript 0.2.0 src/FileIndexer.ts/scriptElementKind().(sym) // documentation ```ts // ^^ reference local 1 // ^^^^^^ reference scip-typescript npm typescript 4.6.2 lib/typescript.d.ts/ts/Symbol# ): ts.ScriptElementKind { // ^^ reference local 1 // ^^^^^^^^^^^^^^^^^ reference scip-typescript npm typescript 4.6.2 lib/typescript.d.ts/ts/ScriptElementKind# ``` The carets and contextual information make it easy to visually check that: - Occurrences are being emitted for the right source ranges - Occurrences have the expected symbol strings. The exact syntax for the symbol strings is described in the doc comment for [`Symbol`](https://sourcegraph.com/github.com/sourcegraph/scip@12459c75fc15117e68b4c15a58e8581b738b855f/-/blob/scip.proto?L87-115) in the SCIP Protobuf schema - Symbols correspond to the right package. For example, the `ScriptElementKind` is defined in the `typescript` package (the compiler) whereas `scriptElementKind` is defined in `@sourcegraph/scip-typescript` ## Progressively adding support for language features It's recommended adding support for different features in the following order: 1. Emit occurrences and symbols for a single file. - Iterate over different kinds of entities (functions, classes, properties etc.) 1. Emit hover documentation for entities. If the markup is in a format other than CommonMark, we recommend addressing that difference after addressing other features. 1. Add support for implementation relationships, enabling Find implementations. 1. (Optional) If the hover documentation uses markup in a format other than CommonMark, implement a conversion from the custom markup language to CommonMark. If implementing an indexer in C++, you need to careful about very large indexes, as the default Protoc-generated code has a 2GB implementation limit on message sizes. This limit can be worked around by writing documents to disk one-by-one. For example, this PR [adds support to scip-ruby for writing documents one-by-one](https://github.com/sourcegraph/scip-ruby/pull/190). ## Sourcegraph recommended indexers Language support is an ever-evolving feature of Sourcegraph. Some languages may be better supported than others due to demand or developer bandwidth/expertise. The following clarifies the status of the indexers which the Sourcegraph team can both recommend to customers and provide support for. ### Quick reference This table is maintained as an authoritative resource for users, Sales, and Customer Engineers. Any major changes to the development of our indexers will be reflected here. | **Language** | **Indexer** | **Status** | **Hover docs** | **Go to definition** | **Find references** | **Cross-file** | **Cross-repository** | **Find implementations** | | --------------------- | ----------------- | ------ | ---------- | ---------------- | --------------- | ---------- | ---------------- | -------------------- | | Go | [scip-go] | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | TypeScript/
JavaScript | [scip-typescript] | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | C/C++ | [scip-clang] | 🟡 | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | | Java | [scip-java] | 🟢 | ✓ | ✓ | ✓ | ✓* | ✓ | ✓ | | Scala | [scip-java] | 🟢 | ✓ | ✓ | ✓ | ✓* | ✓ | ✓ | | Kotlin | [scip-java] | 🟢 | ✓ | ✓ | ✓ | ✓* | ✗ | ✓ | | Rust | [rust-analyzer] | 🟢 | ✓ | ✓ | ✓ | ✓* | ✗ | ✓ | | Python | [scip-python] | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | Ruby | [scip-ruby] | 🟢 | ✓ | ✓ | ✓ | ✓ | ✗ | ✓ | | C# | [scip-dotnet] Build tools (`.sln`, `.csproj`) | 🟠 | ✓ | ✓ | ✓ | ✗ | ✓ | ✓ | [scip-go]: https://github.com/sourcegraph/scip-go [scip-typescript]: https://github.com/sourcegraph/scip-typescript [scip-clang]: https://github.com/sourcegraph/scip-clang [scip-java]: https://github.com/sourcegraph/scip-java [scip-ruby]: https://github.com/sourcegraph/scip-ruby [scip-python]: https://github.com/sourcegraph/scip-python [scip-dotnet]: https://github.com/sourcegraph/scip-dotnet [rust-analyzer]: https://rust-analyzer.github.io/ Requires enabling and setting up Sourcegraph's auto-indexing feature. Read more about [Auto-indexing](/code-search/code-navigation/auto_indexing). ### Status definitions An indexer status is: - 🟢 **Generally Available**: Available as a normal product feature, no major features are absent. - 🟡 **Partially Available**: Available, but may be limited in some significant ways. No major features are absent but edge cases remain. - 🟠 **Beta**: Available in pre-release form on a limited basis. Could be useful to early adopters despite lack of features. - 🟣 **Experimental**: Available in pre-release form, with significant caveats. Early adopters can try it with expectations of failure. ## Milestone definitions A common set of steps required to build feature-complete indexers is broadly outlined below. The implementation order and _doneness criteria_ of these steps may differ between language and development ecosystems. Major divergences will be detailed in the notes below. ### Cross repository: Emits monikers for cross-repository support The next milestone provides support for cross-repository definitions and references. The indexer can emit a valid index including import monikers for each symbol defined non-locally, and export monikers for each symbol importable by another repository. This index should be consumed without error by the latest Sourcegraph instance and Go to Definition and Find References should work on cross-repository symbols given that **both repositories are indexed at the exact commit imported**. At this point, the indexer may be generally considered **ready**. Some languages and ecosystems may require some of the additional following milestones to be considered ready due to a bad out-of-the-box developer experience or absence of a critical language features. For example, `scip-java` is nearly useless without built-in support for build systems such as gradle. ### Common build tool integration The next milestone integrates the indexer with a common build tool or framework for the language and surrounding ecosystem. The priority and applicability of this milestone will vary wildly by languages. For example, `scip-go` uses the standard library and the language has a built-in dependency manager; all of our customers use Gradle, making `scip-java` effectively unusable without native Gradle support. The indexer integrates natively with common mainstream build tools. We should aim to cover at least the majority of build tools used by existing enterprise customers. The implementation of this milestone will also vary wildly by language. It could be that the indexer runs as a step in a larger tool, or the indexer contains build-specific logic in order to determine the set of source code that needs to be analyzed. ### The long tail: Find implementations The next milestone represents the never-finished long tail of feature additions. The **remaining 20%** of the language should be supported via incremental updates and releases over time. Support of Find implementations should be prioritized by popularity and demand. We may lack the language expertise or bandwidth to implement certain features on indexers. We will consider investing resources to add additional features when the demand for support is sufficiently high and the implementation is sufficiently difficult. ## More resources
# Code Navigation troubleshooting guide

This guide gives specific instructions for troubleshooting code navigation in your Sourcegraph instance.

## When are issues related to code intelligence? Issues are related to Sourcegraph code navigation when the [indexer](/code-search/code-navigation/writing_an_indexer) is one that we build and maintain. A customer issue should **definitely** be routed to code navigation if any of the following are true. - Precise code navigation queries are slow - Precise code navigation queries yield unexpected results A customer issue should **possibly** be routed to code navigation if any of the following are true. - Search-based code navigation queries are slow - Search-based code navigation queries yield unexpected results A customer issue should **not** be routed to code navigation if any of the following are true. - The indexer is listed in [LSIF.dev](https://lsif.dev/) and _it is not_ one that we maintain. Instead, flag the indexers status and maintainer of the relevant indexer with the customer, and suggest they reach out directly ## Gathering evidence Before bringing a code navigation issue to the engineering team, the site-admin or customer engineer should gather the following details. Not all of these details will be necessary for all classes of errors. ### Sourcegraph instance details The following details should always be supplied. - The Sourcegraph instance version - The Sourcegraph instance deployment type (e.g. server, pure-docker, docker-compose, k8s) - The memory, cpu, and disk resources allocated to the following containers: - frontend - precise-code-intel-worker - codeintel-db - blobstore (or `minio` in versions of Sourcegraph before v3.4.2) If the customer is running a custom patch or an insiders version, we need the docker image tags and SHAs of the following containers: - frontend - precise-code-intel-worker ### Sourcegraph CLI details The following details should be supplied if there is an issue with _uploading_ LSIF indexes to their instance. - The Sourcegraph CLI version ```bash $ src version Current version: 3.26.0 Recommended Version: 3.26.1 ``` ### Settings The following user settings should be supplied if there is an issue with _displaying_ code navigation results. Only these settings should be necessary, but additional settings can be supplied after private settings such as passwords or secret keys have been removed. - `codeIntel.lsif` - `codeIntel.traceExtension` - `codeIntel.disableRangeQueries` - `basicCodeIntel.includeForks` - `basicCodeIntel.includeArchives` - `basicCodeIntel.indexOnly` - `basicCodeIntel.unindexedSearchTimeout` You can get your effective user settings (site-config + user settings override) with the following Sourcegraph CLI command. ```bash $ src api -query 'query ViewerSettings { viewerSettings { final } }' ``` If you have [jq](https://stedolan.github.io/jq/) installed, you can unwrap the data more easily. ```bash src api -query 'query ViewerSettings { viewerSettings { final } }' | jq -r '.data.viewerSettings.final' | jq ``` ### Traces [Jaeger](/admin/observability/tracing) traces should be supplied if there is a noticeable performance issue in receiving code navigation results in the SPA. Depending on the type of user operation that is slow, we will need traces for different request types. | **Send traces for requests** | **When latency is high** | | --------------------------------- | ------------------------------------------------------------------- | | `?DefinitionAndHover`, `?Ranges` | between hovering over an identifier and receiving hover text | | `?References` | between querying references and receiving the first result | | `?Ranges` | between hovering over an identifier and getting document highlights | To gather a trace from the SPA, open your browser's developer tools, open the network tab, then add `?trace=1` to the URL and refresh the page. Note that if the URL contains a query fragment (such as `#L24:27`), the query string must go **before** the leading hash. Hovering over identifiers in the source file should fire off requests to the API. Find a request matching the target type (given in the table above). If there are multiple matching requests, prefer the ones with higher latencies. The `x-trace` header should have a URL value that takes you a detailed view of that specific request. This trace is exportable from the Jaeger UI. ![Network waterfall](https://storage.googleapis.com/sourcegraph-assets/Docs/network-waterfall.png) ![Request headers](https://storage.googleapis.com/sourcegraph-assets/Docs/network-description.png)
# Search-based Code Navigation Supported on [Enterprise](/pricing/enterprise) plans. Available via VS Code and JetBrains editor extensions and the Web.

Learn and understand about Search-based Code Navigation.

Sourcegraph comes with a default built-in code navigation provided by search-based heuristics. It works out of the box with all of the most popular programming languages. ## How does it work? [Search-based Code Navigation](https://github.com/sourcegraph/sourcegraph-basic-code-intel) provides 3-core navigation features: - **Jump to definition**: Performs a [symbol search](/code-search/features#symbol-search). - **Hover documentation**: First, finds the definition. Then, extracts documentation from comments near the definition. - **Find references**: Performs a case-sensitive word-boundary cross-repository [plain text search](/code-search/features#powerful-flexible-queries) for the given symbol Search-based Code Navigation also filters results by file extension and by imports at the top of the file for some languages. ## What configuration settings can I apply? The symbols container recognizes these environment variables: | **Env Vars** | **Deafult** | **Details** | | ---------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------- | | `CTAGS_COMMAND` | `universal-ctags` | Ctags command (should point to universal-ctags executable compiled with JSON and seccomp support) | | `CTAGS_PATTERN_LENGTH_LIMIT` | `250` | The maximum length of the patterns output by ctags | | `LOG_CTAGS_ERRORS` | `false` | Log ctags errors | | `SANITY_CHECK` | `false` | Check that go-sqlite3 works then exit 0 if it's ok or 1 if not | | `SYMBOLS_CACHE_DIR` | `/tmp/symbols-cache` | Directory in which to store cached symbols | | `SYMBOLS_CACHE_SIZE_MB` | `100000` | Maximum size of the disk cache (in megabytes) | | `CTAGS_PROCESSES` | `strconv.Itoa(runtime.GOMAXPROCS(0))` | Number of concurrent parser processes to run | | `REQUEST_BUFFER_SIZE` | `8192` | Maximum size of buffered parser request channel | | `PROCESSING_TIMEOUT` | `2 hrs` | Maximum time to spend processing a repository | | `MAX_TOTAL_PATHS_LENGTH` | `100000` | Maximum sum of lengths of all paths in a single call to git archive | | `USE_ROCKSKIP` | `false` | Enables [Rockskip](/code-search/code-navigation/rockskip) for fast symbol searches and search-based code navigation on repositories specified in `ROCKSKIP_REPOS`, or respositories over `ROCKSKIP_MIN_REPO_SIZE_MB` in size | | `ROCKSKIP_REPOS` | N/A | In combination with `USE_ROCKSKIP=true` this specifies a comma-separated list of repositories to index using [Rockskip](/code-search/code-navigation/rockskip) | | `ROCKSKIP_MIN_REPO_SIZE_MB` | N/A | In combination with `USE_ROCKSKIP=true` all repos that are at least this big will be indexed using Rockskip | | `MAX_CONCURRENTLY_INDEXING` | 4 | Maximum number of repositories being indexed at a time by [Rockskip](/code-search/code-navigation/rockskip) (also limits ctags processes) | The default values for these environment variables come from [`config.go`](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/eea895ae1a8acef08370a5cc6f24bdc7c66cb4ed/cmd/symbols/config.go#L42-L59). To enable precise code navigation for your repository, see our [docs here](/code-search/code-navigation/precise_code_navigation#setting-up-code-navigation-for-your-codebase). ## More resources
# Rockskip: fast symbol sidebar and search-based code navigation on monorepos This feature is in Beta stage. Rockskip is an alternative symbol indexing and query engine for the symbol service intended to improve performance of the symbol sidebar and search-based code navigation on big monorepos. It was added in Sourcegraph 3.38. ## When should I use Rockskip? ![still processing symbols error](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/symbol-sidebar-timeout.png) ![hover popover spinner](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/hover-popover-spinner.png) If you regularly see the above error or slow hover popovers (when not using precise navigation), it probably means that the default implementation (which copies SQLite DBs for each commit) is not fast enough and that Rockskip might help. A very rough way to gauge if Rockskip will help is if your repository has a 2GB+ `.git` directory, 50K+ commits, or 50K+ files in the working tree. You can always try Rockskip for a while and if it doesn't help then you can disable it. ## How do I enable Rockskip? **Step 1:** Set environment variables on the `symbols` container: For Docker Compose: ```yaml services: symbols-0: environment: # Enables Rockskip - USE_ROCKSKIP=true # Uses Rockskip for all repositories over 1GB - ROCKSKIP_MIN_REPO_SIZE_MB=1000 ``` For Helm: ```yaml # overrides.yaml symbols: env: # Enables Rockskip USE_ROCKSKIP: value: "true" # Uses Rockskip for all repositories over 1GB ROCKSKIP_MIN_REPO_SIZE_MB: value: "1000" ``` For Kubernetes: ```yaml # base/symbols/symbols.Deployment.yaml spec: template: spec: containers: - name: symbols env: # Enables Rockskip - name: USE_ROCKSKIP value: "true" # Uses Rockskip for all repositories over 1GB - name: ROCKSKIP_MIN_REPO_SIZE_MB value: "1000" ``` For all deployments, make sure that: - The `symbols` service has access to the codeintel DB - The `symbols` service has the environment variables set - The `codeintel-db` has a few extra GB of RAM **Step 2:** Kick off indexing 1. Visit your repository in the Sourcegraph UI 1. Click on the branch selector, click **Commits**, and select the second most recent commit (this avoids routing the request to Zoekt) 1. Open the symbols sidebar to kick off indexing. You can expect to see a loading spinner for 5s then an error message saying that indexing is in progress with the estimated time remaining. **Step 3:** Wait for indexing to complete. You can check the status as before by refreshing the page, opening the symbols sidebar, and looking at the error message. If you are interested in more technical details about the status, see the [instructions below](#how-do-i-check-the-indexing-status). **Step 4:** Open the symbols sidebar again and the symbols should appear quickly. Hover popovers and jump-to-definition via search-based code navigation should also respond quickly. That's it! New commits will be indexed automatically when users visit them. ## How long does indexing take? The initial indexing takes roughly 4 hours per GB of the `.git` directory (you can check the size with `du -sch .git`). Once the full repository has been indexed, indexing new commits takes less than 1 second most of the time. ## What resources does Rockskip use? Rockskip stores all data in Postgres, and the tables it creates use roughly 3x as much space as your `.git` directory, so make sure your Postgres instance has enough free disk. Rockskip indexes every symbol in the entire history of your repository and makes heavy use of Postgres indexes to make all kinds of queries fast, including: path prefix queries, regex queries with trigram index optimization, file extension queries, and the internal commit visibility queries. Rockskip is completely single-threaded when indexing a repository, but multiple repositories can be indexed at a time. The concurrency is limited by `MAX_CONCURRENTLY_INDEXING`, which defaults to 4. Rockskip heavily relies on gitserver for data. Rockskip issues very long-running `git log` commands, as well as many `git archive` calls. ## How do I check the indexing status? The easiest way to check the status of a single repository is to open the symbols sidebar and wait 5s for an error message to appear with the estimated time remaining. For more info, the symbols container responds to GET requests on the `localhost:3184/status` endpoint with the following info: - Repository count - Size of the symbols table in Postgres - Most recently searched repositories - List of in-flight indexing and search requests For Kubernetes, find the symbols pod and `exec` a `curl` command in it: ``` yaml $ kubectl get pods | grep symbols symbols-5ff7c67b57-mr5h4 $ kubectl exec -ti symbols-5ff7c67b57-mr5h4 -- curl localhost:3184/status This is the symbols service status page. Number of repositories: 1 Size of symbols table: 3253 MB Most recently searched repositories (at most 5 shown) 2022-03-11 05:48:58.890765 +0000 UTC github.com/sgtest/megarepo Here are all in-flight requests: indexing github.com/sgtest/megarepo@14a3d9849ba587d667efbc542cf0c7cd106c3e72 progress 9.53% (indexed 49151 of 515574 commits), 36h55m18.227079912s remaining Tasks (14006.77s total, current AppendHop+): AppendHop+ 44.76% 49152x, InsertSymbol 18.67% 1997101x, AppendHop- 12.94% 49151x, UpdateSymbolHops 7.78% 825380x, parse 4.01% 369401x, GetCommitByHash 2.73% 515574x, get hops 2.39% 49152x, ArchiveEach 2.26% 98302x, GetSymbol 1.83% 325351x, CommitTx 1.26% 49151x, DeleteRedundant 0.79% 49151x, InsertCommit 0.30% 49152x, Log 0.28% 1x, RevList 0.00% 1x, iLock 0.00% 1x, idle 0.00% 1x, holding iLock ``` In this example you can see there's 1 repository and the symbols service has indexed 9% of all commits with an ETA of 36H from now. There's also a breakdown of tasks that are part of Rockskip's internal workings mostly for Sourcegraph engineers, so you can ignore that. ## When is indexing triggered? Indexing is triggered upon opening the symbol sidebar or hovering on a token. Both of those UI features hit the same `type:symbol` search API which is serviced under the hood by Rockskip. Rockskip indexes the new commits since the previously indexed commit, so if it's been a long time since a user last opened the symbol sidebar then Rockskip will take longer to process before it can service queries. Simply opening the symbol sidebar more frequently (e.g. via having more users on the instance) will decrease the probability of seeing the still-processing message. ## How does it work? For a deeper dive into the index and query structures, check out the [explanatory RFC](https://docs.google.com/document/d/1sDDpZaWdGtIaiNLNB8QsLwHTvH10fhEKpEa4qcog5vg/edit?usp=sharing). ## Limitations - Rockskip does not support file paths that are not encoded in UTF-8. Consequently, any symbols in files with non-UTF-8 encoded paths will not be indexed. # Configuring Maven to Use a Private Repository for Auto-Indexing Configuring Maven to use a private repository, such as Nexus or Artifactory, with Sourcegraph is essential when dependencies are retrieved from private repositories that require authentication (as opposed to public repositories such as Maven Central). This guide covers steps to set up Maven for [scip-java](https://sourcegraph.github.io/scip-java/) indexing with a private repository, ensuring secure and consistent dependency resolution. ## Testing the Configuration on a Single Repository To test and validate the Maven configuration, modify a single repository’s auto-indexing settings to include a custom settings.xml file. Refer to (Maven's official docs)[https://maven.apache.org/settings.html#quick-overview] for an overview of how this file is used to configure Maven repositories and other settings. ### Add Custom Index Job Configuration - Access the repository’s index settings in Sourcegraph and open the “Raw” configuration panel. - Insert the following configuration: ```json { "steps": [], "local_steps": [ "mkdir -p ~/.m2", "echo ' repo $ARTIFACTORY_USER $ARTIFACTORY_PASSWORD ' > ~/.m2/settings.xml" ], "root": "", "indexer": "sourcegraph/scip-java:latest", "indexer_args": [ "scip-java", "index", "--build-tool=auto" ], "outfile": "index.scip", "requestedEnvVars": [ "ARTIFACTORY_USER", "ARTIFACTORY_PASSWORD" ] } ``` ### Set Up Executor Secrets Before triggering the indexing process, make sure the environment variables `$ARTIFACTORY_USER` and `$ARTIFACTORY_PASSWORD` are created as [Executor Secrets](https://sourcegraph.com/docs/admin/executors/executor_secrets). ### Trigger Indexing After configuring the repository, navigate to the "Precise Indexes" tab and click "Enqueue" to start indexing. ## Automating the Configuration Across All Repositories After verifying the configuration on a single repository, you can automate the setup across all repositories by modifying the inference configuration using a Lua script. ### Create or Update the Lua Script Navigate to `site-admin -> Code Graph -> Inference`, and replace or add the following Lua script for [scip-java](https://sourcegraph.github.io/scip-java/) indexing with Maven’s `settings.xml` setup: ```lua local path = require("path") local pattern = require("sg.autoindex.patterns") local recognizer = require("sg.autoindex.recognizer") local patterns = require "internal_patterns" local new_steps = { 'mkdir -p ~/.m2', [[echo "repo$ARTIFACTORY_USER$ARTIFACTORY_PASSWORD" > ~/.m2/settings.xml]] } local new_requested_env_variables = {'ARTIFACTORY_USER', 'ARTIFACTORY_PASSWORD'} local java_indexer = require("sg.autoindex.indexes").get "java" local custom_java_recognizer = recognizer.new_path_recognizer { patterns = { pattern.new_path_basename("pom.xml"), pattern.new_path_basename("build.gradle"), pattern.new_path_basename("build.gradle.kts"), }, generate = function(api, paths) api:register({ local_steps = new_steps, requested_envvars = new_requested_env_variables, root = path.dirname(paths[1]), outfile = "index.scip", indexer = java_indexer, indexer_args = { "scip-java", "index", "--build-tool=auto" } }) end } return require("sg.autoindex.config").new({ ["custom.java"] = custom_java_recognizer, ["sg.java"] = false }) ``` ### Verify the Configuration Once the Lua script is applied, you can verify that the configuration works by using the **"Preview results"** button in the Lua script editor under the "Inference Configuration" section. This will display the inferred index jobs for your repositories, showing details such as the root directory, indexer, indexer arguments, and environment variables used for each job. If everything is configured correctly, the dependencies will be pulled from the specified private repository without issues. # Precise Code Navigation Supported on [Enterprise](/pricing/enterprise) plans. Available via the Web app.

Learn and understand about Precise Code Navigation.

Precise Code Navigation is an opt-in feature that is enabled from your admin settings and requires you to upload indexes for each repository to your Sourcegraph instance. Once setup is complete on Sourcegraph, precise code navigation is available for use across popular development tools: - On the Sourcegraph web UI - On code files on your code host, via [integrations](/integration/) - On diffs in your code review tool, via integrations - Via the [Sourcegraph API](/api/graphql) Sourcegraph automatically uses Precise Code Navigation whenever available, and Search-based Code Navigation is used as a fallback when precise navigation is not available. Precise code navigation relies on the open source [SCIP Code Intelligence Protocol](https://github.com/sourcegraph/scip), which is a language-agnostic protocol for indexing source code. ## Setting up code navigation for your codebase There are several options for setting up precise code navigation listed below. However, we always recommend you start by manually indexing your repo locally using the [approriate indexer](/code-navigation/writing_an_indexer#quick-reference) for your language. Code and build systems can vary by project and ensuring you can first succesfully run the indexer locally leads to a smoother experience since it is vastly easier to debug and iterate on any issues locally before trying to do so in CI/CD or in Auto-Indexing. 1. **Manual indexing**. Index a repository and upload it to your Sourcegraph instance: - [Index a Go repository](/code_navigation/how-to/index_a_go_repository#manual-indexing) - [Index a TypeScript or JavaScript repository](/code_navigation/how-to/index_a_typescript_and_javascript_repository#manual-indexing) - [Index a Java, Scala, or Kotlin repository](https://sourcegraph.github.io/scip-java/docs/getting-started.html) - [Index a Python repository](https://sourcegraph.com/github.com/sourcegraph/scip-python) - [Index a Ruby repository](https://sourcegraph.com/github.com/sourcegraph/scip-ruby) 2. [**Automate indexing via CI**](/code_navigation/how-to/adding_lsif_to_workflows): Add indexing and uploading to your CI setup. 3. [**Auto-indexing**](/code-search/code-navigation/auto_indexing#enable-auto-indexing): Sourcegraph will automatically index your repositories and enable precise code navigation for them. 4. Set up **auto-dependency indexing** to navigate and search through the dependencies your code uses: - **Go**: Enable [auto-indexing](/code-search/code-navigation/auto_indexing) and Sourcegraph will start indexing your dependencies. - **JavaScript, TypeScript**: Enable [auto-indexing](/code-search/code-navigation/auto_indexing#enable-auto-indexing) and set up an [npm dependencies code host](/integration/npm). - **Java, Scala, Kotlin**: Enable [auto-indexing](/code-search/code-navigation/auto_indexing) and set up a [JVM dependencies code host](/integration/jvm). ## Supported languages and indexers Precise Code Navigation requires language-specific indexes to be generated and uploaded to your Sourcegraph instance. We currently have precise code navigation support for the languages below. See the [indexers page](/code-search/code-navigation/writing_an_indexer) for a detailed breakdown of each indexer's status. | Language | Indexer | Status | | ---------------------- | --------------------------------------------------------------------------------- | --------------------- | | Go | [scip-go](https://sourcegraph.com/github.com/sourcegraph/scip-go) | 🟢 Generally available | | TypeScript, JavaScript | [scip-typescript](https://sourcegraph.com/github.com/sourcegraph/scip-typescript) | 🟢 Generally available | | C, C++, CUDA | [scip-clang](https://sourcegraph.com/github.com/sourcegraph/scip-clang) | 🟢 Generally available | | Java, Kotlin, Scala | [scip-java](https://sourcegraph.com/github.com/sourcegraph/scip-java) | 🟢 Generally available | | Rust | [rust-analyzer](https://sourcegraph.com/github.com/rust-lang/rust-analyzer) | 🟢 Generally available | | Python | [scip-python](https://sourcegraph.com/github.com/sourcegraph/scip-python) | 🟢 Generally available | | Ruby | [scip-ruby](https://sourcegraph.com/github.com/sourcegraph/scip-ruby) | 🟢 Generally available | | C#, Visual Basic | [scip-dotnet](https://github.com/sourcegraph/scip-dotnet) | 🟡 Partially available | The easiest way to configure precise code navigation is with [auto-indexing](/code-search/code-navigation/auto_indexing). This feature uses [Sourcegraph executors](/admin/executors/) to automatically create indexes for the code, keeping precise code navigation available and up-to-date. ## Precise navigation examples The following repositories have precise code navigation enabled: | **Programming Language** | **Repos** | | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Go | - [`kubernetes/kubernetes`](https://sourcegraph.com/github.com/kubernetes/kubernetes@master/-/blob/cmd/cloud-controller-manager/main.go?L45:2&popover=pinned)
- [`gohugoio/hugo`](https://sourcegraph.com/github.com/gohugoio/hugo@master/-/blob/common/hugo/hugo.go?L63:15&popover=pinned)
- [`gin-gonic/gin`](https://sourcegraph.com/github.com/gin-gonic/gin@master/-/blob/routergroup.go?L33:6&popover=pinned) | | Java | - [`sourcegraph/jetbrains`](https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/blob/src/main/java/com/sourcegraph/cody/CodyActionGroup.java?L13) | | Scala | - [`neandertech/langoustine`](https://sourcegraph.com/github.com/neandertech/langoustine/-/blob/modules/lsp/src/main/scala/Communicate.scala?L28) | | Kotlin | - [`sourcegraph/jetbrains`](https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/blob/src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt?L42) | | Python | - [`pipecat-ai/pipecat-flows`](https://sourcegraph.com/github.com/pipecat-ai/pipecat-flows/-/blob/src/pipecat_flows/actions.py?L38) | | TypeScript | - [`vuejs/vue`](https://sourcegraph.com/github.com/vuejs/vue@main/-/blob/src/core/observer/index.ts?L68:3&popover=pinned) | | Ruby | - [`Homebrew/brew`](https://sourcegraph.com/github.com/Homebrew/brew@master/-/blob/Library/Homebrew/utils/bottles.rb?L18:18&popover=pinned) | | Rust | - [`rust-lang/cargo`](https://sourcegraph.com/github.com/rust-lang/cargo/-/blob/src/cargo/core/compiler/compilation.rs?L15:12&popover=pinned#tab=references)
- [`rust-lang/rustlings`](https://sourcegraph.com/github.com/rust-lang/rustlings@main/-/blob/src/dev.rs?L10) | | C, C++ | - [`sourcegraph/cxx-precise-examples`](https://sourcegraph.com/github.com/sourcegraph/cxx-precise-examples/-/blob/piecewise_monorepo/arithmetic/src/multiplication.cpp?L3) | ## More resources
# Auto-indexing inference configuration reference This feature is in beta for self-hosted customers. This document details how a site administrator can supply a Lua script to customize the way [Sourcegraph detects precise code intelligence indexing jobs from repository contents](/code-search/code-navigation/explanations/auto_indexing_inference). By default, Sourcegraph will attempt to infer index jobs for the following languages: - [`Go`](/code-search/code-navigation/explanations/auto_indexing_inference#go) - [`Java`/`Scala`/`Kotlin`](/code-search/code-navigation/explanations/auto_indexing_inference#java) - `Python` - `Ruby` - [`Rust`](/code-search/code-navigation/explanations/auto_indexing_inference#rust) - [`TypeScript`/`JavaScript`](/code-search/code-navigation/explanations/auto_indexing_inference#typescript) Inference logic can be disabled or altered in the case when the target repositories do not conform to a pattern that the Sourcegraph default inference logic recognizes. Inference logic is controlled by a **Lua override script** that can be supplied in the UI under `Admin > Code graph > Inference`. While the change is self-service, Sourcegraph support is more than happy to help write custom behaviors with you. Do not hesitate to contact us to get the inference logic behaving how you would expect for your repositories. ## Example The **Lua override script** ultimately must return an _auto-indexing config object_. A configuration that neither disables or adds new recognizers does not change the default inference behavior. ```lua return require("sg.autoindex.config").new({ -- Empty configuration (see below for usage) }) ``` To **disable** default behaviors, you can re-assign a recognizer value to `false`. Each of the built-in recognizers are prefixed with `sg.` (and are the only ones allowed to be). ```lua return require("sg.autoindex.config").new({ -- Disable default Python inference ["sg.python"] = false }) ``` To **add** additional behaviors, you can create and register a new **recognizer**. A recognizer is an interface that requests some set of files from a repository, and returns a set of auto-indexing job configurations that could produce a precise code intelligence index. A _path recognizer_ is a concrete recognizer that advertises a set of path _globs_ it is interested in, then invokes its `generate` function with matching paths from a repository. In the following, all files matching `Snek.module` (`Snek.module`, `proj/Snek.module`, `proj/sub/Snek.module`, etc) are passed to a call to `generate` (if non-empty). The generate function will then return a list of indexing job descriptions. The [guide for auto-indexing jobs configuration](/code-search/code-navigation/auto_indexing_configuration#keys-1) gives detailed descriptions on the fields of this object. The ordering of paths and limits are defined in the [Ordering guarantees and limits](#ordering-guarantees-and-limits) section. ```lua local path = require("path") local pattern = require("sg.autoindex.patterns") local recognizer = require("sg.autoindex.recognizer") local snek_recognizer = recognizer.new_path_recognizer { patterns = { -- Look for Snek.module files -- (would match Snek.module; proj/Snek.module, proj/sub/Snek.module, etc) pattern.new_path_basename("Snek.module"), -- Ignore any files in test or vendor directories pattern.new_path_exclude( pattern.new_path_segment("test"), pattern.new_path_segment("vendor") ), }, -- Called with list of matching Snek.module files generate = function(_, paths) local jobs = {} for i = 1, #paths do -- Create indexing job description for each matching file table.insert(jobs, { indexer = "acme/snek:latest", -- Run this indexer... root = path.dirname(paths[i]), -- ...in this directory local_steps = {"snekpm install"}, -- Install dependencies indexer_args = {"snek", "index", ".", "--output", "index.scip"}, outfile = "index.scip", }) end return jobs end } return require("sg.autoindex.config").new({ -- Register new recognizer ["acme.snek"] = snek_recognizer, }) ``` ## Available libraries There are a number of specific and general-purpose Lua libraries made accessible via the built-in `require`. The type signatures for the functions below use the following syntax: - `(A1, ..., An) -> R`: Function type with arguments of type `A1, ..., An` and return type `R`. - `array[A]`: Table with indexes 1 to N of elements of type `A`. - `table[K, V]`: Table with keys of type `K` and values of type `V`. - `A | B`: Union type (includes values of type `A` and type `B`). - `A...`: Variadic (0 or more values of A, without being wrapped in a table). - `"mystring"`: Literal string type with only `"mystring"` as the allowed value. - `{K1: V1, K2: V2, ...}`: Heterogenous table (object) with a key of type `K1` mapping to a value of type `V1` etc. - `void`: no value returned from function ### `sg.autoindex.recognizer` This auto-indexing-specific library defines the following two functions. - `new_path_recognizer` creates a `Recognizer` from a config object containing `patterns` and `generate` fields. See the [example](#example) above for basic usage. - Type: ``` ({ -- List of patterns to match against paths in the repository "patterns": array[pattern], -- List of patterns to match against paths in the repository -- for getting contents (see contents_by_path below) "patterns_for_content": array[pattern], -- Callback function invoked with paths requested by patterns above -- for creating index jobs "generate": ( registration_api, -- List of paths obtained from 'patterns' and -- 'patterns_for_content' combined. paths: array[string], -- Table mapping paths to contents for paths matched by -- 'patterns_for_content' contents_by_path: table[string, string] ) -> array[index_job], }) -> recognizer ``` where `index_job` is an object with the following shape: ``` index_job = { -- Docker image for the indexer "indexer": string, -- Working directory for invoking the indexer "root": string, -- Preparatory steps to run before invoking the indexer -- such as installing dependencies "steps": array[{ -- Working directory for this step "root": string, -- Docker image to use for this step "image": string, -- List of commands to run inside the Docker image "commands": array[string] }], -- List of commands to run inside the indexer image at "root" -- before invoking the indexer, such as installing dependencies. "local_steps": array[string], -- Command-line invocation for the indexer "indexer_args": array[string], -- Path to the index generated by the indexer "outfile": string, -- Names of necessary environment variables. These are -- made accessible to steps, local_steps, and the -- indexer_args command. -- -- These are generally used for passing secrets. "requested_envvars": array[string], } ``` For installing dependencies, if the indexer image contains the relevant package manager(s), then it is simpler to install dependencies using `local_steps`. Otherwise, the `steps` field allows more customizability. - `new_fallback_recognizer` creates a `recognizer` from an ordered list of `recognizer`s. Each `recognizer` is called sequentially, until one of them emits non-empty results. - Type: `(array[recognizer]) -> recognizer` The `registration_api` object has the following API: - `register` which queues a `recognizer` to be run at a later stage. This makes it possible to add more recognizers dynamically, such as based on whether specific configuration files were found or not. - Type: `(recognizer) -> void` ### `sg.autoindex.patterns` This auto-indexing-specific library defines the following four path pattern constructors. - `new_path_literal(fullpath)` creates a `pattern` that matches an exact filepath. - Type: `(string) -> pattern` - `new_path_segment(segment)` creates a `pattern` that matches a directory name. - Type: `(string) -> pattern` - `new_path_basename(basename)` creates a `pattern` that matches a basename exactly. - Type: `(string) -> pattern` - `new_path_extension(ext_no_leading_dot)` creates a `pattern` that matches files with a given extension. - Type: `(string) -> pattern` This library also defines the following two pattern collection constructors. - `new_path_combine(patterns)` creates a pattern collection object (to be used with [recognizers](#sg-autoindex-recognizers)) from the given set of path `pattern`s. - Type: `((pattern | array[pattern])...) -> pattern` - `new_path_exclude(patterns)` creates a new _inverted_ pattern collection object. Paths matching these `pattern`s are filtered out from the set of matching filepaths given to a recognizer's `generate` function. - Type: `((pattern | array[pattern])...) -> pattern` ### `path` This library defines the following utility functions: - `ancestors(path)` returns a list `{dirname(path), dirname(dirname(path)), ...}`. The last element in the list will be an empty string. - Type: `(string) -> array[string]` - `basename(path)` returns the basename of the given path as defined by Go's [filepath.Base](https://pkg.go.dev/path/filepath#Base). - Type: `(string) -> string` - `dirname(path)` returns the dirname of the given path as defined by Go's [filepath.Dir](https://pkg.go.dev/path/filepath#Dir), except that it (1) returns an empty path instead of `"."` if the path is empty and (2) removes a leading `/` if present. - Type: `string -> string` - `join(path1, path2)` returns a filepath created by joining the given path segments via filepath separator. - Type: `(string, string) -> string` - `split(path)` is a convenience function that returns `dirname(path), basename(path)`. - Type: `(string) -> string, string` ### `json` This library defines the following two JSON utility functions: - `encode(val)` returns a JSON-ified version of the given Lua object. - `decode(json)` returns a Lua table representation of the given JSON text. ### `fun` [Lua Functional](https://github.com/luafun/luafun/tree/cb6a7e25d4b55d9578fd371d1474b00e47bd29f3#lua-functional) is a high-performance functional programming library accessible via `local fun = require("fun")`. This library has a number of functional utilities to help make recognizer code a bit more expressive. ## Ordering guarantees and limits Sourcegraph enforces several limits to avoid inference timeouts and ever-growing auto-indexing queues. These limits apply for a single round of inference for a single repository, combined across all recognizers, including any implicitly included Sourcegraph recognizers. Limit | Default value :-----|-------------: The number of auto-indexing jobs inferred | 100 The number of total paths passed to the inference script's `generate` functions as the second argument `paths` | 500 The number of total paths with contents passed to the inference script's `generate` functions as the third argument `contents_by_paths` | 100 Maximum size limit for file contents, in bytes | 1 MiB Please reach out to Sourcegraph support if you'd like to change these limits. Auto-indexing jobs and paths are first ranked based on the criteria described below. If the number of jobs and/or paths exceeds the limits above, lower ranked items are discarded. - For auto-indexing jobs, ranking is done based on the following: - Descending order of indexer frequency (total number of inferred jobs with the same `indexer` field). - Ascending lexicographic ordering of `indexer`. - Descending order of number of path components for `root`. Shallower roots are preferrred over deeper ones as they are more likely to cover more code. - Ascending lexicographic ordering of `root` paths. - For paths, ranking happens in the following order: - Paths for which the contents are requested are ranked higher. - Paths with fewer components are ranked higher. - Otherwise, lexicographic ordering of paths is used. # Code Navigation

Learn how to navigate your code and understand its dependencies with high precision.

Code Navigation helps you quickly understand your code, its dependencies, and symbols within the Sourcegraph file view while making it easier to move through your codebase via: - Onboarding to codebases faster with cross-repository code navigation features like [Go to definition](/code-search/code-navigation/features#go-to-definition) and [Find references](/code-search/code-navigation/features#find-references) - Providing complete precise reviews, getting up to speed on unfamiliar code, and determining the impact of code changes with the confidence of compiler-accurate code navigation - Determining the root causes quickly with precise code navigation that tracks references across repositories and package dependencies ## Quicklinks ## Features Code Navigation helps you with the following tasks: | **Feature** | **Description** | | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Popover](/code_navigation/explanations/features#popover) | Quickly view a symbol's type signature and documentation without switching to another source file | | [Go to definition](/code_navigation/explanations/features#go-to-definition) | Click the button or symbol name, navigates you to the symbol's definition | | [Find references](/code_navigation/explanations/features#find-references) | Selecting it in the popover lists all references, definitions, and implementations at the bottom, including precise and search-based results | | [Dependency navigation](/code_navigation/explanations/features#dependency-navigation) (Beta) | Extends code navigation to work across [packages](/admin/code_hosts/package-repos) | | [Find implementations](/code_navigation/explanations/features#find-implementations) | Click to go to a symbol's interface definition or, at the interface, see all implementations across repositories, including interfaces implemented by a struct | | [Perform an action](/code-search/code-navigation/features#perform-an-action) | When browsing code, you can perform a couple of actions like open in code host, raw download and view blame. | Read and learn more about [Code Navigation features here →](/code-search/code-navigation/features) ## Code Navigation types There are two types of Code Navigation that Sourcegraph supports: - [Search-based Code Navigation](/code_navigation/explanations/search_based_code_navigation): Works out of the box with most popular programming languages, powered by Sourcegraph's code search. It uses a mix of text search and syntax-level heuristics (no language-level semantic information) for fast, performant searches across large code bases. - [Precise Code Navigation](/code_navigation/explanations/precise_code_navigation): Uses compile-time information to provide users with accurate cross-repository navigation experience across the entire code base.
# Code Navigation Features

Learn and understand more about Sourcegraph's Code Navigation features and core functionality.

Using our [integrations](/integration/), all code navigation features are available everywhere you read code. This includes browsers and GitHub pull requests. ![code-navigation-features](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/extension-example.gif) ## Popover Popovers allow you to quickly glance at the type signature and accompanying documentation of a symbol definition without having to context switch to another source file (which may or may not be available while browsing code). ![popover](https://storage.googleapis.com/sourcegraph-assets/Docs/popover.png) ## Go to definition When you click on the **Go to definition** button in the popover or click on a symbol's name (in the sidebar or code view), you will be navigated directly to the definition of the symbol. ![go-to-definition](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/go-to-def.gif) ## Find references When you select **Find references** from the popover, a panel at the bottom of the page lists all references, definitions, and implementations found for both precise and search-based results (from search heuristics). ![find-references](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/find-references.gif) When a particular token returns a large number of references, we truncate the results to < 500 to optimize for browser loading speed. We are planning to improve this in the future with the ability to view it as a search so that users can utilize the powerful filtering of Sourcegraph's search to find the references they are looking for. ## Dependency navigation This feature is in Beta stage and is not available for other language ecosystems. Dependency navigation enables **Find references** and **Go to definition** to show usages across multiple repositories, including transitive dependencies. For example, the animation below demonstrates how to trigger **Find references** in the `github.com/Netflix/Hystrix` repository and navigate to results in the Java standard library (JDK). ![dependency-navigation](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/dependency-nav.gif) The instructions to set up dependency navigation require you to set up auto-indexing. For more information on how to set up auto-indexing, please refer to our [auto-indexing documentation](/code-search/code-navigation/auto_indexing). ## Find implementations If precise code navigation is enabled for your repositories, you can click **Find Implementations** to navigate to a symbol's interface definition. If you're at the interface definition itself, clicking on **Find Implementations** will show all the places where the interface is being implemented, allowing you to explore how other users across repositories use it. It can also show which interfaces a struct implements. ![find-implementations](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/find-impl.gif) Read [here](/code-search/code-navigation/writing_an_indexer#quick-reference) for an overview of which languages support this feature. ## Perform an Action Code Search allows you to harness the power of Search and quickly find, discover, and understand code. However, the end result isn't always to view the results of a search query. Code Search empowers you to perform an action given a set of results. ![Code Search Actions](https://storage.googleapis.com/sourcegraph-assets/Docs/actions/code-search-actions.png) When browsing code, you can perform the following actions: ### Ask Cody Cody is a free and open-core AI coding assistant that writes, fixes, and maintains your code and is available on Sourcegraph. It allows you to ask natural language questions about your code and receive intelligent suggestions and explanations. When browsing code on Sourcegraph, you can ask Cody a question by clicking the **Ask Cody** button above the file you are viewing. This will open a chat interface where you can have a conversation with Cody about the code you are viewing. Having Cody integrated directly into Sourcegraph code search makes it fast and easy to get AI-powered insights as you explore code. ### Open in Editor When viewing a file in Sourcegraph, you can open it in your editor of choice to edit the file. This allows you to seamlessly transition from browsing code in Sourcegraph to editing code in your preferred code editor. When you click the Open in Editor button, Sourcegraph will detect which editor you have configured and open the file in a new tab in that editor. If you have not configured a default editor, Sourcegraph will prompt you to select an editor before opening the file. You can read more about this [here](/integration/open_in_editor). ### View History The View History action allows you to see the full commit history for a file directly in Sourcegraph. When you click this button, a sidebar will open showing every commit that touched the file, ordered chronologically from newest to oldest. For each commit, you can view the following: - Commit message - Author - Date - Commit SHA ![History action](https://storage.googleapis.com/sourcegraph-assets/Docs/actions/history-action.png) You can click on any commit to view the full diff and see exactly what changed in that particular version of the file. Exploring the history of a file helps you understand how it evolved over time and why certain changes were made. This additional context can be invaluable when trying to modify or debug code. The file history integrates tightly with other Sourcegraph navigation features. You can seamlessly transition from browsing history to blaming lines or searching for references. ### Blame The Blame action shows annotation on each line of a file indicating the last commit that modified the line and who the author was. When you click this button on a file, blame information will be displayed inline. This allows you to easily see the history of every line, without having to explore the full file history. Blame tells you: * The commit that last modified each line * The author who made the change * The commit message * The timestamp of when it was changed ![Blame action](https://storage.googleapis.com/sourcegraph-assets/Docs/actions/blame-action.png) Using blame makes it easy to answer questions like: * Who wrote this line of code originally? * When was this method added? * What changes were made in this commit? You can click on any commit in the blame view to explore that snapshot of the file and see the full diff. Blame data is essential when modifying or debugging existing code in a shared codebase. It helps identify who to talk to when you have questions about particular sections of code. ### Open in Code host The Open in CodeHost button allows you to quickly view the file in its native code host. When you click this button, the file will open in a new browser tab taking you directly to that file on the code host website. For example, if you are viewing a file from a GitHub repository in Sourcegraph, clicking Open in CodeHost will open `GitHub.com` in a new tab with that file displayed. ### Copy Link The Copy Link action allows you to easily copy a permanent link to the exact line range you are viewing in Sourcegraph. When you click this button, the link is copied to your clipboard. You can then paste the link in any text field or document. ![Copy Link action](https://storage.googleapis.com/sourcegraph-assets/Docs/actions/copy-action.gif) ### Raw download The Raw download action allows you to download the raw file contents displayed in Sourcegraph. When viewing code, click the Raw download button to save the file to your machine. ### Line Wrapping The Line Wrap toggle allows you to wrap long lines that extend past the width of the code viewer. When enabled, any line longer than the window width will wrap to the next line, similar to text in a document. This makes it easier to read code snippets with very long lines without having to scroll horizontally. * When disabled (default), long lines will extend past the edge of the window, requiring horizontal scrolling to see the full line. * When enabled, lines will break to the next line before hitting the window edge. Toggling line wrapping on and off helps optimize code readability depending on personal preference. Wrapped lines are visually indicated with a faint vertical line connecting the split sections. Hovering also reveals the full continuous line. Line wrapping does not modify the actual code contents - it is purely a visual modification. Downloaded files will contain the original non-wrapped lines.
# Code Navigation Environment Variables

These docs list supported environment variables for Code Navigation.

## frontend The following are variables are read from the `frontend` service to control code navigation behavior exposed via the GraphQL API. | **Name** | **Default** | **Description** | | ------------------------------------------------- | ------- | ------------------------------------------------------------- | | `PRECISE_CODE_INTEL_DIAGNOSTICS_COUNT_MIGRATION_BATCH_SIZE` | `1000` | The max no. of document records to migrate at a time. | | `PRECISE_CODE_INTEL_DIAGNOSTICS_COUNT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_DEFINITIONS_COUNT_MIGRATION_BATCH_SIZE` | `1000` | The maximum number of definition records to migrate at once. | | `PRECISE_CODE_INTEL_DEFINITIONS_COUNT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_REFERENCES_COUNT_MIGRATION_BATCH_SIZE` | `1000` | The maximum number of reference records to migrate at a time. | | `PRECISE_CODE_INTEL_REFERENCES_COUNT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_DOCUMENT_COLUMN_SPLIT_MIGRATION_BATCH_SIZE` | `100` | The maximum number of document records to migrate at a time. | | `PRECISE_CODE_INTEL_DOCUMENT_COLUMN_SPLIT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_API_DOCS_SEARCH_MIGRATION_BATCH_SIZE` | `1` | The maximum number of bundles to migrate at a time. | | `PRECISE_CODE_INTEL_API_DOCS_SEARCH_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_COMMITTED_AT_MIGRATION_BATCH_SIZE` | `100` | The maximum number of upload records to migrate at a time. | | `PRECISE_CODE_INTEL_COMMITTED_AT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | | `PRECISE_CODE_INTEL_REFERENCE_COUNT_MIGRATION_BATCH_SIZE` | `100` | The maximum number of upload records to migrate at a time. | | `PRECISE_CODE_INTEL_REFERENCE_COUNT_MIGRATION_BATCH_INTERVAL` | `1s` | The timeout between processing migration batches. | The following settings should be the same for the [`precise-code-intel-worker`](#precise-code-intel-worker) service as well. | **Name** | **Default** | **Description** | | ----------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_UPLOAD_BACKEND` | `Blobstore` | The target file service for code graph uploads. S3, GCS, and Blobstore are supported. In older versions of Sourcegraph (before v3.4.2) `Minio` was also a valid value. | | `PRECISE_CODE_INTEL_UPLOAD_MANAGE_BUCKET` | `false` | Whether or not the client should manage the target bucket configuration | | `PRECISE_CODE_INTEL_UPLOAD_BUCKET` | `lsif-uploads` | The name of the bucket to store LSIF uploads in | | `PRECISE_CODE_INTEL_UPLOAD_TTL` | `168h` | The maximum age of an upload before deletion | The following settings should be the same for the [`codeintel-auto-indexing`](#codeintel-auto-indexing) worker task as well. | **Name** | **Default** | **Description** | | ----------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_INSPECTED_PER_SECOND` | `0` | The maximum number of repositories inspected for auto-indexing per second. Set to zero to disable limit. | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_UPDATED_PER_SECOND` | `0` | The maximum number of repositories cloned or fetched for auto-indexing per second. Set to zero to disable limit. | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_INDEX_JOBS_PER_INFERRED_CONFIGURATION` | `25` | Repositories with a number of inferred auto-index jobs exceeding this threshold will be auto-indexed | ## worker The following are variables are read from the `worker` service to control code graph data behavior run in asynchronous background tasks. ### `codeintel-commitgraph` The following variables influence the behavior of the [`codeintel-commitgraph` worker task](/admin/workers#codeintel-commitgraph). | **Name** | **Default** | **Description** | | ------------------------------------ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_MAX_AGE_FOR_NON_STALE_BRANCHES` | `2160h` (about 3 months) | The age after which a branch should be considered stale. Code graph indexes will be evicted from stale branches. | | `PRECISE_CODE_INTEL_MAX_AGE_FOR_NON_STALE_TAGS` | `8760h` (about 1 year) | The age after which a tagged commit should be considered stale. Code graph indexes will be evicted from stale tagged commits. | | `PRECISE_CODE_INTEL_COMMIT_GRAPH_UPDATE_TASK_INTERVAL` | `10s` | The frequency with which to run periodic codeintel commit graph update tasks. | ### `codeintel-auto-indexing` The following variables influence the behavior of the [`codeintel-auto-indexing` worker task](/admin/workers#codeintel-auto-indexing). | **Name** | **Default** | **Description** | | --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_AUTO_INDEXING_TASK_INTERVAL` | `10m` | The frequency with which to run periodic codeintel auto-indexing tasks. | | `PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_PROCESS_DELAY` | `24h` | The minimum frequency that the same repository can be considered for auto-index scheduling. | | `PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_BATCH_SIZE` | `100` | The number of repositories to consider for auto-indexing scheduling at a time. | | `PRECISE_CODE_INTEL_AUTO_INDEXING_POLICY_BATCH_SIZE` | `100` | The number of policies to consider for auto-indexing scheduling at a time. | | `PRECISE_CODE_INTEL_DEPENDENCY_INDEXER_SCHEDULER_POLL_INTERVAL` | `1s` | Interval between queries to the dependency indexing job queue. | | `PRECISE_CODE_INTEL_DEPENDENCY_INDEXER_SCHEDULER_CONCURRENCY` | `1` | The maximum number of dependency graphs that can be processed concurrently. | The following settings should be the same for the [`frontend`](#frontend) service as well. | **Name** | **Default** | **Description** | | ----------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_INSPECTED_PER_SECOND` | `0` | The maximum number of repositories inspected for auto-indexing per second. Set to zero to disable limit. | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_UPDATED_PER_SECOND` | `0` | The maximum number of repositories cloned or fetched for auto-indexing per second. Set to zero to disable limit. | | `PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_INDEX_JOBS_PER_INFERRED_CONFIGURATION` | `25` | Repositories with a number of inferred auto-index jobs exceeding this threshold will be auto-indexed | ### `codeintel-janitor` The following variables influence the behavior of the [`codeintel-janitor` worker task](/admin/workers#codeintel-janitor). | **Name** | **Default** | **Description** | | | ------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | | `PRECISE_CODE_INTEL_UPLOAD_TIMEOUT` | `24h` | The maximum time an upload can be in the 'uploading' state. | | `PRECISE_CODE_INTEL_CLEANUP_TASK_INTERVAL` | `1m` | The frequency with which to run periodic codeintel cleanup tasks. | | `PRECISE_CODE_INTEL_COMMIT_RESOLVER_TASK_INTERVAL` | `10s` | The frequency with which to run the periodic commit resolver task. | | `PRECISE_CODE_INTEL_COMMIT_RESOLVER_MINIMUM_TIME_SINCE_LAST_CHECK` | `24h` | The minimum time the commit resolver will re-check an upload or index record. | | `PRECISE_CODE_INTEL_COMMIT_RESOLVER_BATCH_SIZE` | `100` | The maximum number of unique commits to resolve at a time. | | `PRECISE_CODE_INTEL_COMMIT_RESOLVER_MAXIMUM_COMMIT_LAG` | `0s` | The maximum acceptable delay between accepting an upload and its commit becoming resolvable. Be cautious about setting this to a large value, as uploads for unresolvable commits will be retried periodically during this interval. | | `PRECISE_CODE_INTEL_RETENTION_REPOSITORY_PROCESS_DELAY` | `24h` | The minimum frequency that the same repository's uploads can be considered for expiration. | | `PRECISE_CODE_INTEL_RETENTION_REPOSITORY_BATCH_SIZE` | `100` | The number of repositories to consider for expiration at a time. | | `PRECISE_CODE_INTEL_RETENTION_UPLOAD_PROCESS_DELAY` | `24h` | The minimum frequency that the same upload record can be considered for expiration. | | `PRECISE_CODE_INTEL_RETENTION_UPLOAD_BATCH_SIZE` | `100` | The number of uploads to consider for expiration at a time. | | `PRECISE_CODE_INTEL_RETENTION_POLICY_BATCH_SIZE` | `100` | The number of policies to consider for expiration at a time. | | `PRECISE_CODE_INTEL_RETENTION_COMMIT_BATCH_SIZE` | `100` | The number of commits to process per upload at a time. | | `PRECISE_CODE_INTEL_RETENTION_BRANCHES_CACHE_MAX_KEYS` | `10000` | The number of maximum keys used to cache the set of branches visible from a commit. | | `PRECISE_CODE_INTEL_CONFIGURATION_POLICY_MEMBERSHIP_BATCH_SIZE` | `100` | The maximum number of policy configurations to update repository membership for at a time. | | `PRECISE_CODE_INTEL_DOCUMENTATION_SEARCH_CURRENT_MINIMUM_TIME_SINCE_LAST_CHECK` | `24h` | The minimum time the documentation search current janitor will re-check records for a unique search key. | | `PRECISE_CODE_INTEL_DOCUMENTATION_SEARCH_CURRENT_BATCH_SIZE` | `100` | The maximum number of unique search keys to clean up at a time. | ## precise-code-intel-worker The following are variables are read from the `precise-code-intel-worker` service to control code graph data upload processing behavior. | **Name** | **Default** | **Description** | | ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------ | | `PRECISE_CODE_INTEL_WORKER_POLL_INTERVAL` | `1s` | Interval between queries to the upload queue. | | `PRECISE_CODE_INTEL_WORKER_CONCURRENCY` | `1` | The maximum number of indexes that can be processed concurrently. | | `PRECISE_CODE_INTEL_WORKER_BUDGET` | `0` | The amount of compressed input data (in bytes) a worker can process concurrently. Zero acts as an infinite budget. | The following settings should be the same for the [`frontend`](#frontend) service as well. | **Name** | **Default** | **Description** | | ----------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `PRECISE_CODE_INTEL_UPLOAD_BACKEND` | `Blobstore` | The target file service for code graph data uploads. S3, GCS, and Blobstore are supported. In older versions of Sourcegraph (before v3.4.2) `Minio` was also a valid value. | | `PRECISE_CODE_INTEL_UPLOAD_MANAGE_BUCKET` | `false` | Whether or not the client should manage the target bucket configuration | | `PRECISE_CODE_INTEL_UPLOAD_BUCKET` | `lsif-uploads` | The name of the bucket to store LSIF uploads in | | `PRECISE_CODE_INTEL_UPLOAD_TTL` | `168h` | The maximum age of an upload before deletion |
# Auto-indexing configuration reference This feature is in beta for self-hosted customers. This document details the expected contents of [explicit index job configuration](/code-search/code-navigation/auto_indexing#explicit-index-job-configuration) for a particular repository. Depending on how this configuration is supplied, it may be encoded as JSON. ## Keys The root of the configuration has one top-level key, `index_jobs`, documented below. ### [`index_jobs`](#index-jobs) The index jobs field defines a set of [index job objects](#index-job-object) describing the actions to perform to successfully index a fresh clone of a repository. Each index job is executed independently (and possibly in parallel) by an executor. ## Index job object Each configured index job is run by a single executor process. Multiple index jobs configured for the same repository may be executed by different executor instances, out of order, and possibly in parallel. The basic outline of an index job is as follows. 1. The target repository is cloned into the job's workspace from Sourcegraph. 2. Pre-indexing steps (if any are configured) are executed sequentially in individual Docker containers that volume mount the workspace. 3. A separate Docker container for the indexer is started. 4. Local steps (if configured) are executed within the running container. 5. The indexer is invoked within the running container to produce an index artifact. 6. The [`src` CLI](/cli/) binary is invoked to upload the index artifact to the Sourcegraph instance. The pre-indexing steps, indexer container, local steps, and indexer arguments are configurable via this object. ### Keys Each indexing job object can be configured with the following keys. #### [`steps`](#index-job-steps) The steps field defines an ordered sequence of pre-indexing actions (formatted as a [Docker step object](#docker-step-object)). Each step is executed before the indexer itself is invoked. #### [`indexer`](#index-job-indexer) The name of the Docker image distribution of the target indexer. #### [`local_steps`](#index-job-local-steps) An ordered sequence of commands to execute within a container running the configured indexer image. These commands are passed directly into the target container via `docker exec`, one at a time. Local steps should be used over Docker steps when the intended side effects alter state outside of the workspace on disk (e.g., setting up environment variables or installing OS packages require by the indexer tool). #### [`indexer_args`](#index-job-indexer-args) An ordered sequence of arguments that make up the indexing command. The indexing command is passed directly into the target container via `docker exec`. This step is expected to produce a code graph index artifact (as described by the `root` and `outfile` fields, described below). #### [`root`](#index-job-root) The working directory within the Docker container where the provided local steps and indexer commands are executed. This working directory is relative to the root of the target repository. An empty value (the default) indicates the root of the repository. This is also the directory relative to the path where the code graph index artifact is produced. #### [`outfile`](#index-job-outfile) The path to the code graph index artifact produced by the indexer, which is uploaded to the target Sourcegraph instance via [`src` CLI](/cli/) after the index step has completed successfully. This path is relative to the index job `root` (defined above). If not supplied, the value is assumed to be `dump.lsif` (which is the default artifact name of many indexers). Supply this argument when the target indexer produces a differently named artifact. Alternatively, some indexers provide flags to change the artifact name; in which case `dump.lsif` can be supplied there and a value for this key can be omitted. #### [`requested_envvars`](#index-job-requested-envvars) List of environment variables needed. These are made accessible to steps, local_steps, and the indexer_args command. ### Examples The following example uses the Docker image `sourcegraph/scip-go` pinned at the tag `v0.1` and additionally secured with an image digest. This index configuration runs the Go indexer with quiet output in the `dev/sg` directory and uploads the resulting index file (`index.scip` by default). ```json { "indexer": "sourcegraph/scip-go:v0.1@sha256::39c1495...55391cc", "indexer_args": [ "scip-go", "-q", ], "root": "dev/sg" } ``` The following example uses the Docker image `sourcegraph/scip-typescript` pinned at the tag `autoindex`. This index configuration will run `npm install` followed by the TypeScript indexer `scip-typescript` in the `editors/code` directory. In this job, both commands run in the same workspace, but are invoked in different Docker containers. Both containers happen to be based on the same image, but that's not necessary. Note: `sourcegraph/scip-typescript` does not define a Docker entrypoint, so we need to indicate which binary to invoke (along with any additional arguments). ```json { "steps": [ { "image": "sourcegraph/scip-typescript:autoindex", "commands": [ "npm install" ], "root": "editors/code" } ], "indexer": "sourcegraph/scip-typescript:autoiondex", "indexer_args": [ "scip-typescript", "index" ], "root": "editors/code" } ``` ## Docker step object Each configured Docker step is executed sequentially using the same volume-mounted workspace, which is initially seeded with a fresh clone of the target repository. If the contents of the workspace is modified by one step, the changes will be visible in the next. This makes Docker steps especially useful for pre-indexing tasks that require modification of the source code, such as dependency resolution (e.g., `npm install`, `go mod download`) and code generation (e.g., `go generate ./...`) required for successful compilation or indexing of the project. ### Keys Each Docker step object can be configured with the following keys. #### [`image`](#docker-step-image) The name of the Docker image in which the configured commands are executed. #### [`commands`](#docker-step-commands) An ordered sequence of commands to execute within a container running the configured image. These commands are passed directly into the target container via `docker exec`, one at a time. #### [`root`](#docker-step-root) The working directory within the Docker container where the provided commands are executed. This working directory is relative to the root of the target repository. An empty value (the default) indicates the root of the repository. ### Examples The following example runs `go generate` over all packages in the root of the repository. ```json { "indexer": "golang:1.17.3-buster@sha256:c1bae5f...3e4f07b", "commands": [ "go generate ./..." ] } ``` The following example runs a series of commands to install dependencies in the `lib/proj` directory. ```json { "indexer": "node:alpine3.12@sha256:4435145...fd06fd3", "commands": [ "yarn config set ignore-engines true", "yarn install" ], "root": "lib/proj" } ``` # Auto-indexing Supported on [Enterprise](/pricing/enterprise) plans. Currently in Beta and available via Web app.

Learn and understand how auto-indexing works.

With Sourcegraph deployments supporting [executors](/admin/executors/), your repository contents can be automatically analyzed to produce a code graph index file. Once [auto-indexing is enabled](/code-search/code-navigation/auto_indexing#enable-auto-indexing) and [auto-indexing policies are configured](/code-search/code-navigation/auto_indexing#configure-auto-indexing), repositories will be periodically cloned into an executor sandbox, analyzed, and the resulting index file will be uploaded back to the Sourcegraph instance. Auto-indexing is currently available for Go, TypeScript, JavaScript, Python, Ruby and JVM repositories. See also [dependency navigation](/code-search/code-navigation/features#dependency-navigation) for instructions on how to setup cross-dependency navigation depending on what language ecosystem you use. ## Enable auto-indexing The following docs explains how to turn on [auto-indexing](/code-search/code-navigation/auto_indexing) on your Sourcegraph instance to enable [precise code navigation](/code-search/code-navigation/precise_code_navigation). ### Deploy executors This step is only required if you are on self-hosted Sourcegraph. First, [deploy the executor service](/admin/executors/deploy_executors) targeting your Sourcegraph instance. This will provide the necessary compute resources that clone the target Git repository, securely analyze the code to produce a code graph data index, then upload that index to your Sourcegraph instance for processing. ### Enable index job scheduling Next, enable the following feature flag in your Sourcegraph instance's site configuration. ```yaml { "codeIntelAutoIndexing.enabled": true } ``` This step will control the scheduling of indexing jobs which are made available to the executors deployed in the previous step. ### Tune the index scheduler The frequency of index job scheduling can be tuned via the following environment variables read by `worker` service containers running the [`codeintel-auto-indexing`](/admin/workers#codeintel-auto-indexing) task. - **`PRECISE_CODE_INTEL_AUTO_INDEXING_TASK_INTERVAL`**: The time to run periodic codeintel auto-indexing tasks. The default is every 2 minutes - **`PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_PROCESS_DELAY`**: The minimum time that the same repository can be considered for auto-index scheduling. The default is every 24 hours - **`PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_BATCH_SIZE`**: The number of repositories to consider for auto-indexing scheduling at a time. Default is 2500 - **`PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_INSPECTED_PER_SECOND`**: The maximum number of repositories inspected for auto-indexing per second. Set to zero to disable the limit. Default is 0 ## Configure auto-indexing This feature is in beta for self-hosted customers. Precise code navigation [auto-indexing](/code-search/code-navigation/auto_indexing) jobs are scheduled based on two fronts of configuration. The first front selects the set of repositories and commits within those repositories that are candidates for auto-indexing. These candidates are controlled by [configuring auto-indexing policies](#configure-auto-indexing-policies). The second front determines the set of index jobs that can run over candidate commits. By default, index jobs are [inferred](/code-search/code-navigation/inference_configuration) from the repository structure's on disk. Index job inference uses heuristics such as the presence or contents of particular files to determine the paths and commands required to index a repository. Alternatively, index job configuration [can be supplied explicitly](#explicit-index-job-configuration) for a repository when the inference heuristics are not powerful enough to create an index job that produces the correct results. This might be necessary for projects that have non-standard or complex dependency resolution or pre-compilation steps, for example. ### Configure auto-indexing policies Let's learn how to configure policies to control the scheduling of precise code navigation indexing jobs. An indexing jobs [produces a code graph data index](/code-search/code-navigation/precise_code_navigation) and uploads it to your Sourcegraph instance for use with code navigation. See the [best practices guide](/code-search/code-navigation/how-to/policies_resource_usage_best_practices) for additional details on how policies affect resource usage. Each policy has a number of configurable options, including: - The set of Git branches or tags to which the policy applies - The maximum age of commits that should be indexed (e.g., skip indexing commits made last year) - For branches, whether to only consider the _tip_ of the branch, or all commits on that branch When auto-indexing is enabled, uploading a code graph data index will trigger creation of index jobs for dependencies if they are available on the Sourcegraph instance, in order to provide greater coverage for precise code navigation actions such as Go to definition and Find references. Precise code navigation indexing jobs are scheduled periodically in the background for each repository matching an indexing policy. ### Applying indexing policies globally Site admins can create indexing policies that apply to **all repositories** on their Sourcegraph instance. In order to view and edit these policies, navigate to the code graph configuration in the site-admin dashboard. ![Global auto-indexing policy configuration list page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/global-list-indexing.png) New policies can also be created to apply to the HEAD of the default branch, or to apply to any arbitrary Git branch or tag pattern. For example, you may want to index release branches for all of your repositories (in this example, branches whose last commit is older than five years of age will not apply). ![Global auto-indexing policy configuration edit page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/global-create-indexing.png) ![lobal auto-indexing policy configuration created confirmation](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/post-create.png) New policies can be created to apply to a set of repositories that are matched by name. For example, you may want to enable indexing for a particular set of repositories (in this example, repositories in the `sourcegraph` organization). ![Global auto-indexing policy with repository patterns configuration edit page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/create-repo-list-indexing.png) ![Global auto-indexing policy with repository patterns configuration created confirmation](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/post-create-repo-list.png) ### Applying indexing policies to a specific repository Indexing policies can also be created on a per-repository basis as commit and merge workflows differ wildly from project to project. In order to view and edit repository-specific policies, navigate to the code graph settings in the target repository's index page. ![Repository index page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/sg-3.33/repository-page.png) The settings page will show all policies that apply to the given repository, including both repository-specific policies as well as global policies that match the repository. ![Repository-specific auto-indexing policy configuration list page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/list.png) In this example, we create an indexing policy that applies to all _versioned_ tags (those prefixed with `v`). The **Index all version tags** policy ensures all commits visible from matching tagged commit will be kept indexed (and not removed due to age). ![Repository-specific auto-indexing policy configuration edit page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/create.png) ![Repository-specific auto-indexing policy configuration created confirmation](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/post-create-indexing.png) ### Explicit index job configuration For projects that have non-standard or complex dependency resolution or pre-compilation steps, inference heuristics might not be powerful enough to create an index job that produces the correct results. In these cases, explicit index job configuration can be supplied to a repository in two ways (listed below in order of decreasing precedence). Both methods of configuration share a common expected schema. See the [reference documentation](/code-search/code-navigation/auto_indexing_configuration) for additional information on the shape and content of the configuration. 1. Configure index jobs by committing a `sourcegraph.yaml` file to the root of the target repository. If you're new to YAML and want a short introduction, see [Learn YAML in five minutes](https://learnxinyminutes.com/docs/yaml/). Note that YAML is a strict superset of JSON, therefore the file contents can also be encoded as valid JSON (despite the file extension). 2. Configure index jobs via the target repository's code graph settings UI. In order to view and edit the indexing configuration for a repository, navigate to the code graph settings in the target repository's index page. ![Repository index page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/sg-3.33/repository-page.png) From there you can view or edit the repository's configuration. We use a superset of JSON that allows for comments and trailing commas. The set of index jobs that would be [inferred](/code-search/code-navigation/explanations/auto_indexing_inference) from the content of the repository (at the current tip of the default branch) can be viewed and may often be useful as a starting point to define more elaborate indexing jobs. ![Auto-indexing configuration editor](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/configuration.png) ### Private repositories and packages configuration For auto-indexing jobs to be able to build your projects that use private repositories and packages, you need to provide language-specific configuration in the form of Executor secrets. ### Go For Go resolver to access private Git repositories, you need to configure a `NETRC_DATA` secret with the following contents: ```text machine login password ``` Under the hood, this information will be used to write the [.netrc](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) file that is respected by Git and Go. ### TypeScript/JavaScript For **NPM**, you can create a [secret named `NPM_TOKEN`](https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow#set-the-token-as-an-environment-variable-on-the-cicd-server) which will be automatically picked up by the indexer. ## Language support Auto-indexing is currently available for Go, TypeScript, JavaScript, Python, Ruby and JVM repositories. See also [dependency navigation](/code-search/code-navigation/features#dependency-navigation) for instructions on how to setup cross-dependency navigation depending on what language ecosystem you use. ## Lifecycle of an indexing job Index jobs are run asynchronously from a queue. Each index job has an attached **state** that can change over time as work associated with that job is performed. The following diagram shows transition paths from one possible state of an index job to another. ![Index job state diagram](https://storage.googleapis.com/sourcegraph-assets/Docs/index-states.svg) The general happy-path for an index job is: `QUEUED_FOR_INDEXING`, `INDEXING`, then `INDEXING_COMPLETED`. Once uploaded, the remaining lifecycle is described in [lifecycle of an upload](/code-search/code-navigation/explanations/uploads#lifecycle-of-an-upload). Index jobs may fail to complete due to the job configuration not aligning with the repository contents or due to transient errors related to the network (for example). An index job will enter the `INDEXING_ERRORED` state on such conditions. Errored index jobs may be retried a number of times before moving into a permanently errored state. At any point, an index job record may be deleted (usually due to explicit deletion by the user). ## Lifecycle of an indexing job (via UI) Users can see precise code navigation index jobs for a particular, repository by navigating to the code graph page in the target repository's index page. ![Repository index page](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/sg-3.33/repository-page.png) Administrators of a Sourcegraph instance can see a global view of code graph index jobs across all repositories from the **Site Admin** page. ![Global list of precise code navigation index jobs across all repositories](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/indexes-list.png) The detail page of an index job will show its current state as well as detailed logs about its execution up to the current point in time. ![Upload in processing state](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/indexes-processing.png) The stdout and stderr of each command run during pre-indexing and indexing steps are viewable as the index job is processed. This information is valuable when troubleshooting a [custom index configuration](/code-search/code-navigation/auto_indexing_configuration) for your repository. ![Detailed look at index job logs](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/indexes-processing-detail.png) Once the index job completes, a code graph data file has been uploaded to the Sourcegraph instance. ![Upload in completed state](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/renamed/indexes-completed.png) ## Inference of auto-indexing jobs This feature is in beta for self-hosted customers. When a commit of a repository is selected as a candidate for [auto-indexing](/code-search/code-navigation/auto_indexing) but does not have an explicitly supplied index job configuration, index jobs are inferred from the content of the repository at that commit. The site-config setting `codeIntelAutoIndexing.indexerMap` can be used to update the indexer image that is (globally) used on inferred jobs. For example, `"codeIntelAutoIndexing.indexerMap": {"go": "lsif-go:alternative-tag"}` will cause inferred jobs indexing Go code to use the specified container (with an alternative tag). This can also be useful for specifying alternative Docker registries. This document describes the heuristics used to determine the set of index jobs to schedule. See [configuration reference](/code-search/code-navigation/auto_indexing_configuration) for additional documentation on how index jobs are configured. As a general rule of thumb, an indexer can be invoked successfully if the source code to index can be compiled successfully. The heuristics below attempt to cover the common cases of dependency resolution, but may not be sufficient if the target code requires additional steps such as code generation, header file linking, or installation of system dependencies to compile from a fresh clone of the repository. For such cases, we recommend using the inferred job as a starting point to [explicitly supply index job configuration](/code-search/code-navigation/auto_indexing#explicit-index-job-configuration). ### Go For each directory containing a `go.mod` file, the following index job is scheduled. ```json { "indexing_jobs": [ { "steps": [ { "root": "", "image": "sourcegraph/lsif-go", "commands": [ "go mod download" ] } ], "root": "", "indexer": "sourcegraph/lsif-go", "indexer_args": [ "lsif-go", "--no-animation" ] } ] } ``` For every other directory excluding `vendor/` directories and their children containing one or more `*.go` files, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/lsif-go", "indexer_args": [ "GO111MODULE=off", "lsif-go", "--no-animation" ] } ``` ### TypeScript For each directory excluding `node_modules/` directories and their children containing a `tsconfig.json` file, the following index job is scheduled. Note that there are a dynamic number of pre-indexing steps used to resolve dependencies: for each ancestor directory `ancestor(dir)` containing a `package.json` file, the dependencies are installed via either `yarn` or `npm`. These steps run in order, depth-first. ```json { "steps": [ { "root": "", "image": "sourcegraph/scip-typescript:autoindex", "commands": [ "yarn" ] }, { "root": "", "image": "sourcegraph/scip-typescript:autoindex", "commands": [ "npm install" ] }, "..." ], "local_steps": [ "N_NODE_MIRROR=https://unofficial-builds.nodejs.org/download/release n --arch x64-musl autol" ], "root": "", "indexer": "sourcegraph/scip-typescript:autoindex", "indexer_args": [ "scip-typescript", "index" ] } ``` ### Rust If the repository contains a `Cargo.toml` file, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/lsif-rust", "indexer_args": [ "lsif-rust", "index" ], "outfile": "dump.lsif" } ``` ### Java Inference for languages supported by [scip-java](https://github.com/sourcegraph/scip-java) is currently restricted to Sourcegraph.com. If the repository contains both a `lsif-java.json` file as well as `*.java`, `*.scala`, or `*.kt` files, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/scip-java", "indexer_args": [ "scip-java", "index", "--build-tool=lsif" ], "outfile": "index.scip" } ``` ## More resources # Code intelligence policies resource usage best practices This guide gives an overview of best practices when defining [auto-index scheduling](/code-search/code-navigation/auto_indexing#configure-auto-indexing) and data retention policies as it relates to resource usage (particular the disk requirement for Postgres). **Auto-index scheduling policies** define the _cadence_ at which particular repositories will be subject to have indexing jobs scheduled (depending on the repository's configuration and contents). These policies define when a commit of a repository should be marked as an auto-index job candidate. **Data retention policies** define the set of indexes which are _interesting_ to a particular Sourcegraph instance's users. This is generally not *all* commits (or even all repositories), and can change drastically from company-to-company. SCIP indexes for the head of a repository's default branch are useful to explore what is most likely the current view of the development branch. These are safe from expiration by default and do not require an explicit policy to be defined by the user. SCIP indexes for historic commits can be useful to retain in addition to the current development target (retained implicitly). SCIP indexes associated with git tags matching `v*` (for example) may be useful to index and retain indefinitely (or for some relevant length of time). These indexes are _more_ likely to be used by other projects, running in production, or used externally than any arbitrary commit of the repository. Branches with a particular format may also have significance indicating its indexes should not be garbage collected. Policies should be created in such a manner that the commits most useful to _your_ engineers are covered. This may mean defining both an auto-indexing and data retention policy, or ensuring that SCIP indexes uploaded externally (via build system) are covered by a data retention policy. However, _usefulness_ vs _cost_ can be a delicate balancing act. If all SCIP indexes uploaded to an instance were retained forever, then disk requirements for Postgres would grow continuously. This is not sustainable for any engineering team with a non-zero commit velocity. If your engineering team has zero velocity please contact Sourcegraph support for guidance. Both of these types of policies (as well as any SCIP uploads integrated into a build system) influence the usage of disk in the `codeintel-db` schema. There are two large knobs that can be turned to reduce usage: 1. Reduce index coverage (exclude repositories or targets or branches) or index less frequently 2. Retain fewer indexes as they age (e.g., do not keep indexes on the non-head of branches) The following factors also play a contributing role to the scale of data on a particular instance: - How *large* your repositories (or indexing targets) are - How *frequently* your repositories (or indexing targets) receive new commits - How *widely* your data retention policies retain individual SCIP indexes (one branch vs all branches) - How *deeply* your data retention policies retain individual SCIP indexes (the latest commit vs all commits on a branch) - How many repositories (or indexing targets) have received SCIP uploads (are there deprecated repos being indexed that will never be relevant to a user?) ## Sourcegraph.com's configuration As an example, we detail relevant configuration for [Sourcegraph.com](https://sourcegraph.com). - We support auto-indexing on repositories matching `github.com/*` and `gitlab.com/*`, but only index the `HEAD` of these repositories as there are a massive number and indexing branches or tags of both code hosts would be infeasible. Matching indexes are retained indefinitely, but there is only one set of indexes covered by this policy per repository at any given time. This policy doesn't keep unnecessary data longer than necessary. - We support indexing of all tags of `jdk` with infinite retention to support precise navigation into Java ecosystem internals when individual repositories have precise intelligence. - Experimentally, we're indexing all tags of repositories matching `maven/*` to get quantitative measurements on the number of open-source Java projects we're able to infer build/indexing requirements from given only the repository contents. # Index other languages

This guide is meant to provide instructions for how to enable precise code navigation for any programming language.

The general steps for enabling precise code navigation are as follows: ## Install Sourcegraph CLI The [Sourcegraph CLI](/cli/) is used for uploading SCIP data to your Sourcegraph instance (replace `linux` with `darwin` for macOS): ```sh curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src ``` ## Install SCIP indexer An SCIP indexer is a command line tool that performs code analysis of source code and outputs a file with metadata containing all the definitions, references, and hover documentation in a project in SCIP. The SCIP file is then uploaded to Sourcegraph to power code navigation features. Install the [indexer](/code-search/code-navigation/writing_an_indexer) for the required programming language of your repository by following the instructions in the indexer's README ## Generate SCIP data To generate the SCIP data for your repository run the command in the _generate SCIP data_ step found in the README of the installed indexer. ## Upload SCIP data The upload step is the same for all languages. Make sure the current working directory is a path inside your repository, then use the Sourcegraph CLI to upload the SCIP file: ### To a private Sourcegraph instance (on prem) ```sh SRC_ENDPOINT=https://sourcegraph.mycompany.com src code-intel upload -file=index.scip ``` ### To cloud based Sourcegraph.com ```sh src code-intel upload -github-token=YourGitHubToken -file=dump.lsif ``` The `src-cli` upload command will try to infer the repository and git commit by invoking git commands on your local clone. If git is not installed, is older than version 2.7.0 or you are running on code outside of a git clone, you will need to also specify the `-repo` and `-commit` flags explicitly. If you're using Sourcegraph.com or have enabled [`lsifEnforceAuth`](/admin/config/site_config#lsifEnforceAuth) you need to [supply a GitHub token](#proving-ownership-of-a-github-repository) supplied via the `-github-token` flag in the command above. Successful output will appear similar to the following example. ![Uploading a code graph index via the Sourcegraph CLI](https://storage.googleapis.com/sourcegraph-assets/docs/images/code-intelligence/sg-3.34/uploads/src-lsif-upload.gif) ## Automate code indexing Now that you have successfully enabled code navigation for your repository, you can automate source code indexing to ensure precise code navigation stays up to date with the most recent code changes in the repository. See our [continuous integration guide](/code-search/code-navigation/how-to/adding_lsif_to_workflows) to setup automation. ## Troubleshooting ### Testing Make sure you have configured your Sourcegraph instance and [enabled precise code navigation](/code-search/code-navigation/precise_code_navigation#setting-up-code-navigation-for-your-codebase). Once LSIF data has uploaded, open the Sourcegraph UI or your code host (i.e. GitHub) and navigate to any code file that was part of the repository that was analyzed by the LSIF indexer. Hover over a symbol, variable or function name in the file, you should now see rich LSIF metadata as the source for hover-tooltips, definitions, and references. ### Error Logs To view code graph indexer processing failures go to **Repository settings > Code graph data > Activity for this repository** in your Sourcegraph instance. Failures can occur if the LSIF data is invalid (e.g., malformed indexer output), or problems were encountered during processing (e.g., system-level bug, flaky connections, etc). Try again or [file an issue](https://github.com/sourcegraph/sourcegraph/issues/new) if the problem persists. ### Common Errors Possible errors that can happen during upload include: - Clone in progress: the instance doesn't have the necessary data to process your upload yet, retry in a few minutes - Unknown repository (404): check your `-endpoint` and make sure you can view the repository on your Sourcegraph instance - Invalid commit (404): try visiting the repository at that commit on your Sourcegraph instance to trigger an update - Invalid auth when using Sourcegraph.com or when [`lsifEnforceAuth`](/admin/config/site_config#lsifEnforceAuth) is `true` (401 for an invalid token or 404 if the repository cannot be found on GitHub.com): make sure your GitHub token is valid and that the repository is correct - Unexpected errors (500s): reach out to your Sourcegraph support team for assistance
# Index a TypeScript or JavaScript repository

This page describes how to create an index for JavaScript and TypeScript projects and uploading it to Sourcegraph.

We will use [`scip-typescript`](https://github.com/sourcegraph/scip-typescript) to create the index and the [Sourcegraph CLI](https://github.com/sourcegraph/src-cli) to upload it to Sourcegraph. ## Indexing in CI using scip-typescript directly In this approach, you will directly install `scip-typescript` and `src-cli` in CI. This is particularly useful if you are already using some other Docker image for your build. Here is an example using GitHub Actions to create and upload an index for a TypeScript project. ```yaml jobs: create-index-and-upload: # prevent forks of this repo from uploading lsif indexes if: github.repository == '' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install dependencies run: npm install - name: Install scip-typescript run: npm install -g @sourcegraph/scip-typescript - name: Generate index uses: scip-typescript index - name: Install src-cli run: | curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src - name: Upload index run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress env: SRC_ENDPOINT: https://sourcegraph.com/ ``` `src-cli` ignores index upload failures by default to avoid disrupting CI pipelines with non-critical errors. On CI providers other than GitHub Actions, you may need to explicitly install [Node.js](https://nodejs.org/) as a first step. See the [`scip-typescript` README](https://github.com/sourcegraph/scip-typescript) for the list of supported Node.js versions. Examples: - [lodash/lodash](https://github.com/sourcegraph-codeintel-showcase/lodash/blob/master/.github/workflows/lsif.yml) (JavaScript) ### Optional scip-typescript flags The exact `scip-typescript` invocation will vary based on your configuration. For example: - If you are indexing a JavaScript project instead of TypeScript, add the `--infer-tsconfig` flag. ```sh scip-typescript index --infer-tsconfig ``` - If you are indexing a project using Yarn workspaces, add the `--yarn-workspaces` flag. ```sh scip-typescript index --yarn-workspaces ``` - If you are indexing a project using Pnpm workspaces, add the `--pnpm-workspaces` flag. ```sh scip-typescript index --pnpm-workspaces ``` ## Indexing in CI using the scip-typescript Docker image Sourcegraph provides a Docker image for `sourcegraph/scip-typescript`, which bundles `src-cli` for convenience. Here is an example using the `scip-typescript` Docker image with GitHub Actions to index a TypeScript project. ```yaml jobs: create-and-upload-index: # prevent forks of this repo from uploading lsif indexes if: github.repository == '' runs-on: ubuntu-latest container: sourcegraph/scip-typescript:latest steps: - uses: actions/checkout@v3 - name: Install dependencies run: npm install - name: Generate index run: scip-typescript index - name: Upload index run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -no-progress env: SRC_ENDPOINT: https://sourcegraph.com/ ``` If you are indexing a JavaScript codebase or a project using Yarn workspaces, tweak the `scip-typescript` invocation as documented in the [Optional scip-typescript flags](#optional-scip-typescript-flags) section. ## One-off indexing using scip-typescript locally Creating one-off indexes and uploading them is valuable as a proof of concept, but indexes are not kept up to date. The steps here are similar to those in the previous GitHub Actions example. 1. Install `scip-typescript`. ```sh npm install -g @sourcegraph/scip-typescript ``` 2. Install the Sourcegraph CLI. ```sh curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src ``` The exact invocation may change depending on the OS and architecture. See the [`src-cli` README](https://github.com/sourcegraph/src-cli#installation) for details. 3. `cd` into your project's root (which contains `package.json`/`tsconfig.json`) and run the following: ```sh npm install # Enable (1) type-checking code used from external packages and (2) cross-repo navigation by installing dependencies first with npm or yarn scip-typescript index # for TypeScript projects ``` If you are indexing a JavaScript codebase or a project using Yarn workspaces, tweak the `scip-typescript` invocation as documented in the [Optional scip-typescript flags](#optional-scip-typescript-flags) section. 4. Upload the data to a Sourcegraph instance. ```sh SRC_ENDPOINT= src code-intel upload # for private instances src code-intel upload -github-token= # for public instances ``` The upload command will provide a URL you can visit to see the upload status. Once the upload has finished processing, you can visit the repo and enjoy precise code navigation!
# Go SCIP indexing

This page describes how you can automate data indexing in SCIP for Go codebases or index data manually.

## Automated indexing Sourcegraph provides the Docker images `sourcegraph/scip-go` and `sourcegraph/src-cli` so that you can easily automate indexing in your favorite CI framework. Note that the `scip-go` image bundles `src-cli`, so the second image may not be necessary. The following examples show you how to set up automated indexing in a few popular frameworks. You'll need to substitute the indexer and upload commands with what works for your project locally. If you implement automated indexing in a different framework, feel free to edit this page with instructions! ### GitHub Actions ```yaml on: - push jobs: scip-go: # this line will prevent forks of this repo from uploading lsif indexes if: github.repository == '' runs-on: ubuntu-latest container: sourcegraph/scip-go:latest steps: - uses: actions/checkout@v1 - name: Generate SCIP data run: scip-go - name: Install src CLI run: | curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src - name: Upload SCIP data # this will upload to Sourcegraph.com, you may need to substitute a different command. # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure ``` The following projects have example GitHub Actions workflows to generate and upload LSIF indexes: - [golang/go](https://github.com/sourcegraph-codeintel-showcase/go/blob/f40606b1241b0ca4802d7b00a763241b03404eea/.github/workflows/lsif.yml) - [kubernetes/kubernetes](https://github.com/sourcegraph-codeintel-showcase/kubernetes/blob/master/.github/workflows/lsif.yml) - [moby/moby](https://github.com/sourcegraph-codeintel-showcase/moby/blob/master/.github/workflows/lsif.yml) ### CircleCI ```yaml version: 2.1 jobs: scip-go: docker: - image: sourcegraph/scip-go:latest steps: - checkout - run: scip-go - run: | curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src; # this will upload to Sourcegraph.com, you may need to substitute a different command. # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. - run: src code-intel upload -github-token=<> -ignore-upload-failure workflows: scip-typescript: jobs: - scip-typescript ``` The following projects have example CircleCI configurations to generate and upload SCIP indexes. - [grafana](https://github.com/sourcegraph-codeintel-showcase/grafana/blob/master/.circleci/config.yml) - [helm](https://github.com/sourcegraph-codeintel-showcase/helm/blob/62c38f152d0802719aad1ec4c1c281f01dc75173/.circleci/config.yml) - [prometheus/prometheus](https://github.com/sourcegraph-codeintel-showcase/prometheus/blob/a0a8a249fff9d1c6ce4c097ccc4f5e120c723c51/.circleci/config.yml) ### Travis CI ```yaml services: - docker jobs: include: - stage: scip-go # this will upload to Sourcegraph.com, you may need to substitute a different command. # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. script: - | docker run --rm -v $(pwd):/src -w /src sourcegraph/scip-go:latest /bin/sh -c \ "scip-go; curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src; chmod +x /usr/local/bin/src; src code-intel upload -github-token=$GITHUB_TOKEN -ignore-upload-failure" ``` The following projects have example Travis CI configurations to generate and upload SCIP indexes. - [aws/aws-sdk-go](https://github.com/sourcegraph-codeintel-showcase/aws-sdk-go/blob/92f67a061fcdd46d6a418b28838b10b6ac63a880/.travis.yml) - [etcd-io/etcd](https://github.com/sourcegraph-codeintel-showcase/etcd/blob/eae726706fe8ebf7e08b45ba29a70388595db31b/.travis.yml) - [hugo/hugo](https://github.com/sourcegraph-codeintel-showcase/hugo/blob/6704b7c125d7b21ccf2048d7bff0f1ffe2b0867d/.travis.yml) ## Manual indexing 1. Install the [Go SCIP indexer](https://github.com/sourcegraph/scip-go). 1. Install the [Sourcegraph CLI](https://github.com/sourcegraph/src-cli) with the following command: ```sh curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src ``` - **macOS**: Replace `linux` with `darwin` in the URL and choose the appropriate architecture: M1/M2 chips - `arm64`, Intel chips - `amd64`. - **Windows**: Visit [the CLI repo](https://github.com/sourcegraph/src-cli) for further instructions. 1. `cd` into your Go project's root (where the `go.mod` file lives, if you have one) and run: ```sh scip-go # generates a file named index.scip ``` 1. Upload the data to a Sourcegraph instance with: ``` sh src -endpoint= code-intel upload # for private instances src code-intel upload -github-token= # for public instances ``` The upload command will provide a URL you can visit to see the upload status. When the upload is complete, you can visit the repo and check out the difference in code navigation quality!
# How-to guides - [Adding precise code navigation to CI/CD workflows](/code-search/code-navigation/how-to/adding_lsif_to_workflows) - [Combining SCIP uploads from CI/CD and auto-indexing](/code-search/code-navigation/how-to/combining_scip_uploads_from_ci_cd_and_auto_indexing) - [Go SCIP indexing](/code-search/code-navigation/how-to/index_a_go_repository) - [Index a TypeScript or JavaScript repository](/code-search/code-navigation/how-to/index_a_typescript_and_javascript_repository) - [Index other languages](/code-search/code-navigation/how-to/index_other_languages) - [Code intelligence policies resource usage best practices](/code-search/code-navigation/how-to/policies_resource_usage_best_practices) # Combining SCIP uploads from CI/CD and auto-indexing Sourcegraph Enterprise instances can serve many profiles of repository size and build complexity, and therefore provides multiple methods precise SCIP index data for your team's repositories. We currently support: 1. Uploading [SCIP data yourself](/code-search/code-navigation/how-to/index_other_languages#upload-scip-data) directly from an already-configured build or continuous integration server, as well as 2. [Auto-indexing](/code-search/code-navigation/auto_indexing), which schedules index creation within the Sourcegraph instance. There is nothing preventing users from mix-and-matching these methods (we do it ourselves), but we do have some tips for doing so successfully. First and foremost, try to that auto-indexing is disabled on repositories that will receive manually configured uploads. This can be done by ensuring that no [auto-indexing policies](/code-search/code-navigation/auto_indexing#configure-auto-indexing-policies) exist for the target repo. Even if one is not created explicitly for this repo, it may still be covered under a global policy with a matching repository pattern. If covering policies can't be changed to exclude a repo (or if you want _partially_ auto-indexed coverage), then the repository can be [explicitly configured](/code-search/code-navigation/auto_indexing#explicit-index-job-configuration) with a set of auto-indexing jobs to schedule. Simply delete the job configuration that conflicts the explicitly configured project (the directory and indexer's target language should match). Once an explicit set of jobs are configured, auto-inference will not update it. If the repository shape changes frequently (new index targets are added or removed). Therefore, this configuration should be manually refreshed as necessary. # Adding precise code navigation to CI/CD workflows ## Language-specific guides We are working on creating language specific guides for use with different indexers, so make sure to check for the documentation for your language! If there isn't a guide for your language, this general guide will help you through the precise code navigation setup process. ## Benefits of CI integration Setting up a source code indexing job in your CI build provides you with fast code navigation that gives you more control on when source code gets indexed, and ensures accuracy of your code navigation by keeping in sync with changes in your repository. Due to the large number of CI frameworks and languages we may not have specific documentation for your use case. Feel free to [file an issue](https://github.com/sourcegraph/sourcegraph/issues/new) if you're having difficulties and we can help troubleshoot your setup. ## Using indexer containers We're working on creating containers that bundle indexers and the [Sourcegraph CLI (`src`)](https://github.com/sourcegraph/src-cli). All the languages in our [language-specific guides](/code-search/code-navigation/precise_code_navigation#setting-up-code-navigation-for-your-codebase) are supported, and this section provides a general guide to using those containers. We've pinned the containers to the `latest` tag in these samples so they stay up to date, but make sure you pin them before going live to ensure reproducibility. ### Basic usage Some indexers will work out of the box by just running them in your project root. Here's an example using GitHub actions and Go: ```yaml jobs: scip-go: #this line will prevent forks of this repo from uploading lsif indexes if: github.repository == '' runs-on: ubuntu-latest container: sourcegraph/scip-go:latest steps: - uses: actions/checkout@v1 - name: Generate index run: scip-go - name: Install src CLI run: | curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src - name: Upload index # this will upload to Sourcegraph.com, you may need to substitute a different command # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure ``` ### Sub-projects If your repository contains multiple code projects in different folders, your CI framework likely provides a "working directory" option so that you can do something like: ```yaml jobs: scip-go: # Prevent forks of this repo from uploading SCIP indexes if: github.repository == '' runs-on: ubuntu-latest container: sourcegraph/scip-go:latest steps: - uses: actions/checkout@v1 - name: Generate index working-directory: backend/ run: scip-go - name: Install src CLI working-directory: backend/ run: | curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src chmod +x /usr/local/bin/src - name: Upload index # note that the upload command also needs to happen in the same directory! working-directory: backend/ # this will upload to Sourcegraph.com, you may need to substitute a different command # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure ``` ### Custom build environments Depending on which language you're using, you may need to perform some pre-indexing steps in a custom build environment. You have a couple options for this: - Add the indexer and [Sourcegraph CLI (`src`)](https://github.com/sourcegraph/src-cli) to your environment. To make this easier, you could either directly build a Docker image from our indexer container, or use its Dockerfile as inspiration for getting the tools installed in your environment. - Do the pre-indexing steps in your environment, and then make those artifacts available to our container. This second step is easy in GitHub actions because our container can be used as an action. Here's an example for a TypeScript project: ```yaml jobs: scip-typescript: # this line will prevent forks of this repo from uploading scip indexes if: github.repository == '' runs-on: ubuntu-latest container: my-awesome-container steps: - uses: actions/checkout@v1 - name: Install dependencies run: - name: Generate index uses: docker://sourcegraph/scip-typescript:latest with: args: scip-typescript index - name: Upload index uses: docker://sourcegraph/src-cli:latest with: # this will upload to Sourcegraph.com, you may need to substitute a different command # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. args: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }} -ignore-upload-failure ``` ### GitHub Action Examples The following projects have example GitHub Action workflows to generate and upload indexes. - [elastic/kibana](https://github.com/sourcegraph-codeintel-showcase/kibana/blob/7ed559df0e2036487ae6d606e9ffa29d90d49e38/.github/workflows/lsif.yml) - [golang/go](https://github.com/sourcegraph-codeintel-showcase/go/blob/master/.github/workflows/scip.yml) - [kubernetes/kubernetes](https://github.com/sourcegraph-codeintel-showcase/kubernetes/blob/359b6469d85cc7cd4f6634e50651633eefeaea4e/.github/workflows/lsif.yml) - [lodash/lodash](https://github.com/sourcegraph-codeintel-showcase/lodash/blob/b90ea221bd1b1e036f2dfcd199a2327883f9451f/.github/workflows/lsif.yml) - [moby/moby](https://github.com/sourcegraph-codeintel-showcase/moby/blob/380429abb05846de773d5aa07de052f40c9e8208/.github/workflows/lsif.yml) - [ReactiveX/IxJS](https://github.com/sourcegraph-codeintel-showcase/IxJS/blob/e53d323314043afb016b6deceaeb068d8d23c303/.github/workflows/lsif.yml) ### Circle CI Examples Certain frameworks like Circle CI may require you to explicitly cache artifacts between jobs. In CircleCI this might look like the following: ```yaml version: 2.1 jobs: install-deps: docker: - image: my-awesome-container steps: - checkout - - save_cache: paths: - node_modules key: dependencies jobs: scip-typescript: docker: - image: sourcegraph/scip-typescript:latest steps: - checkout - restore_cache: keys: - dependencies - run: scip-typescript index # this will upload to Sourcegraph.com, you may need to substitute a different command # by default, we ignore failures to avoid disrupting CI pipelines with non-critical errors. - run: src code-intel upload -github-token=<> -ignore-upload-failure workflows: scip-typescript: jobs: - install-deps - scip-typescript: requires: - install-deps ``` The following projects have example CircleCI configurations to generate and upload indexes. - [angular/angular](https://github.com/sourcegraph-codeintel-showcase/angular/blob/f06eec98cadab2ff7a1cef2a03ba7c42015eb399/.circleci/config.yml) - [facebook/jest](https://github.com/sourcegraph-codeintel-showcase/jest/blob/b781fa2b6683f04324edbc4b41552a94f97cd479/.circleci/config.yml) - [facebook/react](https://github.com/sourcegraph-codeintel-showcase/react/blob/e488420f686b88803cfb1bb09bbc4d3991db8c55/.circleci/config.yml) - [grafana](https://github.com/sourcegraph-codeintel-showcase/grafana/blob/664a694955ea40575a1cffe9db47a7adf4d3c2bb/.circleci/config.yml) - [helm](https://github.com/sourcegraph-codeintel-showcase/helm/blob/62c38f152d0802719aad1ec4c1c281f01dc75173/.circleci/config.yml) - [prometheus/prometheus](https://github.com/sourcegraph-codeintel-showcase/prometheus/blob/a0a8a249fff9d1c6ce4c097ccc4f5e120c723c51/.circleci/config.yml) - [ReactiveX/rxjs](https://github.com/sourcegraph-codeintel-showcase/rxjs/blob/c9d3c1a76a68273863fc59075a71b4cc43c06114/.circleci/config.yml) ### Travis CI Examples The following projects have example Travis CI configurations to generate and upload indexes. - [aws/aws-sdk-go](https://github.com/sourcegraph-codeintel-showcase/aws-sdk-go/blob/92f67a061fcdd46d6a418b28838b10b6ac63a880/.travis.yml) - [etcd-io/etcd](https://github.com/sourcegraph-codeintel-showcase/etcd/blob/eae726706fe8ebf7e08b45ba29a70388595db31b/.travis.yml) - [expressjs/express](https://github.com/sourcegraph-codeintel-showcase/express/blob/bd1ae153f19656183257ed223d518aeb9f5091ec/.travis.yml) - [hugo/hugo](https://github.com/sourcegraph-codeintel-showcase/hugo/blob/6704b7c125d7b21ccf2048d7bff0f1ffe2b0867d/.travis.yml) - [Microsoft/TypeScript](https://github.com/sourcegraph-codeintel-showcase/TypeScript/blob/f37f1dee1b3e63b12df2935590c8707a5ec3993b/.travis.yml) - [moment/moment](https://github.com/sourcegraph-codeintel-showcase/moment/blob/eedccdc2c07fb5abe931b427d50f5b3c3f44ac95/.travis.yml) - [sindresorhus/got](https://github.com/sourcegraph-codeintel-showcase/got/blob/164d55a029512cea7f245de870cbb1eaba114734/.travis.yml) ## CI from scratch If you're indexing a language we haven't documented yet in our [language-specific guides](/code-search/code-navigation/precise_code_navigation#setting-up-code-navigation-for-your-codebase), follow the instructions in this section. We want to have containers available for every language with a robust indexer, so please also consider [filing an issue](https://github.com/sourcegraph/sourcegraph/issues/new) to let us know we're missing one. ### Set up your CI machines Your CI machines will need two command-line tools installed. Depending on your build system setup, you can do this as part of the CI step, or you can add it directly to your CI machines for use by the build. 1. The [Sourcegraph CLI (`src`)](https://github.com/sourcegraph/src-cli). 2. The [indexer](/code-search/code-navigation/writing_an_indexer) for your language. ### Add steps to your CI 1. **Generate an index** for a project within your repository by running the indexer in the project directory (consult your indexer's docs). 1. **[Upload that generated index](/code-search/code-navigation/precise_code_navigation#setting-up-code-navigation-for-your-codebase)** to your Sourcegraph instance. ## Recommended upload frequency We recommend that you start with a CI job that runs on every commit (including branches). If you see too much load on your CI, your Sourcegraph instance, or a rapid decrease in free disk space on your Sourcegraph instance, you can instead index only the default branch, or set up a periodic job (e.g. daily) in CI that indexes your default branch. With periodic jobs, you should still receive precise code navigation on non-indexed commits on lines that are unchanged since the nearest indexed commit. This requires that the indexed commit be a direct ancestor or descendant no more than [100 commits](https://github.com/sourcegraph/sourcegraph-public-snapshot/blob/e7803474dbac8021e93ae2af930269045aece079/lsif/src/shared/constants.ts#L25) away. If your commit frequency is too high and your index frequency is too low, you may find commits with no precise code navigation at all. In this case, we recommend you try to increase your index frequency if possible. ## Uploading indexes to Sourcegraph.com Indexes can be uploaded to a self-hosted Sourcegraph instance or to [Sourcegraph.com](https://sourcegraph.com). Using the [Sourcegraph.com](https://sourcegraph.com) endpoint will surface code navigation for your public repositories directly on GitHub via the [Sourcegraph browser extension](/integration/browser_extension) and at `https://sourcegraph.com/github.com//`. Using the [Sourcegraph.com](https://sourcegraph.com) endpoint is free and your index is treated as User-Generated Content (you own it, as covered in our [Sourcegraph.com terms of service](https://about.sourcegraph.com/terms-dotcom#3-proprietary-rights-and-licenses)). If you run into trouble, or a situation arises where you need all of your index expunged, please reach out to us at [support@sourcegraph.com](mailto:support@sourcegraph.com). # Code Graph Data uploads

How Code Graph indexers analyze code and generate and index file.

[Code graph indexers](/code-search/code-navigation/writing_an_indexer) analyze source code and generate an index file, which is subsequently [uploaded to a Sourcegraph instance](/code-search/code-navigation/how-to/index_other_languages#upload-scip-data) using [Sourcegraph CLI](/cli/) for processing. Once processed, this data becomes available for [precise code navigation queries](/code-search/code-navigation/precise_code_navigation). ## Lifecycle of an upload Uploaded index files are processed asynchronously from a queue. Each upload has an attached `state` that can change as work associated with that data is performed. The following diagram shows the possible transition paths from one `state` of an upload to another. ![Upload state diagram](https://storage.googleapis.com/sourcegraph-assets/Docs/upload-states.svg) The typical sequence for a successful upload is: `UPLOADING_INDEX`, `QUEUED_FOR_PROCESSING`, `PROCESSING`, and `COMPLETED`. In some cases, the processing of an index file may fail due to issues such as malformed input or transient network errors. When this happens, an upload enters the `PROCESSING_ERRORED` state. Such error uploads may undergo multiple retry attempts before moving into a permanent error state. At any point, an uploaded record may be deleted. This can happen due to various reasons, such as being replaced by a newer upload, due to the age of the upload record, or by explicit deletion initiated by the user. When deleting a record that could be used for code navigation queries, it transitions first into the `DELETING` state. This temporary state allows Sourcegraph to manage the set of Code Graph uploads smoothly. Changing the state of an upload to or from `COMPLETED` requires updating the [repository commit graph](#repository-commit-graph). This process can be computationally expensive for the worker service or Postgres database. ## Lifecycle of an upload (via UI) After successfully uploading an index file, the Sourcegraph CLI will provide a URL on the target instance to track the progress of that upload. Uploading a code graph index via the Sourcegraph CLI You can view the data uploads for a specific repository by navigating to the Code Graph page on the target repository's index page. Repository index page Alternatively, website administrators of a Sourcegraph instance can access a global view of Code Graph data uploads across all repositories from the **Site Admin** page. Global list of code graphd data uploads across all repositories ## Repository commit graph Sourcegraph maintains a mapping from a commit of a repository to the set of upload records that can resolve a query for that commit. When an upload record transitions to or from the `COMPLETED` state, the set of eligible uploads changes, and this mapping must be recalculated. Upon a state change in an upload, we flag the repository as needing an update. Subsequently, the worker service updates the commit graph and asynchronously clears the flag for that repository. When an upload changes state, the repository is flagged as requiring an update status. Then the [`worker` service](/admin/workers#codeintel-commitgraph) will update the commit graph and unset the flag for that repository asynchronously. While this flag is set, the repository's commit graph is considered `stale`. This means there may be some upload records in a `COMPLETED` state that aren't yet used to resolve code navigation queries. The state of a repository's commit graph can be seen in the code graph data page on the target repository's index page. Stale repository commit graph notice Once the commit graph has updated (and no subsequent changes to that repository's uploads have occurred), the repository commit graph is no longer considered `stale`. Up-to-date repository commit graph notice
# Inference of auto-indexing jobs This feature is in beta for self-hosted customers. When a commit of a repository is selected as a candidate for [auto-indexing](/code-search/code-navigation/auto_indexing) but does not have an explicitly supplied index job configuration, index jobs are inferred from the content of the repository at that commit. The site-config setting `codeIntelAutoIndexing.indexerMap` can be used to update the indexer image that is (globally) used on inferred jobs. For example, `"codeIntelAutoIndexing.indexerMap": {"go": "scip-go:alternative-tag"}` will cause inferred jobs indexing Go code to use the specified container (with an alternative tag). This can also be useful for specifying alternative Docker registries. This document describes the heuristics used to determine the set of index jobs to schedule. See [configuration reference](/code-search/code-navigation/auto_indexing_configuration) for additional documentation on how index jobs are configured. As a general rule of thumb, an indexer can be invoked successfully if the source code to index can be compiled successfully. The heuristics below attempt to cover the common cases of dependency resolution, but may not be sufficient if the target code requires additional steps such as code generation, header file linking, or installation of system dependencies to compile from a fresh clone of the repository. For such cases, we recommend using the inferred job as a starting point to [explicitly supply index job configuration](/code-search/code-navigation/auto_indexing#explicit-index-job-configuration). ## Go For each directory containing a `go.mod` file, the following index job is scheduled. ```json { "index_jobs": [ { "steps": [ { "root": "", "image": "sourcegraph/scip-go", "commands": [ "go mod download" ] } ], "root": "", "indexer": "sourcegraph/scip-go", "indexer_args": [ "scip-go", "--verbose" ] } ] } ``` For every _other_ directory excluding `vendor/` directories and their children containing one or more `*.go` files, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/scip-go", "indexer_args": [ "GO111MODULE=off", "scip-go", "--verbose" ] } ``` ## TypeScript For each directory excluding `node_modules/` directories and their children containing a `tsconfig.json` file, the following index job is scheduled. Note that there are a dynamic number of pre-indexing steps used to resolve dependencies: for each ancestor directory `ancestor(dir)` containing a `package.json` file, the dependencies are installed via either `yarn` or `npm`. These steps run in order, depth-first. ```json { "steps": [ { "root": "", "image": "sourcegraph/scip-typescript:autoindex", "commands": [ "yarn" ] }, { "root": "", "image": "sourcegraph/scip-typescript:autoindex", "commands": [ "npm install" ] }, "..." ], "local_steps": [ "N_NODE_MIRROR=https://unofficial-builds.nodejs.org/download/release n --arch x64-musl autol" ], "root": "", "indexer": "sourcegraph/scip-typescript:autoindex", "indexer_args": [ "scip-typescript", "index" ] } ``` ## Rust If the repository contains a `Cargo.toml` file, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/lsif-rust", "indexer_args": [ "lsif-rust", "index" ], "outfile": "dump.lsif" } ``` ## Java Inference for languages supported by [scip-java](https://github.com/sourcegraph/scip-java) is currently restricted to Sourcegraph.com. If the repository contains both a `lsif-java.json` file as well as `*.java`, `*.scala`, or `*.kt` files, the following index job is scheduled. ```json { "root": "", "indexer": "sourcegraph/scip-java", "indexer_args": [ "scip-java", "index", "--build-tool=lsif" ], "outfile": "index.scip" } ``` # Private Resources on on-prem data center via Sourcegraph Connect agent This feature is in the Experimental stage. Please contact Sourcegraph directly via [preferred contact method](https://about.sourcegraph.com/contact) for more information. As part of the [Enterprise tier](https://sourcegraph.com/pricing), Sourcegraph Cloud supports connecting private resources on any on-prem private network by running Sourcegraph Connect tunnel agent in customer infrastructure. ## How it works Sourcegraph will set up a tunnel server in a customer dedicated GCP project. Customer will start the tunnel agent provided by Sourcegraph with the provided credential. After start, the agent will authenticate and establish a secure connection with Sourcegraph tunnel server. Sourcegraph Connect consists of three major components: Tunnel agent: deployed inside the customer network, which uses its own identity and encrypts traffic between the customer code host and client. Agent can only communicate with permitted customer code hosts inside the customer network. Only agents are allowed to establish secure connections with tunnel server, the server can only accept connections if agent identity is approved. Tunnel server: a centralized broker between client and agent managed by Sourcegraph. Its purpose is to set up mTLS, proxy encrypted traffic between clients and agents and enforce ACL. Tunnel client: forward proxy clients managed by sourcegraph. Every client has its own identity and it cannot establish a direct connection with the customer agent, and has to go through tunnel server. [link](https://link.excalidraw.com/readonly/453uvY8infI8wskSecGJ)