Files
ServerKit/backend/tests/test_config_checkpoint_alias.py
T
Juan DenisandClaude Opus 4.8 d87e69b44f refactor(unify): §8 Phase B4 — surface DeploymentSnapshot as "Config Checkpoint"
Recorded §8 decision: a deployment config snapshot is shown as a "Config
Checkpoint" in the UI to end the overloaded "snapshot" wording. Distinct from
data-protection backups and from WordPress DB snapshots, which are untouched.

Backend:
- snapshots blueprint serves every route under /apps/:id/config-checkpoints
  in addition to /apps/:id/snapshots (dual @route — both resolve to one view).

Frontend:
- DeployTab section "Deployment Timeline" → "Config Checkpoints" with reworded
  hint; ConfigDiffModal + DeploymentTimeline empty/peer copy use "checkpoint".
- api/snapshots.js gains getConfigCheckpoint(s)/Diff/restore aliases.
- ProtectionStatusCard: "Snapshots run on the configured schedule" → "Backups"
  (that card describes backups, not config checkpoints).

Verified: 2 alias tests + existing config-snapshot suite pass; frontend build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:24:13 -04:00

26 lines
1.1 KiB
Python

"""§8 Phase B4 — /config-checkpoints aliases /snapshots.
"Config Checkpoint" is the user-facing name for a deployment config snapshot.
The snapshots blueprint serves every route under both /snapshots and
/config-checkpoints so the API matches the new wording while old callers keep
working.
"""
def test_config_checkpoints_resolves_same_handler(app, client, auth_headers):
# Both prefixes hit the same view, so a missing app produces the identical
# 404 response on either — proof the alias resolves to the same handler.
snaps = client.get('/api/v1/apps/999999/snapshots', headers=auth_headers)
ckpts = client.get('/api/v1/apps/999999/config-checkpoints', headers=auth_headers)
assert snaps.status_code == 404
assert ckpts.status_code == 404
assert ckpts.get_json() == snaps.get_json()
def test_both_route_spaces_registered():
from app import create_app
application = create_app('testing')
rules = {r.rule for r in application.url_map.iter_rules()}
assert any('/snapshots' in r for r in rules)
assert any('/config-checkpoints' in r for r in rules)