ENGINEERING

Tag New Flags with an Expiry Date When Their MR Opens

When a GitLab MR that introduces a new feature flag is opened, this records the flag with a default expiry date in Postgres and comments on the MR with the cleanup deadline.

CategoryEngineering
Enginesim
Difficultybeginner
Triggerevent
Steps5
Setup~5 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab MR opened webhook firesGitLabGitLab
  • LogicParse diff for newly added flag keys
  • LogicExit if no new flag keys introduced
  • ActionUpsert Postgres registry row with 90-day expiry and ownerPostgreSQLPostgres
  • OutputComment expiry deadline on the GitLab MRGitLabGitLab

What it does

Intercepts flag creation at the source. When a newly opened GitLab MR adds a feature-flag key that is not yet in the registry, it inserts a row in Postgres with a default expiry (creation date plus 90 days) and posts an MR comment stating the cleanup deadline and owner. Debt prevention rather than debt cleanup.

When to use it

Use this as the upstream complement to the other reapers: the best stale flag is one that never goes stale because it had an expiry from day one. Adopt it when starting a flag-hygiene program so new flags stop adding to the pile while older workflows drain the existing backlog.

How it works

  1. 1A GitLab MR-opened webhook fires.
  2. 2Parse the diff for newly added flag-key references.
  3. 3Branch: exit if the MR introduces no new flag keys.
  4. 4For each new key, upsert a Postgres registry row with a 90-day expiry and the MR author as owner.
  5. 5Post a GitLab comment on the MR naming the flag, its expiry date, and cleanup expectations.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.