From 63c0ed9c7ccb5c3ea3a9eb7face9838d1baa3c65 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 29 Apr 2025 12:10:18 -0700 Subject: [PATCH 1/5] Docs working branch for Sourcegraph 6.3 release --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83b3636b4..20ca1a558 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Sourcegraph Docs - + Welcome to the Sourcegraph documentation! We're excited to have you contribute to our docs. We've recently rearchitectured our docs tech stack — powered by Next.js, TailwindCSS and deployed on Vercel. This guide will walk you through the process of contributing to our documentation using the new tech stack. From a2ac5b67e50f89872dacd5c372e8b4c53b07bc60 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 29 Apr 2025 12:25:53 -0700 Subject: [PATCH 2/5] Configure initial setup --- docs.config.js | 2 +- docs/legacy.mdx | 1 + src/data/versions.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs.config.js b/docs.config.js index c6260bc43..a8b074cdf 100644 --- a/docs.config.js +++ b/docs.config.js @@ -1,5 +1,5 @@ const config = { - DOCS_LATEST_VERSION: '6.2' + DOCS_LATEST_VERSION: '6.3' }; module.exports = config; diff --git a/docs/legacy.mdx b/docs/legacy.mdx index 5f23bc984..0bbfeaea8 100644 --- a/docs/legacy.mdx +++ b/docs/legacy.mdx @@ -4,6 +4,7 @@ + - [6.2](https://6.2.sourcegraph.com) - [6.1](https://6.1.sourcegraph.com) - [6.0](https://6.0.sourcegraph.com) diff --git a/src/data/versions.ts b/src/data/versions.ts index f82f0b21d..ce85e869e 100644 --- a/src/data/versions.ts +++ b/src/data/versions.ts @@ -15,8 +15,8 @@ export const versions: VersionI[] = [ url: '/docs', }, { - name: 'v6.1', - url: 'https://6.1.sourcegraph.com/' + name: 'v6.2', + url: 'https://6.2.sourcegraph.com/' }, ]; From ee0e50e478201ef2dcfc2ca57d541d4fe87f8bf6 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 29 Apr 2025 19:47:07 -0700 Subject: [PATCH 3/5] Faster Smart Apply updates (#1107) - https://linear.app/sourcegraph/issue/PROD-555/faster-smart-apply-ga-gtm-enablement --- docs/cody/capabilities/chat.mdx | 6 +++ docs/cody/capabilities/supported-models.mdx | 47 ++++++++++++--------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/docs/cody/capabilities/chat.mdx b/docs/cody/capabilities/chat.mdx index 05a37054d..e3be0ca47 100644 --- a/docs/cody/capabilities/chat.mdx +++ b/docs/cody/capabilities/chat.mdx @@ -74,6 +74,12 @@ Smart Apply also supports the executing of commands in the terminal. When you as ![smart-apply](https://storage.googleapis.com/sourcegraph-assets/Docs/smart-apply-2025.png) +### Model used for Smart Apply + +To ensure low latency, Cody uses a more targeted Qwen 2.5 Coder model for Smart Apply. This model improves the responsiveness of the Smart Apply feature in both VS Code and JetBrains while preserving edit quality. Users on Cody Free, Pro, Enterprise Starter, and Enterprise plans get this default Qwen 2.5 Coder model for Smart Apply suggestions. + +Enterprise users not using Cody Gateway get a Claude Sonnet-based model for Smart Apply. + ## 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. diff --git a/docs/cody/capabilities/supported-models.mdx b/docs/cody/capabilities/supported-models.mdx index b6a518544..4b34f3a77 100644 --- a/docs/cody/capabilities/supported-models.mdx +++ b/docs/cody/capabilities/supported-models.mdx @@ -6,20 +6,20 @@ Cody supports a variety of cutting-edge large language models for use in chat an 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) | ✅ | ✅ | ✅ | | | | | +| **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. @@ -39,13 +39,20 @@ In addition, Sourcegraph Enterprise customers using GCP Vertex (Google Cloud Pla 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) | - | - | ✅ | | | | | -| | | | | | | | | | +| **Provider** | **Model** | **Free** | **Pro** | **Enterprise** | | | | | +| :----------- | :---------------------------------------------------------------------------------------- | :------- | :------ | :------------- | --- | --- | --- | --- | +| Fireworks.ai | [DeepSeek-Coder-V2](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct) | ✅ | ✅ | ✅ | | | | | +| 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). + +## Smart Apply + +| **Provider** | **Model** | **Free** | **Pro** | **Enterprise** | | | | | | | +| :----------- | :------------- | :------- | :------ | :------------- | --- | --- | --- | --- | --- | --- | +| Fireworks.ai | Qwen 2.5 Coder | ✅ | ✅ | ✅ | | | | | | | + +Enterprise users not using Cody Gateway get a Claude Sonnet-based model for Smart Apply. From 6c322fb143732b288e24314ead0262979c33e32d Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Tue, 29 Apr 2025 19:47:48 -0700 Subject: [PATCH 4/5] Default Search Context for Admins (#1108) - https://linear.app/sourcegraph/issue/SRCH-1874/gtm-pm-creating-gtm-materials-definition-of-done-for-search-contexts --- docs/code-search/working/search_contexts.mdx | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/code-search/working/search_contexts.mdx b/docs/code-search/working/search_contexts.mdx index a0dbbe2d0..501800d39 100644 --- a/docs/code-search/working/search_contexts.mdx +++ b/docs/code-search/working/search_contexts.mdx @@ -37,7 +37,9 @@ You can also search across multiple contexts at once using the `OR` [boolean ope 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 +### Default search context + +#### For users 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. @@ -45,6 +47,25 @@ If a user ever loses access to their default search context (eg. the search cont 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. +#### For site admins + +Site admins can set a default search context for all users on the Sourcegraph instance. This helps teams improve onboarding and search quality by focusing searches on the most relevant parts of the codebase rather than the entire indexed set of repositories. + +An admin can set a default search context via: + +- Click the **More** button from the top menu of the Sourcegraph web app +- Next, go to **Search Contexts** +- For the existing context list, click on the **...** menu and select **[Site admin only] Set as default for all users** +- Alternatively, you can create a new context and then set it for all users via the same option + +![admin-level-default-context](https://storage.googleapis.com/sourcegraph-assets/Docs/admin-default-context.png) + +Here are a few considerations: + +- If a user already has a personal default search context set, it will not be overridden +- The admin-set default will apply automatically if a user only uses the global context +- Individual users can see the instance-wide default and override it with their own default if they choose + ### 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. From 4d6981dd0d73c771ab8170f74bad88783d2de5ce Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Wed, 30 Apr 2025 17:16:25 -0700 Subject: [PATCH 5/5] Add file and directory filtering on compare page (#1112) - https://linear.app/sourcegraph/issue/PROD-572/compare-page-file-filtering-ui-ga-gtm-enablement --------- Co-authored-by: Peter Guy --- docs/code-search/compare-file-filtering.mdx | 118 ++++++++++++++++++++ docs/code-search/features.mdx | 9 ++ 2 files changed, 127 insertions(+) create mode 100644 docs/code-search/compare-file-filtering.mdx diff --git a/docs/code-search/compare-file-filtering.mdx b/docs/code-search/compare-file-filtering.mdx new file mode 100644 index 000000000..b2bd3776f --- /dev/null +++ b/docs/code-search/compare-file-filtering.mdx @@ -0,0 +1,118 @@ +# File Filtering in the Repository Comparison Page + +The repository comparison page provides powerful file filtering capabilities that allow you to focus on specific files in a comparison. The system supports multiple ways to specify which files you want to view when comparing branches, tags, or commits. + +## Query parameter-based file filtering + +The comparison page supports three different query parameters to specify which files to include in the comparison: + +### 1. Individual file paths + +You can specify individual files using either of these parameters: + +- `filePath=path/to/file.js` - Primary parameter for specifying files +- `f=path/to/file.js` - Shorthand alternative + +Multiple files can be included by repeating the parameter: + +```shell +?filePath=src/index.ts&filePath=src/components/Button.tsx +``` + +### 2. Compressed file lists + +For comparisons with a large number of files, the system supports compressed file lists (newline-separated): + +- `compressedFileList=base64EncodedCompressedData` - Efficiently packs many file paths + +This parameter efficiently transmits large file paths using base64-encoded, gzip-compressed data. The compression allows hundreds or thousands of files to be included in a URL without exceeding length limits, which vary depending on the browser, HTTP server, and other services involved, like Cloudflare. + +```typescript +// Behind the scenes, the code decompresses file lists using: +const decodedData = atoburl(compressedFileList) +const compressedData = Uint8Array.from([...decodedData].map(char => char.charCodeAt(0))) +const decompressedData = pako.inflate(compressedData, { to: 'string' }) +``` + +One way to create a list of files for the `compressedFileList` parameter is to use Python's built-in libraries to compress and encode using url-safe base64 encoding (smaller than base64-encoding, then url-encoding). + +```shell +python3 -c "import sys, zlib, base64; sys.stdout.write(base64.urlsafe_b64encode(zlib.compress(sys.stdin.buffer.read())).decode().rstrip('='))" < list.of.files > list.of.files.deflated.b64url +``` + +### 3. Special focus mode + +You can focus on a single file using: + +- `focus=true&filePath=path/to/specific/file.js` - Show only this file in detail view + +## File filtering UI components + +The comparison view provides several UI components to help you filter and navigate files: + +### FileDiffPicker + +The FileDiffPicker component allows you to: + +- Search for files by name or path +- Filter files by type/extension +- Toggle between showing all files or only modified files +- Sort files by different criteria (path, size of change, etc.) + +This component uses a dedicated file metadata query optimized for quick filtering. Results are displayed as you type. Through client-side filtering, the component can efficiently handle repositories with thousands of files. + +### File navigation + +When viewing diffs, you can: + +- Click on any file in the sidebar to switch to that file +- Use keyboard shortcuts to navigate between files +- Toggle between expanded and collapsed views of files +- Show or hide specific changes (additions, deletions, etc.) + +### URL-based filtering + +Any filters you apply through the UI will update the URL with the appropriate query parameters. This means you can: + +1. Share specific filtered views with others +2. Bookmark comparisons with specific file filters +3. Navigate back and forth between different filter states using browser history + +## Implementation details + +The system makes strategic performance trade-offs to provide a smooth user experience: + +```typescript +/* + * For customers with extremely large PRs with thousands of files, + * we fetch all file paths in a single API call to enable client-side filtering. + * + * This eliminates numerous smaller API calls for server-side filtering + * when users search in the FileDiffPicker. While requiring one large + * initial API call, it significantly improves subsequent search performance. + */ +``` + +The file filtering system uses a specialized file metadata query that is faster and lighter than the comprehensive file diffs query used to display actual code changes. + +## Usage examples + +1. View only JavaScript files: + +```bash + ?filePath=src/utils.js&filePath=src/components/App.js +``` + +2. Focus on a single file: + +```bash + ?focus=true&filePath=src/components/Button.tsx + ``` + +3. Use a compressed file list for many files: + +```bash + ?compressedFileList=H4sIAAAAAAAAA2NgYGBg... +``` + +This flexible filtering system allows you to create customized views of repository comparisons, making reviewing changes in large projects easier. diff --git a/docs/code-search/features.mdx b/docs/code-search/features.mdx index 345d284b6..0c8ac9a7d 100644 --- a/docs/code-search/features.mdx +++ b/docs/code-search/features.mdx @@ -120,6 +120,15 @@ Here is an example of search results with personalized search ranking enabled: As you can see, the results are now ranked based on their relevance to the query, and the results from repositories you've recently contributed to are boosted. +## Compare changes across revisions + +When you run a search, you can compare the results from two different revisions of the codebase. From your search query results page, click the three-dot **...** icon next to the **Contributors** tab. Then select the **Compare** option. + +From here, you can execute file and directory filtering and compare large diffs, making it easier to navigate and manage. + +This file picker is useful when comparing branches with thousands of changed files and allows you to select specific files or directories to focus on. You can [filter files directly](/code-search/compare-file-filtering) by constructing a URL with multiple file paths or use a compressed file list for even larger selections. + +![file-and-directory-filtering](https://storage.googleapis.com/sourcegraph-assets/Docs/filter-by-file-dir-on-compare.png) ## Other search tips