Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating sourcegraph.com Search Links #847

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/admin/audit_log.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ If you are interested to use this feature or to stream to a different destinatio

## Developing

The single entry point to the audit logging API is made via the [`audit.Log`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/audit/audit.go?L19) function. This internal function can be used from any place in the app, and nothing else needs to be done for the logged entry to appear in the audit log.
The single entry point to the audit logging API is made via the [`audit.Log`](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/audit/audit.go?L19) function. This internal function can be used from any place in the app, and nothing else needs to be done for the logged entry to appear in the audit log.

Example call:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/config/advanced_config_file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Where `extsvc.json` contains a JSON object that specifies _all_ of your code hos
}
```

You can find a full list of [valid top-level keys here](https://sourcegraph.com/github.com/sourcegraph/sourcegraph-public-snapshot@b7ebb9024e3a95109fdedfb8057795b9a7c638bc/-/blob/cmd/frontend/graphqlbackend/schema.graphql#L1104-1110).
You can find a full list of [valid top-level keys here](TODO/UPDATE SOURCEGRAPH SEARCH LINK-public-snapshot@b7ebb9024e3a95109fdedfb8057795b9a7c638bc/-/blob/cmd/frontend/graphqlbackend/schema.graphql#L1104-1110).

If you want to _allow_ edits to be made through the web UI (which will be overwritten with what is in the file on a subsequent restart), you may additionally set `EXTSVC_CONFIG_ALLOW_EDITS=true`. **Note** that if you do enable this, it is your responsibility to ensure the configuration on your instance and in the file remain in sync.

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/enterprise_getting_started_guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you're deploying a new Enterprise instance, this page covers our most frequen
- [GitHub integration](/integration/github)
- [All code host integrations (not GitLab or GitHub)](/integration/#integrations)
- [Full guide to site config options](/admin/config/site_config#auth-sessionExpiry)
- [Changelog](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/CHANGELOG) to track releases and updates
- [Changelog](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/CHANGELOG) to track releases and updates

### Docker-compose
- [Basic installation guide](/admin/deploy/docker-compose/)
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/executors/deploy_executors_binary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ If you use the systemd service, simply run `systemctl start executor`, otherwise
## Upgrading executors

Upgrading executors is relatively uninvolved. Simply follow the instructions below.
Also, check the [changelog](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/CHANGELOG) for any Executors related breaking changes or new features that you might want to configure.
Also, check the [changelog](TODO/UPDATE SOURCEGRAPH SEARCH LINK@main/-/blob/CHANGELOG) for any Executors related breaking changes or new features that you might want to configure.

### **Step 1:** First, grab the executor binary for the new target Sourcegraph version.

Expand Down
4 changes: 2 additions & 2 deletions docs/admin/executors/deploy_executors_binary_offline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ To install the Firecracker sandbox image, import the image using `docker`.
$ docker pull <docker repository image for sourcegraph/ignite:v0.10.5>
```

> Note: Check the [version](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/internal/config/consts.go?L15) against the version of executors being installed.
> Note: Check the [version](TODO/UPDATE SOURCEGRAPH SEARCH LINK@main/-/blob/cmd/executor/internal/config/consts.go?L15) against the version of executors being installed.

If you are using a custom image instead of the Sourcegraph image, you will need to set the environment variable
`EXECUTOR_FIRECRACKER_SANDBOX_IMAGE` to match the image name.
Expand All @@ -181,7 +181,7 @@ To install the Firecracker Kernel image, import the image (`sourcegraph/ignite-k
$ ignite kernel import --runtime docker <docker repository image for sourcegraph/ignite-kernel:5.10.135-amd64>
```

> Note: Check the [version](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/internal/config/consts.go?L18) against the version of executors being installed.
> Note: Check the [version](TODO/UPDATE SOURCEGRAPH SEARCH LINK@main/-/blob/cmd/executor/internal/config/consts.go?L18) against the version of executors being installed.

If you are using a custom image instead of the Sourcegraph image, you will need to set the environment variable
`EXECUTOR_FIRECRACKER_KERNEL_IMAGE` to match the image name.
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/executors/deploy_executors_kubernetes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Executors interact with the Kubernetes API to manage the lifecycle of individual
| `batch` | `jobs` | `create`, `delete` | Executors create Job pods to run processes. Once Jobs are completed, they are cleaned up. |
| | `pods`, `pods/log` | `get`, `list`, `watch` | Executors need to look up and steam logs from the Job Pods. |

See the [example Role YAML](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/kubernetes/batches/executor-batches.Role.yml) for more details on the exact RBAC requirements for native Kubernetes Executors.
See the [example Role YAML](TODO/UPDATE SOURCEGRAPH SEARCH LINK@main/-/blob/cmd/executor/kubernetes/batches/executor-batches.Role.yml) for more details on the exact RBAC requirements for native Kubernetes Executors.

## Deployment

Expand Down Expand Up @@ -94,5 +94,5 @@ The Executor Docker image is available on Docker Hub at [`sourcegraph/executor-k
### Example Configuration YAML

See
the [local development YAMLs](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/kubernetes)
the [local development YAMLs](TODO/UPDATE SOURCEGRAPH SEARCH LINK@main/-/blob/cmd/executor/kubernetes)
for an example of how to configure the Executor in Kubernetes.
2 changes: 1 addition & 1 deletion docs/admin/executors/firecracker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Executor can be fined tuned with the following environment variables,

## Known caveats

We [configure iptables](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/cmd/executor/internal/run/install.go?L229-255) to prevent Firecracker-isolated processes from talking on [Private IPv4 Addresses](https://en.wikipedia.org/wiki/Private_network#Private_IPv4_addresses) (providing network-level isolation). They can talk to DNS and Sourcegraph only, which prevents users from talking to a 10.x.x.x, 172.x.x.x, or 192.168.x.x range IP.
We [configure iptables](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/cmd/executor/internal/run/install.go?L229-255) to prevent Firecracker-isolated processes from talking on [Private IPv4 Addresses](https://en.wikipedia.org/wiki/Private_network#Private_IPv4_addresses) (providing network-level isolation). They can talk to DNS and Sourcegraph only, which prevents users from talking to a 10.x.x.x, 172.x.x.x, or 192.168.x.x range IP.
2 changes: 1 addition & 1 deletion docs/admin/how-to/dirty_database_pre_3_37.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ _Note: for codeintel the schema version table is called `codeintel_schema_migrat

### 2. Run the sql queries to finish incomplete migrations

Sourcegraph's migration files take for form of `sql` files following the snake case naming schema `<version>_<description>.<up or down>.sql` and can be found [here](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/tree/migrations) in subdirectories for the specific database. _Note frontend is the pgsql database_.
Sourcegraph's migration files take for form of `sql` files following the snake case naming schema `<version>_<description>.<up or down>.sql` and can be found [here](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/tree/migrations) in subdirectories for the specific database. _Note frontend is the pgsql database_.

1. **Find the up migration starting with the migration's version number identified in [step 1](#1-identify-incomplete-migration):** [https://github.com/sourcegraph/sourcegraph/tree/\<YOUR-SOURCEGRAPH-VERSION\>/migrations](https://github.com/sourcegraph/sourcegraph/tree/main/migrations), making sure to go to \<YOUR-SOURCEGRAPH-VERSION\>

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/how-to/monorepo-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following bullets provide a general guidline to which service may require mo

If you are regularly seeing the `Processing symbols is taking longer than expected. Try again in a while` warning in your sidebar, its likely that your symbols and/or gitserver services are underprovisioned and need more CPU/mem resources.

The [symbols sidebar](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/client/web/src/repo/RepoRevisionSidebarSymbols.tsx?L42) is dependent on the symbols and gitserver services. Upon opening the symbols sidebar, a search query is made to the GraphQL API to retrieve the symbols associated with the current git commit. You can read more about the [symbol search behavior and performance](/code-search/types/symbol#symbol-search-behavior-and-performance).
The [symbols sidebar](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/client/web/src/repo/RepoRevisionSidebarSymbols.tsx?L42) is dependent on the symbols and gitserver services. Upon opening the symbols sidebar, a search query is made to the GraphQL API to retrieve the symbols associated with the current git commit. You can read more about the [symbol search behavior and performance](/code-search/types/symbol#symbol-search-behavior-and-performance).

To address this concern, allocate more resources to the symbols service (to provide more processing power for indexing operations) and allocate more resources to the gitserver (to provide for the extra load associated with responding to fetch requests from symbols, and speed up sending the large repo).

Expand Down
4 changes: 2 additions & 2 deletions docs/admin/how-to/redis_configmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Reference Materials



1. Locate the original redis-cache configuration file: [https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/docker-images/redis-cache/redis.conf](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/docker-images/redis-cache/redis.conf) Use this as the “Default redis.conf file” content in the ConfigMap. Adding `requirepass` sets the password for Redis authentication.
1. Locate the original redis-cache configuration file: [TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/docker-images/redis-cache/redis.conf](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/docker-images/redis-cache/redis.conf) Use this as the “Default redis.conf file” content in the ConfigMap. Adding `requirepass` sets the password for Redis authentication.
2. Create the redis-cache-conf ConfigMap:

```
Expand Down Expand Up @@ -110,7 +110,7 @@ spec:
```


4. Locate the original redis-store configuration file. [https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/docker-images/redis-store/redis.conf](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/docker-images/redis-store/redis.conf) Use this as the “Default redis.conf file” content in the ConfigMap.
4. Locate the original redis-store configuration file. [TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/docker-images/redis-store/redis.conf](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/docker-images/redis-store/redis.conf) Use this as the “Default redis.conf file” content in the ConfigMap.

5. Create the redis-store-conf ConfigMap:

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/observability/opentelemetry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ If you're looking for information about Sourcegraph's bundled Jaeger instance, h

Refer to the [Jaeger](https://opentelemetry.io/docs/languages/js/exporters/#jaeger) documentation for options.

If you must use your own Jaeger instance, and if the bundled otel-collector's basic configuration with the Jaeger OTel exporter enabled meets your needs, configure the otel-collector's startup command to `/bin/otelcol-sourcegraph --config=/etc/otel-collector/configs/jaeger.yaml`. Note that this requires the environment variable `$JAEGER_HOST` to be set on the otel-collector service / container:
If you use your own Jaeger instance, and if the bundled otel-collector's basic configuration with the Jaeger OTel exporter enabled meets your needs, configure the otel-collector's startup command to `/bin/otelcol-sourcegraph --config=/etc/otel-collector/configs/jaeger.yaml`. Note that this requires the environment variable `$JAEGER_HOST` to be set on the otel-collector service / container:

```yaml
# otel-collector config.yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/pings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ The Cody app connects to Sourcegraph.com to send a limited selection of the ping

It may happen that Sourcegraph will stop sending critical telemetry to Sourcegraph.com, if this happens it may indicate a problem with Sourcegraphs frontend database, or a site settings misconfiguration. Below are some debugging steps.

Sourcegraph telemetry pings are handled by a goroutine running on Sourcegraphs frontend service called [`updatecheck`](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/cmd/frontend/internal/app/updatecheck/client.go?subtree=true), `updatecheck` is [started](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Ecmd/frontend/internal/cli/serve_cmd%5C.go+updatecheck.Start%28db%29&patternType=literal) on container startup and periodically requests a variety of queries be run in the `pgsql` database.
Sourcegraph telemetry pings are handled by a goroutine running on Sourcegraphs frontend service called [`updatecheck`](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/cmd/frontend/internal/app/updatecheck/client.go?subtree=true), `updatecheck` is [started](https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:%5Ecmd/frontend/internal/cli/serve_cmd%5C.go+updatecheck.Start%28db%29&patternType=literal) on container startup and periodically requests a variety of queries be run in the `pgsql` database.


### Misconfigured update.channel
The most common scenario in which Sourcegraph stops sending pings is a change to the `update.channel` setting in an instance's [site config](https://sourcegraph.com/docs/admin/config/site_config)
```
"update.channel": "release",
```
*This setting [must be set to "release"](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/updatecheck/client.go?L803-806) in order for the telemetry goroutine to run.*
*This setting [must be set to "release"](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/updatecheck/client.go?L803-806) in order for the telemetry goroutine to run.*


### Check if the goroutine is running
Expand Down
8 changes: 4 additions & 4 deletions docs/admin/repo/perforce.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To enable Perforce code host connections, a site admin must:

> NOTE: While the `fusionClient` configuration is optional, without it the code host connection uses `git p4`, which has performance issues so we strongly recommend `p4-fusion`.

Details of all `p4-fusion` configuration fields can be seen [here](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@2a716bd70c294acf1b3679b790834c4dea9ea956/-/blob/schema/perforce.schema.json?L84-147).
Details of all `p4-fusion` configuration fields can be seen [here](TODO/UPDATE SOURCEGRAPH SEARCH LINK@2a716bd70c294acf1b3679b790834c4dea9ea956/-/blob/schema/perforce.schema.json?L84-147).

1. Click **Add repositories**.

Expand All @@ -73,11 +73,11 @@ Perforce labels are converted to Git tags, but only under the following conditio

Perforce label names are also more flexible than git tag names, so incompatible characters are replaced with underscores. (i.e. `v1:2:3` will become `v1_2_3`)

This behaviour can be disabled by setting `noConvertLabels` to `true` in the [fusion client configuration](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@44e848d4ba5a3d47bc6e8651638cfe2279d02102/-/blob/schema/perforce.schema.json?L66-131).
This behaviour can be disabled by setting `noConvertLabels` to `true` in the [fusion client configuration](TODO/UPDATE SOURCEGRAPH SEARCH LINK@44e848d4ba5a3d47bc6e8651638cfe2279d02102/-/blob/schema/perforce.schema.json?L66-131).

## Repository permissions

To enforce file-level permissions for Perforce depots using the [Perforce protects file](https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_protect.html), include [the `authorization` field](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@2a716bd70c294acf1b3679b790834c4dea9ea956/-/blob/schema/perforce.schema.json?L67-78) in the configuration of the Perforce code host connection you created [above](#add-a-perforce-code-host):
To enforce file-level permissions for Perforce depots using the [Perforce protects file](https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_protect.html), include [the `authorization` field](TODO/UPDATE SOURCEGRAPH SEARCH LINK@2a716bd70c294acf1b3679b790834c4dea9ea956/-/blob/schema/perforce.schema.json?L67-78) in the configuration of the Perforce code host connection you created [above](#add-a-perforce-code-host):

```json
{
Expand Down Expand Up @@ -130,7 +130,7 @@ File-level permissions eliminate the need for [syncing subdirectories to match p

To enable file-level permissions:

1. Add the following entry to your [site configuration file](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@2a716bd/-/blob/schema/site.schema.json?L227-249):
1. Add the following entry to your [site configuration file](TODO/UPDATE SOURCEGRAPH SEARCH LINK@2a716bd/-/blob/schema/site.schema.json?L227-249):

```json
{
Expand Down
8 changes: 4 additions & 4 deletions docs/admin/security_event_logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This guide goes into the details of Security Event Logging in Sourcegraph


## How to log a security event
- All the logging for security event is done through our [security_event_log.go](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/database/security_event_logs.go) functions
- All the logging for security event is done through our [security_event_log.go](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/database/security_event_logs.go) functions
- Previously, events were created within the function where the action was taking place and then pushed to the logging location like this:
```go
event := &SecurityEvent{
Expand All @@ -30,10 +30,10 @@ This guide goes into the details of Security Event Logging in Sourcegraph

db.SecurityEventLogs().LogEvent(ctx, event)

- With a recent change to streamline the process, to log an event, the [LogSecurityEvent](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/database/security_event_logs.go?L253:34&popover=pinned) function can be invoked which takes care of marshaling the arguments and creating the SecurityEvent.
- With a recent change to streamline the process, to log an event, the [LogSecurityEvent](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/database/security_event_logs.go?L253:34&popover=pinned) function can be invoked which takes care of marshaling the arguments and creating the SecurityEvent.
- This function takes following information to create a log event
- Context contains information on the acting user
- SecurityEventName which is predefined [here](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/database/security_event_logs.go?L22-101)
- SecurityEventName which is predefined [here](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/database/security_event_logs.go?L22-101)
- URL if available
- userID of the user that the action is applied towards
- anonymousUserID for unauthenticated users
Expand Down Expand Up @@ -97,7 +97,7 @@ This guide goes into the details of Security Event Logging in Sourcegraph

## FAQ
### What events are currently being logged as security events?
- [These](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/internal/database/security_event_logs.go?L22-101) are the events that are currently being logged.
- [These](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/internal/database/security_event_logs.go?L22-101) are the events that are currently being logged.

### What if I don't want these events to be logged?

Expand Down
2 changes: 1 addition & 1 deletion docs/api/graphql/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Sourcegraph GraphQL API supports the following types of queries:
- Rich git-level metadata, including commits, branches, blame information, and file tree data
- Repository and user metadata

<Callout type="note">The API is under active development. Backwards compatibility will be maintained in most cases, and backwards-incompatible changes will be documented in the [changelog](https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/CHANGELOG).</Callout>
<Callout type="note">The API is under active development. Backwards compatibility will be maintained in most cases, and backwards-incompatible changes will be documented in the [changelog](TODO/UPDATE SOURCEGRAPH SEARCH LINK/-/blob/CHANGELOG).</Callout>

## Quickstart

Expand Down
Loading
Loading