Add import comments feature with support for WordPress, Disqus, and Graphcomment #32

Merged
russellballestrini merged 6 commits from import-comments-feature into main 2025-12-20 10:41:40 -05:00
russellballestrini commented 2025-11-24 07:13:31 -05:00 (Migrated from git2.unturf.com)

This feature allows namespace owners to import comments and threads from various
platforms using the blog-to-json tool (https://github.com/russellballestrini/blog-to-json).

Key Features:

  • Import from WordPress XML, Disqus XML, and Graphcomment exports
  • Automatic user creation with email matching
  • User surrogate creation for comments without emails
  • Smart group postfix generation from namespace domain
  • Permanent postfix locking to prevent duplicate surrogates
  • Duplicate prevention - reuses existing users on re-import
  • Support for nested comment hierarchies
  • Preserves timestamps and IP addresses from original comments

Database Changes:

  • Added import_group_postfix column to rb_namespace table (Unicode(6), nullable)
  • Alembic migration: 5188e62d0afb

New Routes:

  • /ns/{namespace}/import-comments (basic mode)
  • /embed/ns/{namespace}/import-comments (embed mode)

Files Added:

  • remarkbox/views/authenticated/import_comments.py - Main import logic
  • remarkbox/templates/import-comments.j2 - Import page UI
  • remarkbox/tests/test_import_comments.py - Comprehensive test suite

Files Modified:

  • remarkbox/models/namespace.py - Added import_group_postfix column
  • remarkbox/routes.py - Added import-comments routes
  • remarkbox/templates/namespace-settings.j2 - Added import link

Tests:

  • 20+ unit and integration tests covering all scenarios
  • WordPress format import test with real schema
  • Graphcomment format import test
  • Deep comment nesting tests
  • Duplicate prevention and user reuse tests
  • Group postfix locking mechanism tests
  • Surrogate creation and reuse tests
  • Edge case handling (missing fields, invalid input)
This feature allows namespace owners to import comments and threads from various platforms using the blog-to-json tool (https://github.com/russellballestrini/blog-to-json). Key Features: - Import from WordPress XML, Disqus XML, and Graphcomment exports - Automatic user creation with email matching - User surrogate creation for comments without emails - Smart group postfix generation from namespace domain - Permanent postfix locking to prevent duplicate surrogates - Duplicate prevention - reuses existing users on re-import - Support for nested comment hierarchies - Preserves timestamps and IP addresses from original comments Database Changes: - Added import_group_postfix column to rb_namespace table (Unicode(6), nullable) - Alembic migration: 5188e62d0afb New Routes: - /ns/{namespace}/import-comments (basic mode) - /embed/ns/{namespace}/import-comments (embed mode) Files Added: - remarkbox/views/authenticated/import_comments.py - Main import logic - remarkbox/templates/import-comments.j2 - Import page UI - remarkbox/tests/test_import_comments.py - Comprehensive test suite Files Modified: - remarkbox/models/namespace.py - Added import_group_postfix column - remarkbox/routes.py - Added import-comments routes - remarkbox/templates/namespace-settings.j2 - Added import link Tests: - 20+ unit and integration tests covering all scenarios - WordPress format import test with real schema - Graphcomment format import test - Deep comment nesting tests - Duplicate prevention and user reuse tests - Group postfix locking mechanism tests - Surrogate creation and reuse tests - Edge case handling (missing fields, invalid input)
russellballestrini commented 2025-11-24 07:13:31 -05:00 (Migrated from git2.unturf.com)

assigned to @Groupr

assigned to @Groupr
russellballestrini commented 2025-11-24 09:17:55 -05:00 (Migrated from git2.unturf.com)

added 1 commit

  • 0fefbbeb - Fix test issues: use set_role_for_user, add tearDown cleanup, fix namespace references

Compare with previous version

added 1 commit <ul><li>0fefbbeb - Fix test issues: use set_role_for_user, add tearDown cleanup, fix namespace references</li></ul> [Compare with previous version](/engineering/remarkbox/remarkbox/-/merge_requests/26/diffs?diff_id=810&start_sha=9b784fa7d18a6b7234e76462c59062bc55f35620)
russellballestrini commented 2025-11-24 09:20:13 -05:00 (Migrated from git2.unturf.com)

added 1 commit

  • 63be2521 - Fix node queries to use namespace_id directly

Compare with previous version

added 1 commit <ul><li>63be2521 - Fix node queries to use namespace_id directly</li></ul> [Compare with previous version](/engineering/remarkbox/remarkbox/-/merge_requests/26/diffs?diff_id=812&start_sha=0fefbbeb412e0b7a79c6e718df9d7d70af9afe5f)
russellballestrini commented 2025-11-24 10:00:22 -05:00 (Migrated from git2.unturf.com)

added 1 commit

  • bd129d26 - Fix test isolation issues by simplifying assertions and using unique namespaces

Compare with previous version

added 1 commit <ul><li>bd129d26 - Fix test isolation issues by simplifying assertions and using unique namespaces</li></ul> [Compare with previous version](/engineering/remarkbox/remarkbox/-/merge_requests/26/diffs?diff_id=814&start_sha=63be2521c2b99e5c862102c30ebfb4e4b2fe398a)
russellballestrini commented 2025-11-26 16:16:43 -05:00 (Migrated from git2.unturf.com)

added 1 commit

  • 517eb2a0 - Add project setup section to CLAUDE.md reminding to check for repository-specific instructions

Compare with previous version

added 1 commit <ul><li>517eb2a0 - Add project setup section to CLAUDE.md reminding to check for repository-specific instructions</li></ul> [Compare with previous version](/engineering/remarkbox/remarkbox/-/merge_requests/26/diffs?diff_id=817&start_sha=bd129d26cd6d69770ca4aae64a4d2394e79aedd4)
russellballestrini commented 2025-11-26 16:20:30 -05:00 (Migrated from git2.unturf.com)

added 1 commit

  • 640c4566 - Update CLAUDE.md to check parent directories for cross-repo CLAUDE.md files

Compare with previous version

added 1 commit <ul><li>640c4566 - Update CLAUDE.md to check parent directories for cross-repo CLAUDE.md files</li></ul> [Compare with previous version](/engineering/remarkbox/remarkbox/-/merge_requests/26/diffs?diff_id=818&start_sha=517eb2a07e5980deebe33b84887ad0625b4965b5)
russellballestrini commented 2025-12-20 10:41:41 -05:00 (Migrated from git2.unturf.com)

mentioned in commit 8b353fc7ec

mentioned in commit 8b353fc7ec7144c3e43a435fef3a961bb214c288
russellballestrini (Migrated from git2.unturf.com) merged commit 8b353fc7ec into main 2025-12-20 10:41:41 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: engineering/remarkbox#32
No description provided.