elektrine/scripts/check_legacy_marker_budget.sh
Maxfield Luke 454e80a8f8
Some checks failed
Deploy Docker Images / Build, push, and deploy (push) Failing after 19m8s
Smoke / Hello from Forgejo Actions (push) Successful in 1s
Initial commit
Fresh repository on git.elektrine.com/elektrine/elektrine.
2026-07-30 01:36:18 -04:00

27 lines
866 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
# Budget tracks remaining product "compat" surfaces (Mastodon/Pleroma APIs, etc.)
# after removal of dual-path shims and unversioned external routes.
max_markers=129
count=$(
rg -n "legacy|backward|backwards|compat|deprecated" apps config scripts deploy \
-g '!**/test/**' \
-g '!**/priv/repo/migrations/**' \
-g '!**/README.md' \
-g '!**/node_modules/**' \
-g '!**/priv/static/**' \
-g '!scripts/check_legacy_marker_budget.sh' \
| wc -l
)
if ((count > max_markers)); then
echo "error: production legacy/compat marker count is $count; budget is $max_markers" >&2
echo "Hint: avoid adding compatibility branches without cleanup ownership, or lower the baseline by removing stale paths first." >&2
exit 1
fi
echo "Legacy/compat marker budget passed."