Skip to content

Bot merge queue #1773

@linear-code

Description

@linear-code

Context

Staging deployment must be completed sequentially.

Problem

  • Before deploying to main, the PR owner needs to check if there is a staging deployment in progress (people often forget to do this)
  • Tech lead needs to constantly monitoring the deployments to merge new PRs

Solution

Create a github workflow to simulate a PR merge queue.

  1. Trigger workflow when a PR has is ready (ready = PR is NOT a draft, it has been approved and passes all of the linting checks) & trigger workflow every 15/30 mins
  2. Workflow reads all of the open PRs and gets a list of all ready PRs, sorted by creation time (oldest ready PR should be merged first)
  3. Workflow pops the first PR from the queue.
    1. If there is a staging deployment in progress, return
    2. If the PR is up to date with main and there are no merge conflicts, merge it.
    3. If the PR is up to date with main and there are conflicts with main, convert the PR to a draft and ping the owner
    4. If the PR is not up to date with main and there are no conflicts, update it (if linting fails, convert the PR to draft and ping the owner), then merge it.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions