Skip to content

feat: import uds-cli-next source code - #1461

Merged
joelmccoy merged 83 commits into
mainfrom
import-uds-cli-next-linear-history
Aug 20, 2026
Merged

joelmccoy merged 83 commits into
mainfrom
import-uds-cli-next-linear-history

Conversation

@joelmccoy

@joelmccoy joelmccoy commented Aug 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Import the source code of uds-cli-next into uds-cli.

This PR brings over the new command implementation and supporting packages while keeping current uds command routing unchanged. The goal is to land the code first, then wire command mode (and tasks/docs/etc) in a follow-up PR.

Imported paths:

  • cmd/uds-cli-next/
  • internal/
  • pkg/
  • tests/

Excluded from the import:

  • docs/adr/
  • vendor/
  • root repo config
  • CI/release files
  • root docs
  • tasks

Docs, tasks, CI, release configuration, and command routing will be ported in follow-up PRs so this import stays focused on the implementation code.

Import process

This branch was generated from defenseunicorns/uds-cli-next using git-filter-repo.

Additional import cleanup:

  • rewrote module references from github.com/defenseunicorns/uds-cli-next to github.com/defenseunicorns/uds-cli
  • re-signed the rewritten commits for the import branch

Validation

Suggested validation:

go test ./internal/... ./pkg/...
go test ./cmd/uds-cli-next
go run ./cmd/uds-cli-next <commands>
go run ./cmd/uds-cli-next bundle --help

Follow-up

Separate PRs should port docs, tasks, CI/release configuration, and command mode dispatch. This PR intentionally avoids changing runtime routing behavior.

slaskawi and others added 30 commits August 20, 2026 11:18
* Initial scaffoling prep

* Initial

* Install tooling

* Update linters

* Vendored deps

* Remove downloading deps

* Git attributes

* Comments addressed

* Renovate and ADR config

* Update tasks.yaml

* Update CODEOWNERS

* Comments addressed

* Codebase refactoring along with Maciej's comments

* Tests split

* Fix typo

* Moved integration tests to its own directory

* Replace NewIOStreams with NewTestIOStreams

* Separate unit and integration tests

---------
* Bundle examples for discussion

* Aligning the structure with ADR0003

* Updated examples

* Comments addressed

* Updated example
* Bundle examples for discussion

* Aligning the structure with ADR0003

* Updated examples

* uds bundle inspect implementation spec

* uds bundle inspect implementation

* go mod vendor

* Update docs/user-guides/UDS Bundles.md

* Github copilot comments addressed

* Comments addressed

* Comments addressed

* Post-merge fixes

* Multi YAML file test

* Rewrite printing out bundles

* Additional validation logic

* Extra protection from errors in streams

* Simplify sorting

* Method call optimized

* Update docs/user-guides/UDS Bundles.md

* Implemented Github Copilot suggestion

* Comments addressed

---------
* feat: init commit for implementation of create functionality

* revert accidental change to adr

* try again

* refactor testing to not require real filesystem fixtures

* break up into smaller files and fix some things

* fix integration test

* align depedencies with zarf

* address pr feedback

* address pr feedback

* fix linting

* pr feedback: layer concurrency, errgroup limiting, package concurrency removed, oci ref detection improved, added additional optional component tests, simplified the writetarzst to match zarfs

* pr feedback: fix remaining string contains syntax

* pr feedback: ociref tests, focus on directory and checking for bundle.uds.hcl file, architecture filter cleanup and flags, add some e2e tests for conditional components

* increase timeout and optimize download of zarf-dev packages init once rather than twice

* fix local package oci image retrieval

* pr feedback: fix missing arch flag, remove keepalllayers param, extractTarZst context param, new integration test assertions, integration tests for optional component exclusion

* remove design doc

* add shorthand -a flag

* remove local oci annotations

* move oci types

* pr feedback: fix ingest not taking in the full zarf package structure

* More integration tests

---------
* go mod vendor

* uds bundle deploy command

* Comments addressed

* Remove optional components from the Deploy Command

* Remove implementation guidelines

* Revert "Remove optional components from the Deploy Command"

This reverts commit 4446a527b1942b2dacbfd1952e08d395610d0158.

* Deploy ignores optional components unless explicitly requested

* Lint errors fix

* Comments addressed
* feat: add structured logging with log/slog

* chore: add logging library comparison

* chore: refactor/add logging statements to create/deploy

* chore: cleanup

* chore: adjust integration tests

* chore: address pr comment
* adr on interactivity

* Implementation and comments

* Update docs/adr/0005-interactivity.md

* Comments addressed

* Update docs/adr/0005-interactivity.md

* After-merge fixes

* Fixing tests

---------
* chore(deps): update go-dependencies

| datasource | package                                | from    | to      |
| ---------- | -------------------------------------- | ------- | ------- |
| go         | github.com/google/go-containerregistry | v0.21.1 | v0.21.2 |
| go         | github.com/zarf-dev/zarf               | v0.71.1 | v0.73.0 |
| go         | k8s.io/api                             | v0.35.0 | v0.35.2 |
| go         | k8s.io/apimachinery                    | v0.35.0 | v0.35.2 |
| go         | k8s.io/client-go                       | v0.35.0 | v0.35.2 |

* Fixed lint

---------
* feat: add CLI flag handling for all settings

* feat: remove runtime.GOARCH fallback logic from create and deploy

* chore: forgot one

* fix: rebase, conflicts, tests

* fix: address pr comments

* chore: address pr feedback
…l during create (#74)

* chore: add bundle HCL and values files to OCI layer during create

* chore: add ADR for adding bundle definition and value files to OCI layout
| datasource | package                                  | from    | to      |
| ---------- | ---------------------------------------- | ------- | ------- |
| docker     | ghcr.io/defenseunicorns/packages/uds-k3d | 0.19.4  | 0.19.5  |
| docker     | ghcr.io/zarf-dev/packages/init           | v0.71.1 | v0.73.1 |
* chore: implement push to remote OCI registry

* chore: implement pull from remote OCI registry

* chore: add ParseBundleBytes to the Parser interface

* chore: default temp/test directories created with 0o700 (owner-only) permissions

* chore: default temp/test files created with 0o600 (owner-only) permissions
* CLI Options unification

* Address PR #157 review comments for CLI-120

- Add ValidateConfig() guard at Deploy() and Create() entry points
- Fix stale doc comment and package diagram in deploy.go
- Add nil guard to MergeHCL() for defensive coding
- Use cmd.Context() instead of context.Background() in Resolve()
- Remove redundant ConfigPath field and validation from DeployOptions

* Add symmetric ValidateConfig guard to all CLI command Validate() methods

Every command (deploy, create, push, pull, inspect) now calls
bundle.ValidateConfig(o.Config) as the first check in Validate(),
preventing nil pointer dereferences before accessing Config.Options.

* Introduced GlobalConfig

* Fix test

* Revert "Fix test"

This reverts commit edd5ddf1032a74c5197931228b797aa6467fd94d.

* Reapply "Fix test"

This reverts commit 93af7e09aa91c7a9a1dee2d62c286ef6947126cd.

* Introduced GlobalConfig

* Fix integration test

* Update pkg/bundle/types.go

---------
* chore(deps): update test-bundle-dependencies

| datasource | package                                   | from    | to      |
| ---------- | ----------------------------------------- | ------- | ------- |
| docker     | ghcr.io/defenseunicorns/packages/uds-k3d  | 0.19.4  | 0.19.5  |
| docker     | ghcr.io/defenseunicorns/packages/uds/core | 0.59.1  | 0.63.0  |
| docker     | ghcr.io/zarf-dev/packages/init            | v0.73.1 | v0.74.0 |

* Fix test

* Fix test

---------
* chore: add Mergevariables function to deep-merge variables from base and overrides

* chore: refactored config ConfigResolver.Resolve to first merge variables default config if found in bundle directory

* chore: add default bundle config file, defaults.uds.hcl, to bundle OCI layer during create if exists

* chore: return error when loading defaults config file if options block is specified

* chore: add code comment and user doc content about defaults file regarding setting variables and no support for options
* Structured logging

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>

* Code refactoring to the new pattern

* Comments addressed

* Propagate loglevel to Zarf

* Test fix

---------

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
* chore(refactor): standardize zarf package retrieval logic

* chore: address pr feedback

* chore: address more feedback

* chore: more pr feedback

* chore: commit suggestion

* fix: syntax error

* chore: pr feedback

* chore: pr feedback and fix merged code

* chore: remove/consolidate registryopts into configoptions

* fix: nil panics on configoptions

---------
| datasource | package                        | from    | to      |
| ---------- | ------------------------------ | ------- | ------- |
| docker     | ghcr.io/zarf-dev/packages/init | v0.74.0 | v0.74.2 |
| docker     | ghcr.io/zarf-dev/packages/init | v0.73.1 | v0.74.2 |
| datasource | package                                   | from   | to    |
| ---------- | ----------------------------------------- | ------ | ----- |
| docker     | ghcr.io/defenseunicorns/packages/uds/core | 0.63.0 | 1.1.0 |
* feat: add uds bundle reconfigure command

* chore: pr feedback and local review feedback

* chore: pr feedback

* chore: fix bundle file name replacement

* fix: integration tests check
| datasource | package                                   | from    | to      |
| ---------- | ----------------------------------------- | ------- | ------- |
| docker     | ghcr.io/defenseunicorns/packages/uds/core | 1.1.0   | 1.2.0   |
| docker     | ghcr.io/zarf-dev/packages/init            | v0.74.2 | v0.75.0 |
* chore: moved bundle oci layout related functions and corresponding unit test to oci_layout.go and oci_layout_test.go, respectively

* chore: add bundle OCI layout digest verification functions for an extracted OCI artifact

* chore: handle nested indexes and always verify blob size in OCI layout digest verification
| datasource | package                                   | from  | to    |
| ---------- | ----------------------------------------- | ----- | ----- |
| docker     | ghcr.io/defenseunicorns/packages/uds/core | 1.2.0 | 1.2.1 |
* chore: delegate extraction to zarf lib

* fix: pr feedback
| datasource | package                                  | from   | to     |
| ---------- | ---------------------------------------- | ------ | ------ |
| docker     | ghcr.io/defenseunicorns/packages/uds-k3d | 0.19.5 | 0.20.0 |
* Agent guidelines restructure

* comments addressed
| datasource | package                                   | from    | to      |
| ---------- | ----------------------------------------- | ------- | ------- |
| docker     | ghcr.io/defenseunicorns/packages/uds/core | 1.2.1   | 1.3.0   |
| docker     | ghcr.io/zarf-dev/packages/init            | v0.75.0 | v0.75.1 |
* Bundle remove command

* Comments addressed

* fix: remove integration test that triggers os.Exit

TestRemoveCommand_InvalidPackages_Integration called CheckErr which
invokes os.Exit(1), crashing the test process. The invalid --packages
error path is already covered by unit tests.

* fix: wire root command to iostreams and fix remove integration tests

* Comments addressed

* fix: rename dag.GetTraversal to dag.Traversal after merge

* refactor: encapsulate remove orchestration inside ZarfRemover

* review: address remove command feedback

* review: drop --packages CLI flag reference from library errors

* comments addressed
joelmccoy and others added 17 commits August 20, 2026 11:18
* chore: remove uneeded package source from local oci directory

* chore: address pr feedback

* chore: address pr comment

* chore: trigger CI

* chore: merge

* chore: remove unused helpers
* feat(bundle): inspect built artifacts

* fix(bundle): clarify built bundle inspection scope

* feat(bundle): restore built artifact inspection

* chore: pr feedback and cleanup

* fix: address pr feedback

* fix: merge conflict breaking build

* address pr feedback
* fix(CLI-284): use correct value for Reconfigured From

* docs(CLI-284): clarify ADR highlighting correction

* docs(CLI-284): clarify reconfigure provenance digest

* docs(CLI-284): remove unwanted Correction section
* refactor: simplify bundle internals

* refactor: rename internal bundle package

* comments addressed

* comments addressed
* refactor: extractLocals to use dependency order

* fix: handle local[path] being ommitted

* fix: pr feedback

* fix: move expressions_test.go to internal/bundle

* chore: add regression test for catching unevaluated errors

* fix: pr feedback
* refactor!: update oci logic to use upstream oras/zarf libraries

* chore: pr feedback and annotations

* chore: address pr feedback

* chore: better naming and desriptions

* chore: more cleanup

* chore: consistent naming

* chore: address pr feedback

* chore: pr feedback, test fixes, and more cleanup

* chore: more cleanup/optimizations

* chore: clearer function name

* chore: cleanup after merge

* fix: merge regressions

* chore: address pr feedback and more cleanup

* chore: cleanup bad merge additions

* chore: cleanup docs

* chore: address pr feedback

* chore: address pr feedback
| datasource | package                        | from    | to      |
| ---------- | ------------------------------ | ------- | ------- |
| docker     | ghcr.io/zarf-dev/packages/init | v0.82.0 | v0.83.0 |
* wip: bundle signing/verification

* wip: iterate

* wip: fix lint test

* fix: the things

* fix thing

* wip: iterate

* churn some more

* fix: thing

* chore: some plus, some minus

* now we're thinking with oci

* wip: bulk updates based on PR feedback

* fix: simplify workflow

* chore: lint

* chore: local keyless task

* chore: adr renumber, words to make codex happy

* chore: overwrite for evidence malformed

* fix: archive perms

* chore: pr feedback

* chore: warn on failed pull w/ skip verification

* chore: validate bundle def for signing

* docs: add zarf refs to adr

* chore: small change to handle windows seamlessly
* chore: add go fix to linting

* chore: add agent note
…ils (#291)

* refactor!: narrow bundle public API and hide implementation details

* fix: address PR feedback and failing ci jobs

* fix: pr feedback for ispartial status

* fix: address pr feedback

* fix: address pr feedback

* fix: preserve component metadata when filtering package layouts

* fix: harden artifact deploy and preserve hook mutations

* fix: centralize deploy defaults resolution

* fix: greptile comments

* fix: reject unsafe component layout mutations

* fix: address codex reviews

* fix: address pr feedback

* fix: address greptile comment and broken ci jobs

* fix: reject duplicate components and refresh hook logging

* fix: preserve renamed package layout across cluster hooks

* fix: address bundle review feedback

* fix: ci failures
* docs(CLI-296): improve quality of diagnostics

* fix(cli-296): preserve dev deploy integrity warning

* fix(cli-296): restore reconfigure logger binding

* fix(cli-296): bind deploy progress logger

* fix(CLI-296): clarify bundle removal
…eferences (#279)

* fix(CLI-282): protect layer materialization from fs subversion

* fix(CLI-282): space-efficient staging

* fix(CLI-282): move type to types.go

* fix(CLI-282): support relative OCI directories

* fix(CLI-282): thread context.Context through new API

* fix(CLI-282): safely hard-link artifact layers into package staging

* fix(CLI-282): prevent symlinked artifact blobs from escaping package staging

* fix(CLI-282): simplify back to just containing extract

* fix(CLI-282): share a root between staging and artifact workspace

* fix(CLI-282): safely hard-link regular artifact blobs during package staging

* fix(CLI-282): avoid temporary layer-file name collisions during staging

* fix(CLI-282): support external destinations for artifact package staging

* fix(CLI-282): fall back to configured temp directory for package staging

* fix(CLI-282): normalize OCI paths before selecting staging directories

* fix(CLI-282): retry artifact package staging in configured temp storage

* fix(CLI-282): retry package staging after quota exhaustion

* docs(CLI-282): document the staging root approach

* fix(CLI-282): use short temporary names when staging package layers

* docs(CLI-282): add ADR

* docs(CLI-282): add comments

* fix(CLI-282): retry package staging only after storage exhaustion

* chore(CLI-282): cover artifact package staging retries and cleanup

* chore(CLI-282): relocate to types.go and document staging root

* chore(CLI-282): use configured temp directory when OCI path is empty

* docs(CLI-282): renumber rooted staging ADR

* docs(CLI-282(: document empty str return val

* fix(CLI-282): add hard link test

* docs: rename ADR

* test(CLI-282): adapt staging tests after rebase

* fix(CLI-282): remove unused staging helpers
* feat!: identity packages in oci by package name

* chore: add better tests

* chore: pr feedback
* fix(bundle): API cleanup and restore inspect API

* fix(bundle): harden inspect api verification flow

* address codex review comment

* fix: codex review comment

* fix: address pr feedback

* fix: restore inspect logger import
* fix(refactor)!: relocate type defs from types.go, rm types.go files

* fix(refactor)!: fix lint issue

* docs(refactor)!: restore OCI configuration alias comments

* fix(refactor)!: restore deploy hook concurrency contract

* docs(refactor)!: clarify remove force safety bypass

* chore(refactor)!: only define octal mode constants once

* docs(refactor): restore internal bundle type documentation

* docs: renumber ADR

* fix: keep HCL decoder state internal

* fix: remove inert cache option

* fix: keep parser interface internal

* fix: keep public config types tag-free

* docs: restore relocated API contracts

* fix: remove unused internal global options

* test(bundle): remove test-only type aliases

* refactor: remove redundant aliases

* refactor: remove redundant aliases

* refactor: rename file

* refactor: create new configuration.go for some defs

* docs: restore old docs

* docs: rm PackageDeployFn from docs

* docs: restore ExtractBundle docs

* chore: rebase on main

* docs: renumber ADR

* docs: restore pull/push interface contracts

* docs: restore MediaTypeBundler, MediaTypeZarfLayer docs

* docs: renumber ADR

* chore: replace omitempty

* chore: replace omitempty tags
* wip: first pass

* refactor: improve handling of errors in pkg/

* fix: linter failures

* chore: reccomend errors.AsType

* chore: added more tests

* fix: add unmapped invalid oci reference error

* fix: improve bubbling up public errors

* fix: remove duplicate function

* fix: codex pr feedback

* fix: more codex pr feedback

* chore: simplified and improved tone of ADR

* fix: pr feedback

* fix: add skip signature verification on roundtrip test

* fix: more pr feedback

* chore: add comp time checks

* feat: improve context in errors

* fix: pr feedback 2 electric boogaloo

* fix: undo codexs adr number switch
@joelmccoy
joelmccoy requested a review from a team as a code owner August 20, 2026 16:26
Copilot AI lite review requested due to automatic review settings August 20, 2026 16:26
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (216 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@joelmccoy joelmccoy changed the title Import filtered uds-cli-next implementation feat: import uds-cli-next source code Aug 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df6111d611

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/oci/transfer.go Resolved
Comment thread cmd/uds-cli-next/main.go Resolved
Comment thread pkg/bundle/create.go Resolved
Comment thread internal/cli/cmd.go Resolved
Comment thread internal/cli/bundle/config_resolver.go Resolved
Comment thread pkg/bundle/spec/validation.go Resolved
Comment thread internal/bundle/configuration.go Resolved
chance-coleman
chance-coleman approved these changes Aug 20, 2026 •

@eoghanriley eoghanriley left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@joelmccoy
joelmccoy merged commit c769944 into main Aug 20, 2026
20 checks passed
@joelmccoy
joelmccoy deleted the import-uds-cli-next-linear-history branch August 20, 2026 19:07
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.

9 participants