Repository navigation
Conversation
Provide an SDK data directory retained across ordinary uninstall and package updates. Add administrator inventory, explicit purge, and validated offline ZIP backup and restore with matching documentation and regression coverage.
Provide isolated writable DataDir and StateDir fixtures, verify local data survives cache removal, and document testing cleanup ownership.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #2008.
Plugins currently receive disposable process state but no managed location for a local database or business files. This adds
sdk.Env.DataDir, backed byplugins.dir/data/<plugin-id>/. Files survive restart, disable, upgrades, and ordinary uninstall; reinstalling the same ID reuses them. Explicit purge removes local files and KV after draining plugin work, with retryable filesystem cleanup.plugintest.New(t)also supplies separate writableStateDirandDataDirdirectories, with testing-owned cleanup. The regression test checks directory isolation, local record reads after disposable cache removal, and cleanup after the owning test finishes. These fixtures support local storage initialization without simulating the real host's uninstall or archive lifecycle.The admin Local data tab lists retained directories, including uninstalled owners, and provides export, restore, and confirmed purge. Export and restore require a disabled or uninstalled owner and serialize with installation changes. ZIP archives bind the plugin ID, paths, sizes, and SHA-256 hashes; restore validates the complete archive before publishing an absent or empty destination. Path traversal, links, special files, duplicates, corrupt content, and oversized archives are rejected.
SQLite drivers remain plugin dependencies; the host supplies the directory. External databases and S3 remain plugin-configured services with their own backup lifecycle. Documentation covers these boundaries and data-format compatibility on rollback. Ticket workflows, image transport, order queries, and notifications remain outside this PR.
Validation:
make fmtandmake fmt-check: passed for the SDK follow-up, including Go declaration order, Go formatting, frontend formatting, and Web SDK formatting.cd plugin-sdk/go && go test ./...: all packages passed, including local directory isolation and cleanup and the real-processDataDirprotocol round trip.golangci-lint: passed with zero issues.go test ./internal/plugin/... ./internal/appin the backend module.10b019de5, including SDK/protocol checks, full Go and frontend tests, Docker integration tests, production build/embed tests, lint, scripts, and installer checks.10b019de5.AI-assisted implementation.