Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,22 @@ jobs:
with:
flags: integration
token: ${{ secrets.CODECOV_TOKEN }}

coverage-notify:
needs: test
Comment thread
coderabbitai[bot] marked this conversation as resolved.
permissions:
contents: read
# A failed matrix job still gets a report from what did upload.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Disable matrix fail-fast before reporting coverage as complete.

If one test matrix job fails, fail-fast: true cancels other running and queued jobs. Those jobs cannot reach their Codecov upload step. coverage-notify can then report a partial result after the matrix ends. Set test.strategy.fail-fast to false so the remaining jobs can finish and upload. (docs.github.com)

🧰 Tools
🪛 zizmor (1.30.1)

[warning] 1-130: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)


[warning] 114-130: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
run_command: send-notifications
Comment on lines +127 to +129

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '105,140p' .github/workflows/test.yml
cat codecov.yml

Repository: webpack/watchpack

Length of output: 1520


🌐 Web query:

codecov-action v7.1.1 action.yml fail_ci_if_error default send-notifications

💡 Result:

In **`codecov/[email protected]`**, `fail_ci_if_error` is an optional input with default **`'false'`**—so errors do not fail the CI job by default. The action’s `run_command` is separately defaulted to **`'upload-coverage'`**; `send-notifications` is listed as an available command, not the default. ([raw.githubusercontent.com](https://raw.githubusercontent.com/codecov/codecov-action/v7.1.1/action.yml))

Citations:

- 1: https://raw.githubusercontent.com/codecov/codecov-action/v7.1.1/action.yml

🌐 Web query:

official Codecov documentation or source for codecov.yml notify.manual_trigger and the codecov-action v7.1.1 send-notifications command behavior when notification sending fails

💡 Result:

- **`manual_trigger`**: Codecov’s official Notifications documentation says to add `codecov: notify: manual_trigger: true` to `codecov.yml` and run `codecov-cli send-notifications` after all coverage uploads. Its purpose is to prevent automatic notifications until that command is run. ([docs.codecov.com](https://docs.codecov.com/docs/notifications?utm_source=openai))
- **Action command**: The Action supports `run_command: send-notifications`; its docs describe that command as an available CLI command. ([github.com](https://github.com/codecov/codecov-action?utm_source=openai))
- **If sending fails**: The Action exposes `fail_ci_if_error`, documented as “On error, exit with non-zero code,” with a default of `false`. Its action definition passes that setting to the wrapper as `CC_FAIL_ON_ERROR`. So the documented behavior is that setting `fail_ci_if_error: true` makes an error fail the step; with the default `false`, the docs do not promise a non-zero exit. ([github.com](https://github.com/codecov/codecov-action/blob/main/action.yml?utm_source=openai))

**Version caveat:** v7.1.1 was released as commit `303a32d`, but the cited Action input documentation is for `main`, not that tag. The sources found don’t establish the exact failure path of `send-notifications` in the v7.1.1 implementation, so whether a notification-send failure is treated as an Action error remains unverified here. ([github.com](https://github.com/codecov/codecov-action/releases?utm_source=openai))

Citations:

- 1: https://docs.codecov.com/docs/notifications?utm_source=openai
- 2: https://github.com/codecov/codecov-action?utm_source=openai
- 3: https://github.com/codecov/codecov-action/blob/main/action.yml?utm_source=openai
- 4: https://github.com/codecov/codecov-action/releases?utm_source=openai

🌐 Web query:

codecov/codecov-action v7.1.1 303a32d7a59b442fa8d48b6a1cc6825c09c847a5 action.yml CC_FAIL_ON_ERROR send-notifications implementation

💡 Result:

For **`codecov/[email protected]`** at commit `303a32d7a59b442fa8d48b6a1cc6825c09c847a5`:

- **`action.yml`** defines `fail_ci_if_error` (default `false`) and maps it to `CC_FAIL_ON_ERROR`. It also exposes `run_command`, with `send-notifications` as an option; the default command is `upload-coverage`. ([raw.githubusercontent.com](https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/action.yml))
- **`CC_FAIL_ON_ERROR` behavior:** In the bundled wrapper, `send-notifications` passes the flag to the CLI as `--fail-on-error` when true. If the CLI command fails, the wrapper exits nonzero only when `CC_FAIL_ON_ERROR=true`; otherwise it logs the error and continues. ([raw.githubusercontent.com](https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/dist/codecov.sh))
- **Implementation boundary:** The wrapper invokes the selected CLI command with the token and relevant arguments. The CLI’s notification command calls `upload_completion_logic`, but the CLI source found here is from its current `main` branch—not a CLI version pinned by the action commit—so it does not establish the exact internal notification behavior for the CLI version used in a particular run. ([raw.githubusercontent.com](https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/dist/codecov.sh))

The action commit itself identifies as version **7.1.1**. ([raw.githubusercontent.com](https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/src/version))

Citations:

- 1: https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/action.yml
- 2: https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/dist/codecov.sh
- 3: https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/dist/codecov.sh
- 4: https://raw.githubusercontent.com/codecov/codecov-action/303a32d7a59b442fa8d48b6a1cc6825c09c847a5/src/version

Fail the notification job when send-notifications fails.

fail_ci_if_error defaults to false. If notification sending fails, manual_trigger: true can leave the coverage status or comment missing or stale while this job remains successful. Add fail_ci_if_error: true to expose the reporting failure.

Suggested change
         with:
           run_command: send-notifications
+          fail_ci_if_error: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
run_command: send-notifications
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
run_command: send-notifications
fail_ci_if_error: true
🧰 Tools
🪛 zizmor (1.30.1)

[warning] 1-130: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)


[warning] 114-130: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
20 changes: 20 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
codecov:
branch: main
notify:
# Statuses and the comment wait for `coverage-notify` in test.yml, which
# runs once every matrix job has uploaded, not after the first few.
manual_trigger: true
coverage:
precision: 2
round: down
range: "70...100"
status:
project:
default:
target: auto
# Which branch of a race a watcher test takes depends on the runner's
# timing, so the same code covers a few lines more or less run to run.
threshold: 0.5%
patch:
default:
target: auto
Loading