Repository navigation
ci(tests): Remove limitation of branches to run on - #11794
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to f304208
Previous suggestions✅ Suggestions up to commit 142a450
|
|||||||||||||||||||||
|
Hold on, there seems to be a problem with ending of the lines, I'll check why the whole thing is highlighted |
|
Now fine |
|
@OSA413 We might need to add a condition so that the tests don't run twice when the PR is created from a branch in this repo, like we had it in the past - I'm not sure if that condition is still there (didn't manage to check the changes from October yet, only observed the effects). |
There was a problem hiding this comment.
I don't think we should allow to run tests on every push to any branch. Generally developers should use local test run to verify their changes as their are much faster and do not count against the quota. The test run in PR are for helping reviewers. The test run on push are only for calculating coverage.
Why would we want to run test on pushes against any branch?
Yeah, but what if I don't want to boot all the databases (ALL of them) locally to check if a core functionality is still working across all DBs in the change I made? Providing a way of assuring that the tests are fine before creating a PR would decrease the time reviewing because the contributor had the time to check breaking changes on their fork in their branch. |
afair it only applies to the branches where the |
@alumni do you mean the situation when a PR is created and then a contributor with write access is pushing to the PR branch and it's run on their fork and on this repo? This situation was also happening when a contributor with write access created a branch on this repo and pushed to this repo's other branch. |
When I work with other open source projects, I typically make changes locally, run tests, and when all work, I commit, push and immediately go and create a PR without waiting no for CI to run. And when I am maintainer, I do not even look at a PR with failing CI. What you propose is quite unusual setup for both open source and private repos. I doubt anybody would expect his push to a branch would trigger CI, until a PR is created. So I guess they will just create a PR immediately after the push. And spinning 10 docker containers with databases locally to run the tests should also not be that much of an issue on a modern computer. They will be also much faster than in CI. And if you really don't want to do that, you can always temporarily change this file in your branch before making a PR. |
|
@OSA413 No, I meant when a collaborator is creating a branch in this repo, and a PR from that branch (without using a fork). The same action was running twice in the past, I fixed it at some point, did not check if it's the same now (this was affecting @naorpeled quite a lot actually). @pkuczynski we want users to be able to run the actions in their own fork while they are preparing the PR. For me at least it is very helpful, since I don't run all drivers locally. It is also helpful for contributors, since the actions don't run unless they are approved by a collaborator, so seeing the result in their own fork (which counts against their own quota) is extremely helpful. The CI setup that we had in the past was implemented intentionally the way it was, based on the problems we observed over a longer period of time for multiple contributors ;) @pkuczynski please trust us, it was what we wanted. |
What if your local configuration is different than CI's and only it passes the tests but not the CI on the repo? Do you test locally with all operation systems that the project supports? Anyway, this would also be shown in a PR that it fails.
Ooops, your non-maintainer PR is failing because of different configurations (described above in this reply), what will you do? |
In the current setup a push to PR and push to any branch will both cause run of CI so for PR it will be effectively running twice. I guess that's what he thinks... |
I'm afraid that you'll have to figure that out again (in a separate PR, for example) because I have no idea how to properly do that, sorry ;) Anyway here are useful documentation that should point to the correct way:
|
That's why we should help people to have exactly the same configuration like in CI and we already to that with nvmrc and docker compose. If you don use them, you go against contribution guidelines.
I try to reproduce the issue locally. Pushing blindly to CI is pointless since it will run all the test again and again, and you rather only make a mistake against one db... |
Everybody should be first running the tests locally. There is a good reason why actions are not run without pre approval: security and abuse. 99% of people will push and fire up PR immediately. And once we approve first run, it will run on subsequent pushes. In your setup, when PR is fired, the test will run in PR against our quota and in fork against fork quota. Let's have compassion to the planet and not burn electricity for same job twice. Especially we have lengthy jobs. And really running few docker containers with a single docker compose is a matter of single command. |
Does that mean that I have to constantly upgrade RAM to keep my laptop up with the requests of all the databases? My gaming laptop came with 8 GB RAM, I manually upgraded it to 32 GB later. Btw I'm (personally) unable to download Oracle Free DB docker image locally because it restricted downloads from my country. What should I do to comply with the contribution guidelines then? |
That's not the case when contributor has no write access. |
Contributor has nothing to worry. We will run test in PR. And since you run all the other databases, the chance it will fail just of oracle is rather small... |
@OSA413 sure, no problem :) I'll figure it out at some point, just maybe later - these issues with CI that popped up were the last thing I wanted to worry about now. |
PR Code Suggestions ✨No code suggestions found for the PR. |
We've been explicitly recommending contributors to setup the CI in their forks, so they can test their changes without us having to approve the PR. So we would like to allow this in the future as well.
Co-authored-by: Lucian Mocanu <[email protected]>
Co-authored-by: Lucian Mocanu <[email protected]>
User description
Description of change
This change removes restriction of branches the tests are run on. This is useful for contributors that create their forks and their branches. Currently, even if a contributor creates their fork, it's currently limited to
masterandnextbranches. This is useful for people that create a lot of branches to test things on.I verified it on my personal fork.
Basically the same as #11173
Pull-Request Checklist
masterbranch[ ] This pull request links relevant issues asFixes #00000[ ] There are new or updated unit tests validating the change[ ] Documentation has been updated to reflect this changePR Type
Enhancement
Description
Removes branch restrictions from GitHub Actions workflow
Tests now run on all branches, not just master and next
Enables contributors to test on their own fork branches
Simplifies CI/CD configuration for development workflows
Diagram Walkthrough
File Walkthrough
tests.yml
Remove branch restrictions from push trigger.github/workflows/tests.yml
branchesfilter frompushtrigger that limited runs tomasterand
nextpushtrigger to run on all branches without branchspecification
pull_requesttrigger unchanged to maintain PR validation