Skip to content

Expose corpus-export reingest mode through REST and chunked imports #2339

Description

@JSv4

import_corpus_export_for_user(..., reingest_and_remap=True) already supports preserving an export's prepared parsing/structural artifacts when explicitly passed False. The direct REST endpoint and chunked completion path omit that argument, so callers cannot select the existing mode.

Implementation

  • Add a validated reingest_and_remap boolean to CorpusExportImportSerializer, defaulting to True for backward compatibility.
  • Pass the value through CorpusExportImportView to the existing service.
  • Accept and validate the same option in corpus-export chunked-upload metadata. Persist the normalized boolean and pass it through final assembly/completion; handle explicit False correctly rather than using truthiness/defaulting that replaces it.
  • Keep authorization, archive validation, destination-corpus behavior, and supported export formats unchanged. Reuse the existing importer and annotation/relationship remapping logic.
  • Document the default and the fidelity/processing trade-off. Update any frontend import helper that constructs these requests to preserve an explicitly supplied option.

Acceptance criteria

  • Direct and chunked requests with omission or True retain the current reingest behavior.
  • Explicit False reaches the importer and preserves supported exported parsing artifacts, structural annotations, annotation IDs/remappings, labels, metadata, and relationships without scheduling a reparse.
  • Tests cover boolean serialization, malformed values, unauthorized destinations, chunked resume/completion, and a supported export containing cross-document relationships.
  • Use the existing REST/chunked and V2/V3 import regression fixtures; do not introduce a separate import format or pipeline.

Code pointers

serializer; REST view; service option; chunked completion; reingest regression tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions