Skip to content

refactor(CLI-269)!: prepare repository for CLI modes - #1458

Merged
joelmccoy merged 13 commits into
mainfrom
sebastianlaskawiec/prepare-cli-modes
Aug 19, 2026
Merged

joelmccoy merged 13 commits into
mainfrom
sebastianlaskawiec/prepare-cli-modes

Conversation

@slaskawi

@slaskawi slaskawi commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Prepare the repository for complete Legacy and Next command trees without changing the default CLI behavior.

This is a breaking change for Go library consumers. Legacy public packages move from the src namespace to the pkg/legacy namespace. Customers importing the public Go library must update their imports before upgrading.

The migration is mechanical. Package names and exported symbols remain unchanged, so call sites do not need to change.

// Before
import "github.com/defenseunicorns/uds-cli/src/config"
import "github.com/defenseunicorns/uds-cli/src/pkg/bundle"
import "github.com/defenseunicorns/uds-cli/src/types"

// After
import "github.com/defenseunicorns/uds-cli/pkg/legacy/config"
import "github.com/defenseunicorns/uds-cli/pkg/legacy/bundle"
import "github.com/defenseunicorns/uds-cli/pkg/legacy/types"

Additional examples include:

github.com/defenseunicorns/uds-cli/src/pkg/utils
  -> github.com/defenseunicorns/uds-cli/pkg/legacy/utils

github.com/defenseunicorns/uds-cli/src/config/lang
  -> github.com/defenseunicorns/uds-cli/pkg/legacy/config/lang

CLI invocations continue to use the Legacy command tree by default. Next commands are not copied or exposed by this change.

The PR title and commits follow Conventional Commits 1.0.0, with the breaking change marked using !.

Related Issue

Type of change

  • Bug fix (non breaking change which fixes an issue)
  • New feature (non breaking change which adds functionality)
  • Other, repository structure and build preparation, breaking library import migration

Validation

  • Repository lint and secret scanning
  • Unit, router, architecture, and Legacy API compatibility tests
  • Schema and command documentation generation
  • Native and cross platform builds
  • GoReleaser configuration and snapshot release build
  • Local allowlisted Next import proof, kept outside this branch

Checklist before merging

BEGIN_COMMIT_OVERRIDE
refactor!: prepare repository for CLI modes

BREAKING CHANGE: Legacy public Go packages moved from github.com/defenseunicorns/uds-cli/src/... to github.com/defenseunicorns/uds-cli/pkg/legacy/.... Customers must update their imports before upgrading.
END_COMMIT_OVERRIDE

@slaskawi
slaskawi force-pushed the sebastianlaskawiec/prepare-cli-modes branch from 993fb94 to b8c81e7 Compare August 13, 2026 11:21
@slaskawi
slaskawi marked this pull request as ready for review August 17, 2026 08:56
@slaskawi
slaskawi requested a review from a team as a code owner August 17, 2026 08:56
Copilot AI lite review requested due to automatic review settings August 17, 2026 08:56
@slaskawi

Copy link
Copy Markdown
Contributor Author

@greptileai review

@slaskawi slaskawi changed the title refactor: prepare repository for CLI modes refactor!: prepare repository for CLI modes Aug 17, 2026
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reorganizes the existing CLI into explicit Legacy namespaces and introduces mode resolution, repeatable command construction, and updated build/test/release automation. The default command tree remains Legacy, while NextMode is recognized but intentionally unavailable.

  • Moves Legacy CLI and public packages under internal/legacy and pkg/legacy.
  • Adds a mode/bootstrap seam and side-effect-free Cobra root construction.
  • Reconciles fixtures, tests, generators, CI, linting, and release paths.

Confidence Score: 4/5

The initialization-order defect should be fixed before merging because feature-enabled invocations can expose bootstrap arguments to Zarf before mode resolution runs.

The new bootstrap relies on internal/mode.init cleaning os.Args, but the entrypoint imports Legacy and mode as independent dependencies, so Go does not establish the required initialization boundary ahead of Legacy's Zarf dependency graph.

Files Needing Attention: cmd/uds/main.go, internal/mode/mode.go

Important Files Changed

Filename Overview
cmd/uds/main.go Adds the mode-aware entrypoint, but sibling imports do not guarantee that mode bootstrap initialization precedes Legacy/Zarf initialization.
internal/mode/mode.go Implements strict feature parsing and argument normalization; its package-level init cannot by itself order unrelated imported dependency initialization.
internal/legacy/cli/root.go Replaces package-global command construction with a repeatable root constructor while preserving the Legacy command tree.
.goreleaser.yaml Retargets the release build and Legacy version metadata to the moved entrypoint and packages.
hack/push-test-artifacts.sh Updates fixture traversal for the new testdata/legacy layout without an identified path regression.

Sequence Diagram

sequenceDiagram
    participant Go as Go runtime
    participant Legacy as internal/legacy/cli + Zarf
    participant Mode as internal/mode
    participant Main as cmd/uds main
    Go->>Legacy: Initialize sibling import dependency
    Legacy->>Legacy: Dependency initialization may inspect os.Args
    Go->>Mode: Run mode.init()
    Mode->>Mode: Strip --features from os.Args
    Go->>Main: Run main()
    Main->>Mode: Resolve preserved arguments
    Main->>Legacy: Construct selected root command
Loading

Reviews (1): Last reviewed commit: "docs: clarify Zarf feature preservation" | Re-trigger Greptile

Comment thread cmd/uds/main.go Resolved

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.

Pull request overview

Prepares the repository for a future β€œLegacy + Next” dual-command-tree CLI while preserving the current default (Legacy) behavior. This is done primarily through a large-scale move of Legacy code/tests/fixtures into explicit internal/legacy and pkg/legacy namespaces, plus adding a mode/feature bootstrap seam in the new cmd/uds entrypoint.

Changes:

  • Introduces cmd/uds entrypoint with internal/mode feature parsing and an explicit β€œLegacy vs Next” selection seam (Next currently rejected).
  • Relocates Legacy implementation code into internal/legacy/** and pkg/legacy/**, and migrates Legacy E2E + fixtures into tests/legacy/** and testdata/legacy/**.
  • Reconciles build/test/release automation and docs to match the new layout (GoReleaser, workflows, Renovate, schema/docs generation, lint, secret scanning ignore list).

Reviewed changes

Copilot reviewed 140 out of 250 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/legacy/e2e/zarf_test.go Updates fixture paths; adds feature-bootstrap E2E coverage.
tests/legacy/e2e/optional_bundle_test.go Updates fixture paths for optional-component bundle tests.
tests/legacy/e2e/monitor_test.go Updates engine package fixture path.
tests/legacy/e2e/main_test.go Switches to Legacy namespaces (internal/legacy/testutil, pkg/legacy/*); updates init bundle fixture path.
tests/legacy/e2e/ghcr_test.go Switches to pkg/legacy/config; updates GHCR fixture paths and comments.
tests/legacy/e2e/dev_test.go Updates bundle/package fixture paths throughout.
tests/legacy/e2e/completion_test.go Switches to pkg/legacy/config/lang.
tests/legacy/e2e/common.go Adds shared E2E helper(s) (multi-arch index validation).
tests/legacy/e2e/commands_test.go Switches imports to pkg/legacy/* namespaces.
tests/legacy/e2e/bundle_index_test.go Updates bundle fixture paths used for index tests.
tests/legacy/e2e/bundle_deploy_flags_test.go Updates bundle/package fixture paths for flag tests.
testdata/legacy/tasks/tasks.yaml Updates default task paths; removes remote include usage; adds UDS_FEATURES visibility task.
testdata/legacy/tasks/tasks-no-default.yaml Adds tasks fixture without defaults.
testdata/legacy/tasks/remote-tasks.yaml Adds tasks fixture that includes a remote import (new path).
testdata/legacy/tasks/remote-import-tasks.yaml Updates remote include path to new testdata/legacy location.
testdata/legacy/tasks/my-other-env Adds env-file fixture.
testdata/legacy/tasks/my-env Adds env-file fixture with special characters.
testdata/legacy/tasks/more-tasks/foo.yaml Adds nested-include tasks fixture.
testdata/legacy/tasks/more-tasks/bar.yaml Adds nested tasks fixture.
testdata/legacy/tasks/more-tasks-to-import.yaml Adds tasks import/collision fixture.
testdata/legacy/tasks/loop-task.yaml Adds β€œinclude loop” tasks fixture for error-path testing.
testdata/legacy/tasks/inputs/tasks.yaml Adds tasks fixture covering inputs/with semantics.
testdata/legacy/tasks/inputs/tasks-with-inputs.yaml Adds tasks fixture defining tasks with inputs and templating patterns.
testdata/legacy/tasks/even-more-tasks-to-import.yaml Adds additional imported-task fixture with setVariables.
testdata/legacy/packages/zarf-bug/zarf.yaml Adds package fixture to reproduce upstream Zarf component-name behavior.
testdata/legacy/packages/prometheus/zarf.yaml Adds package fixture for composed components and optional-only images.
testdata/legacy/packages/prometheus/images/zarf.yaml Adds composable β€œimages-only” package fixture.
testdata/legacy/packages/podinfo/zarf.yaml Adds podinfo package fixture with flavors and wait actions.
testdata/legacy/packages/podinfo/refs/zarf.yaml Adds refs-based podinfo package fixture for --refs testing.
testdata/legacy/packages/podinfo/flavors/zarf.yaml Adds podinfo flavors fixture.
testdata/legacy/packages/podinfo-refs/zarf.yaml Adds multi-arch image-ref fixture package.
testdata/legacy/packages/podinfo-nginx/zarf.yaml Adds composable package fixture importing podinfo/nginx/no-cluster components.
testdata/legacy/packages/no-cluster/receive-var/zarf.yaml Adds no-cluster package fixture for exported/imported vars behavior.
testdata/legacy/packages/no-cluster/real-simple/zarf.yaml Adds minimal no-cluster package fixture (used in tarball tests).
testdata/legacy/packages/no-cluster/output-var/zarf.yaml Adds no-cluster package fixture that exports multiple variables.
testdata/legacy/packages/no-cluster/output-var-collision/zarf.yaml Adds fixture for export name collision behavior.
testdata/legacy/packages/nginx/zarf.yaml Adds nginx fixture package (manifests + wait).
testdata/legacy/packages/nginx/refs/zarf.yaml Adds nginx refs fixture package for --refs behavior.
testdata/legacy/packages/nginx/refs/deployment.yaml Adds nginx deployment manifest fixture.
testdata/legacy/packages/nginx-namespace-override/zarf.yaml Adds fixture package for namespace override behavior.
testdata/legacy/packages/nginx-namespace-override/refs/deployment.yaml Adds deployment fixture for namespace override package.
testdata/legacy/packages/multi-platform-image/zarf.yaml Adds fixture package using a multi-platform OCI index digest.
testdata/legacy/packages/helm/zarf.yaml Adds helm-overrides fixture package with two charts and variables.
testdata/legacy/packages/helm/unicorn-podinfo/values.yaml Adds Helm values fixture (includes fake secret-like value).
testdata/legacy/packages/helm/unicorn-podinfo/templates/secret.yaml Adds Helm template secret fixture.
testdata/legacy/packages/helm/unicorn-podinfo/templates/file-secret.yaml Adds Helm template file-secret fixture.
testdata/legacy/packages/helm/unicorn-podinfo/Chart.yaml Adds Helm chart fixture metadata and dependencies.
testdata/legacy/packages/helm/unicorn-podinfo/Chart.lock Adds Helm dependency lock fixture.
testdata/legacy/packages/helm/unicorn-podinfo/.helmignore Adds Helm ignore file fixture.
testdata/legacy/packages/helm/second-chart/values.yaml Adds second chart values fixture.
testdata/legacy/packages/helm/second-chart/templates/file-secret.yaml Adds second chart template file-secret fixture.
testdata/legacy/packages/helm/second-chart/Chart.yaml Adds second chart metadata fixture.
testdata/legacy/packages/helm/second-chart/.helmignore Adds second chart ignore fixture.
testdata/legacy/packages/gitrepo/zarf.yaml Adds package fixture that exercises Zarf init gitrepo behavior.
testdata/legacy/packages/gitrepo/refs/deployment.yaml Adds gitrepo package deployment manifest fixture.
testdata/legacy/packages/engine/zarf.yaml Adds UDS Engine policy-violation fixture package.
testdata/legacy/packages/engine/podinfo-values.yaml Adds values fixture that intentionally violates policies.
testdata/legacy/bundles/23-multi-platform-image/uds-bundle.yaml Adds bundle fixture for multi-platform index digest package.
testdata/legacy/bundles/22-invalid-timeout/uds-bundle.yaml Adds bundle fixture with invalid timeout to test validation.
testdata/legacy/bundles/21-signed-with-key/uds-bundle.yaml Adds signed package + embedded public key fixture.
testdata/legacy/bundles/20-signed-no-key/uds-bundle.yaml Adds signed package fixture missing public key.
testdata/legacy/bundles/19-zarf-image-ref/uds-bundle.yaml Adds bundle fixture to exercise image reference forms.
testdata/legacy/bundles/16-zarf-bug/uds-bundle.yaml Adds bundle fixture for upstream Zarf bug reproduction package.
testdata/legacy/bundles/15-dev-deploy/uds-bundle.yaml Adds dev-deploy flavors bundle fixture.
testdata/legacy/bundles/14-optional-components/uds-bundle.yaml Adds optional-components bundle fixture with optionalComponents keys.
testdata/legacy/bundles/13-composable-component/uds-bundle.yaml Adds bundle fixture for composed components via remote pull.
testdata/legacy/bundles/12-exported-pkg-vars/uds-bundle.yaml Adds bundle fixture for exports/imports/overrides behavior.
testdata/legacy/bundles/11-real-simple/uds-bundle.yaml Adds minimal local bundle fixture.
testdata/legacy/bundles/11-real-simple/multiple-simple/uds-bundle.yaml Adds bundle fixture with multiple simple packages.
testdata/legacy/bundles/10-package-naming/uds-bundle.yaml Adds fixture for package name vs actual Zarf package name mismatch.
testdata/legacy/bundles/09-uds-bundle-yml/uds-config.yml Adds .yml config fixture.
testdata/legacy/bundles/09-uds-bundle-yml/uds-bundle.yml Adds .yml bundle fixture.
testdata/legacy/bundles/08-var-precedence/uds-config.yaml Adds fixture for shared vs per-package variable precedence.
testdata/legacy/bundles/08-var-precedence/uds-bundle.yaml Adds bundle fixture for precedence.
testdata/legacy/bundles/07-helm-overrides/variable-files/test.cert Adds base64-like fixture file used as a β€œfile variable” input.
testdata/legacy/bundles/07-helm-overrides/values-file/values2.yaml Adds helm override values fixture (2).
testdata/legacy/bundles/07-helm-overrides/values-file/values.yaml Adds helm override values fixture (1).
testdata/legacy/bundles/07-helm-overrides/values-file/uds-bundle.yaml Adds bundle fixture that tests Helm valuesFiles + inline values + variables.
testdata/legacy/bundles/07-helm-overrides/uds-config.yaml Adds helm-overrides config fixture used by E2E.
testdata/legacy/bundles/07-helm-overrides/uds-config-invalid.yaml Adds invalid config fixture to test validation.
testdata/legacy/bundles/07-helm-overrides/uds-bundle.yaml Adds helm-overrides bundle fixture with variables (incl. file vars).
testdata/legacy/bundles/07-helm-overrides/package-namespace/uds-bundle.yaml Adds package namespace override bundle fixture.
testdata/legacy/bundles/07-helm-overrides/package-namespace-resume/uds-bundle.yaml Adds resume fixture with duplicate packages + differing namespaces.
testdata/legacy/bundles/07-helm-overrides/package-namespace-resume-seed/uds-bundle.yaml Adds seed bundle for resume/duplicate namespace testing.
testdata/legacy/bundles/07-helm-overrides/invalid/uds-bundle.yaml Adds invalid bundle fixture to assert schema/validation errors.
testdata/legacy/bundles/07-helm-overrides/duplicate/uds-bundle.yaml Adds duplicate-package fixture with per-chart namespace overrides.
testdata/legacy/bundles/06-ghcr/uds-bundle.yaml Adds GHCR remote bundle fixture.
testdata/legacy/bundles/05-gitrepo/uds-bundle.yaml Adds bundle fixture for gitrepo package test.
testdata/legacy/bundles/04-init/uds-bundle.yaml Adds β€œlocal+remote init” bundle fixture.
testdata/legacy/bundles/03-local-and-remote/uds-config.yaml Adds local/remote bundle config fixture.
testdata/legacy/bundles/03-local-and-remote/uds-bundle.yaml Adds bundle fixture mixing local and GHCR packages.
testdata/legacy/bundles/02-variables/uds-config.yaml Adds variables bundle config fixture.
testdata/legacy/bundles/02-variables/uds-bundle.yaml Adds variables bundle fixture with anchors and imports/exports.
testdata/legacy/bundles/02-variables/remote/uds-bundle.yaml Adds remote variables bundle fixture.
testdata/legacy/bundles/02-variables/export-name-collision/uds-bundle.yaml Adds export collision fixture bundle.
testdata/legacy/bundles/02-variables/bad-var-name/uds-bundle.yaml Adds invalid import fixture bundle.
testdata/legacy/bundles/01-uds-bundle/uds-config.yaml Adds baseline remote bundle config fixture.
testdata/legacy/bundles/01-uds-bundle/uds-bundle.yaml Adds baseline remote bundle fixture.
tasks/dev.yaml Updates lint task to run across repo (./...) post-move.
src/cmd/version.go Removes old in-src/ version command (migrated to internal/legacy/cli).
src/cmd/vendored.go Removes old vendored runner/zarf command wiring (migrated).
src/cmd/monitor/pepr.go Removes old monitor pepr command (migrated).
src/cmd/monitor/monitor.go Removes old monitor root command (migrated).
src/cmd/internal.go Removes old internal commands (migrated).
renovate.json Updates Renovate file globs from src/test/** to tests/** + testdata/**.
pkg/legacy/utils/utils.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/utils/utils_test.go Updates imports to pkg/legacy/types.
pkg/legacy/utils/sbom.go Updates imports to pkg/legacy/config.
pkg/legacy/utils/oci_transport.go Adds registry plain-HTTP negotiation helper for OCI refs/hosts.
pkg/legacy/utils/oci_transport_test.go Adds unit tests for OCI transport negotiation behavior.
pkg/legacy/utils/boci/oci.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/utils/boci/oci_test.go Updates config import path to pkg/legacy/config.
pkg/legacy/types/valuesources/sources.go Adds valuesource enum (config/env/cli/bundle) under legacy types.
pkg/legacy/types/options.go Adds legacy bundle option structs under pkg/legacy/types.
pkg/legacy/types/chartvariable/chartvariables.go Adds legacy chart variable type enum.
pkg/legacy/types/bundle.go Updates chartvariable/valuesources imports to legacy namespace.
pkg/legacy/types/bundle_test.go Adds tests for signature/keyless verification helper methods.
pkg/legacy/testdata/zarf-package-real-simple-amd64-0.0.1.tar.zst Adds/moves binary fixture tarball used in unit tests.
pkg/legacy/testdata/README.md Updates instructions to regenerate fixture from new testdata paths.
pkg/legacy/style/style.go Adds Legacy output styling utilities.
pkg/legacy/sources/tarball.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/sources/tarball_test.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/sources/remote.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/sources/new.go Updates imports to pkg/legacy/* namespaces.
pkg/legacy/sources/common.go Updates utils import to legacy namespace.
pkg/legacy/sources/common_test.go Adds regression test for preserving manifest digests on load.
pkg/legacy/message/progress.go Adds Legacy progress bar implementation.
pkg/legacy/message/pausible.go Adds pausable writer for output suppression.
pkg/legacy/message/connect.go Adds connect string table output helper.
pkg/legacy/interactive/interactive.go Adds Legacy interactive password prompt helper.
pkg/legacy/engine/stream/common.go Updates imports to legacy namespaces.
pkg/legacy/engine/pepr/stream.go Updates imports to legacy namespaces, including new style pkg.
pkg/legacy/engine/k8s/common.go Adds legacy Kubernetes client constructor.
pkg/legacy/config/config.go Updates types import; adds reserved env guard for UDS_FEATURES.
pkg/legacy/cache/layers.go Updates config import to legacy namespace.
pkg/legacy/cache/cache.go Updates config import to legacy namespace.
pkg/legacy/bundler/remotebundle.go Updates bundler imports to legacy namespaces.
pkg/legacy/bundler/pusher/remote.go Updates pusher imports to legacy namespaces.
pkg/legacy/bundler/localbundle.go Updates bundler imports to legacy namespaces.
pkg/legacy/bundler/localbundle_test.go Updates imports to legacy namespaces.
pkg/legacy/bundler/fetcher/remote.go Updates fetcher imports to legacy namespaces.
pkg/legacy/bundler/fetcher/remote_test.go Adds regression test for cached manifest preservation.
pkg/legacy/bundler/fetcher/local.go Updates imports to legacy namespaces.
pkg/legacy/bundler/fetcher/local_test.go Updates imports to legacy namespaces.
pkg/legacy/bundler/fetcher/fetcher.go Updates imports to legacy namespaces.
pkg/legacy/bundler/fetcher/common.go Updates imports to legacy namespaces.
pkg/legacy/bundler/common.go Updates imports to legacy namespaces.
pkg/legacy/bundler/bundler.go Updates imports to legacy namespaces.
pkg/legacy/bundle/timeout.go Updates imports to legacy namespaces.
pkg/legacy/bundle/timeout_test.go Updates imports to legacy namespaces.
pkg/legacy/bundle/tarball.go Updates imports to legacy namespaces.
pkg/legacy/bundle/tarball_test.go Adds tests for tarball-layer extraction and force-upload repo behavior.
pkg/legacy/bundle/tarball_prefetch.go Updates imports and internal references post-move.
pkg/legacy/bundle/tarball_prefetch_test.go Updates imports to legacy namespaces.
pkg/legacy/bundle/remove.go Updates imports to legacy namespaces.
pkg/legacy/bundle/remove_test.go Updates config import to legacy namespace.
pkg/legacy/bundle/remote.go Updates imports to legacy namespaces.
pkg/legacy/bundle/pull.go Updates imports to legacy namespaces.
pkg/legacy/bundle/publish.go Updates imports to legacy namespaces.
pkg/legacy/bundle/provider.go Updates imports to legacy namespaces.
pkg/legacy/bundle/overrides.go Skips UDS_FEATURES when importing env vars as legacy bundle overrides.
pkg/legacy/bundle/overrides_features_test.go Adds regression test ensuring UDS_FEATURES is not treated as override.
pkg/legacy/bundle/namespace.go Updates types import to legacy namespace.
pkg/legacy/bundle/namespace_test.go Updates types import to legacy namespace.
pkg/legacy/bundle/list.go Updates message import to legacy namespace.
pkg/legacy/bundle/lifecycle_test.go Updates types import to legacy namespace.
pkg/legacy/bundle/inspect.go Updates imports to legacy namespaces.
pkg/legacy/bundle/inspect_test.go Adds regression test for listing images from imageArchives.
pkg/legacy/bundle/dev.go Updates imports to legacy namespaces.
pkg/legacy/bundle/deploy.go Updates imports to legacy namespaces.
pkg/legacy/bundle/deploy_test.go Updates imports/fixture paths for file-variable handling tests.
pkg/legacy/bundle/create.go Updates imports to legacy namespaces.
pkg/legacy/bundle/common.go Updates imports to legacy namespaces.
pkg/legacy/bundle/common_test.go Updates imports to legacy namespaces.
mise.toml Adds pinned GoReleaser tool version.
main.go Removes old root entrypoint (replaced by cmd/uds/main.go).
internal/version/version.go Adds canonical build metadata seam (Version/GitCommit/BuildDate).
internal/mode/mode_test.go Adds tests for mode + feature resolution/bootstrap behavior.
internal/legacy/zarfexec/zarfexec.go Adds helper to run embedded Zarf with explicit args (os.Args restore).
internal/legacy/zarfexec/zarfexec_test.go Adds tests for Zarf exec arg restoration behavior.
internal/legacy/testutil/testutil.go Updates message import; updates Zarf init pkg output dir to new fixtures path.
internal/legacy/cli/viper.go Refactors Viper init/read to avoid side effects during package init.
internal/legacy/cli/version.go Reintroduces version command as side-effect-free constructor under legacy CLI.
internal/legacy/cli/vendored.go Rebuilds vendored runner/zarf commands as explicit constructors and uses zarfexec.
internal/legacy/cli/vendored_test.go Adds test verifying runner env uses UDS_ARCHITECTURE.
internal/legacy/cli/uds_test.go Updates imports and assertions; fixes publish flag lookup to use a constructed root.
internal/legacy/cli/monitor/pepr.go Migrates pepr monitor command to side-effect-free constructor.
internal/legacy/cli/monitor/monitor.go Migrates monitor root/pepr constructors without init side effects.
internal/legacy/cli/monitor/monitor_test.go Adds repeatability test to ensure fresh command trees per constructor call.
internal/legacy/cli/internal.go Migrates internal schema/docs generation commands to side-effect-free constructors.
internal/legacy/cli/dev_test.go Updates imports and adjusts local-bundle detection test path.
internal/legacy/cli/common.go Updates imports to legacy namespaces.
internal/legacy/cli/common_test.go Adds tests for allowed config options.
internal/legacy/cli/cmd_test.go Updates imports to legacy namespaces.
hk.pkl Updates hook check glob patterns to the new directory structure.
hack/push-test-artifacts.sh Updates fixture paths to new testdata/legacy layout.
hack/generate-schema.sh Updates generator invocations to run via ./cmd/uds with Legacy mode.
hack/generate-docs.sh Updates docs generation to run via ./cmd/uds with Legacy mode.
hack/check-architecture.sh Adds guard script ensuring legacy code doesn’t depend on canonical Next packages.
go.mod Promotes pflag to direct dependency.
docs/reference/commands/uds.md Updates generated docs to include --features flag.
docs/reference/commands/uds_version.md Updates generated docs to include --features flag.
docs/reference/commands/uds_run.md Updates generated docs to include --features flag.
docs/reference/commands/uds_remove.md Updates generated docs to include --features flag.
docs/reference/commands/uds_pull.md Updates generated docs to include --features flag.
docs/reference/commands/uds_publish.md Updates generated docs to include --features flag.
docs/reference/commands/uds_monitor.md Updates generated docs to include --features flag.
docs/reference/commands/uds_monitor_pepr.md Updates generated docs to include --features flag.
docs/reference/commands/uds_logs.md Updates generated docs to include --features flag.
docs/reference/commands/uds_list.md Updates generated docs to include --features flag.
docs/reference/commands/uds_inspect.md Updates generated docs to include --features flag.
docs/reference/commands/uds_dev.md Updates generated docs to include --features flag.
docs/reference/commands/uds_dev_deploy.md Updates generated docs to include --features flag.
docs/reference/commands/uds_deploy.md Updates generated docs to include --features flag.
docs/reference/commands/uds_create.md Updates generated docs to include --features flag.
docs/reference/commands/uds_completion.md Updates generated docs to include --features flag.
docs/reference/commands/uds_completion_zsh.md Updates generated docs to include --features flag.
docs/reference/commands/uds_completion_fish.md Updates generated docs to include --features flag.
docs/reference/commands/uds_completion_bash.md Updates generated docs to include --features flag.
docs/adr/0010-legacy-next-coexistence.md Adds ADR documenting legacy/next coexistence target structure and constraints.
CONTRIBUTING.md Updates contributor guidance to new test/fixture locations and test task wording.
cmd/uds/main.go Adds new uds entrypoint with mode bootstrap and feature env propagation.
cmd/uds/main_test.go Adds tests covering default Legacy mode, Next rejection, and feature normalization propagation.
.goreleaser.yaml Updates ldflags to new legacy config path; adds canonical build metadata ldflags; pins build main to ./cmd/uds; sets Zarf CLIVersion from env.
.golangci.yml Reconfigures lint set, enables testing, updates exclusions/paths for new structure.
.gitleaksignore Updates ignore paths to new fixture/test locations.
.gitignore Updates fixture exceptions and legacy CLI generated dirs ignore paths.
.github/workflows/test.yaml Updates CI to run preparation tests; updates optional Zarf fetch step to rewrite init refs in fixtures.
.github/workflows/release.yaml Pins GoReleaser to v2.15.3 and exports ZARF_VERSION env.
.github/workflows/nightly-release.yaml Pins GoReleaser to v2.15.3 and exports ZARF_VERSION env.
.github/codeql.yaml Updates ignored paths to new legacy config locations.
Suppressed comments (2)

internal/mode/mode_test.go:95

  • This failure message uses %q with []string (got/want), which triggers govet's printf analyzer. Use %v (or strings.Join) for slice values.
    internal/legacy/zarfexec/zarfexec_test.go:31
  • This t.Fatalf uses %q with []string (os.Args / originalArgs), which triggers govet's printf analyzer and will fail lint/CI. Use %v (or strings.Join) for slices.

πŸ’‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/mode/mode_test.go Resolved
Prepare the repository for complete Legacy and Next command trees without changing the default CLI behavior.

BREAKING CHANGE: Legacy public Go package imports moved from github.com/defenseunicorns/uds-cli/src/... to github.com/defenseunicorns/uds-cli/pkg/legacy/.... Customers must update their imports before upgrading.

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
@slaskawi
slaskawi force-pushed the sebastianlaskawiec/prepare-cli-modes branch from a960bd3 to 3e40ba0 Compare August 17, 2026 09:05
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Comment thread .github/workflows/nightly-release.yaml Resolved
Comment thread .github/workflows/test.yaml Resolved
Comment thread .github/workflows/test.yaml Resolved
Comment thread .github/workflows/release.yaml Resolved
Comment thread hack/check-architecture.sh Resolved
Comment thread mise.toml Resolved
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
@slaskawi

Copy link
Copy Markdown
Contributor Author

Confirmed. The initialization dependency is explicit: the Legacy CLI imports mode before its Zarf dependency graph initializes.

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
bradclawsie
bradclawsie previously approved these changes Aug 17, 2026

@bradclawsie bradclawsie 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.

whew a long read, but lgtm

@joelmccoy joelmccoy 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.

Generally lgtm! a couple small comments

Comment thread .github/workflows/nightly-release.yaml Resolved
Comment thread .github/workflows/release.yaml Resolved
Comment thread hack/check-architecture.sh Resolved
Comment thread .github/workflows/test.yaml Resolved
Comment thread cmd/uds/main.go Resolved
Comment thread tasks/tests.yaml Resolved
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
bradclawsie
bradclawsie previously approved these changes Aug 18, 2026

@bradclawsie bradclawsie 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.

checked the two new commits ( 89499da and 1511d4e ) since my last approval, these look fine, re-approving

joelmccoy
joelmccoy previously approved these changes Aug 18, 2026

@joelmccoy joelmccoy 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.

LGTM - responded to one of my comments about the wording in the ADR, but really non blocking

Signed-off-by: Sebastian Łaskawiec <sebastian.laskawiec@defenseunicorns.com>
@slaskawi
slaskawi dismissed stale reviews from joelmccoy and bradclawsie via 4937a99 August 19, 2026 07:45

@bradclawsie bradclawsie 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.

checked commits since last approved; lgtm!

@joelmccoy
joelmccoy merged commit cb5d210 into main Aug 19, 2026
53 of 63 checks passed
@joelmccoy
joelmccoy deleted the sebastianlaskawiec/prepare-cli-modes branch August 19, 2026 17:06
@slaskawi slaskawi changed the title refactor!: prepare repository for CLI modes refactor(CLI-269)!: prepare repository for CLI modes Aug 21, 2026
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.

4 participants