Skip to content

Seal the Automatisation external seam and R2 port - #1154

Merged
mustaphaelou merged 2 commits into
mainfrom
agent/seal-automatisation-seam-r2-port
Nov 27, 2026
Merged

mustaphaelou merged 2 commits into
mainfrom
agent/seal-automatisation-seam-r2-port

Conversation

@mustaphaelou

Copy link
Copy Markdown
Owner

Summary

 lib/automations/dependances.ts
+  owns PortEmailsAutomation, PortRechercheAutomation, PortCatalogueAutomation,
+       PortImagesAutomation, EntreeEmailDigest, DependancesAutomations
+  images adapter → supprimerImagesProduitDuStockage / supprimerImagesCategorieDuStockage

 lib/automations/actions.ts
-  stranded Port* and DependancesAutomations definitions
+  imports DependancesAutomations from dependances.ts

 lib/automations/ponts.ts
-  direct R2 calls (supprimerImagesProduitDuStockage / supprimerImagesCategorieDuStockage)
+  routes deleteImages / deleteImage through dependances.images

 lib/use-cases/automatisations.ts & app/admin/automatisations/actions.ts
+  reessayerExecution defaults dependances = dependancesAutomations(new Date())
-  Server Action stops importing dependancesAutomations (ADR-0014)

 test/automations-memoire.ts & lib/automations/action-suppression-images.test.ts
+  creerPortImagesMemoire() in-memory R2 adapter
-  vi.mock("@/lib/images-produit/r2") removed

Completes the external Automatisation seam by moving all port contracts next to their production adapters in dependances.ts, routing R2 Image produit and Structure image deletion through PortImagesAutomation, and defaulting Réessai manuel to production adapters inside lib/use-cases/automatisations.ts.

Evidence

  • Before: ponts.ts called R2 deletion helpers directly (bypassing DependancesAutomations), forcing action-suppression-images.test.ts to vi.mock("@/lib/images-produit/r2"); actions.ts held stranded port types; app/admin/automatisations/actions.ts constructed and injected production adapters into reessayerExecution.
  • After:
    • lib/automations/action-suppression-images.test.ts runs all 7 Image produit and Structure deletion + retry scenarios through creerPortImagesMemoire() with zero vi.mock on r2.ts.
    • bash scripts/checks.sh: all 5 checks passed (lint, format:check, typecheck, full vitest suite, and next build).

Merge Danger

Door: two-way

Internal port/adapter refactor with no schema migration or runtime behaviour change; reverts cleanly in one commit.

Blast Radius: automatisations

Touches Automatisation execution wiring (dependances.ts, actions.ts, ponts.ts, executeur.ts) and Réessai manuel (lib/use-cases/automatisations.ts, app/admin/automatisations/actions.ts). Production R2 deletion behaviour and retry semantics are unchanged.

@mustaphaelou
mustaphaelou merged commit 6073011 into main Nov 27, 2026
6 checks passed
@mustaphaelou
mustaphaelou deleted the agent/seal-automatisation-seam-r2-port branch November 27, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant