Expand description
[ARCHIVED-YYYY-MM-DD] orphan rename helper.
Resources with no DELETE endpoint get renamed instead of dropped, so operators can still find them in the Braze dashboard. Functions are pure and date-injectable so tests can lock the format without coupling to the system clock.
Functionsยง
- archive_
name - Apply the archive prefix to
original. Idempotent: if the name already begins with[ARCHIVED-YYYY-MM-DD], return it unchanged so runningapply --archive-orphanstwice does not produce[ARCHIVED-2026-04-11] [ARCHIVED-2026-04-10] foo. - is_
archived - Whether
namealready carries an archive prefix in the canonical[ARCHIVED-YYYY-MM-DD]shape. The date itself is parsed loosely (any 4-2-2 digit triple) so a name from a different day is still recognized as already-archived.