From 4bd266952240e40153e5b6d6f429a33c04573997 Mon Sep 17 00:00:00 2001 From: Sam Browning <106113886+sabrowning1@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:54:54 -0400 Subject: [PATCH 1/2] Add content for content exclusion in IDE Chat, make scannability changes (#51057) Co-authored-by: hubwriter --- .../about-billing-for-github-copilot.md | 2 +- .../style-guide.md | 2 +- content/copilot/about-github-copilot.md | 2 +- .../using-github-copilot-chat-in-your-ide.md | 3 +- ...ling-github-copilot-enterprise-features.md | 2 +- .../installing-github-copilot-in-the-cli.md | 2 +- .../using-github-copilot-in-the-cli.md | 2 +- ...g-content-exclusions-for-github-copilot.md | 306 ------------------ .../index.md | 14 +- ...opilot-for-members-of-your-organization.md | 7 +- .../index.md | 13 + ...for-copilot-access-in-your-organization.md | 2 + ...opilot-for-members-of-your-organization.md | 3 +- ...t-content-exclusions-for-github-copilot.md | 80 +++++ ...g-content-exclusions-for-github-copilot.md | 136 ++++++++ .../index.md | 16 + .../managing-copilot-knowledge-bases.md | 1 + ...icies-for-copilot-in-your-organization.md} | 3 +- ...o-content-exclusions-for-github-copilot.md | 42 +++ ...anges-to-content-exclusions-in-your-ide.md | 102 ++++++ .../index.md | 12 + ...viewing-audit-logs-for-copilot-business.md | 1 + ...for-github-copilot-in-your-organization.md | 3 +- ...ribing-to-copilot-for-your-organization.md | 2 +- ...oting-common-issues-with-github-copilot.md | 5 +- .../repository-roles-for-an-organization.md | 2 +- .../copilot/content-exclusion-fnmatch-tip.md | 1 + .../copilot/content-exclusion-limitations.md | 3 +- .../copilot/content-exclusion-note.md | 3 +- .../copilot/content-exclusion-permissions.md | 3 + .../copilot/content-exclusion-tooltip.md | 2 +- ...t-exclusions-availability-and-beta-note.md | 3 + .../copilot/content-exclusions-delay.md | 2 +- .../copilot/content-exclusions-scope.md | 6 +- .../copilot/copilot-business-features.md | 4 +- .../copilot/copilot-enterprise-features.md | 2 +- .../more-details-content-exclusion-logs.md | 5 + .../copilot/test-content-exclusions-chat.md | 1 + .../view-last-change-content-exclusions.md | 3 + 39 files changed, 458 insertions(+), 345 deletions(-) delete mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot.md rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => managing-access-to-github-copilot-in-your-organization}/granting-access-to-copilot-for-members-of-your-organization.md (91%) create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/index.md rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => managing-access-to-github-copilot-in-your-organization}/managing-requests-for-copilot-access-in-your-organization.md (89%) rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => managing-access-to-github-copilot-in-your-organization}/revoking-access-to-copilot-for-members-of-your-organization.md (91%) create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot.md create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot.md create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/index.md rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => managing-github-copilot-features-in-your-organization}/managing-copilot-knowledge-bases.md (97%) rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{managing-policies-and-features-for-copilot-in-your-organization.md => managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization.md} (96%) create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/reviewing-changes-to-content-exclusions-for-github-copilot.md create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide.md create mode 100644 content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/index.md rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => reviewing-github-copilot-activity-in-your-organization}/reviewing-audit-logs-for-copilot-business.md (96%) rename content/copilot/managing-copilot/managing-github-copilot-in-your-organization/{ => reviewing-github-copilot-activity-in-your-organization}/reviewing-usage-data-for-github-copilot-in-your-organization.md (90%) create mode 100644 data/reusables/copilot/content-exclusion-fnmatch-tip.md create mode 100644 data/reusables/copilot/content-exclusion-permissions.md create mode 100644 data/reusables/copilot/content-exclusions-availability-and-beta-note.md create mode 100644 data/reusables/copilot/more-details-content-exclusion-logs.md create mode 100644 data/reusables/copilot/test-content-exclusions-chat.md create mode 100644 data/reusables/copilot/view-last-change-content-exclusions.md diff --git a/content/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot.md b/content/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot.md index 404a1b17e64b..c6c6b72ce8fd 100644 --- a/content/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot.md +++ b/content/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot.md @@ -86,7 +86,7 @@ For {% data variables.product.prodname_copilot %} in {% data variables.product.p A {% data variables.product.prodname_copilot %} seat is a license to use {% data variables.product.prodname_copilot %}, which is granted to a unique user account through either an organization or enterprise's {% data variables.product.prodname_copilot_for_business %} or {% data variables.product.prodname_copilot_enterprise %} subscription. -Seat assignment is managed by owners of organizations{% ifversion ghec %} that have been granted access to {% data variables.product.prodname_copilot %} at the enterprise level{% endif %}. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)." +Seat assignment is managed by owners of organizations{% ifversion ghec %} that have been granted access to {% data variables.product.prodname_copilot %} at the enterprise level{% endif %}. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)." If you are a member of an organization or enterprise with a {% data variables.product.prodname_copilot %} subscription, to use the subscription, you will need to be assigned a seat by an organization owner. diff --git a/content/contributing/style-guide-and-content-model/style-guide.md b/content/contributing/style-guide-and-content-model/style-guide.md index 609c315e447e..d912fa17591f 100644 --- a/content/contributing/style-guide-and-content-model/style-guide.md +++ b/content/contributing/style-guide-and-content-model/style-guide.md @@ -727,7 +727,7 @@ Together, permission statements and product callouts tell readers who can use th Consider what information belongs in a permission statement or a product callout. -For example, when creating permissions and product callouts for the article "[AUTOTITLE](/free-pro-team@latest/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)," the permission statement would answer "What role can manage policies and features for {% data variables.product.prodname_copilot %} in an organization?" And the product callout would answer "What {% data variables.product.prodname_copilot_short %} subscriptions do users need to manage {% data variables.product.prodname_copilot_short %} policies and features for an organization?" +For example, when creating permissions and product callouts for the article "[AUTOTITLE](/free-pro-team@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)," the permission statement would answer "What role can manage policies and features for {% data variables.product.prodname_copilot %} in an organization?" And the product callout would answer "What {% data variables.product.prodname_copilot_short %} subscriptions do users need to manage {% data variables.product.prodname_copilot_short %} policies and features for an organization?" #### Focus on key information, not explanations diff --git a/content/copilot/about-github-copilot.md b/content/copilot/about-github-copilot.md index 74b0abdc959b..53d6855b30ad 100644 --- a/content/copilot/about-github-copilot.md +++ b/content/copilot/about-github-copilot.md @@ -32,7 +32,7 @@ Using the chat feature, you can ask {% data variables.product.prodname_copilot_s * **Pull request summaries** _({% data variables.product.prodname_copilot_enterprise_short %} only)_ - Get {% data variables.product.prodname_copilot_short %} to describe the changes in a pull request. For more information, see {% ifversion ghec %}"[AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-pull-request-summaries/creating-a-pull-request-summary-with-github-copilot)."{% else %}"[AUTOTITLE](/copilot/github-copilot-enterprise/copilot-pull-request-summaries/about-copilot-pull-request-summaries)."{% endif %} -* **Knowledge bases** _({% data variables.product.prodname_copilot_enterprise_short %} only)_ - Create and manage collections of documentation to use as a context for chatting with {% data variables.product.prodname_copilot_short %}. For more information, see {% ifversion ghec %}"[AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases)."{% else %}"[AUTOTITLE](/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases)."{% endif %} +* **Knowledge bases** _({% data variables.product.prodname_copilot_enterprise_short %} only)_ - Create and manage collections of documentation to use as a context for chatting with {% data variables.product.prodname_copilot_short %}. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases)" in the {% data variables.product.prodname_ghe_cloud %} documentation. For a full list of the features and functionality available on each {% data variables.product.prodname_copilot %} plan, see "[AUTOTITLE](/copilot/copilot-individual/github-copilot-individual-feature-set)", "[AUTOTITLE](/copilot/copilot-business/github-copilot-business-feature-set)", or "[AUTOTITLE](/copilot/github-copilot-enterprise/overview/github-copilot-enterprise-feature-set)." diff --git a/content/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide.md b/content/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide.md index 7e56f7a48f58..6e60cd7a212b 100644 --- a/content/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide.md +++ b/content/copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide.md @@ -205,7 +205,7 @@ The skills you can use in {% data variables.product.prodname_copilot_chat_short {% endnote %} -Organization owners can create knowledge bases, grouping together Markdown documentation across one or more repositories. For more information, see "[AUTOTITLE](/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases)." +Organization owners can create knowledge bases, grouping together Markdown documentation across one or more repositories. For more information, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases)." You can tell {% data variables.product.prodname_copilot_short %} to answer a question within the context of a knowledge base. @@ -426,7 +426,6 @@ To share feedback about {% data variables.product.prodname_copilot_chat_short %} * **A compatible JetBrains IDE**. {% data variables.product.prodname_copilot %} is compatible with the following IDEs: {% data reusables.copilot.jetbrains-compatible-ides %} - {% data reusables.copilot.jetbrains-plugin-prerequisites %} {% data reusables.copilot.chat-access-denied %} diff --git a/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md b/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md index d28a62c0844f..1f43d0ce65ed 100644 --- a/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md +++ b/content/copilot/github-copilot-enterprise/overview/enabling-github-copilot-enterprise-features.md @@ -79,7 +79,7 @@ After {% data variables.product.prodname_copilot_enterprise_short %} has been en 1. Create at least one knowledge base. - Knowledge bases bring together Markdown documentation across one or more repositories and make them available through {% data variables.product.prodname_copilot_enterprise_short %}. Once created, organization members can specify a knowledge base as the context for {% data variables.product.prodname_copilot_chat_dotcom_short %} and {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %}. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases)." + Knowledge bases bring together Markdown documentation across one or more repositories and make them available through {% data variables.product.prodname_copilot_enterprise_short %}. Once created, organization members can specify a knowledge base as the context for {% data variables.product.prodname_copilot_chat_dotcom_short %} and {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %}. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases)." ## Further reading diff --git a/content/copilot/github-copilot-in-the-cli/installing-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/installing-github-copilot-in-the-cli.md index baee897b3314..5f60d861aea9 100644 --- a/content/copilot/github-copilot-in-the-cli/installing-github-copilot-in-the-cli.md +++ b/content/copilot/github-copilot-in-the-cli/installing-github-copilot-in-the-cli.md @@ -17,7 +17,7 @@ redirect_from: * **Access to {% data variables.product.prodname_copilot %}**. See "[AUTOTITLE](/copilot/about-github-copilot#getting-access-to-github-copilot)". * **{% data variables.product.prodname_cli %} installed.** {% data reusables.cli.cli-installation %} -If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.product.prodname_copilot_cli_short %} if your organization owner or enterprise administrator has disabled {% data variables.product.prodname_copilot_cli_short %}. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)." +If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.product.prodname_copilot_cli_short %} if your organization owner or enterprise administrator has disabled {% data variables.product.prodname_copilot_cli_short %}. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)." ## Installing {% data variables.product.prodname_copilot_cli_short %} diff --git a/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md b/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md index 31d80554b6e2..28fa4c29ed75 100644 --- a/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md +++ b/content/copilot/github-copilot-in-the-cli/using-github-copilot-in-the-cli.md @@ -15,7 +15,7 @@ shortTitle: Use Copilot in the CLI * **{% data variables.product.prodname_cli %} installed**. {% data reusables.cli.cli-installation %} * **{% data variables.product.prodname_copilot_cli_short %} extension installed**. See "[AUTOTITLE](/copilot/github-copilot-in-the-cli/installing-github-copilot-in-the-cli)." -If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.product.prodname_copilot_cli_short %} if your organization owner or enterprise administrator has disabled {% data variables.product.prodname_copilot_cli_short %}. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)." +If you have access to {% data variables.product.prodname_copilot %} via your organization or enterprise, you cannot use {% data variables.product.prodname_copilot_cli_short %} if your organization owner or enterprise administrator has disabled {% data variables.product.prodname_copilot_cli_short %}. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)." ## Getting command explanations diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot.md deleted file mode 100644 index f3952d7cd740..000000000000 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot.md +++ /dev/null @@ -1,306 +0,0 @@ ---- -title: Configuring content exclusions for GitHub Copilot -shortTitle: Excluding content -intro: 'You can prevent specified files from being used to inform code completion suggestions made by {% data variables.product.prodname_copilot %}. {% data variables.product.prodname_copilot %} will not be available in excluded files.' -product: 'This feature is available for organization and enterprise accounts with a {% data variables.product.prodname_copilot_business_short %} subscription, and for enterprise accounts with a {% data variables.product.prodname_copilot_enterprise_short %} subscription.' -permissions: 'Repository administrators and organization owners can manage the content exclusion settings for {% data variables.product.prodname_copilot %}.

People with the "Maintain" role for a repository can view the content exclusion settings for that repository, but can''t change these settings. For more information, see "[AUTOTITLE](/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization)."' -redirect_from: - - /copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot - - /copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot -layout: inline -topics: - - Copilot -versions: - feature: copilot ---- - -{% note %} - -**Note:** - -{% data reusables.copilot.content-exclusion-note %} - -{% endnote %} - -## About configuring content exclusions - -You may want to prevent certain files from being available to {% data variables.product.prodname_copilot %}. You can configure {% data variables.product.prodname_copilot %} so that it ignores these files. You do this by specifying paths to excluded content in the settings for your repository or organization. - -When you specify content exclusions it has two effects: - -* The content of the affected files will not be used by {% data variables.product.prodname_copilot %} to inform the code completion suggestions it makes in other files. -* {% data variables.product.prodname_copilot %} code completion will not be available in the affected files. - -{% data reusables.copilot.content-exclusions-delay %} For more information, see "[Propagating content exclusion changes to your IDE](#propagating-content-exclusion-changes-to-your-ide)." - -### Limitations - -{% data reusables.copilot.content-exclusion-limitations %} - -### What can you exclude? - -When you specify content exclusion in the settings for a repository, you can only exclude files in that repository. - -When you specify content exclusion in the settings for an organization, you can exclude files in any Git-based repository hosted on {% data variables.product.prodname_dotcom_the_website %} or anywhere that can be accessed using any of the following syntaxes: - -```text -http[s]://host.xz[:port]/path/to/repo.git/ - -git://host.xz[:port]/path/to/repo.git/ - -[user@]host.xz:path/to/repo.git/ - -ssh://[user@]host.xz[:port]/path/to/repo.git/ -``` - -{% note %} - -**Note:** It's important to be aware that content can be excluded by the settings of any {% data variables.product.prodname_dotcom %} organization with a {% data variables.product.prodname_copilot_business_short %}{% ifversion ghec %} or {% data variables.product.prodname_copilot_enterprise_short %}{% endif %} subscription. Excluded files may be in a repository that is not owned by the organization in which the exclusion was defined. The excluded files may also be located in a Git-based repository that is not hosted on {% data variables.product.prodname_dotcom %}. - -{% endnote %} - -### Who is affected by a content exclusion setting? - -{% data reusables.copilot.content-exclusions-scope %} - -{% ifversion fpt %}All exclusions, whether they are defined in repository settings or in organization settings, apply to all members of the organization who have been granted a {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} subscription.{% endif %} - -{% ifversion ghec %} -You can't specify content exclusions in the settings for an enterprise. However, all content exclusions defined in organization or repository settings apply to all members of the enterprise who have been granted a {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} subscription. - -This means, for example, that if you are an admin of an organization that belongs to Enterprise X, you can set up an exclusion for files in any Git-based repositories, hosted on {% data variables.product.prodname_dotcom %} or elsewhere, and the exclusion will apply to anyone who gets their {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} license from any organization in Enterprise X. - -However, it's recommended that, where an exclusion is being defined for a {% data variables.product.prodname_dotcom %} repository, you should define this either in the settings of that repository or in the settings for the organization that owns the repository. This makes it easier to identify the exclusions that are in place for a repository than if you define the exclusions in the settings of another organization in the enterprise. -{% endif %} - -### Data sent to {% data variables.product.prodname_dotcom %} - -After you configure content exclusion, the client (for example, the {% data variables.product.prodname_copilot_short %} extension for {% data variables.product.prodname_vscode_shortname %}) sends the current repository URL to the {% data variables.product.prodname_dotcom %} server so that the server can return the correct policy to the client. URLs sent to the server in this way are not logged anywhere. - -## Configuring content exclusions for your repository - -You can use your repository settings to specify content in your repository that {% data variables.product.prodname_copilot %} should ignore. - -{% data reusables.repositories.navigate-to-repo %} -{% data reusables.repositories.sidebar-settings %} - -1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**. - - If your repository inherits any exclusions from {%ifversion fpt %}its parent organization{% else %} organizations in the same enterprise{% endif %}, you'll see {%ifversion ghec %}one or more{% else %} a{% endif %} gray box{%ifversion ghec %}es{% endif %} at the top of the page containing details of these exclusions. You cannot edit these settings. - - {%ifversion ghec %} - - {% note %} - - **Note**: Exclusions that affect your repository can be defined in the settings of any organization in your {% data variables.product.prodname_dotcom %} enterprise, in addition to those defined in your repository settings. - - {% endnote %} - - {% endif %} - -1. In the box under "Paths to exclude in this repository," enter the paths to files from which {% data variables.product.prodname_copilot_short %} should be excluded. - - ![Screenshot of the "Paths to exclude" text box in the repository settings for {% data variables.product.prodname_copilot_short %}.](/assets/images/help/copilot/paths-to-ignore.png) - - Use the format: `- "/PATH/TO/DIRECTORY/OR/FILE"`, with each path on a separate line. You can add comments by starting a line with `#`. - - You can use fnmatch pattern matching notation to specify file paths. For more information, see "[File](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch)" in the ruby-doc.org documentation. - - {% note %} - - **Note**: Patterns are case insensitive. - - {% endnote %} - -### Example of paths specified in the repository settings - -```yaml annotate -# Ignore the `/src/some-dir/kernel.rs` file in this repository. -- "/src/some-dir/kernel.rs" - -# Ignore files called `secrets.json` anywhere in this repository. -- "secrets.json" - -# Ignore all files whose names begin `secret` anywhere in this repository. -- "secret*" - -# Ignore files whose names end `.cfg` anywhere in this repository. -- "*.cfg" - -# Ignore all files in or below the `/scripts` directory of this repository. -- "/scripts/**" -``` - -## Configuring content exclusions for your organization - -You can use your organization settings to specify content, in any repository, that {% data variables.product.prodname_copilot %} should ignore. - -{% data reusables.profile.access_org %} -{% data reusables.profile.org_settings %} - -1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**. -1. In the box under "Repositories and paths to exclude," enter details of where {% data variables.product.prodname_copilot_short %} should be excluded. - - For each repository in which you want files to be excluded from {% data variables.product.prodname_copilot_short %}, enter a reference to the repository on one line, followed by paths to locations within the repository, with each path on a separate line. Use the following format: - - ```yaml - REPOSITORY-REFERENCE: - - "/PATH/TO/DIRECTORY/OR/FILE" - - "/PATH/TO/DIRECTORY/OR/FILE" - - ... - ``` - - Repositories can be referenced using various protocols. You can use any of the following syntaxes for `REPOSITORY-REFERENCE` and {% data variables.product.prodname_copilot_short %} will match them regardless of how the repository was cloned locally: - - ```text - http[s]://host.xz[:port]/path/to/repo.git/ - - git://host.xz[:port]/path/to/repo.git/ - - [user@]host.xz:path/to/repo.git/ - - ssh://[user@]host.xz[:port]/path/to/repo.git/ - ``` - - {% note %} - - **Notes**: - * The `user@` and `:port` parts of the `REPOSITORY-REFERENCE` are ignored in the calculation of which paths to ignore for a repository. - * Each repository reference can contain a single `*` wildcard. For example, `https://github.com/octo-org/*` matches all repositories in the `octo-org` organization. - * There is additional support for Azure DevOps URLs. For more information, see "[Azure DevOps `REPOSITORY-REFERENCE` support](#azure-devops-repository-reference-support)." - - {% endnote %} - - You can use fnmatch pattern matching notation to specify file paths. For more information, see "[File](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch)" in the ruby-doc.org documentation. - - {% note %} - - **Note**: Patterns are case insensitive. - - {% endnote %} - -### Example of repositories and paths in organization settings - -```yaml annotate -# Ignore all `.env` files at any path, in any repository. -# This setting applies to all repositories, not just to those on GitHub.com. -# This could also have been written on a single line as: -# -# "*": ["**/.env"] -"*": - - "**/.env" - -# In the `octo-repo` repository in this organization: -octo-repo: - # Ignore the `/src/some-dir/kernel.rs` file. - - "/src/some-dir/kernel.rs" - -# In the `primer/react` repository on {% data variables.product.prodname_dotcom %}: -https://github.com/primer/react.git: - # Ignore files called `secrets.json` anywhere in this repository. - - "secrets.json" - # Ignore files called `temp.rb` in or below the `/src` directory. - - "/src/**/temp.rb" - -# In the `copilot` repository of any {% data variables.product.prodname_dotcom %} organization: -git@github.com:*/copilot: - # Ignore any files in or below the `/__tests__` directory. - - "/__tests__/**" - # Ignore any files in the `/scripts` directory. - - "/scripts/*" - -# In the `gitlab-org/gitlab-runner` repository on GitLab: -git@gitlab.com:gitlab-org/gitlab-runner.git: - # Ignore the `/main_test.go` file. - - "/main_test.go" - # Ignore any files with names beginning `server` or `session`, anywhere in this repository. - - "{server,session}*" - # Ignore any files with names ending `.md` or `.mk`, anywhere in this repository. - - "*.m[dk]" - # Ignore files directly within directories such as `packages` or `packaged`, anywhere in this repository. - - "**/package?/*" - # Ignore files in or below any `security` directories, anywhere in this repository. - - "**/security/**" -``` - -## Reviewing changes to the content exclusion settings - -If you are an organization owner, you can check any changes that have been made to content exclusions. - -1. Open the "Content exclusion" page in the settings for your organization ([described here](#configuring-content-exclusions-for-your-organization)), or the settings for a repository ([described here](#configuring-content-exclusions-for-your-repository)). -1. Scroll to the bottom of the page. - - You will see the name of the person who last changed the settings, and information about when they made this change. - -1. Click the time of the last change. - - ![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png) - - {% note %} - - **Note**: The time of the last change is only a link if you are an organization owner. - - {% endnote %} - - The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action. - - If you clicked through from a repository settings page, the audit log is filtered to show only changes to content exclusions for that repository. - -1. Click the ellipsis (...) at the end of each entry to see more details. - - If the "excluded_paths" entry is truncated, hover over the truncated value to show the full entry. This displays the content of the exclusion settings after the change was saved. - - ![Screenshot of audit log details for the 'copilot.content_exclusion_changed' action. The ellipsis button is highlighted.](/assets/images/help/copilot/copilot-audit-log.png) - -## Checking the effect of a settings change - -When you change {% data variables.product.prodname_copilot_short %}'s content exclusions you can check that the setting blocks {% data variables.product.prodname_copilot_short %} from suggesting code in the specified files. - -To confirm that {% data variables.product.prodname_copilot_short %} is disabled for a file, open the file in the editor and start typing a line of code, such as a comment. Normally, you would see a code completion suggestion from {% data variables.product.prodname_copilot_short %} as you type. If {% data variables.product.prodname_copilot_short %} is disabled by a content exclusion, code completion suggestions will not be offered, and the file's contents will not be used to generate suggestions in other files. - -### Checking settings changes in your IDE - -If you are working in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, or a supported JetBrains IDE, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion. - -1. Open a file that you expect to be affected by your content exclusions. - - If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it. - -1. Hover over this icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file. - - ![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png) - -{% note %} - -**Note**: In {% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode_shortname %} you can display the log for the {% data variables.product.prodname_copilot_short %} extension to see details of content exclusions without having to hover over the {% data variables.product.prodname_copilot_short %} icon. For more information, see "[AUTOTITLE](/copilot/troubleshooting-github-copilot/viewing-logs-for-github-copilot-in-your-environment?tool=vscode)." - -{% endnote %} - -### Propagating content exclusion changes to your IDE - -If you are working in Neovim, content exclusions are fetched from {% data variables.product.prodname_dotcom %} each time you open a file. However, if you are working in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, or a supported JetBrains IDE, you may have to wait up to 30 minutes to see the effect of a settings change. Alternatively, you can manually reload the content exclusion settings into your IDE. - -To reload content exclusions into {% data variables.product.prodname_vs %}, close and reopen the application. - -To reload content exclusions into {% data variables.product.prodname_vscode_shortname %}: - -1. Access the Command Palette. For example, by pressing Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux). -1. Type: `reload`. -1. Select **Developer: Reload Window**. - -To reload content exclusions into your JetBrains IDE, either close and reopen the application, or log out of {% data variables.product.prodname_dotcom %} and then log back in, as follows. - -1. Click the {% data variables.product.prodname_copilot_short %} icon in the status bar and select **Logout from {% data variables.product.prodname_dotcom %}**. -1. The {% data variables.product.prodname_copilot_short %} icon in the status bar will now have a diagonal line through it. Click it and select **Login to {% data variables.product.prodname_dotcom %}**. -1. The "Sign in to {% data variables.product.prodname_dotcom %}" message is displayed showing a device code. Click **Copy and Open**. -1. On the "Device Activation" page, paste in the device code and click **Continue**. -1. On the next page, click **Authorize {% data variables.product.prodname_copilot %} Plugin**. - -### Azure DevOps `REPOSITORY-REFERENCE` support - -Both the new (dev.azure.com) and old (visualstudio.com) formats for Azure DevOps are treated as equivalent in the `REPOSITORY-REFERENCE` syntax. You can use either host when specifying `REPOSITORY-REFERENCE`, and {% data variables.product.prodname_copilot_short %} will match them regardless of which host was used to clone the repository locally. - -## Further reading - -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business)" -* "[AUTOTITLE](/enterprise-cloud@latest/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot#github-copilot-content-exclusions-are-not-being-applied)" diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/index.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/index.md index b79afdd3b273..535b17e6af8c 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/index.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/index.md @@ -1,7 +1,7 @@ --- title: Managing GitHub Copilot in your organization shortTitle: Manage for organization -intro: "Organization owners can grant and revoke access to {% data variables.product.prodname_copilot %}, manage {% data variables.product.prodname_copilot_short %} related policies and features, as well as reviewing audit logs and usage data." +intro: 'Organization owners can subscribe to {% data variables.product.prodname_copilot_short %}, manage {% data variables.product.prodname_copilot_short %} for their organization, and control {% data variables.product.prodname_copilot_short %} policies.' versions: feature: copilot redirect_from: @@ -11,14 +11,8 @@ topics: - Copilot children: - /subscribing-to-copilot-for-your-organization - - /granting-access-to-copilot-for-members-of-your-organization - - /managing-copilot-knowledge-bases - - /managing-requests-for-copilot-access-in-your-organization - - /revoking-access-to-copilot-for-members-of-your-organization - - /reviewing-usage-data-for-github-copilot-in-your-organization - - /managing-policies-and-features-for-copilot-in-your-organization - - /configuring-content-exclusions-for-github-copilot - - /reviewing-audit-logs-for-copilot-business + - /managing-access-to-github-copilot-in-your-organization + - /managing-github-copilot-features-in-your-organization + - /reviewing-github-copilot-activity-in-your-organization - /canceling-copilot-for-your-organization --- - diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md similarity index 91% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md index 05d3599e0058..ba705c3cfe84 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization.md @@ -11,6 +11,7 @@ redirect_from: - /copilot/managing-copilot-for-business/managing-access-for-copilot-for-business-in-your-organization - /copilot/managing-copilot-business/managing-access-for-copilot-business-in-your-organization - /copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization topics: - Copilot --- @@ -86,6 +87,6 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to grant acc ## Further reading * [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center) -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)" -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)" -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)" +* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)" +* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)" +* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)" diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/index.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/index.md new file mode 100644 index 000000000000..c64cd7db1000 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/index.md @@ -0,0 +1,13 @@ +--- +title: Managing access to GitHub Copilot in your organization +shortTitle: Manage access +intro: 'Organization owners can grant and revoke {% data variables.product.prodname_copilot_short %} access for members of their organization.' +versions: + feature: copilot +topics: + - Copilot +children: + - /granting-access-to-copilot-for-members-of-your-organization + - /managing-requests-for-copilot-access-in-your-organization + - /revoking-access-to-copilot-for-members-of-your-organization +--- diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md similarity index 89% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md index 136f4bf9526a..616f8dff6297 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization.md @@ -6,6 +6,8 @@ permissions: Organization owners product: '{% data variables.product.prodname_copilot_business_short %}' versions: feature: copilot +redirect_from: + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-requests-for-copilot-access-in-your-organization topics: - Copilot --- diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md similarity index 91% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md index d5c130845f9e..1bda7a076ae0 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization.md @@ -9,6 +9,7 @@ topics: - Copilot redirect_from: - /copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization --- ## How revoking access affects billing @@ -45,4 +46,4 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to revoke ac * [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center) * "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)." -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)" +* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization)" diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot.md new file mode 100644 index 000000000000..00a3d3b675a2 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot.md @@ -0,0 +1,80 @@ +--- +title: About content exclusions for GitHub Copilot +intro: 'Learn how content exclusions for {% data variables.product.prodname_copilot %} work.' +permissions: '{% data reusables.copilot.content-exclusion-permissions %}' +product: '{% data reusables.gated-features.copilot-business-and-enterprise %}' +versions: + feature: copilot +redirect_from: + - /copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot + - /copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot +topics: + - Copilot +shortTitle: About content exclusions +--- + +{% data reusables.copilot.content-exclusion-note %} + +You can configure {% data variables.product.prodname_copilot %} to **ignore certain files by excluding specific paths to content** in the settings for your repository or organization. + +When you specify content exclusions, there are up to three effects depending on the level of support for your IDE: + +* Code completion will not be available in the affected files. +* The content in affected files will not inform code completion suggestions in other files. +* The content in affected files will not inform {% data variables.product.prodname_copilot_chat %}'s responses. + +{% data reusables.copilot.content-exclusions-delay %} See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide)." + +## Availability of content exclusions + +| Tool | Code completion support | {% data variables.product.prodname_copilot_chat_short %} support | +|--------|:--------:|:--------:| +| {% data variables.product.prodname_vs %} | {% octicon "check" aria-label="Supported" %} | {% octicon "x" aria-label="Not supported" %} | +| {% data variables.product.prodname_vscode %} | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | +| JetBrains IDEs | {% octicon "check" aria-label="Supported" %} | {% octicon "check" aria-label="Supported" %} | +| Vim/Neovim | {% octicon "check" aria-label="Supported" %} | Not applicable | +| Azure Data Studio | {% octicon "x" aria-label="Not supported" %} | Not applicable | +| {% data variables.product.prodname_dotcom_the_website %} | Not applicable | {% octicon "x" aria-label="Not supported" %} | + +## Limitations of content exclusions + +{% data reusables.copilot.content-exclusion-limitations %} + +## What can you exclude? + +When you specify content exclusion in the settings for a repository, you can only exclude files in that repository. + +When you specify content exclusion in the settings for an organization, you can exclude files in any Git-based repository hosted on {% data variables.product.prodname_dotcom_the_website %}, or anywhere that can be accessed using any of the following syntaxes: + +```text +http[s]://host.xz[:port]/path/to/repo.git/ + +git://host.xz[:port]/path/to/repo.git/ + +[user@]host.xz:path/to/repo.git/ + +ssh://[user@]host.xz[:port]/path/to/repo.git/ +``` + +## Who is affected by a content exclusion setting? + +{% data reusables.copilot.content-exclusions-scope %} + +{% ifversion fpt %}All exclusions, whether they are defined in repository settings or in organization settings, apply to all members of the organization who have been granted a {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} subscription.{% endif %} + +{% ifversion ghec %} +You can't specify content exclusions in the settings for an enterprise. However, all content exclusions defined in organization or repository settings apply to all members of the enterprise who have been granted a {% data variables.product.prodname_copilot_short %} seat as part of a {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} subscription. + +This means, for example, that if you are an admin of an organization that belongs to Enterprise X, you can set up an exclusion for files in any Git-based repositories, hosted on {% data variables.product.prodname_dotcom %} or elsewhere, and the exclusion will apply to anyone who gets their {% data variables.product.prodname_copilot_business_short %} or {% data variables.product.prodname_copilot_enterprise_short %} license from any organization in Enterprise X. + +> [!TIP] To more easily track content exclusions, create exclusions in the settings of the repository containing the affected files, or in the settings of the organization that owns the repository. +{% endif %} + +## Data sent to {% data variables.product.prodname_dotcom %} + +After you configure content exclusion, the client (for example, the {% data variables.product.prodname_copilot_short %} extension for {% data variables.product.prodname_vscode_shortname %}) sends the current repository URL to the {% data variables.product.prodname_dotcom %} server so that the server can return the correct policy to the client. These URLs are not logged anywhere. + +## Next steps + +To set up content exclusions in your repository or organization, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot)." diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot.md new file mode 100644 index 000000000000..56e0d52c7dd7 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/configuring-content-exclusions-for-github-copilot.md @@ -0,0 +1,136 @@ +--- +title: Configuring content exclusions for GitHub Copilot +intro: 'You can prevent {% data variables.product.prodname_copilot %} from accessing certain content.' +permissions: '{% data reusables.copilot.content-exclusion-permissions %}' +product: '{% data reusables.gated-features.copilot-business-and-enterprise %}' +layout: inline +versions: + feature: copilot +topics: + - Copilot +shortTitle: Configure content exclusions +--- + +{% data reusables.copilot.content-exclusions-availability-and-beta-note %} + +## Configuring content exclusions for your repository + +You can use your repository settings to specify content in your repository that {% data variables.product.prodname_copilot %} should ignore. + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-settings %} + +1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**. + + If your repository inherits any exclusions from {%ifversion fpt %}its parent organization{% else %} organizations in the same enterprise{% endif %}, you'll see {%ifversion ghec %}one or more{% else %} a{% endif %} gray box{%ifversion ghec %}es{% endif %} at the top of the page containing details of these exclusions. You cannot edit these settings. + +1. In the box following "Paths to exclude in this repository," enter the paths to files from which {% data variables.product.prodname_copilot_short %} should be excluded. + + Use the format: `- "/PATH/TO/DIRECTORY/OR/FILE"`, with each path on a separate line. You can add comments by starting a line with `#`. + + > [!TIP] {% data reusables.copilot.content-exclusion-fnmatch-tip %} + +### Example of paths specified in the repository settings + +```yaml annotate +# Ignore the `/src/some-dir/kernel.rs` file in this repository. +- "/src/some-dir/kernel.rs" + +# Ignore files called `secrets.json` anywhere in this repository. +- "secrets.json" + +# Ignore all files whose names begin with `secret` anywhere in this repository. +- "secret*" + +# Ignore files whose names end with `.cfg` anywhere in this repository. +- "*.cfg" + +# Ignore all files in or below the `/scripts` directory of this repository. +- "/scripts/**" +``` + +## Configuring content exclusions for your organization + +You can use your organization settings to specify content in any Git repository that {% data variables.product.prodname_copilot %} should ignore. + +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} + +1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**. +1. In the box following "Repositories and paths to exclude," enter details of where {% data variables.product.prodname_copilot_short %} should be excluded. + + For each repository in which you want files to be excluded from {% data variables.product.prodname_copilot_short %}, enter a reference to the repository on one line, followed by paths to locations within the repository, with each path on a separate line. Use the following format: + + ```yaml + REPOSITORY-REFERENCE: + - "/PATH/TO/DIRECTORY/OR/FILE" + - "/PATH/TO/DIRECTORY/OR/FILE" + - ... + ``` + + Repositories can be referenced using various protocols. You can use any of the following syntaxes for `REPOSITORY-REFERENCE` and {% data variables.product.prodname_copilot_short %} will match them regardless of how the repository was cloned locally: + + ```text + http[s]://host.xz[:port]/path/to/repo.git/ + + git://host.xz[:port]/path/to/repo.git/ + + [user@]host.xz:path/to/repo.git/ + + ssh://[user@]host.xz[:port]/path/to/repo.git/ + ``` + +### Formatting tips for `REPOSITORY-REFERENCE` + +* {% data reusables.copilot.content-exclusion-fnmatch-tip %} +* The `user@` and `:port` parts of the `REPOSITORY-REFERENCE` are ignored in the calculation of which paths to ignore for a repository. +* Each repository reference can contain a single `*` wildcard. For example, `https://github.com/octo-org/*` matches all repositories in the `octo-org` organization. +* For Azure DevOps, you can use the new (dev.azure.com) or old (visualstudio.com) host format when specifying `REPOSITORY-REFERENCE`, and {% data variables.product.prodname_copilot_short %} will match them regardless of which host was used to clone the repository locally. + +### Example of repositories and paths in organization settings + +```yaml annotate +# Ignore all `.env` files at any path, in any repository. +# This setting applies to all repositories, not just to those on GitHub.com. +# This could also have been written on a single line as: +# +# "*": ["**/.env"] +"*": + - "**/.env" + +# In the `octo-repo` repository in this organization: +octo-repo: + # Ignore the `/src/some-dir/kernel.rs` file. + - "/src/some-dir/kernel.rs" + +# In the `primer/react` repository on {% data variables.product.prodname_dotcom %}: +https://github.com/primer/react.git: + # Ignore files called `secrets.json` anywhere in this repository. + - "secrets.json" + # Ignore files called `temp.rb` in or below the `/src` directory. + - "/src/**/temp.rb" + +# In the `copilot` repository of any {% data variables.product.prodname_dotcom %} organization: +git@github.com:*/copilot: + # Ignore any files in or below the `/__tests__` directory. + - "/__tests__/**" + # Ignore any files in the `/scripts` directory. + - "/scripts/*" + +# In the `gitlab-org/gitlab-runner` repository on GitLab: +git@gitlab.com:gitlab-org/gitlab-runner.git: + # Ignore the `/main_test.go` file. + - "/main_test.go" + # Ignore any files with names beginning with `server` or `session` anywhere in this repository. + - "{server,session}*" + # Ignore any files with names ending with `.md` or `.mk` anywhere in this repository. + - "*.m[dk]" + # Ignore files directly within directories such as `packages` or `packaged` anywhere in this repository. + - "**/package?/*" + # Ignore files in or below any `security` directories, anywhere in this repository. + - "**/security/**" +``` + +## Next steps + +To test your changes, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide)." diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/index.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/index.md new file mode 100644 index 000000000000..67e77186e836 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/index.md @@ -0,0 +1,16 @@ +--- +title: Managing GitHub Copilot features in your organization +shortTitle: Manage features +intro: 'Configure the function and availability of {% data variables.product.prodname_copilot %} features in your organization.' +versions: + feature: copilot +topics: + - Copilot +children: + - /managing-policies-for-copilot-in-your-organization + - /managing-copilot-knowledge-bases + - /about-content-exclusions-for-github-copilot + - /configuring-content-exclusions-for-github-copilot + - /testing-changes-to-content-exclusions-in-your-ide + - /reviewing-changes-to-content-exclusions-for-github-copilot +--- diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases.md similarity index 97% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases.md index a6528bb5a257..5f346f109066 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases.md @@ -12,6 +12,7 @@ redirect_from: - /copilot/github-copilot-enterprise/copilot-chat-in-github/managing-copilot-knowledge-bases - /copilot/github-copilot-chat/copilot-chat-in-github/managing-copilot-knowledge-bases - /copilot/github-copilot-enterprise/managing-copilot-knowledge-bases + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-copilot-knowledge-bases --- {% ifversion fpt %} diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization.md similarity index 96% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization.md index 36ff82d733f7..98bfcbd36014 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization.md @@ -1,5 +1,5 @@ --- -title: Managing policies and features for Copilot in your organization +title: Managing policies for Copilot in your organization intro: 'Learn how to manage policies for {% data variables.product.prodname_copilot %} in your organization.' permissions: Organization owners product: '{% data reusables.gated-features.copilot-business-and-enterprise %}' @@ -10,6 +10,7 @@ redirect_from: - /copilot/managing-copilot-for-business/managing-policies-for-copilot-for-business-in-your-organization - /copilot/managing-copilot-business/managing-policies-for-copilot-business-in-your-organization - /copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization topics: - Copilot shortTitle: Managing policies diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/reviewing-changes-to-content-exclusions-for-github-copilot.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/reviewing-changes-to-content-exclusions-for-github-copilot.md new file mode 100644 index 000000000000..ff4d08c536a6 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/reviewing-changes-to-content-exclusions-for-github-copilot.md @@ -0,0 +1,42 @@ +--- +title: Reviewing changes to content exclusions for GitHub Copilot +intro: 'You can monitor changes to content exclusions in your repositories and organizations.' +permissions: 'Organization owners' +product: '{% data reusables.gated-features.copilot-business-and-enterprise %}' +versions: + feature: copilot +topics: + - Copilot +shortTitle: Review content exclusion changes +--- + +{% data reusables.copilot.content-exclusions-availability-and-beta-note %} + +## Reviewing changes in your repository + +{% data reusables.repositories.navigate-to-repo %} +{% data reusables.repositories.sidebar-settings %} + +1. In the "Code & automation" section of the side bar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}**. +{% data reusables.copilot.view-last-change-content-exclusions %} +1. Click the time of the last change. + + ![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png) + + The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action in the repository. +{% data reusables.copilot.more-details-content-exclusion-logs %} + +## Reviewing changes in your organization + +{% data reusables.profile.access_org %} +{% data reusables.profile.org_settings %} + +1. In the left sidebar, click **{% octicon "copilot" aria-hidden="true" %} {% data variables.product.prodname_copilot_short %}** then click **Content exclusion**. +{% data reusables.copilot.view-last-change-content-exclusions %} +1. Click the time of the last change. + + ![Screenshot of the last edited information. The time of change link is highlighted with a dark orange outline.](/assets/images/help/copilot/content-exclusions-last-edited-by.png) + + The "Audit log" page for the organization is displayed, showing the most recently logged occurrences of the `copilot.content_exclusion_changed` action. + +{% data reusables.copilot.more-details-content-exclusion-logs %} diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide.md new file mode 100644 index 000000000000..584546213edc --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide.md @@ -0,0 +1,102 @@ +--- +title: Testing changes to content exclusions in your IDE +intro: 'You can confirm your changes to content exclusions work as expected using your IDE.' +permissions: '{% data reusables.copilot.content-exclusion-permissions %}' +product: '{% data reusables.gated-features.copilot-business-and-enterprise %}' +versions: + feature: copilot +topics: + - Copilot +shortTitle: Test content exclusions +--- + +{% data reusables.copilot.content-exclusions-availability-and-beta-note %} + +{% vscode %} + +## Propagating content exclusion changes to {% data variables.product.prodname_vscode %} + +In {% data variables.product.prodname_vscode_shortname %}, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload content exclusion settings as follows: + +1. Access the Command Palette. For example, by pressing Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux). +1. Type: `reload`. +1. Select **Developer: Reload Window**. + +## Testing changes to content exclusions in {% data variables.product.prodname_vscode %} + +After content exclusion changes propagate to {% data variables.product.prodname_vscode_shortname %}, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion. + +1. Open a file that you expect to be affected by your content exclusions. + + If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it. + +1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file. + + ![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png) + +1. Optionally, you can also test content exclusions in {% data variables.product.prodname_copilot_chat_short %}. Open the {% data variables.product.prodname_copilot_chat_short %} window by clicking the {% data variables.product.prodname_copilot_chat_short %} icon in the activity bar. + + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/vsc-copilot-chat-icon.png) + +{% data reusables.copilot.test-content-exclusions-chat %} + +{% endvscode %} + +{% visualstudio %} + +## Propagating content exclusion changes to {% data variables.product.prodname_vs %} + +In {% data variables.product.prodname_vs %}, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload the content exclusion settings by closing and reopening the application. + +## Testing changes to content exclusions in {% data variables.product.prodname_vs %} + +In {% data variables.product.prodname_vs %}, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion. + +1. Open a file that you expect to be affected by your content exclusions. + + If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it. + +1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file. + + ![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png) + +{% endvisualstudio %} + +{% jetbrains %} + +## Propagating content exclusion changes to JetBrains IDEs + +In supported JetBrains IDEs, you can wait up to 30 minutes to see the effect of a settings change, or you can manually reload the content exclusion settings by closing and reopening the application. + +## Testing changes to content exclusions in JetBrains IDEs + +In supported JetBrains IDEs, the {% data variables.product.prodname_copilot_short %} icon indicates when {% data variables.product.prodname_copilot_short %} has been disabled by a content exclusion. + +1. Open a file that you expect to be affected by your content exclusions. + + If a {% data variables.product.prodname_copilot_short %} content exclusion applies to this file, the {% data variables.product.prodname_copilot_short %} icon in the status bar has a diagonal line through it. + +1. Hover over the {% data variables.product.prodname_copilot_short %} icon. A popup message tells you whether an organization or the parent repository disabled {% data variables.product.prodname_copilot_short %} for this file. + + ![Screenshot of the {% data variables.product.prodname_copilot_short %} disabled popup in the {% data variables.product.prodname_vscode_shortname %} toolbar.](/assets/images/help/copilot/copilot-disabled-for-repo.png) + +1. Optionally, you can also test content exclusions in {% data variables.product.prodname_copilot_chat_short %}. Open the {% data variables.product.prodname_copilot_chat_short %} window by clicking the **{% data variables.product.prodname_copilot_chat_short %}** icon at the right side of the JetBrains IDE window. + + ![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} icon in the Activity Bar.](/assets/images/help/copilot/jetbrains-copilot-chat-icon.png) + +{% data reusables.copilot.test-content-exclusions-chat %} + +{% endjetbrains %} + +{% vimneovim %} + +## Propagating content exclusion changes to Vim/Neovim + +If you are working in Vim/Neovim, content exclusions are automatically fetched from {% data variables.product.prodname_dotcom %} each time you open a file. + +## Testing changes to content exclusions in Vim/Neovim + +1. Open a file that you expect to be affected by your content exclusions. +1. Begin typing. If {% data variables.product.prodname_copilot %} no longer provides inline suggestions as you type, the file is excluded. + +{% endvimneovim %} diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/index.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/index.md new file mode 100644 index 000000000000..e9ce9e5257a7 --- /dev/null +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/index.md @@ -0,0 +1,12 @@ +--- +title: Reviewing GitHub Copilot activity in your organization +shortTitle: Review activity +intro: 'Understand how members of your organization use {% data variables.product.prodname_copilot %}.' +versions: + feature: copilot +topics: + - Copilot +children: + - /reviewing-usage-data-for-github-copilot-in-your-organization + - /reviewing-audit-logs-for-copilot-business +--- diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-audit-logs-for-copilot-business.md similarity index 96% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-audit-logs-for-copilot-business.md index 40ace6e580b8..8efc52ad3778 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-audit-logs-for-copilot-business.md @@ -7,6 +7,7 @@ redirect_from: - /copilot/managing-copilot-business/reviewing-your-organization-or-enterprises-audit-logs-for-copilot-business - /copilot/managing-github-copilot-in-your-organization/reviewing-your-organization-or-enterprises-audit-logs-for-copilot-business - /copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business versions: feature: copilot product: '{% data reusables.gated-features.copilot-audit-logs %}' diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md similarity index 90% rename from content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md rename to content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md index 4a485d3b4b3e..8665942c1eef 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization.md @@ -9,6 +9,7 @@ topics: - Copilot redirect_from: - /copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization + - /copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-usage-data-for-github-copilot-in-your-organization - /billing/managing-billing-for-github-copilot/viewing-your-github-copilot-usage --- @@ -41,4 +42,4 @@ You can use {% data variables.product.prodname_dotcom %}'s REST API to get detai * "[AUTOTITLE](/copilot/managing-copilot/managing-copilot-for-your-enterprise/viewing-copilot-usage-for-your-enterprise)"{% endif %} * [{% data variables.product.prodname_copilot %} Trust Center](https://resources.github.com/copilot-trust-center) * "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/granting-access-to-copilot-for-members-of-your-organization)." -* "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)" +* "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/revoking-access-to-copilot-for-members-of-your-organization)" diff --git a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/subscribing-to-copilot-for-your-organization.md b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/subscribing-to-copilot-for-your-organization.md index 6d9016d5ca29..e5fe55c5fb9c 100644 --- a/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/subscribing-to-copilot-for-your-organization.md +++ b/content/copilot/managing-copilot/managing-github-copilot-in-your-organization/subscribing-to-copilot-for-your-organization.md @@ -20,6 +20,6 @@ redirect_from: ## Next steps -* Configure policies for {% data variables.product.prodname_copilot_short %} in your organization. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-policies-and-features-for-copilot-in-your-organization)." +* Configure policies for {% data variables.product.prodname_copilot_short %} in your organization. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-policies-for-copilot-in-your-organization)." * Grant {% data variables.product.prodname_copilot_short %} access to some or all members of the organization. See "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/managing-access-for-copilot-business-in-your-organization)." * For billing information, see "[AUTOTITLE](/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot#about-billing-for-github-copilot-business-and-github-copilot-enterprise)" and "[AUTOTITLE](/billing/managing-your-github-billing-settings)." diff --git a/content/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot.md b/content/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot.md index bb556f8b2165..ff5f865ecb11 100644 --- a/content/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot.md +++ b/content/copilot/troubleshooting-github-copilot/troubleshooting-common-issues-with-github-copilot.md @@ -31,15 +31,16 @@ When a file is affected by a content exclusion setting, {% data variables.produc ## {% data variables.product.prodname_copilot %} content exclusions are not being applied +{% data reusables.copilot.content-exclusion-note %} + {% data reusables.copilot.content-exclusions-scope %} -{% data reusables.copilot.content-exclusions-delay %} For more information, see "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot#propagating-content-exclusion-changes-to-your-ide)." +{% data reusables.copilot.content-exclusions-delay %} For more information, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/testing-changes-to-content-exclusions-in-your-ide#propagating-content-exclusion-changes-to-your-ide)." {% note %} **Notes:** -{% data reusables.copilot.content-exclusion-note %} {% data reusables.copilot.content-exclusion-limitations %} {% endnote %} diff --git a/content/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization.md b/content/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization.md index b5c38a4d3279..ded8d9cfe0ce 100644 --- a/content/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization.md +++ b/content/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization.md @@ -119,7 +119,7 @@ Some of the features listed below are limited to organizations using {% data var | Configure [pull request merges](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges) | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | | Configure [a publishing source for {% data variables.product.prodname_pages %}](/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | | {% ifversion copilot %} | -| View [content exclusion settings](/copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot) for {% data variables.product.prodname_copilot %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | +| View [content exclusion settings](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot) for {% data variables.product.prodname_copilot %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | {% octicon "check" aria-label="Yes" %} | | {% endif %} | | Manage [branch protection rules](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule){% ifversion repo-rules %} and [repository rulesets](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets){% endif %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "x" aria-label="No" %} | {% octicon "check" aria-label="Yes" %} | | {% ifversion repo-rules %} | diff --git a/data/reusables/copilot/content-exclusion-fnmatch-tip.md b/data/reusables/copilot/content-exclusion-fnmatch-tip.md new file mode 100644 index 000000000000..16deb3797691 --- /dev/null +++ b/data/reusables/copilot/content-exclusion-fnmatch-tip.md @@ -0,0 +1 @@ +You can use fnmatch pattern matching notation to specify file paths. Patterns are case insensitive. See "[File](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch)" in the ruby-doc.org documentation. diff --git a/data/reusables/copilot/content-exclusion-limitations.md b/data/reusables/copilot/content-exclusion-limitations.md index 168b73a5e35b..ac59bac33bca 100644 --- a/data/reusables/copilot/content-exclusion-limitations.md +++ b/data/reusables/copilot/content-exclusion-limitations.md @@ -1,3 +1,2 @@ -* With the exception of {% data variables.product.prodname_vscode %}, content exclusion is currently not supported for {% data variables.product.prodname_copilot_chat %}. -* Content exclusion is not applied, in {% data variables.product.prodname_copilot_chat %} in {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vs %}, when you use the `@github` {% data variables.product.prodname_copilot_short %} chat participant in your question. +* In {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode %}, content exclusions are not applied when you use the `@github` chat participant in your question. * It's possible that {% data variables.product.prodname_copilot_short %} may use semantic information from an excluded file if the information is provided by the IDE in a non-excluded file. Examples of such content include type information and hover-over definitions for symbols used in code. diff --git a/data/reusables/copilot/content-exclusion-note.md b/data/reusables/copilot/content-exclusion-note.md index c0bb1457c601..15cc76619e98 100644 --- a/data/reusables/copilot/content-exclusion-note.md +++ b/data/reusables/copilot/content-exclusion-note.md @@ -1,2 +1 @@ -* Excluding content from {% data variables.product.prodname_copilot %} is currently in public beta and is subject to change. -* This feature is supported for {% data variables.product.prodname_copilot %} code completion in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode %}, JetBrains IDEs, and neovim. It is also supported for {% data variables.product.prodname_copilot_chat %} in {% data variables.product.prodname_vscode_shortname %}. For details of supported JetBrains IDEs, see "[AUTOTITLE](/copilot/getting-started-with-github-copilot?tool=jetbrains#prerequisites)." +> [!NOTE] Excluding content from {% data variables.product.prodname_copilot %} is currently in public beta and is subject to change. diff --git a/data/reusables/copilot/content-exclusion-permissions.md b/data/reusables/copilot/content-exclusion-permissions.md new file mode 100644 index 000000000000..3878844cfb1e --- /dev/null +++ b/data/reusables/copilot/content-exclusion-permissions.md @@ -0,0 +1,3 @@ +Repository administrators and organization owners can manage content exclusion settings. + +People with the "Maintain" role for a repository can view, but not edit, content exclusion settings for that repository. diff --git a/data/reusables/copilot/content-exclusion-tooltip.md b/data/reusables/copilot/content-exclusion-tooltip.md index 3a23a6aa12d5..b977ee8fc75e 100644 --- a/data/reusables/copilot/content-exclusion-tooltip.md +++ b/data/reusables/copilot/content-exclusion-tooltip.md @@ -2,4 +2,4 @@ If a file has been configured as excluded content for {% data variables.product. ![Screenshot of the {% data variables.product.prodname_copilot_short %} icon in {% data variables.product.prodname_vscode_shortname %} with a tooltip for a content exclusion.](/assets/images/help/copilot/copilot-disabled-for-repo.png) -For more information, see "[AUTOTITLE](/copilot/managing-copilot-business/configuring-content-exclusions-for-github-copilot)." +For more information, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot)." diff --git a/data/reusables/copilot/content-exclusions-availability-and-beta-note.md b/data/reusables/copilot/content-exclusions-availability-and-beta-note.md new file mode 100644 index 000000000000..04833f747455 --- /dev/null +++ b/data/reusables/copilot/content-exclusions-availability-and-beta-note.md @@ -0,0 +1,3 @@ +> [!NOTE] +> * Excluding content from {% data variables.product.prodname_copilot %} is currently in public beta and is subject to change. +> * Content exclusions are currently supported in select IDEs. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot#availability-of-content-exclusions)." diff --git a/data/reusables/copilot/content-exclusions-delay.md b/data/reusables/copilot/content-exclusions-delay.md index f459f8dee6ba..6a74d032910f 100644 --- a/data/reusables/copilot/content-exclusions-delay.md +++ b/data/reusables/copilot/content-exclusions-delay.md @@ -1 +1 @@ -After you add or change content exclusions it can take up to 30 minutes for this to take effect in IDEs where the settings are already loaded. You can apply changes to your own IDE forcing it to reload the content exclusion settings. +After you add or change content exclusions, it can take up to 30 minutes to take effect in IDEs where the settings are already loaded. You can apply changes to your own IDE, forcing it to reload the content exclusion settings. diff --git a/data/reusables/copilot/content-exclusions-scope.md b/data/reusables/copilot/content-exclusions-scope.md index 22d0102e2a80..6c4c269d0b95 100644 --- a/data/reusables/copilot/content-exclusions-scope.md +++ b/data/reusables/copilot/content-exclusions-scope.md @@ -1,3 +1,5 @@ -{% data variables.product.prodname_copilot %} content exclusion settings do not apply to everyone who uses {% data variables.product.prodname_copilot_short %}. +A content exclusion setting **only applies to people who meet each of the following criteria**: +* They have been granted a seat as part of a {% data variables.product.prodname_copilot_for_business %} or {% data variables.product.prodname_copilot_enterprise %} subscription +* They are members of the same {% ifversion fpt %}organization{% else %}enterprise{% endif %} in which the content exclusion is configured -A content exclusion setting only applies to people who have been granted a seat as part of a {% data variables.product.prodname_copilot_for_business %} or {% data variables.product.prodname_copilot_enterprise %} subscription and are members of the same {% ifversion fpt %}organization{% else %}enterprise{% endif %} in which the content exclusion is configured. Other users who can access the specified files will not be affected by the content exclusion and will still see code completion suggestions. +Anyone else who can access the specified files will still see code completion suggestions and {% data variables.product.prodname_copilot_chat %} responses referencing the specified files. diff --git a/data/reusables/copilot/copilot-business-features.md b/data/reusables/copilot/copilot-business-features.md index 38b8b280d565..0d4fd7f4c639 100644 --- a/data/reusables/copilot/copilot-business-features.md +++ b/data/reusables/copilot/copilot-business-features.md @@ -4,7 +4,7 @@ These features are available to organization owners and administrators to manage ### Content exclusion -Content exclusions allow you to configure {% data variables.product.prodname_copilot %} to ignore certain files in your repository. This can be useful if you have files that you don't want to be available to {% data variables.product.prodname_copilot %}. For more information, see "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot)." +Content exclusions allow you to configure {% data variables.product.prodname_copilot %} to ignore certain files in your repository. This can be useful if you have files that you don't want to be available to {% data variables.product.prodname_copilot %}. See "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/about-content-exclusions-for-github-copilot)." ### Managing access to {% data variables.product.prodname_copilot %} @@ -16,4 +16,4 @@ Organization owners can manage policies for {% data variables.product.prodname_c ### Audit logs -Organization owners can review audit logs for {% data variables.product.prodname_copilot %} in their organization, to understand what actions have been taken and by which users. For more information, see "[AUTOTITLE](/copilot/managing-github-copilot-in-your-organization/reviewing-audit-logs-for-copilot-business)." +Organization owners can review audit logs for {% data variables.product.prodname_copilot %} in their organization, to understand what actions have been taken and by which users. For more information, see "[AUTOTITLE](/copilot/managing-copilot/managing-github-copilot-in-your-organization/reviewing-github-copilot-activity-in-your-organization/reviewing-audit-logs-for-copilot-business)." diff --git a/data/reusables/copilot/copilot-enterprise-features.md b/data/reusables/copilot/copilot-enterprise-features.md index f6996d84c4f8..c9fd3e121083 100644 --- a/data/reusables/copilot/copilot-enterprise-features.md +++ b/data/reusables/copilot/copilot-enterprise-features.md @@ -8,4 +8,4 @@ ### {% data variables.product.prodname_copilot_short %} knowledge bases -Knowledge bases are collections of Markdown documentation from one or more repositories. When you ask a question in {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_dotcom_the_website %} and in {% data variables.product.prodname_vscode_shortname %} you can specify a knowledge base as the context for your question. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/managing-copilot-knowledge-bases)." +Knowledge bases are collections of Markdown documentation from one or more repositories. When you ask a question in {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_dotcom_the_website %} and in {% data variables.product.prodname_vscode_shortname %} you can specify a knowledge base as the context for your question. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/managing-copilot-knowledge-bases)." diff --git a/data/reusables/copilot/more-details-content-exclusion-logs.md b/data/reusables/copilot/more-details-content-exclusion-logs.md new file mode 100644 index 000000000000..e7c4025ca179 --- /dev/null +++ b/data/reusables/copilot/more-details-content-exclusion-logs.md @@ -0,0 +1,5 @@ +1. Click the ellipsis (...) at the end of each entry to see more details. + + If the "excluded_paths" entry is truncated, hover over the truncated value to show the full entry. This displays the content of the exclusion settings after the change was saved. + + ![Screenshot of audit log details for the 'copilot.content_exclusion_changed' action. The ellipsis button is highlighted.](/assets/images/help/copilot/copilot-audit-log.png) diff --git a/data/reusables/copilot/test-content-exclusions-chat.md b/data/reusables/copilot/test-content-exclusions-chat.md new file mode 100644 index 000000000000..a238165721ee --- /dev/null +++ b/data/reusables/copilot/test-content-exclusions-chat.md @@ -0,0 +1 @@ +1. Ask {% data variables.product.prodname_copilot_chat_short %} a question about the excluded file. If your content is excluded successfully, {% data variables.product.prodname_copilot_short %} will be unable to answer your question, and will explain that some files were excluded from the conversation due to content exclusion rules. diff --git a/data/reusables/copilot/view-last-change-content-exclusions.md b/data/reusables/copilot/view-last-change-content-exclusions.md new file mode 100644 index 000000000000..f33f68a5ef15 --- /dev/null +++ b/data/reusables/copilot/view-last-change-content-exclusions.md @@ -0,0 +1,3 @@ +1. Scroll to the bottom of the page. + + You will see the name of the person who last changed the content exclusion settings, and information about when they made this change. From ec2440dc296bd0fd8180d12837a5d648f3a01ec9 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 24 Jun 2024 10:17:37 -0400 Subject: [PATCH 2/2] Tool to find unused variables (#50103) --- package.json | 1 + .../scripts/find-unsed-variables.ts | 149 ++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 src/content-linter/scripts/find-unsed-variables.ts diff --git a/package.json b/package.json index 5692e2c983f2..447a9fa4ffe7 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "find-orphaned-assets": "node src/assets/scripts/find-orphaned-assets.js", "find-orphaned-features": "tsx src/data-directory/scripts/find-orphaned-features/index.ts", "find-past-built-pr": "tsx src/workflows/find-past-built-pr.ts", + "find-unused-variables": "tsx src/content-linter/scripts/find-unsed-variables.ts", "fixture-dev": "cross-env ROOT=src/fixtures/fixtures npm start", "fixture-test": "cross-env ROOT=src/fixtures/fixtures npm test -- src/fixtures/tests", "index": "tsx src/search/scripts/index/index.ts", diff --git a/src/content-linter/scripts/find-unsed-variables.ts b/src/content-linter/scripts/find-unsed-variables.ts new file mode 100644 index 000000000000..0e78e03d1ffc --- /dev/null +++ b/src/content-linter/scripts/find-unsed-variables.ts @@ -0,0 +1,149 @@ +/** + * This script iterates over all pages and all reusables and looks for + * mentions of variables in Liquid syntax. For example, + * + * --- + * title: '{% data variables.product.prodname_mobile %} is cool' + * shortTitle: '{% data variables.product.prodname_mobile %}' + * --- + * + * This also mentions {% data variables.product.prodname_ios %} + * + * So in this case, we *know* that `prodname_mobile` and + * `prodname_ios` inside `data/variables/product.yml` is definitely used. + * So that variable won't be mentioned as unused. + * + */ +import fs from 'fs' +import yaml from 'js-yaml' + +import { program } from 'commander' + +import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data.js' +import { TokenizationError } from 'liquidjs' + +import readFrontmatter from '@/frame/lib/read-frontmatter.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import walkFiles from '@/workflows/walk-files.js' + +program + .description('Finds unused variables in frontmatter, content, and reusables') + .option('-o, --output-file ', 'path to output file', 'stdout') + .option('--json', 'serialize output in JSON') + .option('--markdown', 'serialize output as a Markdown comment') + .parse(process.argv) + +type Options = { + outputFile: string + json?: boolean + markdown?: boolean +} +main(program.opts()) + +async function main(options: Options) { + const variables = getVariables() + const pages = await getPages() + for (const page of pages) { + try { + const filePath = page.fullPath + const fileContent = fs.readFileSync(filePath, 'utf-8') + const { content, data } = readFrontmatter(fileContent) + const title = (data && data.title) || '' + const shortTitle = (data && data.shortTitle) || '' + const intro = (data && data.intro) || '' + for (const string of [content, title, shortTitle, intro]) { + checkString(string, variables) + } + } catch (err) { + if (err instanceof Error && 'code' in err && err.code === 'ENOENT') continue + throw err + } + } + for (const filePath of getReusableFiles()) { + const fileContent = fs.readFileSync(filePath, 'utf-8') + checkString(fileContent, variables) + } + + const { outputFile, json } = options + if (!outputFile || outputFile === 'stdout') { + if (json) { + console.log(JSON.stringify(Object.fromEntries(variables), null, 2)) + } else { + console.log(variables) + } + } else if (options.markdown) { + let output = '' + const keys = Array.from(variables.values()).sort() + if (keys.length > 0) { + output += `There are ${variables.size} unused variables.\n\n` + output += '| Variable | File |\n' + output += '| --- | --- |\n' + for (const key of keys) { + output += `| ${key} | ${variables.get(key)} |\n` + } + output += `\nThis comment was generated by the \`find-unused-variables\` script.\n` + } + if (outputFile && output) { + fs.writeFileSync(outputFile, output, 'utf-8') + } else if (output) { + console.log(output) + } + } else { + if (json || outputFile.endsWith('.json')) { + fs.writeFileSync(outputFile, JSON.stringify(Object.fromEntries(variables), null, 2), 'utf-8') + } else { + let output = '' + for (const [key, value] of variables) { + output += `${key} in ${value}\n` + } + fs.writeFileSync(outputFile, output, 'utf-8') + } + } +} + +function getVariables(): Map { + const variables = new Map() + for (const filePath of walkFiles('data/variables', '.yml')) { + const dottedPathBase = + 'variables.' + filePath.replace('data/variables/', '').replace('.yml', '').replace(/\//g, '.') + const data = yaml.load(fs.readFileSync(filePath, 'utf-8')) as Record + for (const key of Object.keys(data)) { + const dottedPath = dottedPathBase + '.' + key + variables.set(dottedPath, filePath) + } + } + return variables +} + +async function getPages() { + const unversionedTree = await loadUnversionedTree([]) + const pageList = await loadPages(unversionedTree) + return pageList +} + +function getReusableFiles(root = 'data') { + const here: string[] = [] + for (const file of fs.readdirSync(root)) { + const filePath = `${root}/${file}` + if (fs.statSync(filePath).isDirectory()) { + here.push(...getReusableFiles(filePath)) + } else if (file.endsWith('.md') && file !== 'README.md') { + here.push(filePath) + } + } + return here +} + +function checkString(string: string, variables: Map) { + try { + for (const token of getLiquidTokens(string)) { + if (token.name === 'data') { + const { args } = token + variables.delete(args) + } + } + } catch (err) { + if (err instanceof TokenizationError) return + throw err + } +}