Skip to content

feat: invert --with-git to --without-git for comp build and prepare-sources#162

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/invert-with-git-flag-default
Closed

feat: invert --with-git to --without-git for comp build and prepare-sources#162
Copilot wants to merge 2 commits intomainfrom
copilot/invert-with-git-flag-default

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

azldev component build and azldev component prepare-sources defaulted to the legacy source prep flow, while azldev component render always used the dist-git flow with synthetic commit history. This inverts the default so all three commands are consistent.

Changes

  • preparesources.go / build.go: WithGitRepo boolWithoutGitRepo bool; flag renamed --with-git--without-git (default false = dist-git on by default). Condition logic inverted accordingly.
  • Warning message updated: fires when --skip-overlays is set and --without-git is not (i.e., git flow is enabled but will have no effect).
  • Tests (preparesources_test.go, build_test.go): assert --without-git is registered with default false; assert legacy --with-git does not exist.
  • CLI docs regenerated via mage docs.

Before / After

# Before: opt-in to dist-git flow
azldev component build -p curl --with-git

# After: dist-git is the default; opt out if needed
azldev component build -p curl
azldev component build -p curl --without-git  # legacy/no-git behavior

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dario.cat
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • example.com
    • Triggering command: /tmp/go-build1685468948/b666/sourceproviders.test /tmp/go-build1685468948/b666/sourceproviders.test -test.testlogfile=/tmp/go-build1685468948/b666/testlog.txt -test.paniconexit0 -test.timeout=10m0s go1.25.6 -c=4 -nolocalimports -importcfg /tmp/go-build1685468948/b585/importcfg -pack /home/REDACTED/work/azure-linux-dev-tools/azure-linux-dev-tools/internal/app/azldev/cmds/component/add.go VFhAWUIJBRpS -qui�� VvaAEw8uD /tmp/go-build240-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet . o x86_64-linux-gnu-bool ux-amd64/pkg/too-buildtags (dns block)
    • Triggering command: /tmp/go-build259055312/b001/sourceproviders.test /tmp/go-build259055312/b001/sourceproviders.test -test.testlogfile=/tmp/go-build259055312/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build1685468948/b851/vet.cfg ry/retry_test.go zUBtsJhar ux-amd64/pkg/tool/linux_amd64/compile 5468948/b114/ -dev-tools/inter-o mpile ux-amd64/pkg/too-trimpath ortc�� wPWbfYyV0 .cfg ux-amd64/pkg/tool/linux_amd64/compile 5468948/b114/ 5468948/b292/ mpile ux-amd64/pkg/too-buildtags (dns block)
  • go.opentelemetry.io
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.szostok.io
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.uber.org
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • go.yaml.in
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • gopkg.in
    • Triggering command: /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses /home/REDACTED/.cache/go-build/7b/7be0cdfd4e5e66df21672375347bd23e46040e0c601b55d1ed8bef64f03acd06-d/go-licenses report --ignore golang.org/x --ignore github.com/microsoft/azure-linux-dev-tools ./... ux-amd64/pkg/tool/linux_amd64/vet provider.go GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/vet (dns block)
  • invalid-domain.there.is.no.such.resource
    • Triggering command: /tmp/go-build1685468948/b659/rpmprovider.test /tmp/go-build1685468948/b659/rpmprovider.test -test.testlogfile=/tmp/go-build1685468948/b659/testlog.txt -test.paniconexit0 -test.timeout=10m0s go1.25.6 -c=4 -nolocalimports -importcfg /tmp/go-build1685468948/b576/importcfg -pack /home/REDACTED/work/azure-linux-dev-tools/azure-linux-dev-tools/internal/app/azldev/core/testutils/cobrautils.go 8sd-sVnQMlmS -W go-crypto@v1.1.6-errorsas /tmp/go-build240-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet . e/internal/gopat-atomic --64 ux-amd64/pkg/too-buildtags (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI self-assigned this May 6, 2026
Copilot AI review requested due to automatic review settings May 6, 2026 19:12
Copilot AI review requested due to automatic review settings May 6, 2026 19:12
Copilot AI linked an issue May 6, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 19:21
Copilot AI changed the title [WIP] Invert --with-git flag to --without-git for source build feat: invert --with-git to --without-git for comp build and prepare-sources May 6, 2026
Copilot AI requested a review from dmcilvaney May 6, 2026 19:22
@dmcilvaney dmcilvaney marked this pull request as ready for review May 6, 2026 21:57
Copilot AI review requested due to automatic review settings May 6, 2026 21:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR makes the dist-git source preparation flow the default for azldev component build and azldev component prepare-sources by inverting the CLI flag from --with-git to --without-git, aligning behavior with azldev component render.

Changes:

  • Renames option fields and flags from WithGitRepo/--with-git to WithoutGitRepo/--without-git and inverts the runtime logic.
  • Updates warning behavior when --skip-overlays is used under the dist-git flow.
  • Regenerates CLI reference docs and updates tests to validate the new flag and ensure the legacy flag is absent.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/app/azldev/cmds/component/preparesources.go Invert dist-git toggle and warning logic for prepare-sources.
internal/app/azldev/cmds/component/build.go Invert dist-git toggle for component build.
internal/app/azldev/cmds/component/preparesources_test.go Updates tests to assert new flag registration and absence of legacy flag.
internal/app/azldev/cmds/component/build_test.go Updates tests to assert new flag registration and absence of legacy flag.
docs/user/reference/cli/azldev_component_prepare-sources.md Regenerates CLI docs reflecting --without-git.
docs/user/reference/cli/azldev_component_build.md Regenerates CLI docs reflecting --without-git.

Comment on lines +134 to +135
cmd.Flags().BoolVar(&options.WithoutGitRepo, "without-git", false,
"Skip creating a dist-git repository with synthetic commit history")
Comment on lines +125 to 126
slog.Warn("dist-git flow has no effect when '--skip-overlays' is set; " +
"synthetic history requires overlays to be applied")
cmd.Flags().BoolVar(&options.WithGitRepo, "with-git", false,
"Create a dist-git repository with synthetic commit history (requires a project git repository)")
cmd.Flags().BoolVar(&options.WithoutGitRepo, "without-git", false,
"Skip creating a dist-git repository with synthetic commit history")
@dmcilvaney
Copy link
Copy Markdown
Contributor

superseded by #164

@dmcilvaney dmcilvaney closed this May 7, 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.

[Copilot] comp build should default to the same flow the render uses

3 participants