Skip to content

Update Code Insights docs with new sub-repo perms setting #1128

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,24 @@ 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.
Code Insights by default can **not** query repositories that have [sub-repo permissions](/admin/permissions/api#Setting-sub-repository-permissions-for-users) configured. Note that some repositories can sync sub-repo permissions from the code host - Perforce depots currently (6.4).

<Callout type="note"> Perforce depots converted to git are also currently not supported for Code Insights.</Callout>
The reason for that restriction is security concerns around exposing the code in those repositories to users who should not be able to access it.

Code Insights exposes only aggregated analytics and counts of patterns, though, not the raw code, so the security concerns could be less for Code Insights.

If desired, a Sourcegraph admin can enable Code Insights access to repositories that use sub-repo permissions in site config:

```json
"experimentalFeatures": {
"subRepoPermissions": {
"enabled": true,
"allowCodeInsights": true
}
}
```

`allowCodeInsights` is `false` by default, preserving historical behavior.

## Feature parity limitations

Expand Down
4 changes: 2 additions & 2 deletions docs/code_insights/references/requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ You can only use Code Insights on a [Docker Compose](/admin/deploy/docker-compos

## Code hosts

Sourcegraph Code Insights is compatible with any [Sourcegraph-compatible code host](/admin/repo/), except:
Sourcegraph Code Insights is compatible with any [Sourcegraph-compatible code host](/admin/repo/).

* Perforce repositories making use of sub-repo permissions are not supported
If the repo has [sub-repo permissions](/admin/permissions/api#Setting-sub-repository-permissions-for-users) configured, an admin will need to set `experimentalSettings.subRepoPermissions.allowCodeInsights` to `true` in site config to allow Code Insights to query that repo.