Block new tables from retention policy allowlist
What does this MR do and why?
Adds a Danger check that fails when new table entries are appended to
spec/support/database/retention-policy-missing-allowlist.yml.
The allowlist is introduced in !252009 (merged) to grandfather in tables that
predate the Data Retention Policy Framework.
Without a guard, contributors can grow the exception list instead of
declaring a retention policy under db/docs/data_retention/<table>.yml,
silently expanding what the RSpec suite considers "temporarily exempt".
This MR adds a small Danger plugin that:
- Runs only when the allowlist file itself is modified in the MR.
- Reads the file's diff, extracts added
- <table>entries, and callsfaillisting every added table. - Points the author at the framework handbook page and the correct declaration path.
Removals from the allowlist (the intended direction — a table has declared a retention policy and is being removed from the exception list) are ignored.
Stacked on top of !252009 (merged) because the allowlist file it guards is introduced there.
How to set up and validate locally
Locally simulate a new-table addition:
echo "- brand_new_table" >> spec/support/database/retention-policy-missing-allowlist.yml
git add spec/support/database/retention-policy-missing-allowlist.yml
git commit -m "test: add fake table to allowlist"
bundle exec danger dry_runDanger should fail, listing brand_new_table and pointing at the
framework docs.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.