DEVOPS

Fully-Rolled-Out Flag Cleanup PR Opener

Scans your flag-state table for flags that have been at 100% rollout for longer than a grace window.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerschedule
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerWeekly schedule fires
  • ActionQuery flags at 100% past grace windowPostgreSQLPostgres
  • LogicDrop flags tagged keep / kill-switch
  • ActionLocate flag call sites in repoGitHubGitHub
  • ActionOpen cleanup PR inlining live branchGitHubGitHub
  • OutputPost PR links to Slack for reviewSlack

What it does

Finds feature flags that have served 100% of traffic on the same variant for longer than a configurable grace period (the toggle has effectively become permanent), and opens a code-cleanup pull request that removes the now-dead `if (flag)` branch and inlines the live path.

When to use it

Run it on a schedule when your flag-state table tracks rollout percentage and last-changed timestamps, and you want stale toggles cleared out of the codebase before they rot into invisible tech debt.

How it works

  1. 1A weekly schedule fires the workflow.
  2. 2It queries Postgres for flags at 100% rollout whose last state change is older than the grace window.
  3. 3A filter drops any flag tagged `keep` or `kill-switch` so safety flags survive.
  4. 4For each surviving flag it searches the GitHub repo for the flag key's call sites.
  5. 5It opens a branch and PR that deletes the conditional and inlines the enabled branch, citing the rollout age in the description.
  6. 6It posts the PR links to Slack for an engineer to review and merge.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect PostgresAny Postgres URL — query, write, migrate.
  2. 2
    Connect GitHubRepos, issues, pull requests, actions.
  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.