GitHub Actions radicalized me
-
The real problem is merging before waiting for that one slow CI pipeline to complete
gitlab has a feature where you can set it to auto-merge when and if the CI completes successfully
-
- You write tests for functionality before you write the functionality.
- You code the functionality so the tests pass.
- Then, and only then, the test becomes a regression test and is enabled in your CI automation.
- If the test ever breaks again the merge is blocked.
I disagree. Merging should be blocked on any failing test. No commit should be merged to master with a failing test. If you want to write tests first, then do that on a feature branch, but squash the commits properly before merging. Or add them as disabled first and enable after the feature is implemented. The enabled tests must always pass on every commit on master.
So I can never commit a test without also implementing the functionality?
That's madness.
-
So I can never commit a test without also implementing the functionality?
That's madness.
You can, but not on master.
-
One problem is GHs auto-merge when ready button. It will merge when there are still tests running unless they are required. It would be much better if the auto merges took into account all checks and not just required ones.
It tests passing is a requirement of merging, then you should set the tests as required.
-
It tests passing is a requirement of merging, then you should set the tests as required.
If you have
folderA
andfolderB
each with their own set of tests. You don't needfolderA
s tests to run with a change tofolderB
. Most CI/CD systems can do this easily enough with two different reports. But you cannot mark them both as required as they both wont always run. Instead you need a complicated fan out pipelines in your CICD system so you can only have one report back to GH or you need to always spawn a job for both folders and have the ones that dont need to run return successful. Neither of these is very good and becomes very complex when you are working with large monorepos.It would be much better if the CICD system that knows which pipelines it needs to run for a given PR could tell GH about which tests are required for a particular PR and if you could configure GH to wait for that report from the CICD system. Or at the very least if the auto-merge was blocked for any failed checks and the manual merge button was only blocked on required checks.
-
If you have
folderA
andfolderB
each with their own set of tests. You don't needfolderA
s tests to run with a change tofolderB
. Most CI/CD systems can do this easily enough with two different reports. But you cannot mark them both as required as they both wont always run. Instead you need a complicated fan out pipelines in your CICD system so you can only have one report back to GH or you need to always spawn a job for both folders and have the ones that dont need to run return successful. Neither of these is very good and becomes very complex when you are working with large monorepos.It would be much better if the CICD system that knows which pipelines it needs to run for a given PR could tell GH about which tests are required for a particular PR and if you could configure GH to wait for that report from the CICD system. Or at the very least if the auto-merge was blocked for any failed checks and the manual merge button was only blocked on required checks.
You can have certain jobs run based on what directories or files were modified. If projectA was the only one modified, it can run just projectA's tests.
-
If you have
folderA
andfolderB
each with their own set of tests. You don't needfolderA
s tests to run with a change tofolderB
. Most CI/CD systems can do this easily enough with two different reports. But you cannot mark them both as required as they both wont always run. Instead you need a complicated fan out pipelines in your CICD system so you can only have one report back to GH or you need to always spawn a job for both folders and have the ones that dont need to run return successful. Neither of these is very good and becomes very complex when you are working with large monorepos.It would be much better if the CICD system that knows which pipelines it needs to run for a given PR could tell GH about which tests are required for a particular PR and if you could configure GH to wait for that report from the CICD system. Or at the very least if the auto-merge was blocked for any failed checks and the manual merge button was only blocked on required checks.
Both GitHub Actions and GitLab CI let you specify filepath rules for triggering jobs.
-
It tests passing is a requirement of merging, then you should set the tests as required.
Exactly; the OP image is saying that there's no point to doing that.
-
You can have certain jobs run based on what directories or files were modified. If projectA was the only one modified, it can run just projectA's tests.
Yes. They can. But they do not mix well with required checks. From githubs own documentation:
If a workflow is skipped due to path filtering, branch filtering or a commit message, then checks associated with that workflow will remain in a "Pending" state. A pull request that requires those checks to be successful will be blocked from merging.
If, however, a job within a workflow is skipped due to a conditional, it will report its status as "Success". For more information, see Using conditions to control job execution.
So even with github actions you cannot mix a required check and path/branch or any filtering on a workflow as the jobs will hang forever and you will never be able to merge the branch in. You can do either or, but not both at once and for larger complex projects you tend to want to do both. But instead you need complex complex workflows or workflows that always start and instead do internal checks to detect if they need to actually run or not. And this is with github actions - it is worst for external CICD tooling.
-
wrote on last edited by [email protected]
"You don't have the hiring and firing power."
-- Kitty, Arrested Development