DEVOPS

Flag-Age Gate on Pull Request Merge

On every PR that touches flag-guarded code, it checks how old each referenced flag is and warns when a PR builds on a flag that is already overdue for removal.

CategoryDevOps
Enginesim
Difficultyadvanced
Triggerwebhook
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerPR opened or updated webhookGitHubGitHub
  • ActionExtract flag keys from PR diffGitHubGitHub
  • ActionLook up flag age and rollout statePostgreSQLPostgres
  • LogicSelect flags past expiry SLA
  • ActionPost inline PR review commentGitHubGitHub
  • OutputPing PR author in SlackSlack

What it does

Whenever a pull request modifies code wrapped in a feature flag, it looks up each referenced flag's creation date and rollout state, and warns when developers are extending code that depends on a flag already past its expiry SLA.

When to use it

Use it as a guardrail in active repos where engineers keep adding logic behind flags that should have been retired, quietly compounding the cleanup backlog.

How it works

  1. 1A GitHub pull-request webhook fires when a PR is opened or updated.
  2. 2It diffs the PR to extract every feature-flag key the changed lines reference.
  3. 3It queries Postgres for each flag's age and current rollout status.
  4. 4A filter selects flags older than the expiry SLA or already at 100%.
  5. 5If any stale flag is found, it posts an inline review comment naming the offending flags and their age.
  6. 6It also pings the PR author in Slack so the warning is not missed.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.