Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run Codecov for commits to main #1751

Merged
merged 5 commits into from
Oct 3, 2022
Merged

ci: run Codecov for commits to main #1751

merged 5 commits into from
Oct 3, 2022

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Sep 29, 2022

This PR enables build-test.yml and tests.yml for each commit to main. This addresses two problems:

  1. main is currently only tested every ~30 days
  2. Codecov doesn't find coverage data newer than every ~30 days

This is the "obvious" way to tackle both of these problems, but it is not necessarily the nicest for the environment.

So, there are other ways of tackling this:

  • Run a special codecov workflow for each commit to main. Only run build-test.yml and tests.yml at a reduced frequency, e.g once every couple of days.
  • Run a special codecov workflow for each commit to main. Also, run tests.yml for each commit to main.
  • etc.

@jpivarski do you have a preference here?

Fixes #1745

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #1751 (fbb6ed5) into main (084fa4b) will increase coverage by 0.00%.
The diff coverage is 94.00%.

❗ Current head fbb6ed5 differs from pull request most recent head 85b2e22. Consider uploading reports for the commit 85b2e22 to get more accurate results

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_connect/jax/__init__.py 90.47% <ø> (ø)
src/awkward/_connect/rdataframe/from_rdataframe.py 0.00% <0.00%> (ø)
src/awkward/operations/ak_from_parquet.py 88.72% <0.00%> (ø)
src/awkward/contents/unionarray.py 86.32% <75.00%> (ø)
src/awkward/operations/ak_backend.py 66.66% <75.00%> (ø)
src/awkward/nplikes.py 66.20% <76.47%> (ø)
src/awkward/contents/numpyarray.py 90.09% <77.77%> (ø)
src/awkward/_connect/numpy.py 65.42% <80.00%> (ø)
src/awkward/operations/ak_to_categorical.py 90.90% <83.33%> (ø)
src/awkward/behaviors/string.py 75.86% <88.88%> (ø)
... and 111 more

Now we test each commit to main, this isn't required
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

The motivation for the scheduled test of main and its low frequency was to keep the "tests" badge green, actually. We don't allow tests to fail on main (though that's only partially tested, due to the concurrency issues in always testing exactly what will be in the main branch after merging), so the badge would, in principle, always be green, anyway, but it was grey because of the lack of explicit tests. The 30 day frequency was to avoid spending too much of our resources on the aesthetics of a green badge.

To keep that badge non-gray, we'll need some CI tests to run on main occasionally. Doing it with every commit nearly duplicates the PR branch testing. Maybe it could be done with a smaller matrix? Maybe just one platform-Python version?

But doing both the tests and the Codecov on main is desirable.

@agoose77
Copy link
Collaborator Author

agoose77 commented Sep 29, 2022

Good, that settles it.

It might actually be possible to check whether the merged PR used the same base commit as main. If we can do that, then we could, in those cases, assume that the coverage result would match the merged repo. Otherwise, we can run a simple single-matrix-element build (Linux py37) to compute the coverage for the merged commit.

If this is not possible, then we can just keep periodic full testing on main, and add a new per-commit single-matrix-element build as suggested in the previous paragraph.

The disadvantage of the single element case is that we might miss changes that are platform/Python version specific. We could choose random configurations such that we cover more matrix elements over the course of the month... but I see that being problematic for determinism reasons. At the end of the day, do we make per-platform changes more frequently than monthly? I suspect not.

@agoose77 agoose77 changed the title ci: run build-test on main ci: run Codecov for commits to main Sep 29, 2022
@agoose77
Copy link
Collaborator Author

I've settled on just running a single Codecov job for commits to main. Every month we'll run a full build, which will update our coverage baseline in cases where we made coverage-altering per-platform changes. I think these are probably rare enough tha t we don't need to go to the extra effort of testing a larger matrix, or determining whether we can reuse coverage results.

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

This new test does not run monthly, but adding 1 extra task upon PR-merger doesn't significantly increase resource usage, since we're running ~10 for every commit already. It looks like this will provide a Codecov baseline and a quick test of main itself (as opposed to the last commit in the branch).

That seems like a good compromise between leaving actual-main untested (i.e. assuming that all PRs merge into something correct) and fully testing main on every PR merger, or requiring every PR to be up-to-date with main before merging and requiring all of their tests to pass (which essentially serializes testing and merging).

Let's go with this!

@agoose77 agoose77 merged commit 798f51c into main Oct 3, 2022
@agoose77 agoose77 deleted the agoose77/ci-test-main branch October 3, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codecov isn't finding the correct base with "squash and merge"
2 participants