diff --git a/docs/docs.json b/docs/docs.json index 703b0a10..4710e6d0 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -68,6 +68,8 @@ "docs/connections/gitlab", "docs/connections/bitbucket-cloud", "docs/connections/bitbucket-data-center", + "docs/connections/ado-cloud", + "docs/connections/ado-server", "docs/connections/gitea", "docs/connections/gerrit", "docs/connections/generic-git-host", diff --git a/docs/docs/connections/ado-cloud.mdx b/docs/docs/connections/ado-cloud.mdx new file mode 100644 index 00000000..d4e51bd6 --- /dev/null +++ b/docs/docs/connections/ado-cloud.mdx @@ -0,0 +1,141 @@ +--- +title: Linking code from Azure Devops Cloud +sidebarTitle: Azure Devops Cloud +icon: https://www.svgrepo.com/show/448307/azure-devops.svg +--- + +import AzureDevopsSchema from '/snippets/schemas/v3/azuredevops.schema.mdx' + +If you're not familiar with Sourcebot [connections](/docs/connections/overview), please read that overview first. + +## Examples + + + + ```json + { + "type": "azuredevops", + "repos": [ + "organizationName/projectName/repoName", + "organizationName/projectName/repoName2 + ] + } + ``` + + + ```json + { + "type": "azuredevops", + "orgs": [ + "organizationName", + "organizationName2 + ] + } + ``` + + + ```json + { + "type": "azuredevops", + "projects": [ + "organizationName/projectName", + "organizationName/projectName2" + ] + } + ``` + + + ```json + { + "type": "azuredevops", + // Include all repos in my-org... + "orgs": [ + "my-org" + ], + // ...except: + "exclude": { + // repos that are disabled + "disabled": true, + // repos that match these glob patterns + "repos": [ + "reposToExclude*" + ], + // projects that match these glob patterns + "projects": [ + "projectstoExclude*" + ] + // repos less than the defined min OR larger than the defined max + "size": { + // repos that are less than 1MB (in bytes)... + "min": 1048576, + // or repos greater than 100MB (in bytes) + "max": 104857600 + } + } + } + ``` + + + +## Authenticating with Azure Devops Cloud + +Azure Devops Cloud requires you to provide a PAT in order to index your repositories. To learn how to create PAT, check out the [Azure Devops docs](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows). +Sourcebot needs the `Read` access for the `Code` scope in order to find and clone your repos. + +Next, provide the access token via the `token` property, either as an environment variable or a secret: + + + + + 1. Add the `token` property to your connection config: + ```json + { + "type": "azuredevops", + "token": { + // note: this env var can be named anything. It + // doesn't need to be `ADO_TOKEN`. + "env": "ADO_TOKEN" + } + // .. rest of config .. + } + ``` + + 2. Pass this environment variable each time you run Sourcebot: + ```bash + docker run \ + -e ADO_TOKEN= \ + /* additional args */ \ + ghcr.io/sourcebot-dev/sourcebot:latest + ``` + + + + Secrets are only supported when [authentication](/docs/configuration/auth/overview) is enabled. + + 1. Navigate to **Secrets** in settings and create a new secret with your PAT: + + ![](/images/secrets_list.png) + + 2. Add the `token` property to your connection config: + + ```json + { + "type": "azuredevops", + "token": { + "secret": "mysecret" + } + // .. rest of config .. + } + ``` + + + + +## Schema reference + + +[schemas/v3/azuredevops.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/azuredevops.json) + + + + \ No newline at end of file diff --git a/docs/docs/connections/ado-server.mdx b/docs/docs/connections/ado-server.mdx new file mode 100644 index 00000000..e1d755f8 --- /dev/null +++ b/docs/docs/connections/ado-server.mdx @@ -0,0 +1,141 @@ +--- +title: Linking code from Azure Devops Server +sidebarTitle: Azure Devops Server +icon: https://www.svgrepo.com/show/448307/azure-devops.svg +--- + +import AzureDevopsSchema from '/snippets/schemas/v3/azuredevops.schema.mdx' + +If you're not familiar with Sourcebot [connections](/docs/connections/overview), please read that overview first. + +## Examples + + + + ```json + { + "type": "azuredevops", + "repos": [ + "organizationName/projectName/repoName", + "organizationName/projectName/repoName2 + ] + } + ``` + + + ```json + { + "type": "azuredevops", + "orgs": [ + "collectionName", + "collectionName2" + ] + } + ``` + + + ```json + { + "type": "azuredevops", + "projects": [ + "collectionName/projectName", + "collectionName/projectName2" + ] + } + ``` + + + ```json + { + "type": "azuredevops", + // Include all repos in my-org... + "orgs": [ + "my-org" + ], + // ...except: + "exclude": { + // repos that are disabled + "disabled": true, + // repos that match these glob patterns + "repos": [ + "reposToExclude*" + ], + // projects that match these glob patterns + "projects": [ + "projectstoExclude*" + ] + // repos less than the defined min OR larger than the defined max + "size": { + // repos that are less than 1MB (in bytes)... + "min": 1048576, + // or repos greater than 100MB (in bytes) + "max": 104857600 + } + } + } + ``` + + + +## Authenticating with Azure Devops Server + +Azure Devops Server requires you to provide a PAT in order to index your repositories. To learn how to create PAT, check out the [Azure Devops docs](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows). +Sourcebot needs the `Read` access for the `Code` scope in order to find and clone your repos. + +Next, provide the access token via the `token` property, either as an environment variable or a secret: + + + + + 1. Add the `token` property to your connection config: + ```json + { + "type": "azuredevops", + "token": { + // note: this env var can be named anything. It + // doesn't need to be `ADO_TOKEN`. + "env": "ADO_TOKEN" + } + // .. rest of config .. + } + ``` + + 2. Pass this environment variable each time you run Sourcebot: + ```bash + docker run \ + -e ADO_TOKEN= \ + /* additional args */ \ + ghcr.io/sourcebot-dev/sourcebot:latest + ``` + + + + Secrets are only supported when [authentication](/docs/configuration/auth/overview) is enabled. + + 1. Navigate to **Secrets** in settings and create a new secret with your PAT: + + ![](/images/secrets_list.png) + + 2. Add the `token` property to your connection config: + + ```json + { + "type": "azuredevops", + "token": { + "secret": "mysecret" + } + // .. rest of config .. + } + ``` + + + + +## Schema reference + + +[schemas/v3/azuredevops.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/azuredevops.json) + + + + \ No newline at end of file diff --git a/docs/docs/connections/gitea.mdx b/docs/docs/connections/gitea.mdx index 2318b166..1d439c76 100644 --- a/docs/docs/connections/gitea.mdx +++ b/docs/docs/connections/gitea.mdx @@ -85,7 +85,6 @@ Next, provide the access token via the `token` property, either as an environmen - Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI. 1. Add the `token` property to your connection config: ```json diff --git a/docs/docs/connections/github.mdx b/docs/docs/connections/github.mdx index 0abf13b8..c6e5f5c6 100644 --- a/docs/docs/connections/github.mdx +++ b/docs/docs/connections/github.mdx @@ -132,7 +132,6 @@ Next, provide the access token via the `token` property, either as an environmen - Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI. 1. Add the `token` property to your connection config: ```json diff --git a/docs/docs/connections/gitlab.mdx b/docs/docs/connections/gitlab.mdx index 173c05f8..2680064b 100644 --- a/docs/docs/connections/gitlab.mdx +++ b/docs/docs/connections/gitlab.mdx @@ -120,7 +120,6 @@ Next, provide the PAT via the `token` property, either as an environment variabl - Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI. 1. Add the `token` property to your connection config: ```json diff --git a/docs/images/ado.svg b/docs/images/ado.svg new file mode 100644 index 00000000..e5668e9b --- /dev/null +++ b/docs/images/ado.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/snippets/bitbucket-app-password.mdx b/docs/snippets/bitbucket-app-password.mdx index 1f52e79c..0a5fdac3 100644 --- a/docs/snippets/bitbucket-app-password.mdx +++ b/docs/snippets/bitbucket-app-password.mdx @@ -1,6 +1,5 @@ - Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI. 1. Add the `token` and `user` (username associated with the app password you created) properties to your connection config: ```json diff --git a/docs/snippets/bitbucket-token.mdx b/docs/snippets/bitbucket-token.mdx index 8b7e1db6..94197e01 100644 --- a/docs/snippets/bitbucket-token.mdx +++ b/docs/snippets/bitbucket-token.mdx @@ -1,6 +1,5 @@ - Environment variables are only supported in a [declarative config](/docs/configuration/declarative-config) and cannot be used in the web UI. 1. Add the `token` property to your connection config: ```json diff --git a/docs/snippets/platform-support.mdx b/docs/snippets/platform-support.mdx index 38266b2d..5f667361 100644 --- a/docs/snippets/platform-support.mdx +++ b/docs/snippets/platform-support.mdx @@ -3,6 +3,43 @@ + {/* Mintlify has a bug where linking to a file for the logo renders it with a white background, so we have to embed it directly */} + + + + } + /> + + + + } + /> diff --git a/docs/snippets/schemas/v3/azuredevops.schema.mdx b/docs/snippets/schemas/v3/azuredevops.schema.mdx index 5f802485..a36132ff 100644 --- a/docs/snippets/schemas/v3/azuredevops.schema.mdx +++ b/docs/snippets/schemas/v3/azuredevops.schema.mdx @@ -65,23 +65,12 @@ "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -138,7 +127,7 @@ "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/docs/snippets/schemas/v3/connection.schema.mdx b/docs/snippets/schemas/v3/connection.schema.mdx index 6845a626..3203cadd 100644 --- a/docs/snippets/schemas/v3/connection.schema.mdx +++ b/docs/snippets/schemas/v3/connection.schema.mdx @@ -934,23 +934,12 @@ "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -1007,7 +996,7 @@ "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/docs/snippets/schemas/v3/index.schema.mdx b/docs/snippets/schemas/v3/index.schema.mdx index 0d740128..8f3a4e6f 100644 --- a/docs/snippets/schemas/v3/index.schema.mdx +++ b/docs/snippets/schemas/v3/index.schema.mdx @@ -1197,23 +1197,12 @@ "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -1270,7 +1259,7 @@ "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/packages/schemas/src/v3/azuredevops.schema.ts b/packages/schemas/src/v3/azuredevops.schema.ts index be9af667..02bc989d 100644 --- a/packages/schemas/src/v3/azuredevops.schema.ts +++ b/packages/schemas/src/v3/azuredevops.schema.ts @@ -64,23 +64,12 @@ const schema = { "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -137,7 +126,7 @@ const schema = { "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/packages/schemas/src/v3/azuredevops.type.ts b/packages/schemas/src/v3/azuredevops.type.ts index cd5a5589..eec963bc 100644 --- a/packages/schemas/src/v3/azuredevops.type.ts +++ b/packages/schemas/src/v3/azuredevops.type.ts @@ -29,10 +29,6 @@ export interface AzureDevOpsConnectionConfig { * The type of Azure DevOps deployment */ deploymentType?: "cloud" | "server"; - /** - * The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1. - */ - apiVersion?: string; /** * Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...). */ @@ -40,7 +36,7 @@ export interface AzureDevOpsConnectionConfig { /** * List of organizations to sync with. For Cloud, this is the organization name. For Server, this is the collection name. All projects and repositories visible to the provided `token` will be synced, unless explicitly defined in the `exclude` property. */ - organizations?: string[]; + orgs?: string[]; /** * List of specific projects to sync with. Expected to be formatted as '{orgName}/{projectName}' for Cloud or '{collectionName}/{projectName}' for Server. */ @@ -55,7 +51,7 @@ export interface AzureDevOpsConnectionConfig { */ disabled?: boolean; /** - * List of individual repositories to exclude from syncing. Glob patterns are supported. + * List of repositories to exclude from syncing. Glob patterns are supported. */ repos?: string[]; /** diff --git a/packages/schemas/src/v3/connection.schema.ts b/packages/schemas/src/v3/connection.schema.ts index 87658cbd..cb867694 100644 --- a/packages/schemas/src/v3/connection.schema.ts +++ b/packages/schemas/src/v3/connection.schema.ts @@ -933,23 +933,12 @@ const schema = { "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -1006,7 +995,7 @@ const schema = { "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/packages/schemas/src/v3/connection.type.ts b/packages/schemas/src/v3/connection.type.ts index eaba169a..7922ef20 100644 --- a/packages/schemas/src/v3/connection.type.ts +++ b/packages/schemas/src/v3/connection.type.ts @@ -341,10 +341,6 @@ export interface AzureDevOpsConnectionConfig { * The type of Azure DevOps deployment */ deploymentType?: "cloud" | "server"; - /** - * The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1. - */ - apiVersion?: string; /** * Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...). */ @@ -352,7 +348,7 @@ export interface AzureDevOpsConnectionConfig { /** * List of organizations to sync with. For Cloud, this is the organization name. For Server, this is the collection name. All projects and repositories visible to the provided `token` will be synced, unless explicitly defined in the `exclude` property. */ - organizations?: string[]; + orgs?: string[]; /** * List of specific projects to sync with. Expected to be formatted as '{orgName}/{projectName}' for Cloud or '{collectionName}/{projectName}' for Server. */ @@ -367,7 +363,7 @@ export interface AzureDevOpsConnectionConfig { */ disabled?: boolean; /** - * List of individual repositories to exclude from syncing. Glob patterns are supported. + * List of repositories to exclude from syncing. Glob patterns are supported. */ repos?: string[]; /** diff --git a/packages/schemas/src/v3/index.schema.ts b/packages/schemas/src/v3/index.schema.ts index 7e60afa6..02b9f361 100644 --- a/packages/schemas/src/v3/index.schema.ts +++ b/packages/schemas/src/v3/index.schema.ts @@ -1196,23 +1196,12 @@ const schema = { "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -1269,7 +1258,7 @@ const schema = { "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/packages/schemas/src/v3/index.type.ts b/packages/schemas/src/v3/index.type.ts index 1c4dd89e..68417ba7 100644 --- a/packages/schemas/src/v3/index.type.ts +++ b/packages/schemas/src/v3/index.type.ts @@ -466,10 +466,6 @@ export interface AzureDevOpsConnectionConfig { * The type of Azure DevOps deployment */ deploymentType?: "cloud" | "server"; - /** - * The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1. - */ - apiVersion?: string; /** * Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...). */ @@ -477,7 +473,7 @@ export interface AzureDevOpsConnectionConfig { /** * List of organizations to sync with. For Cloud, this is the organization name. For Server, this is the collection name. All projects and repositories visible to the provided `token` will be synced, unless explicitly defined in the `exclude` property. */ - organizations?: string[]; + orgs?: string[]; /** * List of specific projects to sync with. Expected to be formatted as '{orgName}/{projectName}' for Cloud or '{collectionName}/{projectName}' for Server. */ @@ -492,7 +488,7 @@ export interface AzureDevOpsConnectionConfig { */ disabled?: boolean; /** - * List of individual repositories to exclude from syncing. Glob patterns are supported. + * List of repositories to exclude from syncing. Glob patterns are supported. */ repos?: string[]; /** diff --git a/schemas/v3/azuredevops.json b/schemas/v3/azuredevops.json index 3486f835..f9b6bd81 100644 --- a/schemas/v3/azuredevops.json +++ b/schemas/v3/azuredevops.json @@ -33,23 +33,12 @@ "default": "cloud", "description": "The type of Azure DevOps deployment" }, - "apiVersion": { - "type": "string", - "default": "7.1", - "description": "The Azure DevOps API version to use. For Cloud, use 7.1 or later. For Server: 2022 uses 7.1, 2020 uses 6.0, 2019 uses 5.1.", - "examples": [ - "7.1", - "7.0", - "6.0", - "5.1" - ] - }, "useTfsPath": { "type": "boolean", "default": false, "description": "Use legacy TFS path format (/tfs) in API URLs. Required for older TFS installations (TFS 2018 and earlier). When true, API URLs will include /tfs in the path (e.g., https://server/tfs/collection/_apis/...)." }, - "organizations": { + "orgs": { "type": "array", "items": { "type": "string", @@ -106,7 +95,7 @@ "type": "string" }, "default": [], - "description": "List of individual repositories to exclude from syncing. Glob patterns are supported." + "description": "List of repositories to exclude from syncing. Glob patterns are supported." }, "projects": { "type": "array", diff --git a/vendor/zoekt b/vendor/zoekt index 07c64afd..12a2f4ad 160000 --- a/vendor/zoekt +++ b/vendor/zoekt @@ -1 +1 @@ -Subproject commit 07c64afd5c719b5c95aae21c71009aacadbc528e +Subproject commit 12a2f4ad075359a09bd8a91793acb002211217aa