Skip to content

Commit f8415c0

Browse files
authored
chore: disable codecov from v2-release branch (#32125)
In #32082, we added codecov checks to mergify merge conditions. This, as originally intended, blocked merging to both the `main` and the `v2-release` branches. However, we decided that currently we won't be applying codecov on the `v2-release` branch because it is redundant. Ideally, to achieve this, we would remove the conditions only from the mergify configuration that applies to the `v2-release` branch. But our configuration isn't set up that way right now, it doesn't distinguish between branches. Luckily, mergify will [automatically honor branch protection rules](Mergifyio/mergify#2184 (comment)), so we can safely remove the branch dependant conditions from mergify all together, and keep them only in branch protection rules (which we already configured). Once this PR is merged, I will also remove the codecov branch protection from `v2-release` (but keep it on `main`). ## Additional Changes There's some additional codecov related cleanup we need to do so might as well. They are explained as review comments. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 588f1f6 commit f8415c0

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

.github/workflows/codecov.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
name: collect
1212
if: github.repository == 'aws/aws-cdk'
1313
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
1416
steps:
1517
- name: Checkout
1618
uses: actions/checkout@v4
@@ -19,10 +21,10 @@ jobs:
1921
uses: actions/setup-node@v4
2022

2123
- name: Install dependencies
22-
run: cd packages/aws-cdk && yarn install
24+
run: yarn install
2325

2426
- name: Build CLI
25-
run: cd packages/aws-cdk && npx lerna run build --scope=aws-cdk
27+
run: npx lerna run build --scope=aws-cdk
2628

2729
- name: Run tests
2830
run: cd packages/aws-cdk && yarn test
@@ -33,4 +35,4 @@ jobs:
3335
directory: packages/aws-cdk/coverage
3436
fail_ci_if_error: true
3537
flags: suite.unit
36-
token: ${{ secrets.CODECOV_TOKEN }}
38+
use_oidc: true

.mergify.yml

-24
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ queue_rules:
1515
- "#changes-requested-reviews-by=0"
1616
- status-success~=AWS CodeBuild us-east-1
1717
- status-success=validate-pr
18-
- status-success=codecov/patch
19-
- status-success=codecov/patch/packages/aws-cdk
20-
- status-success=codecov/project
21-
- status-success=codecov/project/packages/aws-cdk
2218
commit_message_template: |-
2319
{{ title }} (#{{ number }})
2420
{{ body }}
@@ -37,10 +33,6 @@ queue_rules:
3733
- "#changes-requested-reviews-by=0"
3834
- status-success~=AWS CodeBuild us-east-1
3935
- status-success=validate-pr
40-
- status-success=codecov/patch
41-
- status-success=codecov/patch/packages/aws-cdk
42-
- status-success=codecov/project
43-
- status-success=codecov/project/packages/aws-cdk
4436
commit_message_template: |-
4537
{{ title }} (#{{ number }})
4638
{{ body }}
@@ -72,10 +64,6 @@ pull_request_rules:
7264
- "#changes-requested-reviews-by=0"
7365
- status-success~=AWS CodeBuild us-east-1
7466
- status-success=validate-pr
75-
- status-success=codecov/patch
76-
- status-success=codecov/patch/packages/aws-cdk
77-
- status-success=codecov/project
78-
- status-success=codecov/project/packages/aws-cdk
7967
- name: automatic merge (2+ approvers)
8068
actions:
8169
comment:
@@ -96,10 +84,6 @@ pull_request_rules:
9684
- "#changes-requested-reviews-by=0"
9785
- status-success~=AWS CodeBuild us-east-1
9886
- status-success=validate-pr
99-
- status-success=codecov/patch
100-
- status-success=codecov/patch/packages/aws-cdk
101-
- status-success=codecov/project
102-
- status-success=codecov/project/packages/aws-cdk
10387
- name: automatic merge (no-squash)
10488
actions:
10589
comment:
@@ -120,10 +104,6 @@ pull_request_rules:
120104
- "#changes-requested-reviews-by=0"
121105
- status-success~=AWS CodeBuild us-east-1
122106
- status-success=validate-pr
123-
- status-success=codecov/patch
124-
- status-success=codecov/patch/packages/aws-cdk
125-
- status-success=codecov/project
126-
- status-success=codecov/project/packages/aws-cdk
127107
- name: remove stale reviews
128108
actions:
129109
dismiss_reviews:
@@ -163,7 +143,3 @@ pull_request_rules:
163143
- "#changes-requested-reviews-by=0"
164144
- status-success~=AWS CodeBuild us-east-1
165145
- status-success=validate-pr
166-
- status-success=codecov/patch
167-
- status-success=codecov/patch/packages/aws-cdk
168-
- status-success=codecov/project
169-
- status-success=codecov/project/packages/aws-cdk

packages/aws-cdk/jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module.exports = {
1212
lines: 81
1313
},
1414
},
15-
"coveragePathIgnorePatterns": [
15+
coveragePathIgnorePatterns: [
16+
...baseConfig.coveragePathIgnorePatterns,
1617
// Mostly wrappers around the SDK, which get mocked in unit tests
1718
"<rootDir>/lib/api/aws-auth/sdk.ts",
1819
],

packages/aws-cdk/lib/api/logs/logs-monitor.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ export class CloudWatchLogEventMonitor {
124124
}
125125

126126
private async tick(): Promise<void> {
127+
// excluding from codecoverage because this
128+
// doesn't always run (depends on timing)
129+
/* istanbul ignore next */
127130
if (!this.active) {
128-
// excluding from codecoverage because this
129-
// doesn't always run (depends on timing)
130-
/* istanbul ignore next */
131131
return;
132132
}
133133
try {

0 commit comments

Comments
 (0)