Skip to main content

Module orphan

Module orphan 

Source
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 running apply --archive-orphans twice does not produce [ARCHIVED-2026-04-11] [ARCHIVED-2026-04-10] foo.
is_archived
Whether name already 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.