Skip to content

Commit 7853aa7

Browse files
authored
Merge branch 'main' into audrey/pushed-only-changesets
2 parents 7c8e8ea + 3d2c54b commit 7853aa7

File tree

30 files changed

+2584
-10201
lines changed

30 files changed

+2584
-10201
lines changed

docs/admin/config/batch_changes.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,42 @@ batchSpecLibrary(first: 100) {
370370
}
371371
}
372372
```
373+
374+
### Featured Templates
375+
376+
<Callout type="note">Featured templates are supported in Sourcegraph v6.4 and more.</Callout>
377+
378+
Site-admins can mark a template as featured by either clicking the star button next to the list of library records. Featured records will automatically move to a section atop the remaining library records.
379+
380+
### Labels
381+
382+
<Callout type="note">Labels are supported in Sourcegraph v6.4 and more.</Callout>
383+
384+
Batch Spec Library records support an optional `labels` field for categorization and filtering. Common labels include:
385+
386+
- `"featured"` - Marks popular or recommended batch specs that are displayed in a "Featured Templates" section above the remaining examples
387+
- Custom labels for organizational categorization (not exposed to Batch Changes users yet)
388+
389+
To remove the featured status, you can update the library record with an empty list of labels (`[]`).
390+
391+
```graphql
392+
createBatchSpecLibraryRecord(name: "example", spec: "version: 2\nname: example", labels: ["featured"]) {
393+
id
394+
labels
395+
}
396+
397+
updateBatchSpecLibraryRecord(id: "QmF0Y2hTcGVjTGlicmFyeVJlY29yZDo4", name: "example-2", spec: "version: 2\nname: example-2", labels: ["featured"]) {
398+
id
399+
labels
400+
}
401+
402+
# Query only featured batch specs
403+
batchSpecLibrary(first: 100, labels: ["featured"]) {
404+
nodes {
405+
id
406+
name
407+
labels
408+
spec
409+
}
410+
}
411+
```

docs/admin/updates/docker_compose.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ For upgrade procedures or general info about sourcegraph versioning see the link
1111
>
1212
> ***If the notes indicate a patch release exists, target the highest one.***
1313
14+
## v6.3 patch 1
15+
16+
- Grafana's port 3370 is no longer open by default for unauthenticated access for Docker Compose and Pure Docker deployments. Admins can still access Grafana by logging in to their Sourcegraph instance, navigating to the Site Admin page, then clicking Monitoring from the left navigation menu. If customers require port 3370 to be open, see [[PR 1204](https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/1204/files)] for insight on how to add this port to their `docker-compose.override.yaml` file.
17+
1418
## v6.2.2553
1519

1620
### Known issues

docs/analytics/cloud.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,16 @@ export GRANULARITY="<GRANULARITY>"
153153
curl -X GET "https://analytics.sourcegraph.com/api/reports/by-user-client-date?instanceURL=$INSTANCE_URL&granularity=$GRANULARITY" \
154154
-H "Authorization: Bearer $ACCESS_TOKEN"
155155
```
156+
157+
Optional `startDate` and `endDate` values (formatted as `YYYY-MM-DD`) can be specified. Both parameters are optional. If neither is specified, the default is all time. If only one is specified, then only the start or end date filter will be applied.
158+
159+
Example:
160+
161+
```sh
162+
export INSTANCE_URL="<INSTANCE_URL>" # e.g. example.sourcegraphcloud.com
163+
export START_DATE="2025-01-01"
164+
export END_DATE="2025-12-31"
165+
166+
curl -X GET "https://analytics.sourcegraph.com/api/reports/by-user-client-date?instanceURL=$INSTANCE_URL&startDate=$START_DATE&endDate=$END_DATE" \
167+
-H "Authorization: Bearer $ACCESS_TOKEN"
168+
```

docs/analytics/index.mdx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,20 @@ Many of the metrics above are also available for Cody only. However, some user d
7575
| Daily code navigation activity | Count of code navigation operations performed each day |
7676
| Daily code navigation users | Number of unique users utilizing code navigation features each day |
7777
| Precise vs. search-based code navigation actions by language | Comparison of precise vs. search-based navigation success rates broken down by programming language |
78+
| Batch changes usage funnel | Number of times various Batch Changes actions were taken each day: Batch Changes opened, specs created, specs executed, changesets published, and changes merged (from the Sourcegraph UI) |
7879

7980
### Autocompletion metrics
8081

8182
| **Metric** | **Description** |
8283
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83-
| Total accepted completions | Count of completions accepted by users during the selected time |
84-
| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion |
85-
| Completions by day | The number of completions suggested by day and by editor. |
86-
| Completion acceptance rate (CAR) | The percent of completions presented to a user for at least 750ms accepted by day, the editor, day, and month. |
87-
| Weighted completion acceptance rate (wCAR) | Similar to CAR, but weighted by the number of characters presented in the completion, by the editor, day, and month. This assigns more "weight" to accepted completions that provide more code to the user. |
88-
| Completion persistence rate | Percent of completions that are retained or mostly retained (67%+ of inserted text) after various time intervals. |
89-
| Average completion latency (ms) | The average milliseconds of latency before a user is presented with a completion suggestion by an editor. |
90-
| Acceptance rate by language | CAR and total completion suggestions broken down by editor during the selected time |
84+
| Total accepted completions & auto-edits | Count of completions and auto-edits accepted by users during the selected time |
85+
| Hours saved | The number of hours saved by Cody users, assuming 2 minutes saved per completion and auto-edit |
86+
| Completions and auto-edits by day | The number of completions and auto-edits suggested by day and by editor. |
87+
| Completion and auto-edit acceptance rate (CAR) | The percent of completions and auto-edits presented to a user for at least 750ms accepted by day, the editor, day, and month. |
88+
| Weighted completion and auto-edit acceptance rate (wCAR) | Similar to CAR, but weighted by the number of characters presented in the completion and auto-edit, by the editor, day, and month. This assigns more "weight" to accepted completions that provide more code to the user. |
89+
| Completion persistence rate | Percent of completions that are retained or mostly retained (67%+ of inserted text) after various time intervals. Auto-edits are not included. |
90+
| Average completion and auto-edit latency (ms) | The average milliseconds of latency before a user is presented with a completion or auto-edit suggestion by an editor. |
91+
| Acceptance rate by language | CAR and total completion suggestions broken down by editor during the selected time. Auto-edits not included |
9192

9293
### Chat and prompt metrics
9394

@@ -126,6 +127,8 @@ When exporting, you can group the data by:
126127
- User and day
127128
- User, day, client, and language
128129

130+
And you can select the timeframe for the export using the `startDate` and `endDate` parameters (with `YYYY-MM-DD` values).
131+
129132
Each row in the CSV represents a user's activity for a specific combination of these groupings (e.g., a particular day, month, client, and/or language). The CSV includes metrics such as searches, code navigation actions, chat conversations, code completions, and more.
130133

131134
#### Important Notes
@@ -155,3 +158,8 @@ Each row in the CSV represents a user's activity for a specific combination of t
155158
| Total Characters Written by Cody | Inserted code that Cody generates via chat, prompt responses, accepted autocompletions, or suggestions/fixes. Used as the numerator in the "Percentage of Code Written by Cody" ratio. |
156159
| Total Characters Written | Total new code inserted into the editor (includes both user-generated and Cody-generated characters). Used as the denominator in the "Percentage of Code Written by Cody" ratio. |
157160
| Percentage of Code Written by Cody | Measures Cody's impact: (Total Characters Written by Cody ÷ Total Characters Written) × 100. [Learn more about this metric.](/analytics/pcw) |
161+
| Auto-edit suggested events | Number of Cody auto-edit suggestions offered. |
162+
| Auto-edit accepted events | Number of Cody auto-edit suggestions accepted by the user. |
163+
| Auto-edit acceptance rate | Ratio of accepted to suggested auto-edits, combined across editors. |
164+
| Lines changed by chats and commands | Number of lines of code (LOC) changed by chat and command events. |
165+
| Lines changed by completions and auto-edits | Number of lines of code (LOC) changed by completion and auto-edit events. |

docs/batch-changes/bulk-operations-on-changesets.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ Below is a list of supported bulk operations for changesets and the conditions w
3333
| **Commenting** | Post a comment on all selected changesets. Useful for pinging people, reminding them to take a look at the changeset, or posting your favorite emoji |
3434
| **Detach** | Detach a selection of changesets from the batch change to remove them from the archived tab |
3535
| **Re-enqueue** | Re-enqueues the pending changes for all selected changesets that failed |
36-
| **Merge (experimental)** | Merge the selected changesets on code hosts. Some changesets may be unmergeable due to their states, which does not impact the overall bulk operation. Failed merges are listed under the bulk operations tab. In the confirmation modal, you can opt for a squash merge strategy, available on GitHub, GitLab, and Bitbucket Cloud. For Bitbucket Server/Data Center, only regular merges are performed |
36+
| **Merge** | Merge the selected changesets on code hosts. Some changesets may be unmergeable due to their states, which does not impact the overall bulk operation. Failed merges are listed under the bulk operations tab. In the confirmation modal, you can opt for a squash merge strategy, available on GitHub, GitLab, and Bitbucket Cloud. For Bitbucket Server/Data Center, only regular merges are performed |
3737
| **Close** | Close the selected changesets on the code hosts |
3838
| **Publish** | Publishes the selected changesets, provided they don't have a [`published` field](/batch-changes/batch-spec-yaml-reference#changesettemplatepublished) in the batch spec. You can choose between draft and normal changesets in the confirmation modal |
3939
| **Push-only** | Pushes code changes to a new branch on a code host without making a merge request. Available on GitHub and GitLab only. |
4040
| **Export** | Export selected changesets that you can use for later use |
4141
| **Re-execute** | Users can re-execute individual changeset creation logic for selected workspaces. This allows for creating new changesets for users who are using non-deterministic run steps (for example,LLMs) |
42+
| **Enable auto-merge for GitHub (experimental)** | Enable auto-merge on selected GitHub changesets. When enabled, changesets will be automatically merged once all required status checks pass and any blocking reviews are resolved. This feature is GitHub-specific and requires [appropriate setup](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository) on the target repositories. Failed actions are listed under the bulk operations tab. |
4243

4344
## Monitoring bulk operations
4445

docs/cli/references/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Most commands require that the user first [authenticate](quickstart#connect-to-s
1515
* [`login`](references/login)
1616
* [`lsif`](references/lsif)
1717
* [`orgs`](references/orgs)
18+
* [`prompts`](references/prompts)
1819
* [`repos`](references/repos)
1920
* [`scout`](references/scout)
2021
* [`search`](references/search)

docs/cli/references/prompts.mdx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# src prompts
2+
3+
<p className="subtitle">`src prompts` is a tool that manages prompt library prompts and tags in a Sourcegraph instance.</p>
4+
5+
## Usage
6+
7+
```
8+
'src prompts' is a tool that manages prompt library prompts and tags in a Sourcegraph instance.
9+
10+
Usage:
11+
12+
src prompts command [command options]
13+
14+
The commands are:
15+
16+
list lists prompts
17+
get get a prompt by ID
18+
create create a prompt
19+
update update a prompt
20+
delete delete a prompt
21+
export export prompts to a JSON file
22+
import import prompts from a JSON file
23+
tags manage prompt tags (use "src prompts tags [command] -h" for more info)
24+
25+
Use "src prompts [command] -h" for more information about a command.
26+
```
27+
28+
## Sub-commands
29+
30+
* [list](prompts/list)
31+
* [get](prompts/get)
32+
* [create](prompts/create)
33+
* [update](prompts/update)
34+
* [delete](prompts/delete)
35+
* [export](prompts/export)
36+
* [import](prompts/import)
37+
* [tags](prompts/tags)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# src prompts create
2+
3+
Create a new prompt in your Sourcegraph instance.
4+
5+
## Usage
6+
7+
```bash
8+
src prompts create [flags]
9+
```
10+
11+
## Examples
12+
13+
```bash
14+
# Create a basic prompt (uses current user as owner)
15+
src prompts create \
16+
-name="go-error-handling" \
17+
-description="Best practices for Go error handling" \
18+
-content="Write a Go function that properly handles errors..."
19+
20+
# Create a prompt with tags
21+
src prompts create \
22+
-name="python-optimization" \
23+
-description="Python performance optimization tips" \
24+
-content="Optimize this Python code for better performance..." \
25+
-tags="UHJvbXB0VGFnOjE=,UHJvbXB0VGFnOjI="
26+
27+
# Create a draft prompt
28+
src prompts create \
29+
-name="draft-prompt" \
30+
-description="Work in progress prompt" \
31+
-content="This prompt is still being developed..." \
32+
-draft
33+
34+
# Create a recommended prompt with auto-submit
35+
src prompts create \
36+
-name="recommended-prompt" \
37+
-description="A recommended prompt for common use" \
38+
-content="This is a recommended prompt..." \
39+
-recommended \
40+
-auto-submit
41+
42+
# Create a secret prompt for INSERT mode
43+
src prompts create \
44+
-name="secret-insert-prompt" \
45+
-description="Secret prompt for code insertion" \
46+
-content="Insert code here..." \
47+
-visibility="SECRET" \
48+
-mode="INSERT"
49+
50+
# Create a prompt with explicit owner (optional)
51+
src prompts create \
52+
-name="team-shared-prompt" \
53+
-description="A prompt shared with a specific owner" \
54+
-content="This prompt has an explicit owner..." \
55+
-owner="VXNlcjox"
56+
```
57+
58+
## Flags
59+
60+
| Flag | Description |
61+
|------|-------------|
62+
| `-name` | The prompt name (required) |
63+
| `-description` | Description of the prompt (required) |
64+
| `-content` | The prompt template text content (required) |
65+
| `-owner` | The ID of the owner (user or organization) (optional, defaults to current user) |
66+
| `-tags` | Comma-separated list of tag IDs |
67+
| `-draft` | Whether the prompt is a draft (default: false) |
68+
| `-visibility` | Visibility of the prompt: PUBLIC or SECRET (default: "PUBLIC") |
69+
| `-auto-submit` | Whether the prompt should be automatically executed in one click (default: false) |
70+
| `-mode` | Mode to execute prompt: CHAT, EDIT, or INSERT (default: "CHAT") |
71+
| `-recommended` | Whether the prompt is recommended (default: false) |
72+
73+
### API flags
74+
75+
| Flag | Description |
76+
|------|-------------|
77+
| `-dump-requests` | Log GraphQL requests and responses to stdout |
78+
| `-get-curl` | Print the curl command for executing this query and exit (WARNING: includes printing your access token!) |
79+
| `-insecure-skip-verify` | Skip validation of TLS certificates against trusted chains |
80+
| `-trace` | Log the trace ID for requests. See https://docs.sourcegraph.com/admin/observability/tracing |
81+
| `-user-agent-telemetry` | Include the operating system and architecture in the User-Agent sent with requests to Sourcegraph (default: true) |

0 commit comments

Comments
 (0)