SP-874: Add single package import command#369
Open
Zgjim Haziri (ZgjimHaziri) wants to merge 2 commits into
Open
SP-874: Add single package import command#369Zgjim Haziri (ZgjimHaziri) wants to merge 2 commits into
Zgjim Haziri (ZgjimHaziri) wants to merge 2 commits into
Conversation
Adds the CLI counterpart to the new pacman single-package import API. The command lives under a new 'config package' subgroup, separate from the existing batch 'config import', because the two use different, non-interchangeable archive formats. Supports importing from a package zip (--file) or a directory (--directory, flat-zipped by the CLI), with --overwrite and optional --json output. Config docs and CLI help updated to frame the batch commands as their own batch-specific set. Includes-AI-Code: true Co-authored-by: Cursor <cursoragent@cursor.com>
…fixes) Mark injected members as readonly and use node: import prefixes for built-in modules. The single-package-import test mocks node:fs explicitly so the temp file cleanup is intercepted (the global fs mock only covers the bare specifier). Includes-AI-Code: true Co-authored-by: Cursor <cursoragent@cursor.com>
|
Comment on lines
+70
to
+71
| .option("-f, --file <file>", "Package zip file (relative path)") | ||
| .option("-d, --directory <directory>", "Package directory (relative path)") |
Contributor
There was a problem hiding this comment.
Something that could make the interface a bit simpler, could be a source paramter that replaces both file and directory, and could be either a zip file or a directory and is resolved internally by the tool to determine its type
Contributor
Author
There was a problem hiding this comment.
I like the explicit options a bit more, since it's more clear what the options are. Let's see what the others think, and we can decide based on that.
3 tasks
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.



Description
Adds a new
config package importcommand for importing a single package — the CLI counterpart to the new pacman single-package import API (POST /pacman/api/core/staging/packages/import-file).How it was done:
config packagesubgroup instead of overloading the existing batchconfig import. The two use different, non-interchangeable archive formats (the batch archive has nested per-package zips + manifest; the single-package format is a flatpackage.json+nodes/), so keeping them separate avoids confusing the workflows.--file) or a directory (--directory, which the CLI flat-zips before upload), with an--overwriteflag and optional--jsonoutput. A 4 GB uncompressed guard is enforced on the archive.Relevant links
Checklist
Includes-AI-Code: true
Made with Cursor