Skip to content

feat: support multiple package removal#5013

Open
Avadhut03 wants to merge 3 commits into
zarf-dev:mainfrom
Avadhut03:support-multiple-package-removal
Open

feat: support multiple package removal#5013
Avadhut03 wants to merge 3 commits into
zarf-dev:mainfrom
Avadhut03:support-multiple-package-removal

Conversation

@Avadhut03

Copy link
Copy Markdown

Description

This PR adds support for removing multiple packages in a single zarf package remove command by allowing multiple package names or sources to be passed as arguments. The existing interactive package selection behavior is preserved when no arguments are provided, and the command now iterates through each specified package

Related Issue

Fixes #4992

Checklist before merging

@Avadhut03
Avadhut03 requested review from a team as code owners June 27, 2026 14:26
@netlify

netlify Bot commented Jun 27, 2026

Copy link
Copy Markdown

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 907d3d5
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6a4126778408db0008f383f3

@Avadhut03
Avadhut03 force-pushed the support-multiple-package-removal branch from a15585c to 46315ca Compare June 27, 2026 14:28
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.88235% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/package.go 5.88% 32 Missing ⚠️
Files with missing lines Coverage Δ
src/cmd/package.go 42.21% <5.88%> (-0.18%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Avadhut03 Avadhut03 changed the title Added a support for an multiple zarf package removal feat: support multiple package removal Jun 28, 2026
Signed-off-by: Avadhut03 <avadhutkul60@gmail.com>
@Avadhut03
Avadhut03 force-pushed the support-multiple-package-removal branch from 7699d76 to 27b6c0e Compare June 28, 2026 13:15
Signed-off-by: Avadhut03 <avadhutkul60@gmail.com>
Signed-off-by: Avadhut03 <avadhutkul60@gmail.com>
@Avadhut03
Avadhut03 force-pushed the support-multiple-package-removal branch from 29b4635 to 907d3d5 Compare June 28, 2026 13:49
@brandtkeller

Copy link
Copy Markdown
Member

Thank you for the patience @Avadhut03 ! We'll get this into review shortly.

@brandtkeller brandtkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initial thought around inputs that will be acceptable.

I do want to leave open the distinct possibility that we decide not to do this work. It's still very much appreciated and we should evaluate it through this PR - but I also don't want to make the command oddly-shaped by adding variance in how the command operates based on number of packages.

Comment thread src/cmd/package.go
return fmt.Errorf("unable to load the package: %w", err)
}

removeOpt := packager.RemoveOptions{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we want to pursue this change (leaving the option open to leave the command as-is) - I think we'll want additional validation on the options you can pass in.

things like namespace override shouldn't be accepted on remove when multiple packages are being targeted. Same for values and potentially other inputs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks for the feedback! That makes sense. I agree that the command shouldn't have ambiguous behavior depending on the number of packages.

If we decide to move forward with supporting multiple package removal, I can add validation to explicitly reject options that don't make sense in that context (for example, --namespace, --values, --set, and any other package-specific overrides). That way the behavior remains predictable and we avoid ambiguous semantics.

If, after discussion, we decide that supporting multiple package removal isn't the right direction for the CLI, I'm also happy to keep the command as-is. I'll wait for the design decision before investing further in the implementation.

@github-project-automation github-project-automation Bot moved this to In progress in Zarf Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Support passing multiple packages to zarf package remove

2 participants