Skip to content

Issue932#933

Merged
shira6 merged 11 commits into
masterfrom
issue932
Jul 14, 2026
Merged

Issue932#933
shira6 merged 11 commits into
masterfrom
issue932

Conversation

@ilayfalach

Copy link
Copy Markdown
Collaborator

Implement document export to repository (#932)

Adds the reverse of the existing repository loader: export project documents into a repository JSON file that loads back through loadAllDatasourcesInRepositoryJSONToProject.

What you can do:

Export a single document, several, or all documents of a project
Merge into an existing repository with automatic duplicate detection (content hash or ObjectId)
override mode to strip duplicates from the whole file
How it's built (Approach C):

hera/utils/data/repositoryExport.py — pure, DB-free logic (hashing, merge, dedup)
dataToolkit.exportDocumentsToRepository — thin facade (query → pure funcs → write file)
hera-project repository export — CLI subcommand
Tests: 28 passing in test_repository_export.py (25 unit + 3 Mongo integration, incl. round-trip). No regressions in test_repository.py / test_datalayer.py.

📖 Design spec & usage: docs/superpowers/specs/2026-06-14-document-export-to-repository-design.md

Note: resource handling is reference-only in this MVP (isRelativePath:"False", no file copying); copyResources=True is the documented extension point.

Ilay Falach and others added 9 commits June 14, 2026 13:37
Brainstormed design for the reverse of the repository loader: export
project Metadata documents into a repository JSON file (reference-only),
with content-hash/ObjectId duplicate detection and a dedup override mode.
Approach C: pure-function logic module + thin dataToolkit facade + CLI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Guards against itemName collisions so distinct documents are never
silently overwritten when they share an ObjectId-derived name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Queries the source project, delegates to the pure repositoryExport
helpers, writes the JSON file and optionally registers it. Excludes the
project's internal __config__ document when exporting all documents.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verifies an exported repository file re-loads through the existing
loadRepositoryFromPath with item fields intact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lior-antonov

Copy link
Copy Markdown
Collaborator

@ilayfalach please remove/add to .gitignore claude's plan files

shira6
shira6 previously requested changes Jun 25, 2026
Comment thread .github/workflows/ci.yml
Comment thread docs/superpowers/plans/2026-06-14-document-export-to-repository.md Outdated
Comment thread docs/superpowers/specs/2026-06-14-document-export-to-repository-design.md Outdated
Comment thread requirements.txt
Ilay Falach and others added 2 commits July 14, 2026 09:39
Removes docs/superpowers/plans/2026-06-14-document-export-to-repository.md
and docs/superpowers/specs/2026-06-14-document-export-to-repository-design.md,
which shouldn't have been committed to the repo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts:
#	hera/utils/data/CLI.py
@shira6
shira6 dismissed their stale review July 14, 2026 07:02

all requested changes has been made

@shira6
shira6 merged commit d68c305 into master Jul 14, 2026
1 check passed
@shira6
shira6 deleted the issue932 branch July 14, 2026 07:02
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.

3 participants