Skip to content

Conversation

@webknjaz
Copy link
Member

@webknjaz webknjaz commented Nov 7, 2025

The patch aims to ensure Codecov reports are uploaded on failures. This is achieved by checking a cancelled() state which makes sure the default success() isn't applied.

It also bumps the Codecov action to v5 and makes the Codecov config dot-prefixed.

Finally, an explicit notification mechanism is configured to tell Codecov about upload completions. This should to prevent Codecov from processing coverage reports too early.

Contributor checklist
  • Included tests for the changes.
  • A change note is created in changelog.d/ (see changelog.d/README.md for instructions) or the PR text says "no changelog needed".
Maintainer checklist
  • If no changelog is needed, apply the bot:chronographer:skip label.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

@webknjaz webknjaz added this to the later milestone Nov 7, 2025
@webknjaz webknjaz self-assigned this Nov 7, 2025
@webknjaz webknjaz added maintenance Related to maintenance processes ci Related to continuous integration tasks labels Nov 7, 2025
@webknjaz webknjaz force-pushed the maintenance/gha-codecov-stability branch from 6ab7e4d to 97aa041 Compare November 7, 2025 02:06
Copy link
Member

@sirosen sirosen left a comment

Choose a reason for hiding this comment

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

👍 for the core ideas. I've not used this codecov mechanism before, but I'm happy to learn.


comment: false # avoid spamming reviews

...
Copy link
Member

Choose a reason for hiding this comment

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

Is an ellipsis a special kind of YAML node? I don't recall this one, but there are so many exotic features in YAML that I'm slow to assume that it's a mistake.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's just a marker of the end. Totally optional. I just like it there and it got copied from another project.

A multi-document YAML file might look like this:

---

doc1: stuff

---

doc2: things

---

doc3: the rest

...

@webknjaz
Copy link
Member Author

webknjaz commented Nov 7, 2025

I've but (edited) not used this codecov mechanism before, but I'm happy to learn.

I've only started integrating it recently. I've added it to ansible/ansible and aio-libs/yarl only, I think.

Previously, I was adding the exact number of uploads to the config to prevent Codecov from reporting too early. But that's annoying to maintain as it should match the number of CI jobs which changes with the matrix.

So explicit notifications is sorta the same but not precisely. AFAIU, this delays Codecov's processing in their backend until notified. However, I think it still may sometimes report checks (statuses/comments) to GH earlier than it finished processing all the reports it'd received. The linked PRs have a bunch of references that I explored — they made me conclude it works like this.


In other news, I started this because the codecov upload step gets skipped on failures and I'm currently trying to fix that — GHA seems to evaluate the conditional to false and I'm trying to understand why. Perhaps, #2266 will help shed some light on it as I think it's capable of analysing expressions.

This is achieved by checking a `cancelled()` state which makes sure
the default `success()` isn't applied.
This aims to prevent Codecov from processing coverage reports too
early.
@webknjaz webknjaz force-pushed the maintenance/gha-codecov-stability branch from a4d4450 to 17050d9 Compare November 7, 2025 17:56
webknjaz added a commit to webknjaz/pip-tools that referenced this pull request Nov 7, 2025
@webknjaz webknjaz force-pushed the maintenance/gha-codecov-stability branch from 17050d9 to 3e234d9 Compare November 7, 2025 18:09
@webknjaz webknjaz requested a review from Copilot November 7, 2025 18:09
@webknjaz webknjaz marked this pull request as ready for review November 7, 2025 18:09
@webknjaz webknjaz enabled auto-merge November 7, 2025 18:09

This comment was marked as resolved.

@webknjaz webknjaz force-pushed the maintenance/gha-codecov-stability branch from 3e234d9 to b0730a6 Compare November 7, 2025 18:11
@webknjaz
Copy link
Member Author

webknjaz commented Nov 8, 2025

@sirosen I've confirmed that this works and reverted the artificial failure. This should be ready for merge. Once it's in, we should make sure #2253 is rebased so that we get more visibility into what might not be marked as covered under Python 3.8 in there.

@webknjaz webknjaz added this pull request to the merge queue Nov 8, 2025
Merged via the queue into jazzband:main with commit 785ed5e Nov 8, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided ci Related to continuous integration tasks maintenance Related to maintenance processes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants