Upgrade
-
Change the version constraint:
-
Run
terraform init -upgrade. -
Run
terraform plan.
batching_rules, as changed outside Terraform; that’s harmless. To roll back, pin ~> 1.1 and run terraform init -upgrade.
What changes
Leaving out required_statuses no longer removes the override
In 1.x, leaving it out removed the queue’s override on every apply; 2.0 leaves the override alone, and plan doesn’t flag this. To clear an override, set required_statuses = [], which did nothing in 1.x.
required_statuses is a set
Order no longer matters. Wrap an index into it in sort(), such as sort(trunk_merge_queue.main.required_statuses)[0], to get the same check as in 1.x.
api_key and base_url must be known when planning
1.x fell back to TRUNK_API_KEY and TRUNK_BASE_URL while they were unknown; 2.0 fails, so apply anything they depend on first.
base_url is the API host
Set it to the host, such as https://api.trunk.io; a value ending in /v1 still works.
New in 2.0
- API keys. See Switch to an API key.
- New settings:
test_branch_construction_modeandbatching_rules. - With an API key:
queue_idandmanaged_state, import by queue ID, andbatching_max_wait_time_minutes = 0(don’t wait). testing_timeout_minutes = 0means no timeout.
Fixed in 2.0
- A wrong or revoked organization API token, or an unknown repository, now fails the refresh instead of removing the queue from state.
- With the organization API token, a refresh no longer writes to queues on hosts other than
github.com; it warns instead. Use an API key to update those queues.
Switch to an API key
The v1 API, which the organization API token uses, will be deprecated soon. To move to v2:- Create an API key with the Update Merge Queue settings permission.
- Lower any value above a v2 cap.
- Replace the token with the key, in
TRUNK_API_KEYorapi_key. - Run
terraform apply. It changes only values you lowered, and recordsqueue_idandmanaged_state.