diff --git a/content/code-security/concepts/about-code-quality.md b/content/code-security/concepts/about-code-quality.md index ae7556ec3f66..9ce394b43df1 100644 --- a/content/code-security/concepts/about-code-quality.md +++ b/content/code-security/concepts/about-code-quality.md @@ -29,7 +29,7 @@ With {% data variables.product.prodname_code_quality_short %}, you can: * Review clear explanations for findings and apply one-click **{% data variables.product.prodname_copilot_short %}-powered autofixes**. * Use **repository dashboards** to track reliability and maintainability scores, identify areas needing attention, and prioritize remediation. * Monitor **organization dashboards** to understand the code health of your repositories at a glance and determine which repositories to investigate further. -* Set up **rulesets** for pull requests to enforce code quality standards and block changes that do not meet your criteria. +* Set up **rulesets** for pull requests to enforce code quality standards and block changes that do not meet your criteria. You can also enforce coverage thresholds with rulesets to block pull requests that don't meet a minimum coverage percentage or that cause coverage to drop by more than the allowed amount. * Upload **code coverage** reports to see test coverage metrics directly on pull requests, helping reviewers identify untested code. * Easily assign remediation work to **{% data variables.copilot.copilot_cloud_agent %}**, if you have a {% data variables.product.prodname_copilot_short %} license. diff --git a/content/code-security/how-tos/maintain-quality-code/index.md b/content/code-security/how-tos/maintain-quality-code/index.md index f2a3447e2f1a..173c5f812ddd 100644 --- a/content/code-security/how-tos/maintain-quality-code/index.md +++ b/content/code-security/how-tos/maintain-quality-code/index.md @@ -12,6 +12,7 @@ children: - /set-up-code-coverage - /interpret-results - /set-pr-thresholds + - /restrict-code-coverage - /unblock-your-pr redirect_from: - /code-security/code-quality/how-tos diff --git a/content/code-security/how-tos/maintain-quality-code/restrict-code-coverage.md b/content/code-security/how-tos/maintain-quality-code/restrict-code-coverage.md new file mode 100644 index 000000000000..9af90a811783 --- /dev/null +++ b/content/code-security/how-tos/maintain-quality-code/restrict-code-coverage.md @@ -0,0 +1,39 @@ +--- +title: Restricting code coverage on pull requests +shortTitle: Restrict code coverage +intro: Protect your test coverage by automatically blocking pull requests that fall below the coverage levels your team requires. +versions: + feature: code-quality +permissions: '{% data reusables.permissions.code-quality-repo-enable %}' +contentType: how-tos +category: + - Improve code quality +--- + +> [!NOTE] +> This feature is in {% data variables.release-phases.public_preview %} and subject to change. + +## Prerequisites + +* {% data variables.product.prodname_code_quality %} is enabled on the repository. +* Code coverage data is uploaded to {% data variables.product.github %} for the pull request branch. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/set-up-code-coverage). + +## Creating a coverage threshold rule + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-settings %} +{% data reusables.repositories.repo-rulesets-settings %} +1. Create a new branch ruleset or click an existing one to edit it. +1. Under "Branch rules", select **Restrict code coverage**. +1. Expand **Additional settings** to configure thresholds. A value of 0 means that the threshold is disabled. + + * **Minimum coverage percentage**: enter a value to block pull requests where aggregated coverage falls below this percentage. + * **Maximum coverage drop**: enter a value to block pull requests where coverage drops by more than this many percentage points relative to the default branch. + +1. Click **Create** or **Save changes**. + +{% ifversion repo-rules-enterprise %} + +> [!TIP] +> Consider setting your ruleset to **Evaluate** mode before switching to **Active**. This lets you observe which pull requests would have been blocked without enforcing the rule, giving you a chance to calibrate your thresholds. +{% endif %} diff --git a/content/code-security/how-tos/maintain-quality-code/set-up-code-coverage.md b/content/code-security/how-tos/maintain-quality-code/set-up-code-coverage.md index 51d909e34a20..121ea4f890f9 100644 --- a/content/code-security/how-tos/maintain-quality-code/set-up-code-coverage.md +++ b/content/code-security/how-tos/maintain-quality-code/set-up-code-coverage.md @@ -127,3 +127,4 @@ jobs: ## Next steps * **Interpret results:** Understand coverage metrics and per-file breakdowns on your pull requests. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/interpret-results). +* **Enforce coverage thresholds:** Block pull requests that don't meet a minimum coverage percentage or that cause coverage to drop. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/restrict-code-coverage). diff --git a/content/code-security/how-tos/maintain-quality-code/unblock-your-pr.md b/content/code-security/how-tos/maintain-quality-code/unblock-your-pr.md index d9e67f8ea40b..2cfdc6c9ef59 100644 --- a/content/code-security/how-tos/maintain-quality-code/unblock-your-pr.md +++ b/content/code-security/how-tos/maintain-quality-code/unblock-your-pr.md @@ -1,7 +1,7 @@ --- title: Resolving a block on your pull request shortTitle: Unblock your PR -intro: Identify and resolve a code quality block on your pull request so you can merge your changes. +intro: Identify and resolve a code quality or coverage threshold block on your pull request so you can merge your changes. versions: feature: code-quality permissions: '{% data reusables.permissions.code-quality-see-repo-findings %}' @@ -16,10 +16,14 @@ category: ## Understanding why your pull request is blocked -Repository administrators can set code quality gates for maintainability and reliability using {% data variables.product.prodname_code_quality %}. When you open a pull request, a scan automatically runs to check your changes against these standards. +Repository administrators can set quality gates using {% data variables.product.prodname_code_quality %}. When you open a pull request, checks automatically run to evaluate your changes against these standards. -If your pull request introduces code that falls below the required quality threshold, you’ll see a merge block banner at the bottom of the pull request in the Checks section: -"Merging is blocked: Code quality findings were detected." +There are two types of blocks: + +* **Code quality findings**: your changes introduce issues that fall below the required quality threshold. +* **Coverage threshold**: your changes cause code coverage to fall below a required minimum, or cause coverage to drop by more than a permitted amount relative to the default branch. + +If your pull request introduces code that falls below the required quality threshold, you'll see a merge block banner at the bottom of the pull request in the "Checks" section: "Merging is blocked: Code quality findings were detected." ![Screenshot of the merge block banner in the Checks section of a pull request.](/assets/images/help/code-quality/code-quality-merge-block.png) @@ -64,6 +68,19 @@ In order to unblock your pull request, you need to resolve each required finding To see if you've met the code quality requirements, look at the "Checks" section at the bottom of your pull request. The merge block banner should no longer be present, and you should be able to merge your changes as usual. +## Resolving a coverage threshold block + +If your pull request is blocked by a coverage threshold rule, you'll see a merge block banner in the "Checks" section with a message describing which threshold was not met. For example: + +* "Coverage 22.0% is below minimum 50.0%": your pull request branch coverage is below the minimum coverage percentage configured in the ruleset. +* "Coverage decreased by 2.5%, maximum allowed drop is 1.0%": your changes caused coverage to drop by more than the permitted amount relative to the default branch. + +To unblock your pull request, you need to add or modify tests so that more of the codebase is executed: + +1. Review the coverage summary comment on your pull request to identify which files or areas lack coverage. +1. Add or update tests to increase execution coverage. +1. Push your changes. The coverage check will re-run automatically. + ## Next steps Reduce technical debt by fixing findings in recently changed files. See [AUTOTITLE](/code-security/code-quality/tutorials/improve-recent-merges). diff --git a/content/copilot/concepts/agents/copilot-in-jetbrains.md b/content/copilot/concepts/agents/copilot-in-jetbrains.md new file mode 100644 index 000000000000..d1c482c9f270 --- /dev/null +++ b/content/copilot/concepts/agents/copilot-in-jetbrains.md @@ -0,0 +1,79 @@ +--- +title: Using GitHub Copilot in JetBrains IDEs +shortTitle: Copilot in JetBrains +intro: 'Learn about the different ways to use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_jetbrains_ides %}, including the {% data variables.product.prodname_copilot %} plugin, JetBrains AI Assistant, and {% data variables.copilot.copilot_cli_short %}.' +versions: + feature: copilot +contentType: concepts +category: + - Learn about Copilot +allowTitleToDifferFromFilename: true +--- + +## Introduction + +There are three ways to use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_jetbrains_ides %}: the {% data variables.product.prodname_copilot %} plugin, {% data variables.product.prodname_copilot %} as an agent in JetBrains AI Assistant, and {% data variables.copilot.copilot_cli %} in the integrated terminal. Each entry point provides a different set of capabilities depending on how you prefer to work. + +## Comparing entry points + +| | {% data variables.product.prodname_copilot %} plugin | {% data variables.product.prodname_copilot %} in AI Assistant | {% data variables.copilot.copilot_cli_short %} | +|---|---|---|---| +| **Best for** | Comprehensive AI coding workflow | Quick {% data variables.product.prodname_copilot_short %} access without a separate plugin | Terminal-first workflows | +| **Entry point** | Chat panel, inline chat, code suggestions, code review, commit message | Default agent picker, ACP Registry | Terminal or shell | +| **Code completion** | Yes | Not included | Not included | +| **Next edit suggestions** | Yes | Coming soon | Not included | +| **Agentic experience** | Multiple agent harnesses | {% data variables.product.prodname_copilot_short %} as agent via ACP, Default agent picker | {% data variables.copilot.copilot_cli_short %} | +| **IDE tools** | Yes | Yes | Not included | +| **Model selection** | Yes | Yes | Yes | +| **Inline chat** | Yes | Not included | Not included | +| **Code review** | Yes | Not included | Not included | +| **Commit message generation** | Yes | Not included | Not included | +| **Subscription** | {% data variables.product.prodname_copilot %} | {% data variables.product.prodname_copilot %} | {% data variables.product.prodname_copilot %} | + +## {% data variables.product.prodname_copilot %} plugin + +The {% data variables.product.prodname_copilot %} plugin for {% data variables.product.prodname_jetbrains_ides %} is the most comprehensive way to use {% data variables.product.prodname_copilot_short %} and is the recommended choice. + +The plugin is transitioning from its local agent harness to {% data variables.copilot.copilot_cli_short %} as the default agent harness, which brings faster feature parity and higher-quality results. For more information, see [{% data variables.copilot.copilot_cli_short %} is becoming the default agent harness in {% data variables.product.prodname_copilot %} for JetBrains](https://devblogs.microsoft.com/java/github-copilot-for-jetbrains-is-moving-to-copilot-cli-as-the-default-agent-harness/). For installation instructions, see [AUTOTITLE](/copilot/how-tos/set-up/install-copilot-extension). + +* **Code completion and next edit suggestions**: {% data variables.product.prodname_copilot_short %} suggests completions as you type and proactively predicts your next intended edit. +* **Multiple agent harnesses**: The plugin ships its own agent experience and partners with other agent providers, giving you multiple interaction modes. +* **Full model and feature support**: All {% data variables.copilot.copilot_chat_short %} models, code completion modes, and bring-your-own-key features are available as they are released. +* **Inline chat**: Explain, refactor, document, or generate code directly in the editor gutter, without switching to a separate panel. +* **Code review**: {% data variables.product.prodname_copilot_short %} analyzes your changes and surfaces actionable feedback, flagging potential bugs, style violations, and logic issues. +* **Commit message generation**: {% data variables.product.prodname_copilot_short %} inspects your staged changes and generates a clear, conventional commit message. + +## {% data variables.product.prodname_copilot %} in JetBrains AI Assistant + +> [!NOTE] +> {% data variables.product.prodname_copilot %} in AI Assistant provides chat and agent capabilities only. It does not include code completion, next edit suggestions, inline chat, code review, or commit message generation. + +{% data variables.product.prodname_copilot %} is available as a native agent in JetBrains AI Assistant through the Agent Client Protocol (ACP). The ACP is an open standard for connecting AI agents to the IDE. If you have a valid {% data variables.product.prodname_copilot_short %} subscription, {% data variables.product.prodname_copilot_short %} appears in the AI Assistant agent picker automatically. + +This integration is designed for developers who prefer to work inside the AI Assistant chat panel or who want {% data variables.product.prodname_copilot_short %} available without installing an additional plugin. + +* **No updates required**: The {% data variables.product.prodname_copilot_short %} agent is bundled directly with AI Assistant and kept current automatically. No separate plugin to install, update, or maintain. +* **Chat-centric workflow**: Ideal for multi-step reasoning tasks—describe a goal, let {% data variables.product.prodname_copilot_short %} plan and propose changes, and iterate conversationally. +* **Model selection**: Switch {% data variables.product.prodname_copilot_short %} models or adjust reasoning depth without leaving the chat panel. + +### Using {% data variables.product.prodname_copilot %} in AI Assistant + +1. Open JetBrains AI Assistant by pressing Alt+A (Windows/Linux) or Command+Shift+A (macOS), or click the AI Assistant icon in the right tool window. +1. In the agent picker dropdown at the top of the chat panel, select **{% data variables.product.prodname_copilot %}**. +1. Enter a prompt and start chatting. + +### The ACP Registry + +The ACP Registry is the catalog of agents that AI Assistant knows about. When the IDE starts, it consults the registry to discover which agents are available. {% data variables.product.prodname_copilot %}'s ACP entry is part of the default registry, so {% data variables.product.prodname_copilot_short %} appears in your agent list automatically when you have a valid subscription and the required credentials in place. + +For more information about ACP, see the [ACP documentation](https://agentclientprotocol.com/get-started/introduction). For technical details on running {% data variables.copilot.copilot_cli_short %} as an ACP server, see [AUTOTITLE](/copilot/reference/copilot-cli-reference/acp-server). + +## {% data variables.copilot.copilot_cli %} in the integrated terminal + +{% data variables.copilot.copilot_cli %} brings {% data variables.product.prodname_copilot_short %}'s capabilities directly to the terminal. It is optimized for command-line workflows and can run on macOS, Linux, or Windows. + +## Further reading + +* [AUTOTITLE](/copilot/how-tos/chat-with-copilot/chat-in-ide) +* [AUTOTITLE](/copilot/how-tos/set-up/install-copilot-extension) +* [AUTOTITLE](/copilot/how-tos/use-ai-models/change-the-chat-model) diff --git a/content/copilot/concepts/agents/index.md b/content/copilot/concepts/agents/index.md index 4fbfcda56a97..53d902eb1e36 100644 --- a/content/copilot/concepts/agents/index.md +++ b/content/copilot/concepts/agents/index.md @@ -9,6 +9,7 @@ children: - /cloud-agent - /copilot-cli - /github-copilot-app + - /copilot-in-jetbrains - /code-review - /about-github-agentic-workflows - /copilot-memory diff --git a/content/copilot/concepts/models/auto-model-selection.md b/content/copilot/concepts/models/auto-model-selection.md index c1fdb8cf07b9..cfdb70f72230 100644 --- a/content/copilot/concepts/models/auto-model-selection.md +++ b/content/copilot/concepts/models/auto-model-selection.md @@ -19,7 +19,7 @@ More than just a model picker, {% data variables.copilot.copilot_auto_model_sele ### Auto with task optimization -> [!NOTE] {% data variables.copilot.copilot_auto_model_selection_short_cap_a %} with task optimization is generally available in {% data variables.copilot.copilot_chat_short %} on the {% data variables.product.github %} website and in {% data variables.product.prodname_vscode_shortname %}. +> [!NOTE] {% data variables.copilot.copilot_auto_model_selection_short_cap_a %} with task optimization is generally available in {% data variables.copilot.copilot_chat_short %} on the {% data variables.product.github %} website, in {% data variables.product.prodname_vscode_shortname %}, and in {% data variables.copilot.copilot_cli_short %}. {% data variables.copilot.copilot_auto_model_selection_short_cap_a %} with task optimization combines two systems to provide high quality results and better reliability. One system tracks real-time system health and availability, while the other evaluates task complexity. Putting these together, {% data variables.copilot.copilot_auto_model_selection_short %} routes the task to the optimal model. @@ -60,7 +60,7 @@ When you select **Auto**, {% data variables.copilot.copilot_auto_model_selection ## {% data variables.copilot.copilot_auto_model_selection_short_cap_a %} in {% data variables.product.prodname_copilot_short %} -{% data variables.copilot.copilot_auto_model_selection_short_cap_a %}, optimized for model reliability and availability, is available in these {% data variables.product.prodname_copilot_short %} products: +{% data variables.copilot.copilot_auto_model_selection_short_cap_a %}, optimized for model reliability and availability, is available in these {% data variables.product.prodname_copilot_short %} products: * {% data variables.copilot.copilot_chat_short %}, on the {% data variables.product.github %} website and supported IDEs * {% data variables.copilot.copilot_cli_short %} * {% data variables.copilot.copilot_cloud_agent %} diff --git a/content/copilot/how-tos/chat-with-copilot/chat-in-ide.md b/content/copilot/how-tos/chat-with-copilot/chat-in-ide.md index 708de6427c48..970e0c4265f6 100644 --- a/content/copilot/how-tos/chat-with-copilot/chat-in-ide.md +++ b/content/copilot/how-tos/chat-with-copilot/chat-in-ide.md @@ -384,6 +384,9 @@ The following agents are available: * **{% data variables.copilot.copilot_cli_short %}**: Runs {% data variables.product.prodname_copilot_short %} through {% data variables.copilot.copilot_cli_short %}, providing a terminal-first agentic experience with support for multiple isolation modes, live session progress, and tool call visibility. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-copilot-cli). * **Custom agents**: Use personalized agents tailored to your specific needs. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/about-custom-agents). +> [!TIP] +> You can also access {% data variables.product.prodname_copilot_short %} from JetBrains AI Assistant without installing the {% data variables.product.prodname_copilot_short %} plugin. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-in-jetbrains). + ## Submitting prompts You can ask {% data variables.copilot.copilot_chat_short %} to give you code suggestions, explain code, generate unit tests, and suggest code fixes. diff --git a/content/copilot/how-tos/copilot-cli/cli-best-practices.md b/content/copilot/how-tos/copilot-cli/cli-best-practices.md index 2dd8130eddf1..774ddc3affbb 100644 --- a/content/copilot/how-tos/copilot-cli/cli-best-practices.md +++ b/content/copilot/how-tos/copilot-cli/cli-best-practices.md @@ -94,14 +94,14 @@ Use `/model` to choose from available models based on your task complexity: | Model | Best For | Tradeoffs | | ----- | -------- | --------- | -| **Auto** | Reduced rate limiting and lower latency and errors | See [AUTOTITLE](/copilot/concepts/auto-model-selection#auto-model-selection-in-github-copilot-cli)| +| **Auto** | Reduced rate limiting and lower latency and errors | See [AUTOTITLE](/copilot/concepts/auto-model-selection) | | **Claude Opus 4.5** (default) | Complex architecture, difficult debugging, nuanced refactoring | Most capable but more costly | | **Claude Sonnet 4.5** | Day-to-day coding, most routine tasks | Fast, cost-effective, handles most work well | | **GPT-5.2 Codex** | Code generation, code review, straightforward implementations | Excellent for reviewing code produced by other models | **Recommendations:** -* **Auto** intelligently chooses models based on real time system health and model performance, reducing rate limiting and providing lower latency and errors. +* **Auto** intelligently chooses models based on real-time system health and model performance (reducing rate limiting and providing lower latency and errors), and the complexity of the task you have given {% data variables.product.prodname_copilot_short %}. * **Opus 4.5** is ideal for tasks requiring deep reasoning, complex system design, subtle bug investigation, or extensive context understanding. * **Switch to Sonnet 4.5** for routine tasks where speed and cost efficiency matter—it handles the majority of everyday coding effectively. * **Use Codex** for high-volume code generation and as a second opinion for reviewing code produced by other models. diff --git a/content/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle.md b/content/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle.md index eb4fbdf5a07f..3702153baed8 100644 --- a/content/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle.md +++ b/content/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle.md @@ -49,9 +49,20 @@ To remame a session: ## Sharing a session -You can save the content of the current session as either a Markdown file or a private gist on {% data variables.product.prodname_dotcom_the_website %}. This allows you to share your prompts and {% data variables.product.prodname_copilot_short %}'s responses with others, or store a record of your work outside of the CLI. +You can share the content of the current session as a shareable link to the session on {% data variables.product.prodname_dotcom_the_website %}, a Markdown file, an interactive HTML file, or a private gist on {% data variables.product.prodname_dotcom_the_website %}. This allows you to share your prompts and {% data variables.product.prodname_copilot_short %}'s responses with others, or store a record of your work outside of the CLI. -To share a session as a gist, type the following in an interactive session: +> [!NOTE] +> You can use `/export` as an alias for `/share` in any of the commands below. + +To share the session to {% data variables.product.github %} and print a shareable link, type the following in an interactive session: + +```copilot copy +/share +``` + +To stop sharing the session, type `/share off`. + +To share a session as a gist, type: ```copilot copy /share gist @@ -65,6 +76,19 @@ To export the session conversation as a Markdown file, type: If you don't specify a file path, the Markdown file is saved in the current working directory with the name `copilot-session-SESSIONID.md`. +> [!NOTE] +> Gists are not available to {% data variables.product.prodname_emus %}, or if you use {% data variables.product.prodname_ghe_cloud %} with data residency (*.ghe.com). + +To export the session as an interactive HTML file, type: + +```copilot copy +/share html [PATH-TO-FILE] +``` + +As with Markdown export, if you don't specify a file path the file is saved in the current working directory, with the name `copilot-session-SESSIONID.html`. + +If you have used the `/research` slash command in the current session, you can also use the `/share` command to share a research report. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-cli/research#viewing-and-sharing-a-research-report). + ## Using the `/chronicle` slash command The `/chronicle` slash command provides a set of subcommands that generate specific types of insights from your session history. While you can ask {% data variables.product.prodname_copilot_short %} free-form questions about your sessions at any time, `/chronicle` subcommands provide a quick way to get specific insights. diff --git a/content/copilot/how-tos/set-up/install-copilot-extension.md b/content/copilot/how-tos/set-up/install-copilot-extension.md index cdc360a82743..8307c5833d93 100644 --- a/content/copilot/how-tos/set-up/install-copilot-extension.md +++ b/content/copilot/how-tos/set-up/install-copilot-extension.md @@ -92,6 +92,10 @@ The following procedure will guide you through installation of the {% data varia 1. After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin using {% data variables.product.prodname_copilot %}, click **OK**. +## Other ways to access {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_jetbrains_ides %} + +The plugin provides the full {% data variables.product.prodname_copilot_short %} experience, but you can also access {% data variables.product.prodname_copilot_short %} through JetBrains AI Assistant or {% data variables.copilot.copilot_cli_short %} without installing the plugin. For a comparison of what each entry point offers, see [AUTOTITLE](/copilot/concepts/agents/copilot-in-jetbrains). + {% endjetbrains %} {% vimneovim %} diff --git a/content/copilot/how-tos/use-ai-models/change-the-chat-model.md b/content/copilot/how-tos/use-ai-models/change-the-chat-model.md index 635a073fe7c7..4ad9a3d2f18b 100644 --- a/content/copilot/how-tos/use-ai-models/change-the-chat-model.md +++ b/content/copilot/how-tos/use-ai-models/change-the-chat-model.md @@ -142,6 +142,9 @@ For reasoning models that support configurable thinking effort, you can control {% data reusables.copilot.auto-model-option %} +> [!TIP] +> Model selection is also available when using {% data variables.product.prodname_copilot_short %} through JetBrains AI Assistant. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-in-jetbrains). + {% endjetbrains %} {% eclipse %} diff --git a/content/copilot/reference/ai-models/model-comparison.md b/content/copilot/reference/ai-models/model-comparison.md index 1ae59aef9bd2..6839d29a5342 100644 --- a/content/copilot/reference/ai-models/model-comparison.md +++ b/content/copilot/reference/ai-models/model-comparison.md @@ -19,7 +19,7 @@ contentType: reference > [!NOTE] > * Different models consume {% data variables.product.prodname_ai_credits_short %} at different rates based on their token pricing. For details, see [AUTOTITLE](/copilot/reference/copilot-billing/models-and-pricing). -> * {% data reusables.copilot.auto-model-selection %} +> * Choosing the **Auto** option when selecting a model automatically selects the optimum model for your task, based on model availability and task complexity. If you are on a paid {% data variables.product.prodname_copilot_short %} plan, you qualify for a discount on model costs when you use the **Auto** option. See [AUTOTITLE](/copilot/concepts/auto-model-selection). ### Recommended models by task diff --git a/content/copilot/reference/copilot-cli-reference/acp-server.md b/content/copilot/reference/copilot-cli-reference/acp-server.md index f457fac622b2..f5c190bda12c 100644 --- a/content/copilot/reference/copilot-cli-reference/acp-server.md +++ b/content/copilot/reference/copilot-cli-reference/acp-server.md @@ -136,4 +136,5 @@ main().catch((error) => { ## Further reading +* [AUTOTITLE](/copilot/concepts/agents/copilot-in-jetbrains) * [Official ACP documentation](https://agentclientprotocol.com/protocol/overview) diff --git a/content/copilot/reference/copilot-cli-reference/cli-command-reference.md b/content/copilot/reference/copilot-cli-reference/cli-command-reference.md index 0e7d6573f834..35c4b1785c1e 100644 --- a/content/copilot/reference/copilot-cli-reference/cli-command-reference.md +++ b/content/copilot/reference/copilot-cli-reference/cli-command-reference.md @@ -228,7 +228,7 @@ When diff mode is open (entered via `/diff`): | `/logout` | Log out of {% data variables.product.prodname_copilot_short %}. | | `/lsp [show\|test\|reload\|help] [SERVER-NAME]` | Manage the language server configuration. | | `/mcp [show\|add\|edit\|delete\|disable\|enable\|auth\|reload\|search] [SERVER-NAME]` | Manage the MCP server configuration. See [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers#managing-mcp-servers). | -| `/model`, `/models [MODEL]` | Select the AI model you want to use. | +| `/model`, `/models [MODEL]` | Select the AI model you want to use, or choose **Auto**. See [AUTOTITLE](/copilot/concepts/auto-model-selection). | | `/permissions [show\|reset]` | View or clear in-memory tool and path approvals for the current session. | | `/plan [PROMPT]` | Create an implementation plan before coding. | | `/plugin [marketplace\|install\|uninstall\|update\|list] [ARGS...]` | Manage plugins and plugin marketplaces. See [AUTOTITLE](/copilot/concepts/agents/about-plugins). | @@ -310,7 +310,7 @@ For a complete list of available slash commands enter `/help` in the CLI's inter | `--log-level=LEVEL` | Set the log level (choices: `none`, `error`, `warning`, `info`, `debug`, `all`, `default`). | | `--max-autopilot-continues=COUNT` | Maximum number of continuation messages in autopilot mode (default: unlimited). See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/autopilot). | | `--mode=MODE` | Set the initial agent mode (choices: `interactive`, `plan`, `autopilot`). Cannot be combined with `--autopilot` or `--plan`. | -| `--model=MODEL` | Set the AI model you want to use. Pass `auto` to let {% data variables.product.prodname_copilot_short %} pick the best available model automatically. | +| `--model=MODEL` | Set the AI model you want to use. Pass `auto` as the value to let {% data variables.product.prodname_copilot_short %} pick the best available model automatically. See [AUTOTITLE](/copilot/concepts/auto-model-selection). | | `--mouse[=VALUE]` | Enable or disable mouse support in the interactive interface. VALUE can be `on` (default) or `off`. When enabled, the CLI captures mouse events—scroll wheel, clicks, and so on—to navigate its own interface, such as scrolling the timeline or clicking tabs. When disabled, the terminal's native mouse behavior, such as text selection and scrollback, is preserved. When you set this option explicitly, the value is persisted to your configuration file. | | `-n NAME`, `--name=NAME` | Set a name for the new session. Used by `--resume` and `/resume` to find sessions by name. | | `--no-ask-user` | Disable the `ask_user` tool (the agent works autonomously without asking questions). | diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md b/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md index fc6b92ca6f82..ddfa3d8746de 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md @@ -212,6 +212,20 @@ If your repositories are configured with {% data variables.product.prodname_code For more information, see [AUTOTITLE](/code-security/code-quality/concepts/about-code-quality) and [AUTOTITLE](/code-security/code-quality/how-tos/set-pr-thresholds). +## Restrict code coverage + +> [!NOTE] +> This feature is in {% data variables.release-phases.public_preview %} and subject to change. + +If your repository has {% data variables.product.prodname_code_quality %} enabled and code coverage data is being uploaded, you can use rulesets to prevent pull requests from being merged based on code coverage thresholds. For more information about uploading coverage data, see [AUTOTITLE](/code-security/how-tos/maintain-quality-code/set-up-code-coverage). + +This rule blocks a pull request from being merged when either of two code coverage thresholds is not met: + +* **Minimum coverage percentage**: the aggregated code coverage for the pull request branch is below the configured percentage. +* **Maximum coverage drop**: code coverage drops by more than the configured number of percentage points relative to the default branch. + +For how to configure the thresholds, the prerequisite for uploading coverage data, and how to roll the rule out safely, see [AUTOTITLE](/code-security/how-tos/maintain-quality-code/restrict-code-coverage). + {% endif %} {% ifversion repo-rules-required-workflows %} diff --git a/data/reusables/copilot/auto-model-selection.md b/data/reusables/copilot/auto-model-selection.md deleted file mode 100644 index 8b07d817a346..000000000000 --- a/data/reusables/copilot/auto-model-selection.md +++ /dev/null @@ -1 +0,0 @@ -When you use {% data variables.copilot.copilot_chat_short %} in supported IDEs, **Auto** will automatically select the best model for you based on availability. You can manually choose a different model to override this selection. See [AUTOTITLE](/copilot/concepts/auto-model-selection). diff --git a/data/variables/product.yml b/data/variables/product.yml index 1de3e3d03747..02cb88cf85f3 100644 --- a/data/variables/product.yml +++ b/data/variables/product.yml @@ -308,6 +308,10 @@ prodname_vscode_command_palette: 'Visual Studio Code Command Palette' prodname_vscode_marketplace: 'Visual Studio Code Marketplace' prodname_vs_marketplace_shortname: 'VS Code Marketplace' +# JetBrains IDEs +prodname_jetbrains_ides: 'JetBrains IDEs' +prodname_jetbrains_ide: 'JetBrains IDE' + # GitHub Dependabot prodname_dependabot: 'Dependabot' prodname_dependabot_alerts: 'Dependabot alerts' diff --git a/package-lock.json b/package-lock.json index 6b903418d312..8e35a6e3a80f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "flat": "^6.0.1", "github-slugger": "^2.0.0", "glob": "13.0.2", + "hast-util-from-html": "^2.0.3", "hast-util-from-parse5": "^8.0.3", "hast-util-to-jsx-runtime": "^2.3.6", "hast-util-to-string": "^3.0.1", @@ -7834,18 +7835,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/cheerio/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/cheerio/node_modules/parse5": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", @@ -8780,6 +8769,18 @@ "version": "1.1.1", "license": "ISC" }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", @@ -10602,6 +10603,36 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-from-html": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", + "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html/node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, "node_modules/hast-util-from-parse5": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz", @@ -10702,18 +10733,6 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.0.tgz", "integrity": "sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==" }, - "node_modules/hast-util-raw/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/hast-util-raw/node_modules/parse5": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", @@ -14764,18 +14783,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", @@ -14800,18 +14807,6 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/parse5-parser-stream/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/parse5-parser-stream/node_modules/parse5": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", diff --git a/package.json b/package.json index 36df7e3d1cce..b966c75bf65b 100644 --- a/package.json +++ b/package.json @@ -212,6 +212,7 @@ "flat": "^6.0.1", "github-slugger": "^2.0.0", "glob": "13.0.2", + "hast-util-from-html": "^2.0.3", "hast-util-from-parse5": "^8.0.3", "hast-util-to-jsx-runtime": "^2.3.6", "hast-util-to-string": "^3.0.1", diff --git a/src/frame/components/ui/MarkdownContent/MarkdownContent.tsx b/src/frame/components/ui/MarkdownContent/MarkdownContent.tsx index ef2102c7aaef..77acd14a2abc 100644 --- a/src/frame/components/ui/MarkdownContent/MarkdownContent.tsx +++ b/src/frame/components/ui/MarkdownContent/MarkdownContent.tsx @@ -1,14 +1,11 @@ import { memo, ReactNode } from 'react' -import type { ComponentProps, JSX } from 'react' +import type { JSX } from 'react' import { Fragment, jsx, jsxs } from 'react/jsx-runtime' -import { toJsxRuntime, type Components } from 'hast-util-to-jsx-runtime' +import { toJsxRuntime } from 'hast-util-to-jsx-runtime' import type { Root as HastRoot } from 'hast' import cx from 'classnames' -import { CopyButton } from '@/frame/components/CopyButton' -import { CodeTabsGroup } from '@/frame/components/CodeTabsGroup' -import { ToggleableContent } from '@/tools/components/ToggleableContent' -import { isToggleClass } from '@/tools/components/SelectionContext' +import { markdownComponents } from './markdownComponents' import styles from './MarkdownContent.module.scss' export type MarkdownContentPropsT = { @@ -18,41 +15,6 @@ export type MarkdownContentPropsT = { as?: keyof JSX.IntrinsicElements } -// Map specific elements in the HTML AST to interactive React components instead -// of inert markup enhanced by post-hydration DOM mutation (#6619). This only -// applies to the hast rendering path; the dangerouslySetInnerHTML string path is -// untouched. The same map runs during SSR and on the client, so hydration matches. -const markdownComponents = { - button(props: ComponentProps<'button'>) { - const classes = String(props.className || '').split(/\s+/) - if (classes.includes('js-btn-copy')) { - return - } - return