Commit 9f04beb
authored
feat: route path-level prerender suggestions through deploy and rollback (#2383)
## Summary
- Routes path-level prerender suggestions through the existing
`deployToEdge` / `rollbackSuggestionFromEdge` flow
- On deploy: validates path suggestions (rejects already-deployed,
requires `allowedRegexPatterns`); delegates to
`tokowakaClient.deployToEdge` which handles per-URL and pattern
suggestions uniformly
- On rollback: delegates fully to `tokowakaClient.rollbackSuggestions`
with `allSuggestions` for cascade cleanup; the shared client handles all
three rollback types (per-URL, path-level pattern, domain-wide pattern)
plus the domain-wide → path cascade
- `profile?.email` is passed directly (without fallback) to
`rollbackSuggestions` so the shared client can apply context-specific
`updatedBy` fallback strings:
- `'tokowaka-rollback'` for the suggestion being rolled back
- `'domain-wide-rollback'` for per-URL suggestions covered by a
domain-wide pattern
- `'path-rollback'` for per-URL suggestions covered by a path pattern
- `'domain-wide-rollback-cascade'` for path suggestions and their
covered entries cleaned up as part of a domain-wide rollback
**Depends on**: adobe/spacecat-shared#1598
## Test plan
- [ ] All 417 suggestions controller tests pass
- [ ] Path-level deploy: 400 for already-deployed, 400 for missing
`allowedRegexPatterns`, success path calls `deployToEdge` with correct
args
- [ ] Rollback with email: `rollbackSuggestions` called with `updatedBy:
profile.email`
- [ ] Rollback without email: `rollbackSuggestions` called with
`updatedBy: undefined` (shared client applies correct fallbacks)
- [ ] Domain-wide cascade: `allSuggestions` passed so shared client can
clean up deployed path suggestions and their covered entries
- [ ] 207 multi-status responses with correct succeeded/failed counts
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 30959cb commit 9f04beb
5 files changed
Lines changed: 1096 additions & 733 deletions
File tree
- docs/openapi
- src/controllers
- test/controllers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| |||
0 commit comments