Skip to content

New-DbaDbDataGeneratorConfig - Stop eating the caller loop on failures - #10647

Merged
potatoqualitee merged 1 commit into
developmentfrom
fix-newdbadbdatageneratorconfig-continue-escape
Sep 1, 2026
Merged

New-DbaDbDataGeneratorConfig - Stop eating the caller loop on failures#10647
potatoqualitee merged 1 commit into
developmentfrom
fix-newdbadbdatageneratorconfig-continue-escape

Conversation

@andreasjordan

Copy link
Copy Markdown
Collaborator

Summary

Eleventh fix from the #10638 inventory. Both guards called Stop-Function -Continue without an enclosing loop: the columntypes.json import guard in the begin block, and the write-failure guard at the tail of the process block. The escape ate an iteration of the caller's loop; both now stop and return.

Tests

The write-failure path is pinned by a regression test that generates the config once, sets the target file read-only, and loops three times over the then-failing write: red on the unfixed command ("Expected 3, but got 0"), green on the fix (lab harness, environment clean). The import guard carries no test because it fires only when the module's own shipped bin\datamasking\columntypes.json is missing - untriggerable without corrupting the installation, and the fix is the same two-line shape verified nine times in this series.

References #10638

created by Claude and reviewed by Andreas Jordan

馃 Generated with Claude Code

Both guards called Stop-Function -Continue without an enclosing loop:
the columntypes.json import guard in the begin block and the
write-failure guard at the end of the process block. Without
-EnableException the continue escaped the command and consumed an
iteration of whatever loop the caller was running in. Both now stop
and return.

Part of the #10638 inventory. The write-failure path is pinned by a
regression test that generates the config once, makes the target file
read-only and loops three times over the then-failing write - red on
the unfixed command with "Expected 3, but got 0". The import guard has
no test because it only fires when the module's own shipped
columntypes.json is missing, which cannot be triggered without
corrupting the installation.

References #10638

(do New-DbaDbDataGeneratorConfig)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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

Reviewed the complete current head, both failure guards, regression coverage, and exact-head CI evidence. No material correctness or compatibility issues found.

@potatoqualitee
potatoqualitee merged commit 81c4419 into development Sep 1, 2026
22 checks passed
@potatoqualitee
potatoqualitee deleted the fix-newdbadbdatageneratorconfig-continue-escape branch September 1, 2026 05:47
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.

2 participants