diff --git a/assets/images/help/copilot/chat-mode-vscode.png b/assets/images/help/copilot/chat-mode-vscode.png new file mode 100644 index 000000000000..8586ea09fa3a Binary files /dev/null and b/assets/images/help/copilot/chat-mode-vscode.png differ diff --git a/assets/images/help/copilot/copilot-chat-agent-option.png b/assets/images/help/copilot/copilot-chat-agent-option.png new file mode 100644 index 000000000000..8a7d32606cd6 Binary files /dev/null and b/assets/images/help/copilot/copilot-chat-agent-option.png differ diff --git a/assets/images/help/copilot/copilot-chat-mcp-confirmation-dialog.png b/assets/images/help/copilot/copilot-chat-mcp-confirmation-dialog.png new file mode 100644 index 000000000000..9b98c9e16757 Binary files /dev/null and b/assets/images/help/copilot/copilot-chat-mcp-confirmation-dialog.png differ diff --git a/assets/images/help/copilot/mcp-start-server-button.png b/assets/images/help/copilot/mcp-start-server-button.png new file mode 100644 index 000000000000..601856d10fb6 Binary files /dev/null and b/assets/images/help/copilot/mcp-start-server-button.png differ diff --git a/assets/images/help/copilot/vsc-mcp-server-running.png b/assets/images/help/copilot/vsc-mcp-server-running.png new file mode 100644 index 000000000000..633b8370c430 Binary files /dev/null and b/assets/images/help/copilot/vsc-mcp-server-running.png differ diff --git a/content/admin/installing-your-enterprise-server/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-vmware.md b/content/admin/installing-your-enterprise-server/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-vmware.md index 7164213ec4ef..5f8905b7331d 100644 --- a/content/admin/installing-your-enterprise-server/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-vmware.md +++ b/content/admin/installing-your-enterprise-server/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-vmware.md @@ -22,8 +22,8 @@ shortTitle: Install on VMware ## Prerequisites * {% data reusables.enterprise_installation.software-license %} -* You must have a VMware vSphere ESXi Hypervisor, applied to a bare metal machine that will run {% data variables.location.product_location %}s. We support versions 5.5 to 7.0. The ESXi Hypervisor is free and does not include the (optional) vCenter Server. For more information, see [the VMware ESXi documentation](https://www.vmware.com/products/esxi-and-esx.html). -* You will need access to a vSphere Client. If you have vCenter Server you can use the vSphere Web Client. For more information, see the VMware guide [Log in to vCenter Server by Using the vSphere Web Client](https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.install.doc/GUID-CE128B59-E236-45FF-9976-D134DADC8178.html). +* You must have a VMware vSphere ESXi Hypervisor, applied to a bare metal machine that will run {% data variables.location.product_location %}s. We support versions 5.5 to 8.0. The ESXi Hypervisor is free and does not include the (optional) vCenter Server. For more information, see [the VMware ESXi documentation](https://www.vmware.com/products/esxi-and-esx.html). +* You will need access to a vSphere Client. If you have vCenter Server you can use the vSphere Web Client. For more information, see the VMware guide [Log in to vCenter Server by Using the vSphere Web Client](https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vcenter-server-installation-and-setup-8-0.html). ## Hardware considerations diff --git a/content/copilot/customizing-copilot/extending-copilot-chat-with-mcp.md b/content/copilot/customizing-copilot/extending-copilot-chat-with-mcp.md new file mode 100644 index 000000000000..b2d435e2181b --- /dev/null +++ b/content/copilot/customizing-copilot/extending-copilot-chat-with-mcp.md @@ -0,0 +1,115 @@ +--- +title: Extending Copilot Chat with the Model Context Protocol (MCP) +allowTitleToDifferFromFilename: true +shortTitle: Extend Copilot Chat with MCP +intro: "Learn how to use the Model Context Protocol (MCP) to extend {% data variables.product.prodname_copilot_chat_short %}." +versions: + feature: copilot +topics: + - Copilot +--- + +>[!NOTE] +> * MCP support is currently in {% data variables.release-phases.public_preview %} and subject to change. +> * MCP support is only available in {% data variables.product.prodname_copilot_chat_short %} for {% data variables.product.prodname_vscode %}. +> * The [AUTOTITLE](/free-pro-team@latest/site-policy/github-terms/github-pre-release-license-terms) apply to your use of this product. + +## Overview + +The Model Context Protocol (MCP) is an open standard that defines how applications share context with large language models (LLMs). MCP provides a standardized way to connect AI models to different data sources and tools, enabling them to work together more effectively. + +You can use MCP to extend the capabilities of {% data variables.product.prodname_copilot_chat_short %} by integrating it with a wide range of existing tools and services. For example, the {% data variables.product.github %} MCP server allows you to use {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} to perform tasks on {% data variables.product.github %}. You can also use MCP to create new tools and services that work with {% data variables.product.prodname_copilot_chat_short %}, allowing you to customize and enhance your experience. + +For more information on MCP, see [the official MCP documentation](https://modelcontextprotocol.io/introduction). + +For information on some of the other currently available MCP servers, see [the MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main). + +## Prerequisites + +* **Access to {% data variables.product.prodname_copilot_short %}**. {% data reusables.copilot.subscription-prerequisite %} +* **{% data variables.product.prodname_vscode %} version 1.99 or later**. For information on installing {% data variables.product.prodname_vscode %}, see the [{% data variables.product.prodname_vscode %} download page](https://code.visualstudio.com/Download). + +## Configuring MCP servers in {% data variables.product.prodname_vscode %} + +To configure MCP servers in {% data variables.product.prodname_vscode %}, you need to set up a configuration script that specifies the details of the MCP servers you want to use. You can configure MCP servers for either: + +* **A specific repository**. This will share MCP servers with anyone who opens the project in {% data variables.product.prodname_vscode %}. To do this, create a `.vscode/mcp.json` file in the root of your repository. +* **Your personal instance of {% data variables.product.prodname_vscode %}**. You will be the only person who has access to configured MCP servers. To do this, add the configuration to your `settings.json` file in {% data variables.product.prodname_vscode %}. + + >[!NOTE] We recommend you use only one location per server. Adding the same server to both locations may cause conflicts and unexpected behavior. + +The steps below show how to configure the Fetch MCP server in your `.vscode/mcp.json` file. The Fetch MCP server is a simple MCP server that provides web content fetching capabilities. For more information on the Fetch MCP server, see [the Fetch directory](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) in the MCP Server repository. + +You can use the same steps to configure MCP servers in your personal {% data variables.product.prodname_vscode %} settings. Details on how to configure other MCP servers are available in the [MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main). + +1. Add the following configuration to your `.vscode/mcp.json` file: + + ```json copy + { + "inputs": [ + // The "inputs" section defines the inputs required for the MCP server configuration. + { + "type": "promptString" + } + ], + "servers": { + // The "servers" section defines the MCP servers you want to use. + "fetch": { + "command": "uvx", + "args": ["mcp-server-fetch"] + } + } + } + ``` + +1. Save the `.vscode/mcp.json` file. +1. A "Start" button will appear in your `.vscode/mcp.json` file, at the top of the list of servers. Click the "Start" button to start the MCP servers. This will trigger the input dialog and discover the server tools, which are then stored for later sessions. + + ![Screenshot of MCP server configuration in {% data variables.product.prodname_vscode %}. The "Start" button is outlined in dark orange. ](/assets/images/help/copilot/mcp-start-server-button.png) + +1. Open {% data variables.product.prodname_copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" %} icon in the title bar of {% data variables.product.prodname_vscode %}. +1. In the {% data variables.product.prodname_copilot_chat_short %} box, select **Agent** from the popup menu. + + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} box in {% data variables.product.prodname_vscode %}. The "Agent" option is outlined in dark orange.](/assets/images/help/copilot/copilot-chat-agent-option.png) + +1. To view your list of available MCP servers, click the tools icon in the top left corner of the chat box. This will open the MCP server list, where you can see all the MCP servers and associated tools that are currently available in your {% data variables.product.prodname_vscode %} instance. + +For more information on configuring MCP servers in {% data variables.product.prodname_vscode %}, see [Use MCP servers in {% data variables.product.prodname_vscode %} (Preview)](https://aka.ms/vscode-add-mcp) in the {% data variables.product.prodname_vscode %} documentation. + +>[!IMPORTANT] Beginning April 4, 2025, the {% data variables.product.github %} MCP server, and installation instructions, will be publicly available in the [github-mcp-server](https://github.com/github/github-mcp-server) repository. + +## Using MCP servers in {% data variables.product.prodname_copilot_chat_short %} + +Once you have configured your MCP servers, you can use them in {% data variables.product.prodname_copilot_chat_short %} to access a wide range of tools and services. In the example below, we will use the Fetch MCP server to fetch details about a web page. + +1. Open {% data variables.product.prodname_copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" %} icon in the title bar of {% data variables.product.prodname_vscode %}. +1. In the {% data variables.product.prodname_copilot_chat_short %} box, select **Agent** from the popup menu. +1. In the file with the MCP configuration, check that the MCP server is running. If it is not running, click the "Start" button to start the MCP server. + + ![Screenshot of the MCP server configuration in {% data variables.product.prodname_vscode %}. The "Running" status is outlined in dark orange.](/assets/images/help/copilot/vsc-mcp-server-running.png) + +1. Ask {% data variables.product.prodname_copilot_chat_short %} to fetch the details of a URL. For example: + + `Fetch https://github.com/github/docs.` + +1. If {% data variables.product.prodname_copilot_short %} asks you to confirm that you want to proceed, click **Continue**. + +1. {% data variables.product.prodname_copilot_short %} will fetch the details of the URL and display them in the chat box. + +For more information on using MCP servers in {% data variables.product.prodname_vscode %}, see [Use MCP servers in {% data variables.product.prodname_vscode %} (Preview)](https://aka.ms/vscode-add-mcp) in the {% data variables.product.prodname_vscode %} documentation. + +## Using existing MCP configurations + +If you already have an MCP configuration in Claude Desktop, you can use that configuration in {% data variables.product.prodname_vscode %} to access the same MCP servers. To do this, add the following configuration to your `settings.json` file in {% data variables.product.prodname_vscode %}: + +```json copy +"chat.mcp.discovery.enabled": true" +``` + +{% data variables.product.prodname_vscode %} will automatically find your existing configuration and use it in your {% data variables.product.prodname_vscode %} instance. + +## Creating a new MCP server + +You can create a new MCP server to fulfill your specific needs, and then integrate it with {% data variables.product.prodname_copilot_chat_short %}. For example, you can create an MCP server that connects to a database or a web service, and then use that server in {% data variables.product.prodname_copilot_chat_short %} to perform tasks on that database or web service. + +For more information on creating and configuring your own MCP servers, see [the official MCP documentation](https://modelcontextprotocol.io/quickstart/server). diff --git a/content/copilot/customizing-copilot/index.md b/content/copilot/customizing-copilot/index.md index d35de55300fa..2933e0413a91 100644 --- a/content/copilot/customizing-copilot/index.md +++ b/content/copilot/customizing-copilot/index.md @@ -10,6 +10,7 @@ children: - /extending-the-capabilities-of-github-copilot-in-your-organization - /adding-repository-custom-instructions-for-github-copilot - /adding-personal-custom-instructions-for-github-copilot + - /extending-copilot-chat-with-mcp - /managing-copilot-knowledge-bases - /creating-a-custom-model-for-github-copilot redirect_from: diff --git a/content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md b/content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md index b7afd2de9083..63738bf3a9c6 100644 --- a/content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md +++ b/content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md @@ -113,7 +113,11 @@ See [inline chat](https://code.visualstudio.com/docs/copilot/copilot-chat#_inlin ### Using edit mode -1. To start an edit session, select **Open {% data variables.product.prodname_copilot_edits_short %}** from the {% data variables.product.prodname_copilot_chat_short %} menu. +1. To start an edit session, select **Open Chat** from the {% data variables.product.prodname_copilot_chat_short %} menu. +1. At the bottom of the chat panel, select **Edit** from the mode dropdown. + + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} mode dropdown. The "Edit" option is outlined in dark orange.](/assets/images/help/copilot/chat-mode-vscode.png) + 1. Optionally, add relevant files to the _working set_ to indicate to {% data variables.product.prodname_copilot %} which files you want to work on. 1. Submit a prompt. In response to your prompt, {% data variables.product.prodname_copilot_edits_short %} determines which files in your _working set_ to change and adds a short description of the change. 1. Review the changes and **Apply** or **Discard** the edits for each file. @@ -122,10 +126,8 @@ For more detailed instructions, see [{% data variables.product.prodname_copilot_ ### Using agent mode -{% data reusables.copilot.agent-mode-public-preview-note %} - -1. To start an edit session, select **Open {% data variables.product.prodname_copilot_edits_short %}** from the {% data variables.product.prodname_copilot_chat_short %} menu. -1. Select **Agent** from the mode dropdown menu. +1. To start an edit session, select **Open Chat** from the {% data variables.product.prodname_copilot_chat_short %} menu. +1. At the bottom of the chat panel, select **Agent** from the mode dropdown. 1. Submit a prompt. In response to your prompt, {% data variables.product.prodname_copilot_short %} streams the edits in the editor, updates the working set, and if necessary, suggests terminal commands to run. 1. Review the changes. If {% data variables.product.prodname_copilot_short %} suggested terminal commands, confirm whether or not {% data variables.product.prodname_copilot_short %} can run them. In response, {% data variables.product.prodname_copilot_short %} iterates and performs additional actions to complete the task in your original prompt. diff --git a/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md b/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md index c7b555fc038b..45ff4f7d00a7 100644 --- a/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md +++ b/content/copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot.md @@ -337,8 +337,6 @@ If you want to accept the next line of a suggestion, you will need to set a cust ## About {% data variables.copilot.next_edit_suggestions %} -> [!NOTE] {% data variables.copilot.next_edit_suggestions_caps %} is currently in {% data variables.release-phases.public_preview %} and is subject to change. - Inline suggestions autocomplete code, but many development tasks involve editing existing code. {% data variables.copilot.next_edit_suggestions_caps %} assists with edits both at the cursor and in other relevant parts of the code, helping maintain consistency and streamline changes. {% data variables.copilot.next_edit_suggestions_caps %} predicts where and what edits may be needed based on ongoing changes. Suggestions may span a single symbol, an entire line, or multiple lines, depending on the scope of the potential change. diff --git a/content/issues/tracking-your-work-with-issues/using-issues/creating-an-issue.md b/content/issues/tracking-your-work-with-issues/using-issues/creating-an-issue.md index 0903a71486e1..f3734d27d237 100644 --- a/content/issues/tracking-your-work-with-issues/using-issues/creating-an-issue.md +++ b/content/issues/tracking-your-work-with-issues/using-issues/creating-an-issue.md @@ -171,6 +171,14 @@ If you're using issues to track and prioritize your work, you can use issues to {% endif %} +{% ifversion copilot %} + +## Creating an issue from {% data variables.product.prodname_copilot_chat_short %} + +You can create an issue from {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} with the Model Context Protocol (MCP). For more information, see [AUTOTITLE](/copilot/customizing-copilot/extending-copilot-chat-with-mcp). + +{% endif %} + ## Further reading * [AUTOTITLE](/get-started/writing-on-github) diff --git a/content/repositories/creating-and-managing-repositories/creating-a-new-repository.md b/content/repositories/creating-and-managing-repositories/creating-a-new-repository.md index 44e30ba2ed96..b0bb9a19b7c2 100644 --- a/content/repositories/creating-and-managing-repositories/creating-a-new-repository.md +++ b/content/repositories/creating-and-managing-repositories/creating-a-new-repository.md @@ -63,6 +63,14 @@ If you create an invalid URL using query parameters, or if you don’t have the | `owner` | `https://{% data variables.product.product_url %}/new?owner=avocado-corp&visibility=public` creates a public repository owned by the "avocado-corp" organization. | Any valid organization name or username. Alternatively, while signed in use `@me` to specify your user account as the owner. | | `template_owner` and `template_name` | `https://{% data variables.product.product_url %}/new?owner=avocado-corp&template_owner=avocado-corp&template_name=octo-repo` creates a repository owned by the "avocado-corp" using the avocado-corp's template "octo-repo". | The username of the template owner and the name of the repository template. | +{% ifversion copilot %} + +## Creating a new repository from {% data variables.product.prodname_copilot_chat_short %} + +You can create a new repository from {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %} with the Model Context Protocol (MCP). For more information, see [AUTOTITLE](/copilot/customizing-copilot//extending-copilot-chat-with-mcp). + +{% endif %} + ## Further reading * [AUTOTITLE](/code-security/getting-started/quickstart-for-securing-your-repository) diff --git a/data/release-notes/enterprise-server/3-13/12.yml b/data/release-notes/enterprise-server/3-13/12.yml index 704fe9eec9c2..f5235f4bb3ce 100644 --- a/data/release-notes/enterprise-server/3-13/12.yml +++ b/data/release-notes/enterprise-server/3-13/12.yml @@ -1,5 +1,8 @@ date: '2025-03-04' sections: + features: + - | + Running {% data variables.product.prodname_ghe_server %} on the VMware ESXi 8.0 hypervisor is supported. If your installation is on VMware ESXi 7.X or earlier versions, you can now use the ESXi 8.0 hypervisor. [Updated: 2025-04-02] security_fixes: - | Permissions and ownership of `/etc/ssh/sshd_config` are enforced so that the `root` identity is the only one able to read or write to the file. @@ -52,3 +55,6 @@ sections: After a restore, existing outside collaborators are unable to be added to repositories in a new organization. This issue can be resolved by running `/usr/local/share/enterprise/ghe-es-search-repair` on the appliance. - | After a geo-replica is promoted to be a primary by running `ghe-repl-promote`, the actions workflow of a repository does not have any suggested workflows. + errata: + - | + The release notes previously did not mention VMware ESXi 8.0 support. [Updated: 2025-04-02] diff --git a/data/release-notes/enterprise-server/3-14/9.yml b/data/release-notes/enterprise-server/3-14/9.yml index 2e3f8cfff20e..8e92b50c8744 100644 --- a/data/release-notes/enterprise-server/3-14/9.yml +++ b/data/release-notes/enterprise-server/3-14/9.yml @@ -1,5 +1,8 @@ date: '2025-03-04' sections: + features: + - | + Running {% data variables.product.prodname_ghe_server %} on the VMware ESXi 8.0 hypervisor is supported. If your installation is on VMware ESXi 7.X or earlier versions, you can now use the ESXi 8.0 hypervisor. [Updated: 2025-04-02] security_fixes: - | Permissions and ownership of `/etc/ssh/sshd_config` are now enforced so that the `root` identity is the only one able to read or write to the file. @@ -64,3 +67,6 @@ sections: After a restore, existing outside collaborators are unable to be added to repositories in a new organization. This issue can be resolved by running `/usr/local/share/enterprise/ghe-es-search-repair` on the appliance. - | After a geo-replica is promoted to be a primary by running `ghe-repl-promote`, the actions workflow of a repository does not have any suggested workflows. + errata: + - | + The release notes previously did not mention VMware ESXi 8.0 support. [Updated: 2025-04-02] diff --git a/data/release-notes/enterprise-server/3-15/4.yml b/data/release-notes/enterprise-server/3-15/4.yml index 28c7bff95cfd..41046233f072 100644 --- a/data/release-notes/enterprise-server/3-15/4.yml +++ b/data/release-notes/enterprise-server/3-15/4.yml @@ -1,5 +1,8 @@ date: '2025-03-04' sections: + features: + - | + Running {% data variables.product.prodname_ghe_server %} on the VMware ESXi 8.0 hypervisor is supported. If your installation is on VMware ESXi 7.X or earlier versions, you can now use the ESXi 8.0 hypervisor. [Updated: 2025-04-02] security_fixes: - | Permissions and ownership of `/etc/ssh/sshd_config` are now enforced so that the `root` identity is the only one able to read or write to the file. @@ -66,3 +69,6 @@ sections: [Updated: 2025-03-19] - | After a restore, existing outside collaborators are unable to be added to repositories in a new organization. This issue can be resolved by running `/usr/local/share/enterprise/ghe-es-search-repair` on the appliance. + errata: + - | + The release notes previously did not mention VMware ESXi 8.0 support. [Updated: 2025-04-02] diff --git a/data/release-notes/enterprise-server/3-16/0.yml b/data/release-notes/enterprise-server/3-16/0.yml index 0542b12c53e9..0d79a1097615 100644 --- a/data/release-notes/enterprise-server/3-16/0.yml +++ b/data/release-notes/enterprise-server/3-16/0.yml @@ -27,6 +27,10 @@ sections: # https://github.com/github/releases/issues/4336 - | `ghe-config-apply` applies configuration changes conditionally to the relevant, targeted and specific migrations only. As a result, you can expect less downtime and fewer errors while running `ghe-config-apply`. You can still choose to run `ghe-config-apply` unconditionally using this command: `ghe-config-apply -f`. + - | + We now support the VMware ESXi 8.0 hypervisor. If your {% data variables.product.prodname_ghe_server %} installation is on VMware ESXi 7.X or earlier versions, you can now use the ESXi 8.0 hypervisor. [Updated: 2025-04-02] + - | + Running {% data variables.product.prodname_ghe_server %} on the VMware ESXi 8.0 hypervisor is supported. If your installation is on VMware ESXi 7.X or earlier versions, you can now use the ESXi 8.0 hypervisor. [Updated: 2025-04-02] - heading: Dependabot notes: @@ -256,7 +260,9 @@ sections: # https://github.com/github/releases/issues/4535 - | As of October 15th, 2024, you will no longer be able to enable or disable GitHub security features for repositories from the organization-level security coverage view. This feature has been deprecated and replaced with code security configurations for managing these settings. See the [GitHub blog post](https://github.blog/changelog/2024-10-17-new-code-security-configurations-let-you-set-security-features-at-the-organization-level/). - + errata: - | The release notes previously mentioned GitHub App private key limits, which did not ship in 3.16 and will ship in 3.17. Similarly, PAT rotation policies were mentioned but will ship instead in 3.17. [Updated: 2025-03-21] + - | + The release notes previously did not mention VMware ESXi 8.0 support. [Updated: 2025-04-02] diff --git a/data/reusables/copilot/copilot-edits/agent-mode-description.md b/data/reusables/copilot/copilot-edits/agent-mode-description.md index 1c97ddce785a..4b7fb29ac8fb 100644 --- a/data/reusables/copilot/copilot-edits/agent-mode-description.md +++ b/data/reusables/copilot/copilot-edits/agent-mode-description.md @@ -1 +1 @@ -**Agent mode** (public preview): Use agent mode when you have a specific task in mind and want to enable {% data variables.product.prodname_copilot_short %} to autonomously edit your code. In agent mode, {% data variables.product.prodname_copilot_short %} determines which files to make changes to, offers code changes and terminal commands to complete the task, and iterates to remediate issues until the original task is complete. Agent mode is only available in {% data variables.product.prodname_vscode %}. +**Agent mode**: Use agent mode when you have a specific task in mind and want to enable {% data variables.product.prodname_copilot_short %} to autonomously edit your code. In agent mode, {% data variables.product.prodname_copilot_short %} determines which files to make changes to, offers code changes and terminal commands to complete the task, and iterates to remediate issues until the original task is complete. Agent mode is only available in {% data variables.product.prodname_vscode %}. diff --git a/data/ui.yml b/data/ui.yml index 49c34644dbdb..49a378ece65b 100644 --- a/data/ui.yml +++ b/data/ui.yml @@ -46,10 +46,10 @@ search: privacy_disclaimer: For product and service improvement purposes, the GitHub Docs team will retain questions and answers generated in the Docs search function. Please see the GitHub Privacy Statement to review how GitHub collects and uses your data. ai: disclaimer: Copilot uses AI. Check for mistakes by reviewing the links in the response. - references: References from these articles + references: Additional docs loading_status_message: Loading Copilot response... done_loading_status_message: Done loading Copilot response - unable_to_answer: Sorry, I'm unable to answer that question. Please try a different query or search our docs. + unable_to_answer: Sorry, I'm unable to answer that question. Check that you selected the correct GitHub version or try a different query. copy_answer: Copy answer copied_announcement: Copied! thumbs_up: This answer was helpful diff --git a/package-lock.json b/package-lock.json index b428ebd19ede..620bca1635db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,6 @@ "html-entities": "^2.5.2", "http-proxy-middleware": "3.0.3", "imurmurhash": "^0.1.4", - "ipaddr.js": "^2.2.0", "is-svg": "5.0.0", "javascript-stringify": "^2.1.0", "js-cookie": "^3.0.1", @@ -9262,12 +9261,10 @@ } }, "node_modules/ipaddr.js": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", - "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "version": "1.9.1", "license": "MIT", "engines": { - "node": ">= 10" + "node": ">= 0.10" } }, "node_modules/is-alphabetical": { @@ -13065,15 +13062,6 @@ "node": ">= 0.10" } }, - "node_modules/proxy-addr/node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", diff --git a/package.json b/package.json index c7dd5b606166..8e6ef4d6b1ca 100644 --- a/package.json +++ b/package.json @@ -286,7 +286,6 @@ "html-entities": "^2.5.2", "http-proxy-middleware": "3.0.3", "imurmurhash": "^0.1.4", - "ipaddr.js": "^2.2.0", "is-svg": "5.0.0", "javascript-stringify": "^2.1.0", "js-cookie": "^3.0.1", diff --git a/src/events/components/events.ts b/src/events/components/events.ts index 69e0f989ae02..ab0861c71d94 100644 --- a/src/events/components/events.ts +++ b/src/events/components/events.ts @@ -1,4 +1,4 @@ -/* eslint-disable camelcase, no-unreachable */ +/* eslint-disable camelcase */ import Cookies from 'src/frame/components/lib/cookies' import { parseUserAgent } from './user-agent' import { Router } from 'next/router' @@ -76,9 +76,6 @@ export function sendEvent({ } & EventPropsByType[T]) { if (isHeadless()) return - // Early return to disable event tracking - return - const body = { type, diff --git a/src/fixtures/fixtures/data/ui.yml b/src/fixtures/fixtures/data/ui.yml index 49c34644dbdb..49a378ece65b 100644 --- a/src/fixtures/fixtures/data/ui.yml +++ b/src/fixtures/fixtures/data/ui.yml @@ -46,10 +46,10 @@ search: privacy_disclaimer: For product and service improvement purposes, the GitHub Docs team will retain questions and answers generated in the Docs search function. Please see the GitHub Privacy Statement to review how GitHub collects and uses your data. ai: disclaimer: Copilot uses AI. Check for mistakes by reviewing the links in the response. - references: References from these articles + references: Additional docs loading_status_message: Loading Copilot response... done_loading_status_message: Done loading Copilot response - unable_to_answer: Sorry, I'm unable to answer that question. Please try a different query or search our docs. + unable_to_answer: Sorry, I'm unable to answer that question. Check that you selected the correct GitHub version or try a different query. copy_answer: Copy answer copied_announcement: Copied! thumbs_up: This answer was helpful diff --git a/src/shielding/lib/fastly-ips.ts b/src/shielding/lib/fastly-ips.ts index 142b9d933bb0..f010031ec62d 100644 --- a/src/shielding/lib/fastly-ips.ts +++ b/src/shielding/lib/fastly-ips.ts @@ -1,11 +1,7 @@ // Logic to get and store the current list of public Fastly IPs from the Fastly API: https://www.fastly.com/documentation/reference/api/utils/public-ip-list/ -import ipaddr, { IPv4, IPv6 } from 'ipaddr.js' - -type IPRangeArr = [IPv4 | IPv6, number][] - // Default returned from ➜ curl "https://api.fastly.com/public-ip-list" -export const DEFAULT_FASTLY_IPS: IPRangeArr = [ +export const DEFAULT_FASTLY_IPS: string[] = [ '23.235.32.0/20', '43.249.72.0/22', '103.244.50.0/24', @@ -25,21 +21,22 @@ export const DEFAULT_FASTLY_IPS: IPRangeArr = [ '185.31.16.0/22', '199.27.72.0/21', '199.232.0.0/16', -].map((cidr) => ipaddr.parseCIDR(cidr)) +] -let ipRangeCache: IPRangeArr = [] +let ipCache: string[] = [] -export async function getPublicFastlyIPs(): Promise { +export async function getPublicFastlyIPs(): Promise { // Don't fetch the list in dev & testing, just use the defaults if (process.env.NODE_ENV !== 'production') { - ipRangeCache = DEFAULT_FASTLY_IPS + ipCache = DEFAULT_FASTLY_IPS } - if (ipRangeCache.length) { - return ipRangeCache + if (ipCache.length) { + return ipCache } const endpoint = 'https://api.fastly.com/public-ip-list' + let ips: string[] = [] let attempt = 0 while (attempt < 3) { @@ -50,8 +47,8 @@ export async function getPublicFastlyIPs(): Promise { } const data = await response.json() if (data && Array.isArray(data.addresses)) { - ipRangeCache = data.addresses.map((cidr: string) => ipaddr.parseCIDR(cidr)) - return ipRangeCache + ips = data.addresses + break } else { throw new Error('Invalid response structure') } @@ -60,11 +57,14 @@ export async function getPublicFastlyIPs(): Promise { `Failed to fetch Fastly IPs: ${error.message}. Retrying ${3 - attempt} more times`, ) attempt++ + if (attempt >= 3) { + ips = DEFAULT_FASTLY_IPS + } } } - ipRangeCache = DEFAULT_FASTLY_IPS - return ipRangeCache + ipCache = ips + return ips } // The IPs we check in the rate-limiter are in the form `X.X.X.X` @@ -72,10 +72,10 @@ export async function getPublicFastlyIPs(): Promise { // For an IP in the rate-limiter, we want `X.X.X.*` to match `X.X.X.X/Y` export async function isFastlyIP(ip: string): Promise { // If IPs aren't initialized, fetch them - if (!ipRangeCache.length) { + if (!ipCache.length) { await getPublicFastlyIPs() } - if (!ip) return false // localhost - const addr = ipaddr.parse(ip) - return ipRangeCache.some((range) => addr.match(range)) + const parts = ip.split('.') + const prefix = parts.slice(0, 3).join('.') + return ipCache.some((fastlyIP) => fastlyIP.startsWith(prefix)) } diff --git a/src/shielding/tests/shielding.ts b/src/shielding/tests/shielding.ts index f1932214f6ad..41e4279d0815 100644 --- a/src/shielding/tests/shielding.ts +++ b/src/shielding/tests/shielding.ts @@ -2,6 +2,7 @@ import { describe, expect, test } from 'vitest' import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' import { get } from '@/tests/helpers/e2etest.js' +import { DEFAULT_FASTLY_IPS } from '@/shielding/lib/fastly-ips' describe('honeypotting', () => { test('any GET with survey-vote and survey-token query strings is 400', async () => { @@ -104,7 +105,7 @@ describe('rate limiting', () => { headers: { // Rate limiting only happens in production, so we need to // make the environment look like production. - 'fastly-client-ip': '0.0.0.0', + 'fastly-client-ip': 'abc', }, }) expect(res.statusCode).toBe(200) @@ -117,7 +118,7 @@ describe('rate limiting', () => { { const res = await get('/robots.txt?foo=buzz', { headers: { - 'fastly-client-ip': '0.0.0.0', + 'fastly-client-ip': 'abc', }, }) expect(res.statusCode).toBe(200) @@ -141,7 +142,8 @@ describe('rate limiting', () => { // Fastly IPs are in the form `X.X.X.X/Y` // Rate limited IPs are in the form `X.X.X.X` // Where the last X could be any 2-3 digit number - const mockFastlyIP = '23.235.32.0' + const mockFastlyIP = + DEFAULT_FASTLY_IPS[0].split('.').slice(0, 3).join('.') + `.${Math.floor(Math.random() * 100)}` // Cookies only allows 1 request per minute const res1 = await get('/api/cookies', { headers: {