Skip to content

Commit 396e6ff

Browse files
authored
Merge pull request #32163 from github/repo-sync
Repo sync
2 parents 177a2cd + 7f76335 commit 396e6ff

File tree

6 files changed

+86
-5
lines changed

6 files changed

+86
-5
lines changed

content/code-security/code-scanning/managing-code-scanning-alerts/about-autofix-for-codeql-code-scanning.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ topics:
1919

2020
## About autofix for {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}
2121

22-
Autofix is an AI-powered expansion of {% data variables.product.prodname_code_scanning %} that provides users with targeted recommendations to help them fix {% data variables.product.prodname_code_scanning %} alerts in pull requests so they can avoid introducing new security vulnerabilities. The potential fixes are generated automatically by large language models (LLMs) using data from the codebase, the pull request, and from {% data variables.product.prodname_codeql %} analysis.
22+
{% data variables.product.prodname_code_scanning_caps %} autofix is a {% data variables.product.prodname_copilot %}-powered expansion of {% data variables.product.prodname_code_scanning %} that provides users with targeted recommendations to help them fix {% data variables.product.prodname_code_scanning %} alerts in pull requests so they can avoid introducing new security vulnerabilities. The potential fixes are generated automatically by large language models (LLMs) using data from the codebase, the pull request, and from {% data variables.product.prodname_codeql %} analysis.
2323

24-
{% data variables.product.prodname_code_scanning_caps %} autofix generates potential fixes that are relevant to the existing source code and translates the description and location of an alert into code changes that may fix the alert. The autofix system uses the OpenAI GPT-4 large language model, which has sufficient generative capabilities to produce both suggested fixes in code and explanatory text for those fixes.
24+
{% note %}
25+
26+
**Note:** While {% data variables.product.prodname_code_scanning %} autofix is powered by {% data variables.product.prodname_copilot %}, your enterprise does not need a subscription to {% data variables.product.prodname_copilot %} to use autofix. As long as your enterprise has {% data variables.product.prodname_GH_advanced_security %}, you will have access to autofix.
27+
28+
{% endnote %}
29+
30+
{% data variables.product.prodname_code_scanning_caps %} autofix generates potential fixes that are relevant to the existing source code and translates the description and location of an alert into code changes that may fix the alert. Autofix uses internal {% data variables.product.prodname_copilot %} APIs and private instances of OpenAI large language models such as GPT-4, which have sufficient generative capabilities to produce both suggested fixes in code and explanatory text for those fixes.
31+
32+
{% ifversion code-scanning-autofix %}While {% data variables.product.prodname_code_scanning %} autofix is allowed by default in an enterprise and enabled for every repository using {% data variables.product.prodname_codeql %}, you can choose to opt out and disable autofix. To learn how to disable autofix at the enterprise, organization and repository levels, see "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/disabling-autofix-for-code-scanning)."{% endif %}
33+
34+
In an organization's security overview dashboard, you can view the total number of autofix suggestions generated on open and closed pull requests in the organization for a given time period. For more information, see "[AUTOTITLE](/enterprise-cloud@latest/code-security/security-overview/viewing-security-insights-for-your-organization#autofix-suggestions)" in the {% data variables.product.prodname_ghe_cloud %} documentation.
2535

2636
## Developer experience
2737

@@ -120,10 +130,11 @@ It is important to remember that the author of a pull request retains responsibi
120130

121131
- "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts)"
122132
- "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests#working-with-autofix-suggestions-for-alerts)"
133+
- "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/disabling-autofix-for-code-scanning)"
123134

124135
{% elsif fpt %}
125136

126137
- "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts)"
127-
- [the {% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests#working-with-autofix-suggestions-for-alerts)
138+
- [AUTOTITLE](/enterprise-cloud@latest/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests#working-with-autofix-suggestions-for-alerts) in the {% data variables.product.prodname_ghe_cloud %} documentation
128139

129140
{% endif %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Disabling autofix for code scanning
3+
shortTitle: Disable autofix
4+
intro: You can choose to disallow {% data variables.product.prodname_code_scanning %} autofix for an enterprise or disable autofix at the organization and repository level.
5+
product: '{% data reusables.rai.code-scanning.gated-feature-autofix %}'
6+
versions:
7+
feature: code-scanning-autofix
8+
type: how_to
9+
topics:
10+
- Advanced Security
11+
- Code scanning
12+
- CodeQL
13+
- AI
14+
---
15+
16+
{% data reusables.rai.code-scanning.beta-autofix %}
17+
18+
## About disabling autofix for {% data variables.product.prodname_code_scanning %}
19+
20+
{% data variables.product.prodname_code_scanning_caps %} autofix is a {% data variables.product.prodname_copilot %}-powered expansion of {% data variables.product.prodname_code_scanning %} that provides users with targeted recommendations to help them fix {% data variables.product.prodname_code_scanning %} alerts in pull requests so they can avoid introducing new security vulnerabilities. To learn more about autofix for code scanning, see "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/about-autofix-for-codeql-code-scanning)."
21+
22+
{% data variables.product.prodname_code_scanning_caps %} autofix is allowed by default in an enterprise and enabled for every repository that uses {% data variables.product.prodname_codeql %}, regardless of whether it uses default or advanced setup for {% data variables.product.prodname_code_scanning %}. Administrators at the enterprise, organization and repository levels can choose to opt-out and disable autofix.
23+
24+
Note that disabling autofix at any level will close all open autofix comments from all open pull requests at the level that was disabled. If autofix is disabled and then subsequently enabled, autofix won't automatically suggest any fixes for pull requests that are already open. The suggestions will only be generated for pull requests that are opened after autofix is enabled, or after re-running {% data variables.product.prodname_codeql %} analysis on existing pull requests.
25+
26+
## Blocking use of autofix for an enterprise
27+
28+
Enterprise administrators can disallow autofix for their enterprise. If you disallow autofix for an enterprise, autofix cannot be enabled for any organizations or repositories within the enterprise.
29+
30+
Note that allowing autofix for an enterprise does not enforce enablement of autofix, but means that organization and repository administrators will have the option to enable or disable autofix.
31+
32+
Disallowing autofix at the enterprise level will remove all open autofix comments from open pull requests across all repositories of all organizations within the enterprise.
33+
34+
{% data reusables.enterprise-accounts.access-enterprise %}
35+
{% data reusables.enterprise-accounts.policies-tab %}
36+
{% data reusables.enterprise-accounts.code-security-and-analysis-policies %}
37+
1. Under "Autofix for {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %}", use the dropdown menu to choose "Not allowed."
38+
39+
## Disabling autofix for an organization
40+
41+
If autofix is allowed at the enterprise level, organization administrators have the option to disable autofix for an organization. If you disable autofix for an organization, autofix cannot be enabled for any repositories within the organization.
42+
43+
Note that disabling autofix at the organization level will remove all open autofix comments from open pull requests across all repositories in the organization.
44+
45+
{% data reusables.profile.access_org %}
46+
{% data reusables.profile.org_settings %}
47+
{% data reusables.organizations.security-and-analysis %}
48+
1. Under the "{% data variables.product.prodname_code_scanning_caps %}" section, deselect **Autofix for {% data variables.product.prodname_codeql %}**.
49+
50+
## Disabling autofix for a repository
51+
52+
If autofix is allowed at the enterprise level and enabled at the organization level, repository administrators have the option to disable autofix for a repository. Disabling autofix at the repository level will remove all open autofix comments from all open pull requests across the repository.
53+
54+
{% data reusables.repositories.navigate-to-repo %}
55+
{% data reusables.repositories.sidebar-settings %}
56+
{% data reusables.user-settings.security-analysis %}
57+
1. In the "{% data variables.product.prodname_code_scanning_caps %}" section, deselect **Autofix for {% data variables.product.prodname_codeql %}**.

content/code-security/code-scanning/managing-code-scanning-alerts/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ topics:
1414
children:
1515
- /about-code-scanning-alerts
1616
- /about-autofix-for-codeql-code-scanning
17+
- /disabling-autofix-for-code-scanning
1718
- /managing-code-scanning-alerts-for-your-repository
1819
- /triaging-code-scanning-alerts-in-pull-requests
1920
- /tracking-code-scanning-alerts-in-issues-using-task-lists

content/code-security/code-scanning/managing-code-scanning-alerts/triaging-code-scanning-alerts-in-pull-requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Anyone with push access to a pull request can fix a {% data variables.product.pr
116116

117117
{% data reusables.rai.code-scanning.beta-autofix %}
118118

119-
Autofix is an AI-powered expansion of {% data variables.product.prodname_code_scanning %} that provides you with targeted recommendations to help you fix {% data variables.product.prodname_code_scanning %} alerts in pull requests. The potential fixes are generated automatically by large language models (LLMs) using data from the codebase, the pull request, and from {% data variables.product.prodname_codeql %} analysis.
119+
Autofix, powered by {% data variables.product.prodname_copilot %}, is an expansion of {% data variables.product.prodname_code_scanning %} that provides you with targeted recommendations to help you fix {% data variables.product.prodname_code_scanning %} alerts in pull requests. The potential fixes are generated automatically by large language models (LLMs) using data from the codebase, the pull request, and from {% data variables.product.prodname_codeql %} analysis.
120120

121121
![Screenshot of the check failure for a {% data variables.product.prodname_code_scanning %} alert in a pull request. The first paragraph of the "autofix" suggestion for the alert is highlighted in dark orange.](/assets/images/help/code-scanning/alert+autofix.png)
122122

content/code-security/security-overview/viewing-security-insights-for-your-organization.md

+12
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ The rate is calculated by dividing the number of alerts that were closed and rem
103103

104104
Alerts that are reopened and re-closed during the chosen time period are ignored.
105105

106+
{% ifversion code-scanning-autofix %}
107+
108+
### Autofix suggestions
109+
110+
{% data reusables.rai.code-scanning.beta-autofix %}
111+
112+
Autofix, powered by {% data variables.product.prodname_copilot %}, is an expansion of {% data variables.product.prodname_code_scanning %} that provides you with targeted recommendations to help you fix {% data variables.product.prodname_code_scanning %} alerts in pull requests. For more information, see "[AUTOTITLE](/code-security/code-scanning/managing-code-scanning-alerts/about-autofix-for-codeql-code-scanning)."
113+
114+
The "Autofix suggestions" metric is the total number of Autofix suggestions generated in open and closed pull requests during the chosen time period.
115+
116+
{% endif %}
117+
106118
### Alert activity graph
107119

108120
Expanding on the alert trends graph, the alert activity graph shows you alert inflows and outflows over your chosen time period.

data/reusables/rai/code-scanning/beta-autofix.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% note %}
44

5-
**Note:** {% data variables.product.prodname_dotcom %} autofix for {% data variables.product.prodname_code_scanning %} is in beta. Functionality and documentation are subject to change. During this phase, the feature is restricted to JavaScript, TypeScript, and Python alerts identified by {% data variables.product.prodname_codeql %}. If you have an enterprise account and use {% data variables.product.prodname_GH_advanced_security %}, you can join the [waitlist for {% data variables.product.prodname_GH_advanced_security %} AI features](https://github.com/features/preview/security).
5+
**Note:** {% data variables.product.prodname_dotcom %} autofix for {% data variables.product.prodname_code_scanning %} is in beta. Functionality and documentation are subject to change. During this phase, the feature is restricted to JavaScript, TypeScript, Python, and Java alerts identified by {% data variables.product.prodname_codeql %}. If you have an enterprise account and use {% data variables.product.prodname_GH_advanced_security %}, your enterprise has access to the beta.
66

77
{% endnote %}
88

0 commit comments

Comments
 (0)