Skip to content

Commit

Permalink
chore: disable codecov from v2-release branch (#32125)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
iliapolo authored Nov 14, 2024
1 parent 588f1f6 commit f8415c0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
name: collect
if: github.repository == 'aws/aws-cdk'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -19,10 +21,10 @@ jobs:
uses: actions/setup-node@v4

- name: Install dependencies
run: cd packages/aws-cdk && yarn install
run: yarn install

- name: Build CLI
run: cd packages/aws-cdk && npx lerna run build --scope=aws-cdk
run: npx lerna run build --scope=aws-cdk

- name: Run tests
run: cd packages/aws-cdk && yarn test
Expand All @@ -33,4 +35,4 @@ jobs:
directory: packages/aws-cdk/coverage
fail_ci_if_error: true
flags: suite.unit
token: ${{ secrets.CODECOV_TOKEN }}
use_oidc: true
24 changes: 0 additions & 24 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ queue_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
Expand All @@ -37,10 +33,6 @@ queue_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
commit_message_template: |-
{{ title }} (#{{ number }})
{{ body }}
Expand Down Expand Up @@ -72,10 +64,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: automatic merge (2+ approvers)
actions:
comment:
Expand All @@ -96,10 +84,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: automatic merge (no-squash)
actions:
comment:
Expand All @@ -120,10 +104,6 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
- name: remove stale reviews
actions:
dismiss_reviews:
Expand Down Expand Up @@ -163,7 +143,3 @@ pull_request_rules:
- "#changes-requested-reviews-by=0"
- status-success~=AWS CodeBuild us-east-1
- status-success=validate-pr
- status-success=codecov/patch
- status-success=codecov/patch/packages/aws-cdk
- status-success=codecov/project
- status-success=codecov/project/packages/aws-cdk
3 changes: 2 additions & 1 deletion packages/aws-cdk/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {
lines: 81
},
},
"coveragePathIgnorePatterns": [
coveragePathIgnorePatterns: [
...baseConfig.coveragePathIgnorePatterns,
// Mostly wrappers around the SDK, which get mocked in unit tests
"<rootDir>/lib/api/aws-auth/sdk.ts",
],
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk/lib/api/logs/logs-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ export class CloudWatchLogEventMonitor {
}

private async tick(): Promise<void> {
// excluding from codecoverage because this
// doesn't always run (depends on timing)
/* istanbul ignore next */
if (!this.active) {
// excluding from codecoverage because this
// doesn't always run (depends on timing)
/* istanbul ignore next */
return;
}
try {
Expand Down

0 comments on commit f8415c0

Please sign in to comment.