Repository navigation
Validate triggers in Test-AdfCode and catch Az trigger errors #435 - #509
Merged
Merged
Conversation
…507 ADF refuses to start a trigger with runtimeState Started and no pipeline reference, and the deployment can only pass on the API error. Validate it at build/test time instead. Handles both 'pipelines' (array) and 'pipeline' (TumblingWindowTrigger). Part of #435. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start-/Stop-AzDataFactoryV2Trigger write non-terminating errors, so try/catch never caught them under the default ErrorActionPreference: no retry, no warning, raw error in the error stream. Call them with -ErrorAction Stop. Do not retry "Missing or invalid pipeline references". Start-Trigger returns success like Stop-Trigger; Start-Triggers warns about failed starts and the deployment carries on. Part of #435. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #435 via its two sub-issues. Closes #507, closes #508. Reasoning for the approach is in this comment on #435.
#507:
Test-AdfCodevalidates triggers (build/test time)runtimeState: Startedand no pipeline reference, and counts it inWarningCount.pipelinesarray (Schedule, BlobEvents, CustomEvents) and the singlepipelineobject (TumblingWindowTrigger). Stopped triggers are not reported.docs/FEATURES/BUILD_AND_TEST.md.#508: start/stop trigger errors are caught (deployment time)
Start-AzDataFactoryV2Trigger/Stop-AzDataFactoryV2Triggerwrite non-terminating errors, sotry/catchnever saw them under the default$ErrorActionPreference. Both calls now use-ErrorAction Stop, so retries and warnings work whatever the caller's preference is. This also completes the Adds TryCatch to StopTrigger, continuing if fails #404 retry from v1.19.0.Missing or invalid pipeline referencesis not retried (it is permanent).Start-Triggerreturns$true/$false.Start-Triggerstries every trigger and warns about the ones that failed. The deployment carries on.Tests
Test-AdfCode:adf2/TR_without_pipeline.jsonfixture plus 8 cases per trigger type and state (inTestDrive).Start-Trigger/Stop-Trigger/Start-Triggers: mocks write a non-terminating error, as the real cmdlets do. 9 of the 10 new tests failed before the fix.Test-AdfCodetest files: 43/43 passed with$ErrorActionPreference = 'Stop'(as in CI). WithContinue: 42/43, the one failure being the existing "wrong path to DF" test, which fails ondeveloptoo.Notes
[Unreleased]. The version (likely 1.20.0) is still to be set at release.🤖 Generated with Claude Code