diff --git a/docs/configure-connection.md b/docs/configure-connection.md index 6d3bc7b..289f9e6 100644 --- a/docs/configure-connection.md +++ b/docs/configure-connection.md @@ -23,10 +23,10 @@ Aliases: `connections` | Flag | Default | Description | |------|---------|-------------| | `--plugin` | *(interactive)* | Plugin to configure (`github`, `gh-copilot`, `jenkins`, `circleci`, `gitlab`, `bitbucket`, `azuredevops_go`, `jira`, `pagerduty`, `sonarqube`, `argocd`) | -| `--org` | *(plugin-dependent)* | Organization/group/workspace slug (required for GitHub, GitLab, and Azure DevOps; optional for Copilot when `--enterprise` is provided) | +| `--org` | *(plugin-dependent)* | Organization/group/workspace slug (required for GitHub, GitLab, and Azure DevOps; for Azure DevOps, use the organization segment from `https://dev.azure.com/`; optional for Copilot when `--enterprise` is provided) | | `--enterprise` | | GitHub enterprise slug (Copilot only) | | `--name` | `Plugin - org` | Connection display name | -| `--endpoint` | *(plugin default when available)* | API endpoint override (required for Jenkins, Azure DevOps, Jira, SonarQube, and ArgoCD because they have no default endpoint) | +| `--endpoint` | *(plugin default when available)* | API endpoint override (required for Jenkins, Azure DevOps, Jira, SonarQube, and ArgoCD because they have no default endpoint; for Azure DevOps, usually `https://dev.azure.com/`) | | `--proxy` | | HTTP proxy URL | | `--token` | | Plugin PAT or API token (highest priority source). For BasicAuth plugins (Jenkins, Bitbucket), this is the password/app token. | | `--username` | | Username for BasicAuth plugins (Jenkins, Bitbucket). Ignored for token-based plugins. | @@ -58,11 +58,12 @@ Aliases: `connections` For each plugin, the CLI resolves the PAT in this order (see [token-handling.md](token-handling.md) for the full guide): -1. `--token` flag -2. `.devlake.env` file — checked for plugin-specific keys: - - GitHub / Copilot: `GITHUB_PAT`, `GITHUB_TOKEN`, or `GH_TOKEN` -3. Plugin-specific environment variable (same key names, from shell environment) -4. Interactive masked prompt (terminal fallback) +1. `--token` flag +2. `.devlake.env` file — checked for plugin-specific keys: + - GitHub / Copilot: `GITHUB_PAT`, `GITHUB_TOKEN`, or `GH_TOKEN` + - Azure DevOps: `AZURE_DEVOPS_PAT` or `AZDO_PAT` +3. Plugin-specific environment variable (same key names, from shell environment) +4. Interactive masked prompt (terminal fallback) ### Username Resolution (BasicAuth plugins) @@ -115,12 +116,23 @@ gh devlake configure connection --plugin github --org my-org \ # With proxy gh devlake configure connection --plugin github --org my-org --proxy http://proxy:8080 -# BasicAuth plugin (e.g. Jenkins) -gh devlake configure connection --plugin jenkins --username admin --token mypassword - -# Interactive (no --plugin — prompts for everything) -gh devlake configure connection -``` +# BasicAuth plugin (e.g. Jenkins) +gh devlake configure connection --plugin jenkins --username admin --token mypassword + +# Azure DevOps connection +# --org is the organization segment from https://dev.azure.com/ +# --endpoint should usually match: https://dev.azure.com/ +gh devlake configure connection --plugin azuredevops_go --org my-azure-org \ + --endpoint https://dev.azure.com/my-azure-org + +# Azure DevOps via alias, with PAT from AZDO_PAT or AZURE_DEVOPS_PAT +export AZDO_PAT=my-pat +gh devlake configure connection --plugin azure-devops --org my-azure-org \ + --endpoint https://dev.azure.com/my-azure-org + +# Interactive (no --plugin — prompts for everything) +gh devlake configure connection +``` ### Output diff --git a/docs/configure-scope.md b/docs/configure-scope.md index ad35755..dadfc38 100644 --- a/docs/configure-scope.md +++ b/docs/configure-scope.md @@ -109,6 +109,10 @@ gh devlake configure scope add --plugin circleci --connection-id 4 # PagerDuty services (interactive) gh devlake configure scope add --plugin pagerduty --connection-id 5 +# Azure DevOps repos (interactive project + repo picker) +# Uses the saved connection's org and endpoint to discover projects and repos +gh devlake configure scope add --plugin azure-devops --org my-azure-org + # Interactive (omit all flags) gh devlake configure scope add ``` @@ -149,6 +153,13 @@ gh devlake configure scope add 2. Prompts for one or more services to track 3. Calls `PUT /plugins/pagerduty/connections/{id}/scopes` with the selected services +### What It Does (Azure DevOps) + +1. Uses the saved Azure DevOps connection's org and endpoint to discover remote scopes +2. Lists projects for that organization via the DevLake remote-scope API +3. Lets you pick one or more repos within those projects to collect +4. Calls `PUT /plugins/azuredevops_go/connections/{id}/scopes` with the selected repos + --- ## configure scope list