Skip to content

refactor: invert --with-git to --without-git for comp build and prepare-sources#164

Merged
reubeno merged 1 commit intomicrosoft:mainfrom
Tonisal-byte:asalinas/invert-with-git-flag-default
May 7, 2026
Merged

refactor: invert --with-git to --without-git for comp build and prepare-sources#164
reubeno merged 1 commit intomicrosoft:mainfrom
Tonisal-byte:asalinas/invert-with-git-flag-default

Conversation

@Tonisal-byte
Copy link
Copy Markdown
Contributor

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 bool → WithoutGitRepo 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

Copilot AI review requested due to automatic review settings May 7, 2026 01:05
@Tonisal-byte Tonisal-byte force-pushed the asalinas/invert-with-git-flag-default branch from 3b93ac5 to 26d0050 Compare May 7, 2026 01:09
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

This PR flips azldev component build and azldev component prepare-sources from an opt-in dist-git/synthetic-history flow (--with-git) to a default-on flow with an opt-out flag (--without-git), aligning them with azldev component render behavior.

Changes:

  • Renamed options WithGitRepoWithoutGitRepo and renamed CLI flag --with-git--without-git for component build and component prepare-sources, inverting the enabling logic.
  • Updated flag registration tests to assert the new flag exists (default false) and the legacy flag does not exist.
  • Updated scenario test project creation to initialize a git repo for templated projects where synthetic history is required.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/app/azldev/cmds/component/preparesources.go Renames/inverts git-flow flag and updates warning/option wiring for dist-git source prep.
internal/app/azldev/cmds/component/preparesources_test.go Verifies --without-git flag registration/defaults and absence of --with-git.
internal/app/azldev/cmds/component/build.go Renames/inverts git-flow flag and updates source preparer options accordingly.
internal/app/azldev/cmds/component/build_test.go Verifies --without-git flag registration/defaults and absence of --with-git.
scenario/internal/projecttest/templatetestproject.go Adds an option to initialize templated test projects as git repos with an initial commit.
scenario/component_build_test.go Ensures scenario build tests create projects initialized as git repos to support default dist-git behavior.

Comment thread internal/app/azldev/cmds/component/preparesources.go
@Tonisal-byte Tonisal-byte force-pushed the asalinas/invert-with-git-flag-default branch from 26d0050 to f9c020c Compare May 7, 2026 01:17
@reubeno reubeno merged commit fba026f into microsoft:main May 7, 2026
15 checks passed
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