Skip to content

SP-1472: Add config branch export and import (beta) - #401

Merged
Laberion Ajvazi (LaberionAjvazi) merged 9 commits into
mainfrom
LaberionAjvazi/sp-1472
Jul 29, 2026
Merged

SP-1472: Add config branch export and import (beta)#401
Laberion Ajvazi (LaberionAjvazi) merged 9 commits into
mainfrom
LaberionAjvazi/sp-1472

Conversation

@LaberionAjvazi

Copy link
Copy Markdown
Contributor

Description

Adds beta config branch export and config branch import. Both read and write local files by default, and mirror a branch to a Git branch one-to-one when --gitProfile is set. export --all pushes the main package and all of its branches in one go.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

The root program registers -V, --version, which shadowed the subcommand
flag: the CLI printed its own version and exited without merging.

Includes-AI-Code: true
Local exports and per-branch progress on --all ignored --json, so a
JSON summary was only produced when pushing to Git. Report through a
single-purpose writeJson helper and let each call site choose, matching
the existing branch command service.

Fold the new branch-key helpers into the existing core BranchUtils
rather than shipping a second class under the same name.

Includes-AI-Code: true
The import endpoint derives the target package solely from
package.json#key, so silently skipping the key rewrite let a mismatched
source create or overwrite an unrelated package while the CLI reported
success on the intended branch. Validate the source key before upload,
accepting either the project key or the branch key, and fail when the
rewrite cannot be applied.

Includes-AI-Code: true
Exporting or importing --branchKey main resolves to '<packageKey>@main',
which Pacman never creates because the key is reserved, so the command
only failed once the backend returned a 404. Reject it locally with a
message pointing at --all, and skip any branch keyed 'main' in --all so
it cannot push over the main package's mirror.

Includes-AI-Code: true
@LaberionAjvazi
Laberion Ajvazi (LaberionAjvazi) marked this pull request as ready for review July 28, 2026 15:02
Drop the duplicated uncompressed-size limit, readable-stream helper and
multipart assembly in favour of SinglePackageImportService, so the size
limit and the "packageFile" contract have a single owner.

Validate the user-supplied zip before extracting it rather than checking
the archive we build afterwards, so an oversized source is rejected
before it expands onto disk. Adds coverage for the --file import path,
which had none.

Includes-AI-Code: true

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3e014ad. Configure here.

Base automatically changed from LaberionAjvazi/sp-1447 to main July 29, 2026 11:27
PR #399 was squash-merged, so main carries the SP-1447 branch commands as
a single commit while this branch still carries them as three. Every
conflict was that duplicated history rather than a real content clash:
main is byte-identical to this branch's SP-1447 tip for all six files, so
each conflict resolves to this branch's version, which is main's content
plus the SP-1472 export/import changes on top.

The two docs hunks where main had content are lines SP-1472 reworded to
mention the Git mirror, so the reworded text is kept.

Includes-AI-Code: true
@sonarqubecloud

Copy link
Copy Markdown

@LaberionAjvazi
Laberion Ajvazi (LaberionAjvazi) merged commit fcf5e50 into main Jul 29, 2026
6 checks passed
@LaberionAjvazi
Laberion Ajvazi (LaberionAjvazi) deleted the LaberionAjvazi/sp-1472 branch July 29, 2026 14:31
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.

2 participants