Skip to content

Add output repository reseed workflow for recreated remotes #120

Description

@schmoelder

CADET-RDM has an awkward recovery path when an output repository remote is intentionally deleted and recreated, for example to purge GitHub-hosted Git LFS objects.

Current behavior:

  • The project repository metadata still points to the output remote.
  • ProjectRepo(...) notices that the local output directory is missing and clones the configured remote.
  • If the recreated remote is empty, OutputRepo(...) then fails with FileNotFoundError because output/.cadet-rdm-data.json is missing.
  • The useful initialization code exists internally as initialize_output_repo(...), but there is no obvious output-only CLI workflow for this case.

Expected workflow:

CADET-RDM should expose a command such as:

cadetrdm output reseed --remote git@github.com:owner/project_output.git

or:

cadetrdm output init --force

The command should:

  1. read project_uuid, output_uuid, the output directory name, and configured output remote from the project repository metadata;
  2. create a fresh local output repository with valid CADET-RDM output metadata;
  3. add or preserve the configured output remote;
  4. optionally push only the fresh main branch;
  5. avoid restoring old result branches or old LFS objects.

For this recovery case, the existing project_uuid and output_uuid should be preserved, because the output repository is still the same logical RDM output store.
The remote has only been recreated to clear storage.
A new UUID would make sense only for a deliberately new, unrelated output store.

It would also help if CADET-RDM detected this failure mode and printed a targeted message such as:

The output remote exists but is not a CADET-RDM output repository.
Run `cadetrdm output reseed` to initialize a fresh output main branch.

instead of surfacing only the missing .cadet-rdm-data.json exception.

Related documentation gap:

For GitHub-hosted LFS objects, rewriting history does not remove already uploaded LFS objects from storage.
Deleting and recreating the output repository is the documented cleanup path.
CADET-RDM documentation could mention that only a fresh metadata main should be pushed back in that workflow, not git push --all, because pushing all branches may restore the old LFS objects.

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