diff --git a/docs/code_insights/explanations/current_limitations_of_code_insights.mdx b/docs/code_insights/explanations/current_limitations_of_code_insights.mdx index a9e00c79a..725e96456 100644 --- a/docs/code_insights/explanations/current_limitations_of_code_insights.mdx +++ b/docs/code_insights/explanations/current_limitations_of_code_insights.mdx @@ -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). - Perforce depots converted to git are also currently not supported for Code Insights. +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 diff --git a/docs/code_insights/references/requirements.mdx b/docs/code_insights/references/requirements.mdx index e42e590e4..af9ea8eba 100644 --- a/docs/code_insights/references/requirements.mdx +++ b/docs/code_insights/references/requirements.mdx @@ -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.