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: configure bors #2761

Merged
merged 2 commits into from
Nov 22, 2022
Merged

ci: configure bors #2761

merged 2 commits into from
Nov 22, 2022

Conversation

messense
Copy link
Member

Closes #2710
Closes #2714

@messense messense added the CI-skip-changelog Skip checking changelog entry label Nov 20, 2022
@messense
Copy link
Member Author

actions/runner#1985 matrix doesn't work in jobs.<job_id>.if, so annoying.

@messense
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Nov 20, 2022
@bors
Copy link
Contributor

bors bot commented Nov 20, 2022

try

Build succeeded:

- emscripten
if: always()
runs-on: ubuntu-latest
steps:
Copy link
Member

Choose a reason for hiding this comment

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

Is this really necessary? Doesn't needs already require these job to finish successfully? Also what the reason to have if: always() here?

Generally speaking, I am not a fan of the manual JavaScript-based approach to CI workflows and would prefer if just split our workflows into one pull requests and for used by bors even if it means having some redundancies between the two workflow definitions if this allows us to keep the declarative approach.

I am also not sure if just adjusting the matrix of the build job is sufficient differentiation between the two use cases (pre-review check and pre-merge check). More fundamentally, I feel that the build could use some re-engineering as it has a collected a lot of different use cases in conditional steps which would work better as individual jobs IMHO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this really necessary? Doesn't needs already require these job to finish successfully? Also what the reason to have if: always() here?

It gives a nicer overview: https://github.com/PyO3/pyo3/actions/runs/3508244920/jobs/5876898372#step:2:1 even when canceled due to previous failures.

Copied from https://github.com/cross-rs/cross/blob/ab99baf7f4c39403a0b033cef95d798bd0b9a940/.github/workflows/ci.yml#L361-L373

Copy link
Member Author

Choose a reason for hiding this comment

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

I feel that the build could use some re-engineering as it has a collected a lot of different use cases in conditional steps which would work better as individual jobs IMHO.

Expanding more jobs may result in more cache misses thus longer build time, we are already over the 10GB cache limit.

Copy link
Member

Choose a reason for hiding this comment

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

Expanding more jobs may result in more cache misses thus longer build time, we are already over the 10GB cache limit.

We could also improve on this front, considering the approach outlined in #2710 (comment), the caches for the pull requests could become much more lightweight. (I think the issue of missing caches could also be solved by running the lightweight on-pull-request workflow as an on-push event on main? The heavyweight jobs would only run on trying/staging I guess?)

Copy link
Member Author

Choose a reason for hiding this comment

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

run check (not test) for each OS / Python version, and then one run of the test suite on each OS w. latest Python

It's not really lightweight IMO, I'd drop the run check (not test) for each OS / Python version part, and coverage jobs are even heavier but they should be kept to ensure good test coverage.

I think the issue of missing caches could also be solved by running the lightweight on-pull-request workflow as an on-push event on main?

It will do, but I think with bors we shouldn't re-run workflow on main, bors was designed to avoid broken checks on main I think?. Maybe we should explore using sccache instead.

Copy link
Member

Choose a reason for hiding this comment

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

I'd drop the run check (not test) for each OS / Python version part

I agree. I don't think full platform coverage is something we need during review.

and coverage jobs are even heavier but they should be kept to ensure good test coverage.

As with the above, I think one coverage job should suffice. (And it could subsume the test job because the tests run to produce the coverage.)

It will do, but I think with bors we shouldn't re-run workflow on main,

Exactly, bors should only run on trying/staging which is main after merging the PR, hence one does not need to re-run bors on main because updating main to trying/staging is a fast-forward merge to something that was just tested.

So in summary:

  • main and pull requests: lightweight pre-review workflow to seed cache.
  • trying/staging: heavyweight bors pre-merge workflow. (Since bors pushes to our repo it should be able to use our caches without seeding.)

@messense messense force-pushed the bors branch 2 times, most recently from 72b6f8a to 53cb9f6 Compare November 21, 2022 02:58
@messense
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Nov 21, 2022
@bors
Copy link
Contributor

bors bot commented Nov 21, 2022

try

Build succeeded:

@messense
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Nov 21, 2022
@bors
Copy link
Contributor

bors bot commented Nov 21, 2022

try

Build succeeded:

@davidhewitt
Copy link
Member

Thanks! I'm curious to see what it looks like without the conclusion job, so I've pushed that to my own branch.

@messense
Copy link
Member Author

messense commented Nov 22, 2022

I'm curious to see what it looks like without the conclusion job

I'm a bit worried about it due to this comment in bors forum: https://forum.bors.tech/t/check-matrix/673/2

Bors always marks things finished with the first status that matches the name. Whatever status is set in your bors.toml should be unique, otherwise things won't work, because bors doesn't know about your test matrix.

@davidhewitt
Copy link
Member

Right, good find.

In which case, I think this is a great starting point, shall we merge this one and then we can write follow-up PRs for the improvements in #2761 (comment) as well as bringing pyo3-ffi-check into this workflow etc?

@messense messense marked this pull request as ready for review November 22, 2022 08:25
@messense
Copy link
Member Author

In which case, I think this is a great starting point, shall we merge this one and then we can write follow-up PRs for the improvements in #2761 (comment) as well as bringing pyo3-ffi-check into this workflow etc?

I think so.

We need to tweak the required status. I think we can drop python3.11-* in required status first and use bors r+ command to generate the bors build status then add it to required status.

@messense
Copy link
Member Author

bors r+

@davidhewitt
Copy link
Member

I think I've managed to update the rules... Let's see what happens.

@bors
Copy link
Contributor

bors bot commented Nov 22, 2022

Build succeeded:

@bors bors bot merged commit d53baed into PyO3:main Nov 22, 2022
@messense messense deleted the bors branch November 22, 2022 11:37
@messense messense added the CI Continuous Integration label Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add bors to CI
3 participants