Skip to content

Add Forgejo integration#25

Open
vondutchi wants to merge 3 commits into
PlakarKorp:mainfrom
vondutchi:codex/forgejo-integration
Open

Add Forgejo integration#25
vondutchi wants to merge 3 commits into
PlakarKorp:mainfrom
vondutchi:codex/forgejo-integration

Conversation

@vondutchi

Copy link
Copy Markdown

Closes PlakarKorp/hub#4.

What

Adds a new Forgejo integration with importer and exporter connectors.

  • importer streams Forgejo native dumps into Plakar via forgejo dump --file - --type tar.gz --quiet by default
  • supports Forgejo CLI options for binary path, work path, custom path, config path, temp dir, database syntax, dump type, and skip flags
  • exporter extracts tar, tar.gz/tgz, and zip dump archives to a target directory so the snapshot content is restored to a Forgejo-loadable state
  • rejects archive entries that would escape the restore target directory
  • includes schemas, manifest metadata, README usage notes, and focused unit tests

Notes

Forgejo does not expose a single full-instance forgejo restore command, so this exporter restores the dump contents to disk and documents that the operator should continue with Forgejo's documented restore procedure for their database/storage backend.

Validation

From forgejo/:

go test ./...
go vet ./...
make build
make clean

@vondutchi

Copy link
Copy Markdown
Author

Follow-up hardening pushed in 9b2e3fe:

  • normalize dump_type before passing it through to forgejo dump
  • handle a closed/nil importer result channel without panicking
  • add focused regression tests for both cases

Verification rerun after the update:

go test ./...
go vet ./...
make build && make clean

@vondutchi

Copy link
Copy Markdown
Author

Added one more test-only follow-up in 6837665 to cover the Forgejo command execution boundary:

  • fake forgejo binary test verifies startDump streams stdout and passes the expected dump args
  • Ping failure test verifies stderr is included in the returned error

Verification rerun:

go test ./...
go vet ./...
make build && make clean

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.

[Placeholder] Forgejo integration

1 participant