Skip to content

refactor(site-import): reuse CMS media client#80

Merged
DavidBabinec merged 1 commit into
mainfrom
refactor/site-import-media-client
Jun 26, 2026
Merged

refactor(site-import): reuse CMS media client#80
DavidBabinec merged 1 commit into
mainfrom
refactor/site-import-media-client

Conversation

@DavidBabinec

Copy link
Copy Markdown
Contributor

What changed

  • Replaced the Site Import adapter's local media upload/folder response schemas and raw fetch calls with the canonical CMS media persistence client.
  • Kept the adapter's import-specific folder path cache and non-fatal folder-placement behavior.
  • Removed the architecture allowlist entry that excused raw admin fetches in createSiteImportAdapter.

Why

Site Import was duplicating the same media upload, folder listing, folder creation, and folder assignment behavior that the Media workspace already gets through @core/persistence/cmsMedia. That made credentials, URL encoding, response validation, and error behavior easy to drift.

Impact

Imported assets now ride the same validated CMS media client contract as the rest of the admin app. Folder assignment remains best-effort, so an assignment failure does not abort an otherwise successful asset upload.

Verification

  • bun test src/__tests__/admin/siteImport/createSiteImportAdapter.test.ts red before implementation, then passing
  • bun test src/__tests__/architecture/boundary-validation.test.ts
  • bun run build
  • bun test
  • bun run lint
@DavidBabinec DavidBabinec marked this pull request as ready for review June 26, 2026 15:03
@DavidBabinec DavidBabinec merged commit c5c9686 into main Jun 26, 2026
6 checks passed
@DavidBabinec DavidBabinec deleted the refactor/site-import-media-client branch June 30, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant