149 support importing multiple collections at once#156
Open
matstech wants to merge 4 commits into
Open
Conversation
0467c25 to
3d2e6c5
Compare
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.
Summary
This PR introduces batch collection import for all four supported formats (Postman, Bruno, OpenAPI/Swagger, and Solo), replacing the old single-file import API with a batch-first API on both the backend and the frontend.
Closes: #149
Description
Backend
Four new public
Appmethods replace the old single-import collection methods:The old single-file methods (
ImportPostmanCollection,ImportBrunoCollection,ImportOpenAPICollection,ImportSoloCollection) have been removed from the Wails surface.Batch orchestration lives in
internal/collection/batch_import.go. Each batch run:maxConcurrentCollectionImports = 4)UpdateCollectionA new
SelectFilesmethod was added alongside the existingSelectFileandSelectDirectory:The Bruno importer was also fixed in this PR:
params:queryandparams:pathDSL sections are now parsed correctly alongside the olderquerysectionparams:queryparams:pathare substituted directly into the URLFrontend
collectionImportStore.svelte.tswas migrated to the batch APIs. The pending import state changed from a singlepath: stringtopaths: string[]. Postman, OpenAPI, and Solo use the new multi-file picker; Bruno keeps the single-directory picker (multi-directory Bruno import is supported through drag-and-drop).After a batch completes, a summary notification is shown:
N collections importedN imported, M failed(first few per-item errors shown as separate toasts)Failed to import N collectionsLocalImportPane.sveltewas updated so theonImportcallback receivesdroppedPaths?: string[]instead of a single optional path. The display now shows the full path for one source andN sources selectedfor multiple. The component remains generic and shared with environment imports.EnvironmentManager.sveltewas updated to stay compatible with the newLocalImportPanecallback shape while preserving single-source environment import behavior (paths?.[0]). No batch environment import is introduced.CollectionList.sveltewires the new store shape: import disabled state checkspaths.length, drag-and-drop forwards all dropped paths to the store, and the old Solo overwrite modal was removed (Solo batch always overwrites).The environment manager modal was also fixed: the modal no longer opens fullscreen (was using
fullscreen+size="none"); it now usessize="xl"with a fixed body height, matching the Settings modal layout.Accepted limitations
OpenDirectoryDialogin Wails returns a single path; there is no multi-directory picker equivalent.BasePathandServersare not exposed in the batch result DTO. The OpenAPI importer already uses this metadata internally to compute the imported collection'sbaseUrlvariable; the frontend only needs per-item warnings.Breaking Changes
The following public
Appmethods have been removed from the Wails surface:ImportPostmanCollection(path string) errorImportBrunoCollection(path string) errorImportOpenAPICollection(path string) (OpenAPIImportCollectionResult, error)ImportSoloCollection(path string, overwrite bool) errorOpenAPIImportCollectionResulttypeCallers should use the new batch methods, passing a one-item path slice for single-source imports.
Tests performed 🧪
CollectionManager.ImportBatch: global errors (nil manager, empty paths), per-item failures (empty path string, import error, nil collection, save error), result ordering, warnings propagation, mixed success/failureparams:query,params:path, and URL deduplication coverage using a real Bruno collection fixturego test ./...passesgo build ./...passescd frontend && npm run formatpassescd frontend && npm run checkpasses (0 errors, 0 warnings)cd frontend && npm run lintpassescd frontend && npm run buildpassesLocalImportPanecallback shape change