Conversation
cdc-ap66
approved these changes
Aug 14, 2025
cdc-ap66
left a comment
Contributor
There was a problem hiding this comment.
Thanks for fixing this. It was an annoying pattern we hadn't got around to fixing. This is much better! LGTM
Collaborator
Author
|
Let's hope this works! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, any time I push a commit to a branch that has an open PR, CI will add another commit, updating the test coverage badge. Most of the time, this is a trivial commit, since the coverage hasn't actually changed, and it's only the timestamp that gets altered.
This caused friction for me because it meant that, at random intervals after I had
git pushed to my PR branch, I would need togit pull --rebase, to update the coverage badge based on what had happened in CI.My proposal here is to only run pytest on every push to a PR-linked branch, but update the coverage branch only when merging into main.
I'm not 100% sure this will work as expected. It might also not be the best approach. For example, one might just drop the timestamp, or maybe run some more complex logic to see if the test coverage actually changed (i.e., run
poetry run coverage-badge, writing the bad to some temporary location, and then proceeding to commit it only if the checked-in file and the temporary file differ?).