Skip to content

Commit 3ca115e

Browse files
authored
Merge pull request #43126 from github/repo-sync
Repo sync
2 parents 94ae83b + 354d907 commit 3ca115e

File tree

12 files changed

+160
-20
lines changed

12 files changed

+160
-20
lines changed

content/code-security/concepts/about-code-quality.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ With {% data variables.product.prodname_code_quality_short %}, you can:
2828
* Identify code quality risks and opportunities in **pull requests** and through **repository scans**.
2929
* Review clear explanations for findings and apply one-click **{% data variables.product.prodname_copilot_short %}-powered autofixes**.
3030
* Use **repository dashboards** to track reliability and maintainability scores, identify areas needing attention, and prioritize remediation.
31+
* Monitor **organization dashboards** to understand the code health of your repositories at a glance and determine which repositories to investigate further.
3132
* Set up **rulesets** for pull requests to enforce code quality standards and block changes that do not meet your criteria.
3233
* Easily assign remediation work to **{% data variables.copilot.copilot_coding_agent %}**, if you have a {% data variables.product.prodname_copilot_short %} license.
3334

@@ -49,7 +50,7 @@ With {% data variables.product.prodname_code_quality_short %}, you can:
4950

5051
{% data variables.product.prodname_code_quality_short %} also performs AI-powered analysis with results displayed separately on the "**{% data variables.code-quality.recent_suggestions %}**" repository dashboard. Unlike the rule-based {% data variables.product.prodname_codeql %} analysis that scans the entire codebase and pull requests, this AI-powered analysis only examines files recently pushed to the default branch and may identify issues in languages beyond those listed above. For more information, see [AUTOTITLE](/code-security/code-quality/responsible-use/code-quality).
5152

52-
## Understanding where {% data variables.product.prodname_code_quality_short %} findings appear after enablement
53+
## Where will findings appear?
5354

5455
Once you enable {% data variables.product.prodname_code_quality_short %} for a repository, you'll see {% data variables.product.prodname_codeql %} scans for:
5556

@@ -76,5 +77,5 @@ Each {% data variables.product.prodname_codeql %} analysis will use {% data vari
7677

7778
## Next steps
7879

79-
* Enable {% data variables.product.prodname_code_quality_short %} for your repository, see [AUTOTITLE](/code-security/code-quality/how-tos/enable-code-quality). Enterprise owners **may** need to first update their Advanced Security policies, see [AUTOTITLE](/code-security/code-quality/how-tos/allow-in-enterprise)
80+
* Enable {% data variables.product.prodname_code_quality_short %} for your repository, see [AUTOTITLE](/code-security/code-quality/how-tos/enable-code-quality). Enterprise owners **may** need to first update their Advanced Security policies, see [AUTOTITLE](/code-security/code-quality/how-tos/allow-in-enterprise).
8081
* See how {% data variables.product.prodname_code_quality %} works on your default branch to surface code quality issues and help you understand your repository's code health at a glance. See [AUTOTITLE](/code-security/code-quality/get-started/quickstart).

content/code-security/how-tos/maintain-quality-code/enable-code-quality.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ redirect_from:
4141
4242
## Next steps
4343

44-
* Learn about the code quality backlog for your repository. See [AUTOTITLE](/code-security/code-quality/how-tos/interpret-results).
45-
* Find and fix code quality issues before they reach your default branch. See [AUTOTITLE](/code-security/code-quality/tutorials/fix-findings-in-prs).
44+
* **For your repository:** Understand your code quality backlog in detail. See [AUTOTITLE](/code-security/code-quality/how-tos/interpret-results).
45+
* **For your organization:** Understand the code health of your repositories at a glance. See [AUTOTITLE](/code-security/how-tos/view-and-interpret-data/analyze-organization-data/explore-code-quality).

content/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/allow-github-code-quality-in-enterprise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ For more information about policies for {% data variables.product.prodname_AS %}
3737

3838
## Next steps
3939

40-
To see {% data variables.product.prodname_code_quality_short %} in action, turn the feature on for one or more repositories, [AUTOTITLE](/code-security/code-quality/how-tos/enable-code-quality).
40+
To see {% data variables.product.prodname_code_quality_short %} in action, turn the feature on for one or more repositories. See [AUTOTITLE](/code-security/code-quality/how-tos/enable-code-quality).
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Exploring GitHub Code Quality results in your organization
3+
shortTitle: Explore code quality
4+
intro: Understand your organization's code health at a glance with the organization-level dashboard for {% data variables.product.prodname_code_quality_short %}.
5+
product: '{% data reusables.gated-features.code-quality-availability %}'
6+
permissions: 'Organization members'
7+
contentType: how-tos
8+
versions:
9+
feature: code-quality
10+
topics:
11+
- Code Quality
12+
---
13+
14+
{% data reusables.code-quality.code-quality-preview-note %}
15+
16+
## Prerequisites
17+
18+
* If your organization belongs to an enterprise, an enterprise owner must enable {% data variables.product.prodname_code_quality_short %} for your organization. See [AUTOTITLE](/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/allow-github-code-quality-in-enterprise).
19+
* Your organization must have repositories with {% data variables.product.prodname_code_quality_short %} enabled. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/enable-code-quality).
20+
21+
## Viewing code quality insights for your organization
22+
23+
1. On {% data variables.product.prodname_dotcom %}, navigate to the main page of your organization. For example, from [https://github.com/settings/organizations](https://github.com/settings/organizations?ref_product=github&ref_type=engagement&ref_style=text).
24+
{% data reusables.organizations.security-overview %}
25+
1. In the "Metrics" section of the sidebar, click {% octicon "code-square" aria-hidden="true" aria-label="code-square" %} **Code quality**.
26+
27+
> [!NOTE] The dashboard only displays data for repositories where the viewer can see code quality findings.
28+
29+
## Interpreting the score distribution chart
30+
31+
The score distribution chart provides a visual overview of the code health of your organization. Each bubble represents a collection of repositories with the same maintainability and reliability scores.
32+
* The **position** of each bubble demonstrates the overall health of those repositories. Higher bubbles represent higher maintainability scores, while bubbles further to the right represent higher reliability scores.
33+
* The **color and border pattern** of a bubble indicate the severity of the lower score for those repositories. For example, a bubble with a "Needs improvement" score in either category will always be red with a dashed border.
34+
* The **size** of each bubble represents the number of repositories with that particular score combination.
35+
36+
To view the maintainability score, reliability score, and number of repositories represented by a particular bubble, hover over the bubble.
37+
38+
## Exploring the repository table
39+
40+
Below the bubble chart, there is a table that lists all repositories in your organization. Here, you can view code quality findings, along with more detailed information about those findings.
41+
42+
You can sort the repository table in ascending or descending order for any column by clicking the column header.
43+
44+
## Investigating low-scoring repositories
45+
46+
1. To filter the dashboard data for the lowest-performing repositories, on the score distribution chart, click the bubble with the lowest combined scores.
47+
1. Scroll down to the repository table. By default, the table is sorted from most to least recent repository scan, helping you prioritize current quality issues.
48+
1. Optionally, to prioritize repositories with the highest number of {% data variables.product.prodname_codeql %} findings, click **Standard Findings** twice.
49+
1. To view the repository-level dashboard for a specific repository, click the repository's name.
50+
51+
## Next steps
52+
53+
To understand the code health information available on the repository-level dashboard, see [AUTOTITLE](/code-security/how-tos/maintain-quality-code/interpret-results).

content/code-security/how-tos/view-and-interpret-data/analyze-organization-data/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ contentType: how-tos
1818
children:
1919
- /assessing-code-security-risk
2020
- /assessing-adoption-code-security
21+
- /explore-code-quality
2122
- /exporting-data-from-security-overview
2223
- /viewing-security-insights
2324
- /interpreting-security-findings

content/code-security/reference/supply-chain-security/dependabot-options-reference.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,11 @@ Parameters | Purpose |
281281
| `IDENTIFIER` | Define an identifier for the group to use in branch names and pull request titles. This must start and end with a letter, and can contain letters, pipes `\|`, underscores `_`, or hyphens `-`. |
282282
| `applies-to` | Specify which type of update the group applies to. When undefined, defaults to version updates. Supported values: `version-updates` or `security-updates`. |
283283
| `dependency-type` | Limit the group to a type. Supported values: `development` or `production`. |
284-
| `patterns` | Define one or more patterns to include dependencies with matching names. |
285284
| `exclude-patterns` | Define one or more patterns to exclude dependencies from the group. |
285+
| {% ifversion dependabot-updates-group-by %} |
286+
| `group-by` | Group updates across multiple directories. Supported value: `dependency-name`. |
287+
| {% endif %} |
288+
| `patterns` | Define one or more patterns to include dependencies with matching names. |
286289
| `update-types` | Limit the group to one or more semantic versioning levels. Supported values: `minor`, `patch`, and `major`. |
287290

288291
### `dependency-type` (`groups`)
@@ -294,6 +297,29 @@ By default, a group will include all types of dependencies.
294297
* Use `development` to include only dependencies in the "Development dependency group."
295298
* Use `production` to include only dependencies in the "Production dependency group."
296299

300+
{% ifversion dependabot-updates-group-by %}
301+
302+
### `group-by` (`groups`)
303+
304+
Use `groups.<group-name>.group-by` to specify how {% data variables.product.prodname_dependabot %} should group updates across multiple directories in a monorepo.
305+
306+
* **Type:** String
307+
* **Accepted values:** `dependency-name`
308+
* **Applies to:** Configurations with multiple directories specified
309+
310+
When set to `dependency-name`, {% data variables.product.prodname_dependabot %} will create a single pull request for each dependency update across all specified directories, rather than separate pull requests per directory.
311+
312+
**Limitations of cross-directory grouping**
313+
314+
When using `group-by: dependency-name`:
315+
* All directories must use the same package ecosystem (for example, all `npm` or all `bundler`)
316+
* Applies to **version updates only**
317+
* If directories have incompatible version constraints for a dependency, {% data variables.product.prodname_dependabot %} will create separate pull requests
318+
319+
For examples showing the use of `group-by`, see [AUTOTITLE](/code-security/tutorials/secure-your-dependencies/optimizing-pr-creation-version-updates#grouping-updates-across-directories-in-a-monorepo).
320+
321+
{% endif %}
322+
297323
### `patterns` and `exclude-patterns` (`groups`)
298324

299325
Both options support using `*` as a wild card to define matches with dependency names. If a dependency matches both a pattern and an exclude-pattern, then it is excluded from the group.

content/code-security/tutorials/improve-code-quality/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ children:
1515
redirect_from:
1616
- /code-security/code-quality/tutorials
1717
---
18-

content/code-security/tutorials/secure-your-dependencies/optimizing-pr-creation-version-updates.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ See also [`cooldown`](/code-security/dependabot/working-with-dependabot/dependab
110110

111111
## Prioritizing meaningful updates
112112

113+
### Grouping related dependencies together
114+
113115
You can use `groups` to consolidate updates for multiple dependencies into a single pull request. This helps you focus your review time on higher risk updates, and minimize the time spent reviewing minor version updates. For example, you can combine updates for minor or patch updates for development dependencies into a single pull request, and have a dedicated group for security or version updates that impact a key area of your codebase.
114116

115117
You must configure groups per individual package ecosystem, then you can create multiple groups per package ecosystem using a combination of criteria:
@@ -124,3 +126,36 @@ To see all supported values for each criterion, see [`groups`](/code-security/de
124126
The below examples present several different methods to create groups of dependencies using the criteria.
125127

126128
{% data reusables.dependabot.dependabot-version-updates-groups-yaml-example %}
129+
130+
{% ifversion dependabot-updates-group-by %}
131+
132+
### Grouping updates across directories in a monorepo
133+
134+
If you manage a monorepo with multiple directories that share common dependencies, you can reduce the number of pull requests for version updates by grouping updates by dependency name across all directories.
135+
136+
When you configure {% data variables.product.prodname_dependabot %} to monitor multiple directories and enable grouping by dependency name, {% data variables.product.prodname_dependabot %} will:
137+
* Create a single pull request for each dependency update that affects multiple directories
138+
* Update the same dependency to the same version across all directories in one operation
139+
* Reduce the number of pull requests you need to review
140+
* Minimize CI/CD costs by running tests once instead of per directory
141+
142+
For more information, see [`group-by`](/code-security/reference/supply-chain-security/dependabot-options-reference#group-by-groups).
143+
144+
This configuration example groups updates by dependency name across the `/frontend`, `/admin-panel`, and `/mobile-app` directories. If `lodash` needs to be updated in all three directories, {% data variables.product.prodname_dependabot %} will create a single pull request named "Bump lodash in monorepo-dependencies group" that updates `lodash` in all three locations.
145+
146+
```yaml
147+
version: 2
148+
updates:
149+
- package-ecosystem: "npm"
150+
directories:
151+
- "/frontend"
152+
- "/admin-panel"
153+
- "/mobile-app"
154+
schedule:
155+
interval: "weekly"
156+
groups:
157+
monorepo-dependencies:
158+
group-by: dependency-name
159+
```
160+
161+
{% endif %}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reference: Issue #20890 - Dependabot can group updates by dependency name across multiple directories in a monorepo [GA]
2+
versions:
3+
fpt: '*'
4+
ghec: '*'
5+
ghes: '>= 3.21'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{% ifversion fpt or ghec %}
2-
{% data variables.product.prodname_code_quality %} is available for organization-owned repositories on {% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}
2+
{% data variables.product.prodname_team %} or {% data variables.product.prodname_ghe_cloud %}
33
{% endif %}

0 commit comments

Comments
 (0)