Schedule icon
Request icon
Script icon
Docker icon
If icon
SlackIncomingWebhook icon

GitLab merge request missing approval and reviewer sentinel

Audit GitLab merge requests via GraphQL API for missing reviewers and required approvals, alerting maintainers in Slack to enforce code review governance.

Categories
BusinessInfrastructure

Audits active GitLab merge requests targeting protected branches using the GitLab GraphQL API, detects merge requests lacking assigned reviewers or missing required approvals, and alerts engineering teams in Slack to maintain review velocity.

What you get

  • Continuous enforcement of code review standards on critical target branches (e.g., main, release, master).
  • Early discovery of orphaned or unreviewed pull requests before they cause sprint delivery delays.
  • Automated weekday digests highlighting MR authors, reviewer counts, and required approvals remaining.
  • Reduced pull request idle time and improved engineering velocity.

Who it's for

  • Engineering Managers and Tech Leads tracking PR lead times and team code review responsiveness.
  • Platform and DevSecOps Engineers implementing automated branch protection governance.
  • Software Development Teams operating on GitLab Cloud or self-hosted GitLab instances.

Why orchestrate this with Kestra

Managing review backlogs across dozens of repositories often results in pull requests sitting idle without reviewers for days. Kestra periodically inspects GitLab's GraphQL endpoint to pull merge request approval rules, runs policy checks inside an isolated Python script runner, and delivers direct actionable reminders with clickable MR links to engineering Slack channels.

Prerequisites

  • A GitLab personal access token or project access token with read_api permission.
  • A Slack Incoming Webhook URL configured for review notifications.

Secrets

  • GITLAB_PRIVATE_TOKEN: GitLab token passed in the Authorization: Bearer header.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to post review reminders.

Quick start

  1. Store your GitLab token and Slack webhook in Kestra Secrets (GITLAB_PRIVATE_TOKEN and SLACK_WEBHOOK_URL).
  2. Set gitlab_project_path to your target project (e.g. gitlab-org/gitlab) and configure target_branch.
  3. Trigger a manual execution from the Kestra UI to verify that active merge requests are evaluated.
  4. Enable the weekday_review_governance_schedule trigger to automate twice-daily checks.

How to extend

  • Add automated reviewer assignment mutations via GitLab REST/GraphQL API based on CODEOWNERS files.
  • Filter merge requests by specific labels (e.g., security, urgent, customer-reported) for prioritized routing.
  • Calculate and store PR review turnaround times into a PostgreSQL or BigQuery analytics warehouse.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.