Move Blogger import to compat and add a native-import dispatcher #557

Open
tobi wants to merge 1 commit from relocate-blogger-importer into main
Owner

Phase 0 of the importer rewrite: relocates the legacy Blogger.com Atom/RSS import (the only thing Importer did until now) into compat/Global/Importer.js as Importer.blogger, and rewrites code/Global/Importer.js as a thin dispatcher that sniffs the uploaded file by content (ZIP magic bytes) to detect a native Antville export archive.

Native restore logic (Importer.restoreSite) isn't implemented yet — that's the next PR. For now, detecting a ZIP with no Importer.restoreSite defined yet, or an unrecognized file, surfaces a clear site.importError instead of crashing silently, mirroring the exportError handling already in place for export. Also fixes the upload cleanup (File.remove) only running on the success path by moving it into finally.

Test plan

  • Deploy to antville-test.de
  • Confirm the relocated Blogger import path still works end-to-end (upload a real Blogger Atom export, confirm stories get created)
  • Confirm uploading a non-Blogger, non-ZIP file surfaces site.importError in the #import skin instead of failing silently
  • Confirm uploading a ZIP surfaces the "Native site import is not available yet" error cleanly
Phase 0 of the importer rewrite: relocates the legacy Blogger.com Atom/RSS import (the only thing `Importer` did until now) into `compat/Global/Importer.js` as `Importer.blogger`, and rewrites `code/Global/Importer.js` as a thin dispatcher that sniffs the uploaded file by content (ZIP magic bytes) to detect a native Antville export archive. Native restore logic (`Importer.restoreSite`) isn't implemented yet — that's the next PR. For now, detecting a ZIP with no `Importer.restoreSite` defined yet, or an unrecognized file, surfaces a clear `site.importError` instead of crashing silently, mirroring the `exportError` handling already in place for export. Also fixes the upload cleanup (`File.remove`) only running on the success path by moving it into `finally`. ## Test plan - [ ] Deploy to antville-test.de - [ ] Confirm the relocated Blogger import path still works end-to-end (upload a real Blogger Atom export, confirm stories get created) - [ ] Confirm uploading a non-Blogger, non-ZIP file surfaces `site.importError` in the `#import` skin instead of failing silently - [ ] Confirm uploading a ZIP surfaces the "Native site import is not available yet" error cleanly
tobi self-assigned this 2026-07-17 15:12:46 +00:00
The current Importer only ever parsed Blogger.com Atom/RSS exports, which
is a legacy compatibility feature, not the primary import path. Relocate
it to compat/Global/Importer.js as Importer.blogger, and rewrite the
core Importer.run as a thin dispatcher that sniffs the uploaded file by
content (ZIP magic bytes) to detect a native Antville export archive,
falling back to Importer.blogger when compat is active. Native restore
logic lands in a follow-up PR; for now an unrecognized or not-yet-
supported file surfaces a clear site.importError instead of failing
silently, mirroring the exportError handling already in place. Also
fixes the upload cleanup only running on the success path by moving it
into a finally block.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177qdRkssL6kBk5ngMDHwnP
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin relocate-blogger-importer:relocate-blogger-importer
git switch relocate-blogger-importer

Merge

Merge the changes and update on Forgejo.
git switch main
git merge --no-ff relocate-blogger-importer
git switch relocate-blogger-importer
git rebase main
git switch main
git merge --ff-only relocate-blogger-importer
git switch relocate-blogger-importer
git rebase main
git switch main
git merge --no-ff relocate-blogger-importer
git switch main
git merge --squash relocate-blogger-importer
git switch main
git merge --ff-only relocate-blogger-importer
git switch main
git merge relocate-blogger-importer
git push origin main
Sign in to join this conversation.
No description provided.