diff --git a/content/copilot/concepts/agents/code-review.md b/content/copilot/concepts/agents/code-review.md index 885aa2e30725..42d1b7f07f69 100644 --- a/content/copilot/concepts/agents/code-review.md +++ b/content/copilot/concepts/agents/code-review.md @@ -110,6 +110,8 @@ If {% data variables.product.prodname_actions %} is unavailable or if Actions wo {% data reusables.copilot.code-review.code-review-actions-usage %} +Organizations in this situation can use self-hosted runners. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners). + ## Code review monthly quota Each time {% data variables.product.prodname_copilot_short %} reviews a pull request or reviews code in your IDE, your monthly quota of {% data variables.product.prodname_copilot_short %} premium requests is reduced by one. diff --git a/content/copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners.md b/content/copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners.md new file mode 100644 index 000000000000..e2357c818f29 --- /dev/null +++ b/content/copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners.md @@ -0,0 +1,47 @@ +--- +title: Configuring self-hosted runners for GitHub Copilot code review +shortTitle: Configure self-hosted runners +intro: 'Learn how to configure self-hosted runners for {% data variables.copilot.copilot_code-review_short %}.' +allowTitleToDifferFromFilename: true +versions: + feature: copilot +topics: + - Copilot +contentType: how-tos +category: + - Author and optimize with Copilot +--- + +## About {% data variables.product.prodname_actions %} usage for code review tools + +{% data reusables.copilot.code-review.code-review-actions-usage %} Organizations in this situation can use self-hosted runners. + +## Configuring self-hosted runners for code review + +You can run {% data variables.copilot.copilot_code-review_short %} using self-hosted {% data variables.product.prodname_actions %} runners with ARC (Actions Runner Controller). You must first set up ARC-managed scale sets in your environment. For more information on ARC, see [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/about-actions-runner-controller). + +> [!WARNING] +> ARC is the only officially supported solution for self-hosting {% data variables.copilot.copilot_code-review_short %}. For security reasons, we do not recommend using non-ARC self-hosted runners. + +> [!NOTE] +> {% data variables.copilot.copilot_code-review_short %} is only compatible with Ubuntu x64 Linux runners. Runners with Windows, macOS or other operating systems are not supported. + +To configure self-hosted runners for {% data variables.copilot.copilot_code-review_short %}: + +1. Configure network security controls for your {% data variables.product.prodname_actions %} runners to ensure that {% data variables.copilot.copilot_code-review_short %} does not have open access to your network or the public internet. + + You must configure your firewall to allow connections to the [standard hosts required for {% data variables.product.prodname_actions %} self-hosted runners](/actions/reference/runners/self-hosted-runners#accessible-domains-by-function), plus the following hosts: + + * `api.githubcopilot.com` + * `uploads.github.com` + * `user-images.githubusercontent.com` +1. In your `copilot-setup-steps.yml` file, set the `runs-on` attribute to your ARC-managed scale set name. For more information, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment). + + ```yaml + # ... + + jobs: + copilot-setup-steps: + runs-on: arc-scale-set-name + # ... + ``` diff --git a/content/copilot/how-tos/use-copilot-agents/request-a-code-review/index.md b/content/copilot/how-tos/use-copilot-agents/request-a-code-review/index.md index 5bae0c886fae..af4d5a5f2403 100644 --- a/content/copilot/how-tos/use-copilot-agents/request-a-code-review/index.md +++ b/content/copilot/how-tos/use-copilot-agents/request-a-code-review/index.md @@ -7,11 +7,11 @@ versions: children: - /use-code-review - /configure-automatic-review + - /configure-self-hosted-runners redirect_from: - /copilot/using-github-copilot/code-review - /copilot/how-tos/agents/copilot-code-review - /copilot/how-tos/agents/request-a-code-review - - /copilot/how-tos/use-copilot-agents/request-a-code-review/configure-self-hosted-runners contentType: how-tos --- diff --git a/content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md b/content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md index 968407a35b8b..9e8ca00dd003 100644 --- a/content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md +++ b/content/copilot/reference/copilot-usage-metrics/copilot-usage-metrics.md @@ -23,7 +23,7 @@ For guidance on how to read and interpret these metrics, see [AUTOTITLE](/copilo ## {% data variables.product.prodname_copilot_short %} usage dashboard metrics -These metrics appear directly in the {% data variables.product.prodname_copilot_short %} usage dashboard. +These metrics appear directly in the {% data variables.product.prodname_copilot_short %} usage dashboard. These charts do **not** include {% data variables.copilot.copilot_cli_short %} usage. | Metric | Description | |:--|:--| @@ -89,6 +89,20 @@ These fields appear in the exported NDJSON reports and in the {% data variables. | `totals_by_language_feature` | Breakdown combining language and feature dimensions. | | `totals_by_model_feature` / `totals_by_language_model` | Model-specific breakdowns for chat activity (not completions). | | `last_known_ide_version` / `last_known_plugin_version` | The most recent IDE and {% data variables.copilot.copilot_chat_short %} extension version detected for each user. | +| `daily_active_cli_users` | Number of unique users in the enterprise who used {% data variables.product.prodname_copilot_short %} via the CLI on a given day. This field is **independent** of IDE active user counts and is **not** included in IDE-based active user definitions. Omitted for enterprises with no CLI usage on that day. | +| `totals_by_cli` | Breakdown of CLI-specific metrics for the enterprise on a given day. Independent of IDE metrics—CLI usage is **not** reflected in other fields such as `totals_by_ide` or `totals_by_feature`. Omitted for enterprises with no CLI usage on that day. See [{% data variables.copilot.copilot_cli_short %} metrics fields](#copilot-cli-metrics-fields-api-only) below. | + +### {% data variables.copilot.copilot_cli_short %} metrics fields (API only) + +The `totals_by_cli` object contains the following nested fields when CLI usage is present. These metrics are currently only available in the enterprise-level reports. + +| Field | Description | +|:--|:--| +| `totals_by_cli.session_count` | Number of distinct CLI sessions initiated on this day. | +| `totals_by_cli.request_count` | Total number of requests made to {% data variables.product.prodname_copilot_short %} via the CLI on this day, including both user-initiated prompts and automated agentic follow-up calls. | +| `totals_by_cli.token_usage.output_tokens_sum` | Total number of output tokens generated across all CLI requests on this day. | +| `totals_by_cli.token_usage.prompt_tokens_sum` | Total number of prompt tokens sent across all CLI requests on this day. | +| `totals_by_cli.token_usage.avg_tokens_per_request` | Average number of **output** and **prompt** tokens per CLI request, computed as `(output_tokens_sum + prompt_tokens_sum) ÷ request_count`.| ### Pull request activity fields (API only) diff --git a/content/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics.md b/content/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics.md index c398634b052c..60280f76dc42 100644 --- a/content/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics.md +++ b/content/copilot/reference/copilot-usage-metrics/reconciling-usage-metrics.md @@ -23,10 +23,12 @@ The {% data variables.product.prodname_copilot_short %} usage metrics dashboard, ## Prerequisite -{% data variables.product.prodname_copilot_short %} usage metrics depend on **telemetry from users’ IDEs**. If a developer has disabled telemetry in their IDE, their {% data variables.product.prodname_copilot_short %} activity will **not** appear in the dashboard, API reports, or exported data. +IDE-based {% data variables.product.prodname_copilot_short %} usage metrics depend on **telemetry from users’ IDEs**. If a developer has disabled telemetry in their IDE, their IDE-based {% data variables.product.prodname_copilot_short %} activity will **not** appear in the dashboard, API reports, or exported data. If you notice missing users or unexpectedly low adoption numbers, verify IDE telemetry settings before troubleshooting other causes. +{% data variables.copilot.copilot_cli_short %} metrics (`daily_active_cli_users` and `totals_by_cli`) are collected and reported separately from IDE telemetry. CLI usage does **not** contribute to IDE-based active user counts or other IDE metrics. + ## Metric alignment The dashboard and APIs use shared definitions for key metrics: