This repository hosts the trunk mergequeue-tool which can be used to demonstrate the performance characteristics of repository managed by trunk merge graph under different simulated loads.
Usage: mq [OPTIONS] [COMMAND]
Commands:
generate Generate pull requests
enqueue Enqueue a specific pull request to the merge queue
test-sim Simulate a test with flake rate in consideration
housekeeping Clean out conflicting PRs and requeue failed PRs
config Print current configuration content to json
defaultconfig Generate default configuration content
Options:
--gh-token <GH_TOKEN> GitHub token (can be specified multiple times, or use GH_TOKEN env var)
--trunk-token <TRUNK_TOKEN> Trunk API token (can also use TRUNK_TOKEN env var)
--dry-run Show what would be done without executing
-h, --help Print help
-V, --version Print versionRunning mq generate will attempt to generate pull requests at the configured rate. Generate can
operate in two different modes. By setting the mutually exclusive requests_per_hour or
requests_per_run value you are specifying to either run in either distributed mode which will try to
distribute the generate load across the specified run_generate_for value or burst mode which will
attempt to create pull requests as quickly as possible given the specified requests_per_run value.
Burst Mode configuration to create 20 pull requests as quickly as possible
requests_per_run: 20Distributed Mode configuration to create 25 pull requests over 15 minutes time
requests_per_hour = 100
run_generate_for = "15 minutes"The load imparted onto the connected queue is controlled by the mq.toml file in the .config
folder.
The configuration system allows for setting the desired load on the queue, the flake rate and the
interdependence element of the pull requests. The tooling is designed to generate pull requests
assuming mq generate is called every 10 minutes.
# parallelqueue - will push deps information to the service to take advantage of trunk merge dynamic parallel queues
# singlequeue - single traditional queueu
# Default value: "singlequeue"
#mode = "singlequeue"
# Default value: "none"
#build = "none"
[trunk]
# Default value: "api.trunk.io"
#api = "api.trunk.io"
[git]
# Default value: "Jane Doe"
#name = "Jane Doe"
# Default value: "[email protected]"
#email = "[email protected]"
[pullrequest]
# Default value: ""
#labels = ""
# Default value: ""
#comment = ""
# Default value: "This pull request was generated by the 'mq' tool"
#body = "This pull request was generated by the 'mq' tool"
# Default value: 0
#requests_per_hour = 0
# The desired length of time generate should run for attempting to
# distribute the requests_per_hour over that time period
#
# Default value: "10 minutes"
#run_generate_for = "10 minutes"
# Default value: 0
#requests_per_run = 0
# Default value: "bazel/"
#change_code_path = "bazel/"
# Default value: 1
#max_deps = 1
# Default value: 1
#max_impacted_deps = 1
# Distribution of dependency counts for PRs (deterministic based on PR number)
# Format: "0.75x1,0.15x2,0.09x3,0.01xALL" means 75% get 1 dep, 15% get 2 deps, etc.
# "ALL" means use all available dependencies.
# The distribution is stable but shuffled so the occurence rate will be randomly distributed
# If not set, falls back to max_deps/max_impacted_deps behavior
# deps_distribution = "0.75x1,0.15x2,0.09x3,0.01xALL"
# Default value: 100
#logical_conflict_every = 100
# Default value: "logical-conflict.txt"
#logical_conflict_file = "logical-conflict.txt"
# Default value: ["removed from the merge queue", "To merge this pull request, check the box to the left", "/trunk merge"]
#detect_stale_pr_comments = ["removed from the merge queue", "To merge this pull request, check the box to the left", "/trunk merge"]
# Default value: "4 hours"
#close_stale_after = "4 hours"
[test]
# Default value: 0.1
#flake_rate = 0.1
# Default value: "1 second"
#sleep_for = "1 second"
[merge]
# Default value: "comment"
#trigger = "api" # Options: "api", "run", "comment", "label"
# Default value: ""
#labels = ""
# Default value: ""
#comment = ""
# Default value: ""
#run = ""