description |
---|
Merge Queue's create predictive branches to verify that the future state of your protected branch will remain green when the contents of the queue merge into it. |
- Instead of merging your pull requests directly through GitHub, engineers submit their pull requests to the merge queues service. A pull request can be submitted to the queue before passing CI or code review is complete. Once the prerequisites for the queue have been met - the pull request will formally enter the queue.
- Trunk Merge Queue will test your pull request against the changes ahead of it in the queue so that the changes are tested against the predicted view of the branch, assuming everything ahead of it merges successfully. This process is called predictive testing and is illustrated in the video below.
- When all the required tests are passed, Trunk will squash merge your pull request into the protected branch automatically.
- If your pull requests fails testing - it will either be retested or removed from the queue for further inspection by the author.
{% embed url="https://share.vidyard.com/watch/31gaLwGNSYTn2ec2BSQjkn" %} predictive testing // test pull requests ahead of you in the queue with your changes {% endembed %}
What happens under the hood when I submit a pull request to the queue?
- Trunk Merge Queue will wait until all the normal gating tests for a pull request are passing. By default, this is the list of required status checks and code review requirements you have configured for pull requests to pass before they can be merged onto
main
- Once the pre-requisites are met, Trunk Merge Queue will create a temporary branch with the naming convention
trunk-merge/***
. This branch will be based on the head ofmain
and will include the changes in your pull request and the changes from pull requests ahead of your pull request in the queue. This is the predictive branch described above and is used to guarantee the correctness of your system. - The same tests that are required for your pull request will now be run on this predictive branch. When those tests pass - your original pull request will be merged into
main
.
Batching | batching.md |
Dynamic Parallel Queues | parallel-queues |
Optimistic Merging | optimistic-merging.md |
Pending Failure Depth | pending-failure-depth.md |
Prioritization | pr-prioritization.md |
Flaky Test Protection | anti-flake-protection.md |
{% embed url="https://youtu.be/V74t41-uV7I" %}
Trunk Merge Queue works with any CI provider as long as you use GitHub for your repo hosting.
Talk to a developer | https://calendly.com/trunk/demo | ||
Get started on your own | set-up-trunk-merge |