Skip to content

fix: extract embedded defaults during dry runs#278

Merged
dmcilvaney merged 4 commits into
mainfrom
copilot/fix-dry-run-config-loading-issue
Jul 21, 2026
Merged

fix: extract embedded defaults during dry runs#278
dmcilvaney merged 4 commits into
mainfrom
copilot/fix-dry-run-config-loading-issue

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Dry-run skipped extracting embedded defaults into azldev’s temporary directory, causing project configuration loading to fail before command execution.

Changes

  • Copy semantics
    • Keep CopyDirRecursive dry-run-aware.
    • Make CopyDirRecursiveCrossFS unconditional, matching its contract.
  • Default configuration
    • Extract embedded defaults regardless of dry-run state.
    • Continue isolating extraction within azldev’s temporary directory.
  • Regression coverage
    • Cover project configuration loading with dry-run and built-in defaults.
    • Verify ordinary directory copies remain suppressed during dry-run.

Copilot AI requested review from Copilot and removed request for Copilot July 10, 2026 20:55
Copilot AI requested review from Copilot and removed request for Copilot July 10, 2026 21:05
Copilot AI changed the title [WIP] Fix dry-run skips embedded default-config extraction fix: extract embedded defaults during dry runs Jul 10, 2026
Copilot AI requested a review from dmcilvaney July 10, 2026 21:10
Comment thread internal/projectconfig/config.go Outdated

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.

do we need this dryrunnable anymore?
@copilot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No—it became unused once default extraction was made unconditional. Removed it from LoadProjectConfig and the forwarding app method in 25dcdec.

Copilot AI requested review from Copilot and removed request for Copilot July 10, 2026 23:04
Copilot AI requested a review from dmcilvaney July 10, 2026 23:05
@dmcilvaney
dmcilvaney marked this pull request as ready for review July 17, 2026 17:47
Copilot AI review requested due to automatic review settings July 17, 2026 17:47
@dmcilvaney
dmcilvaney force-pushed the copilot/fix-dry-run-config-loading-issue branch from 25dcdec to 267fa71 Compare July 17, 2026 17:47

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

Fixes dry-run failures during project configuration loading by ensuring embedded default configs are extracted into the temp directory even when the CLI is invoked with --dry-run, while keeping “ordinary” directory copies suppressed in dry runs.

Changes:

  • Adjusts file copy APIs so CopyDirRecursive remains dry-run-aware, while CopyDirRecursiveCrossFS is unconditional (so embedded defaults extraction always happens).
  • Removes DryRunnable plumb-through from project config loading and default config extraction to avoid dry-run short-circuiting.
  • Adds/updates unit tests for dry-run directory-copy suppression and for loading configs with embedded defaults.

Reviewed changes

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

Show a summary per file
File Description
internal/utils/fileutils/copy.go Refactors copy helpers; moves dry-run behavior to CopyDirRecursive and makes cross-FS recursive copy unconditional.
internal/utils/fileutils/copy_test.go Adds a test asserting recursive dir copy is suppressed in dry-run mode.
internal/projectgen/projectgen_test.go Updates LoadProjectConfig call sites to match the new signature.
internal/projectconfig/config.go Removes DryRunnable dependency and always extracts embedded defaults when enabled.
internal/projectconfig/config_test.go Adds a default-config loading test and updates existing tests for the new LoadProjectConfig signature.
internal/app/azldev/app.go Removes dryRunnable plumbing into config loading.
defaultconfigs/defaultconfigs.go Updates CopyTo signature and call path to use unconditional cross-FS recursive copy.

Comment thread internal/projectconfig/config_test.go
Comment on lines 37 to 40
err = fileutils.CopyDirRecursiveCrossFS(
dryRunnable,
sourceFS, embedfsRootDir,
fs, destPath,
fileutils.CopyDirOptions{},
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 17, 2026 20:58
@dmcilvaney

Copy link
Copy Markdown
Contributor

@copilot There are two review comments, please have a look at them. I applied the suggested fix for one, please triage and consider fixing the 2nd.

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Copilot AI requested review from Copilot and removed request for Copilot July 17, 2026 21:06

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot There are two review comments, please have a look at them. I applied the suggested fix for one, please triage and consider fixing the 2nd.

Fixed in 7c7fcfc — changed the CopyTo error to use %#q for the destination path and \n before %w, matching the repo's error-string conventions.

Copilot AI requested a review from dmcilvaney July 17, 2026 21:06

@liunan-ms liunan-ms 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, approved 👍
Is there an open bug for this that can be linked here?

@dmcilvaney

Copy link
Copy Markdown
Contributor

LGTM, approved 👍 Is there an open bug for this that can be linked here?

#277

@dmcilvaney
dmcilvaney merged commit 93c3e19 into main Jul 21, 2026
19 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.

Bug: dry-run skips embedded default-config extraction and breaks config loading

4 participants