Skip to content

Commit 9f04beb

Browse files
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/site-opportunities.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ site-opportunity-suggestions-edge-deploy:
598598
type: integer
599599
autoCovered:
600600
type: integer
601-
description: Number of additional suggestions auto-marked as deployed by domain-wide config
601+
description: Number of additional suggestions auto-marked as deployed by domain-wide or path-level config
602602
message:
603603
type: string
604604
description: Present when autoCovered > 0

0 commit comments

Comments
 (0)