feat(deploy): cf-cache-rules-apply.sh for BIT-21912 / BIT-21847 #8

Merged
spark merged 12 commits from feat/bit-21912-cf-cache-rules-script into main 2026-05-12 12:33:48 +01:00
Owner

Summary

  • Adds deploy/scripts/cf-cache-rules-apply.sh — ready-to-run script that applies the Cloudflare HTML Cache Rules for andebol.net and newsproject.bitreport.pt once a CF_API_TOKEN (Cache Rules write) is injected.
  • Auto-discovers zone IDs, upserts the Cache Rule from docs/deployment.md § Cloudflare — HTML edge cache, and runs double-curl verification.

Context

BIT-21912 — CF_API_TOKEN is not available in this agent's execution environment (vault-managed). Script is in-repo so the board can inject the token for agent re-execution or run it directly.

Pre-rule baseline (2026-05-12T11:18 UTC):

Zone cf-cache-status TTFB
andebol.net DYNAMIC ~0.38 s
newsproject.bitreport.pt DYNAMIC ~0.17–0.39 s

Test plan

  • Run: CF_API_TOKEN=<token> bash deploy/scripts/cf-cache-rules-apply.sh
  • Second curl -fsSI https://andebol.net/ → cf-cache-status: HIT
  • Second curl -fsSI https://newsproject.bitreport.pt/ → cf-cache-status: HIT
  • Post results on BIT-21912; parent BIT-21847 unblocked
## Summary - Adds `deploy/scripts/cf-cache-rules-apply.sh` — ready-to-run script that applies the Cloudflare HTML Cache Rules for `andebol.net` and `newsproject.bitreport.pt` once a `CF_API_TOKEN` (Cache Rules write) is injected. - Auto-discovers zone IDs, upserts the Cache Rule from `docs/deployment.md` § *Cloudflare — HTML edge cache*, and runs double-`curl` verification. ## Context [BIT-21912](/BIT/issues/BIT-21912) — `CF_API_TOKEN` is not available in this agent's execution environment (vault-managed). Script is in-repo so the board can inject the token for agent re-execution or run it directly. **Pre-rule baseline (2026-05-12T11:18 UTC):** | Zone | cf-cache-status | TTFB | |------|-----------------|------| | andebol.net | DYNAMIC | ~0.38 s | | newsproject.bitreport.pt | DYNAMIC | ~0.17–0.39 s | ## Test plan - [ ] Run: `CF_API_TOKEN=<token> bash deploy/scripts/cf-cache-rules-apply.sh` - [ ] Second `curl -fsSI https://andebol.net/` → `cf-cache-status: HIT` - [ ] Second `curl -fsSI https://newsproject.bitreport.pt/` → `cf-cache-status: HIT` - [ ] Post results on [BIT-21912](/BIT/issues/BIT-21912); parent [BIT-21847](/BIT/issues/BIT-21847) unblocked
spark added 12 commits 2026-05-12 12:22:48 +01:00
Paperclip-Agent: Diana Neves (urlKey diana-neves; id 4427016d-7e8f-46e9-9694-3d062e78cc3a)
Paperclip-Issue: BIT-3492
Paperclip-Run: 9280060a-beda-4265-ac1e-c080464cbbd8
Refresh docs/PROJECT_STATUS.md against API state: BIT-2030 remains
in_progress; BIT-2078 and BIT-2080 are done; BIT-2079 is in_progress.
Objective #2 and WIP table now reference PERFORMANCE_BASELINE and
post-audit remediation instead of a stale open audit task.

Co-authored-by: Cursor <[email protected]>
Add runbooks README cross-reference to PROJECT_STATUS/architecture
objectives. Extend PROJECT_STATUS with child BIT-21610 and WIP row for
post-baseline production cache/TTFB validation.

Co-authored-by: Cursor <[email protected]>
Record the daily fila orphan_lock escalation subtask as an operational
child of BIT-2030 for parity with the board tree.

Co-authored-by: Cursor <[email protected]>
feat(BIT-2079): add systemd service+timer for andebol.net writer pipeline
Tests / writer-pipeline tests (push) Successful in 18s
Tests / bridge tests (push) Successful in 17s
Tests / frontend lib tests (push) Successful in 17s
6282e73926
Daily oneshot cycle at 06:00 UTC via news-writer-andebol.timer;
env template covers ANDEBOL_WP_* credentials; deployment.md updated
with install steps, log tailing, and manual test run instructions.

Paperclip-Issue: BIT-2079
Reflect API state: BIT-2079 and BIT-21615 done; BIT-21610 in_progress;
objective #11 and WIP table updated accordingly.

Co-authored-by: Cursor <[email protected]>
Paperclip API drift: add child BIT-21770, set BIT-21610 to todo, WIP row
for recovery task.

Co-authored-by: Cursor <[email protected]>
Cache-Control headers (BIT-2261) confirmed live on both domains.
TTFB improved from ~300ms to ~220ms. Remaining gap: Cloudflare Cache
Rule needed for HTML caching (cf-cache-status still DYNAMIC).

Paperclip-Issue: BIT-21610
All direct children are done on the board; mark parent BIT-2030 done,
update objective #2 and WIP section, and note sweep completion in intro.

Co-authored-by: Cursor <[email protected]>
Add 3-sample min/median/max TTFB measurements confirming ~220ms origin
latency. Both domains return cache-control: s-maxage=60, stale-while-revalidate=300.
Cloudflare edge caching (cf-cache-status: HIT) still pending Cache Rule
in BIT-21847.

Paperclip-Issue: BIT-21610
Paperclip-Run: $PAPERCLIP_RUN_ID
Add /api/ exclusion and per-zone filter expressions in deployment.md.
Record continuation verification in PERFORMANCE_BASELINE (still DYNAMIC).
Execution moves to Paperclip child BIT-21912 for DevOps dashboard apply.

Co-authored-by: Cursor <[email protected]>
feat(deploy): add cf-cache-rules-apply.sh for BIT-21912 / BIT-21847
Tests / writer-pipeline tests (push) Successful in 15s
Tests / bridge tests (push) Successful in 14s
Tests / frontend lib tests (push) Successful in 14s
Tests / writer-pipeline tests (pull_request) Successful in 11s
Tests / bridge tests (pull_request) Successful in 12s
Tests / frontend lib tests (pull_request) Successful in 13s
938a59dc3d
Cloudflare HTML Cache Rule apply + verify script for andebol.net and
newsproject.bitreport.pt. Needs CF_API_TOKEN (Cache Rules write); auto-
discovers zone IDs, upserts the rule from deployment.md runbook expression,
and runs double-curl verification. Ready to run once token is injected.

Paperclip-Issue: BIT-21912
paperclip-review-bot left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
founding-engineer left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
devops-engineer left a comment
Member

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)

auto-approve: CI success (gitea_auto_approve_open_prs_once.py)
spark scheduled this pull request to auto merge when all checks succeed 2026-05-12 12:33:47 +01:00
spark merged commit da7a01a1c1 into main 2026-05-12 12:33:48 +01:00
Sign in to join this conversation.