Skip to content

Rename client-side "preflight" to "provision validation" (#7113)#8844

Draft
vhvb1989 wants to merge 6 commits into
mainfrom
rename-validate-from-localPreflight
Draft

Rename client-side "preflight" to "provision validation" (#7113)#8844
vhvb1989 wants to merge 6 commits into
mainfrom
rename-validate-from-localPreflight

Conversation

@vhvb1989

Copy link
Copy Markdown
Member

Fixes #7113

Summary

Renames azd's client-side "local preflight" provisioning check to "provision validation" to avoid confusion with the Azure ARM Preflight API. The term "preflight" was overloaded across three unrelated meanings; this PR renames only the local client-side feature and leaves the server-side ARM preflight call and the mage preflight dev checks untouched.

Behavioral change — config gate split

The single provision.preflight gate is split into two independent keys:

Config key Controls
provision.preflight off Skips only the server-side ARM preflight call (target.ValidatePreflight)
validation.provision off (new) Skips only azd's local client-side validation (the renamed feature)

⚠️ Users who previously set provision.preflight off to silence azd's local checks must now also set validation.provision off. Called out in the CHANGELOG.

Issue sub-tasks addressed

  • Rename "preflight" → "provision validation" (feature, code, UI, telemetry, docs)
  • Lowercase the DeploymentStateSkipped value to "deployment state"
  • Replace "abort" wording with "canceled" (UI strings, skip reasons, telemetry outcomes aborted_by_*canceled_by_*)

Telemetry rename

Old New
Event validation.preflight validation.provision
validation.preflight.* fields validation.provision.*
Outcome aborted_by_user / aborted_by_errors canceled_by_user / canceled_by_errors

Telemetry docs (telemetry-data.md, metrics-audit schema + matrix), the design doc, architecture docs, config option descriptions, and CHANGELOG are all updated in sync. Downstream analytics issues (Azure/azure-dev-pr#1790, Azure/azure-dev-pr#1792) have been notified with the field mapping and forward-compatible KQL.

Renamed files

  • bicep/local_preflight.gobicep/provision_validation.go (+ test)
  • output/ux/preflight_report.gooutput/ux/provision_validation_report.go (+ test, + 6 snapshots)
  • test/functional/preflight_quota_test.goprovision_validation_quota_test.go (+ 6 recordings)
  • docs/design/local-preflight-validation.mddocs/design/provision-validation.md

Validation

  • go build ./..., targeted unit tests, and cmd fig/usage snapshot tests pass
  • golangci-lint run — 0 issues
  • cspell, gofmt -s, copyright-check — clean
  • No go.mod/go.sum changes

Renames azd's client-side "local preflight" provisioning check to "provision
validation" to avoid confusion with the Azure ARM Preflight API. Splits the
single config gate into two independent keys: `provision.preflight` now controls
only the server-side ARM preflight call, while the new `validation.provision`
controls azd's local client-side validation.

Also addresses the issue sub-tasks: lowercases the `DeploymentStateSkipped`
value to "deployment state", and replaces "abort" wording with "canceled"
across UI strings, skip reasons, and telemetry outcome values
(`aborted_by_*` -> `canceled_by_*`).

Telemetry event/fields renamed `validation.preflight*` -> `validation.provision*`
with docs (telemetry-data, metrics-audit specs), design doc, architecture docs,
config option descriptions, and CHANGELOG updated in sync.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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

Renames azd’s local client-side “preflight” provisioning checks to “provision validation”, splits the existing config gate so local validation and ARM ValidatePreflight can be disabled independently, and updates related telemetry/docs/tests to reduce terminology confusion.

Changes:

  • Split the previous provision.preflight gate into validation.provision (local checks) vs provision.preflight (server-side ARM ValidatePreflight), and update the Bicep provider flow accordingly.
  • Rename telemetry event/fields from validation.preflight* to validation.provision* and outcomes from aborted_by_* to canceled_by_*, updating metrics-audit docs and public telemetry reference.
  • Rename/refresh UX report + snapshots and functional/unit tests to match the new “provision validation” terminology.

Reviewed changes

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

Show a summary per file
File Description
docs/specs/metrics-audit/telemetry-schema.md Renames the validation event/fields and updates outcomes in the schema doc.
docs/specs/metrics-audit/feature-telemetry-matrix.md Updates provision command telemetry inventory to the new event/field names.
docs/specs/exegraph/spec.md Updates terminology in exegraph spec (“validation-cancel” wording).
docs/reference/telemetry-data.md Updates public telemetry reference for the renamed validation event/fields/outcomes.
docs/concepts/glossary.md Renames glossary entry to “Provision Validation” and updates the disable config key.
docs/architecture/system-overview.md Updates high-level provisioning pipeline terminology.
docs/architecture/provisioning-pipeline.md Updates pipeline stage naming and documents the new config split.
cli/azd/test/functional/testdata/samples/ai-quota/sub-deployment/infra/main.bicep Updates sample comment to “validation” terminology.
cli/azd/test/functional/testdata/samples/ai-quota/rg-deployment/infra/main.bicep Updates sample comment to “validation” terminology.
cli/azd/test/functional/testdata/samples/ai-quota/README.md Updates sample README references and test filename reference.
cli/azd/test/functional/provision_validation_quota_test.go Renames and updates functional tests to “provision validation” naming and stdin helpers.
cli/azd/resources/config_options.yaml Documents the new validation.provision config option and clarifies provision.preflight.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_RoleAssignmentMissing.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_RoleAssignmentConditional.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_ReservedResourceName.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_AllWarningsCombined.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_AiModelQuotaExceeded.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/testdata/TestProvisionValidationReport_Snapshot_AiModelNotFound.snap New/updated snapshot for renamed UX report output.
cli/azd/pkg/output/ux/provision_validation_report.go Renames preflight report UX types to provision validation report equivalents.
cli/azd/pkg/output/ux/provision_validation_report_test.go Updates tests and snapshots for the renamed UX report.
cli/azd/pkg/infra/provisioning/provider.go Lowercases DeploymentStateSkipped value and renames the “aborted” skip reason.
cli/azd/pkg/infra/provisioning/manager.go Updates skipped-reason handling to the new “validation canceled” constant.
cli/azd/pkg/infra/provisioning/bicep/role_assignment_check_test.go Renames test helpers/types to provision validation equivalents.
cli/azd/pkg/infra/provisioning/bicep/provision_validation.go Renames and refactors local validation pipeline types and temp file naming.
cli/azd/pkg/infra/provisioning/bicep/provision_validation_test.go Updates unit tests for the renamed validation pipeline.
cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go Splits config gates, renames telemetry + outcomes, and separates local vs ARM preflight steps.
cli/azd/pkg/infra/provisioning/bicep/bicep_provider_test.go Updates tests to assert renamed telemetry keys/outcomes and method names.
cli/azd/pkg/infra/provisioning/bicep/bicep_provider_reserved_names_test.go Updates severity enum name in reserved-names validation tests.
cli/azd/pkg/infra/provisioning/bicep/bicep_provider_coverage_test.go Updates coverage tests for renamed constructor/types.
cli/azd/magefile.go Updates excluded playback test names to new provision validation test names.
cli/azd/internal/tracing/fields/fields.go Renames tracing attribute keys for provision validation.
cli/azd/internal/tracing/events/events.go Renames validation event constant to validation.provision.
cli/azd/internal/errors.go Updates comment to reflect provision validation decline behavior.
cli/azd/internal/cmd/provision_test.go Renames regression test and updates skipped reason constant.
cli/azd/internal/cmd/provision_graph.go Updates the graph path sentinel/error translation for validation-canceled behavior.
cli/azd/docs/environment-variables.md Updates AZD_DEPLOYMENT_ID_FILE docs to reference “canceled by provision validation”.
cli/azd/docs/design/provision-validation.md Renames and updates design doc for the new feature naming and config split.
cli/azd/cmd/middleware/error_test.go Updates test text for wrapped ErrAbortedByUser case.
cli/azd/CHANGELOG.md Adds breaking change entry describing rename + config split + telemetry rename.
cli/azd/.vscode/cspell.yaml Updates cspell override path to the renamed Go file.
Comments suppressed due to low confidence (2)

cli/azd/docs/design/provision-validation.md:104

  • azd-code-reviewer: This section documents check return values as *ProvisionValidationCheckResult, but the implementation returns a slice ([]ProvisionValidationCheckResult). The docs should match the actual API so new checks are written correctly.
    cli/azd/docs/design/provision-validation.md:114
  • azd-code-reviewer: The "Adding a New Check" snippet uses validator.AddCheck(func(...) (*ProvisionValidationCheckResult, error) { ... }), but the code registers checks via ProvisionValidationCheck{RuleID, Fn} where Fn returns ([]ProvisionValidationCheckResult, error). The snippet should be updated to prevent copy/paste errors.

Comment thread cli/azd/internal/tracing/fields/fields.go Outdated
Comment thread cli/azd/internal/errors.go Outdated
Comment thread cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go Outdated
- Sync 'aborted_by_*' -> 'canceled_by_*' example values in telemetry field comment
- Align ErrAbortedByUser message text to 'operation canceled by user'
- Update bicep_provider comment 'aborted' -> 'canceled by provision validation'
- Correct provision-validation design doc check API (slice return + ProvisionValidationCheck{RuleID, Fn})

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 34 out of 46 changed files in this pull request and generated 3 comments.

Comment thread cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go Outdated
Comment thread cli/azd/internal/cmd/provision_graph.go
Comment thread cli/azd/internal/errors.go Outdated
- Emit consistent empty/zero validation.provision.* telemetry attributes on the config-skip path
- Standardize on American 'canceled' spelling (provision_graph success message, ErrOperationCancelled text)
- Update affected coverage test assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 36 out of 48 changed files in this pull request and generated 3 comments.

Comment thread cli/azd/internal/tracing/events/events.go Outdated
Comment thread cli/azd/internal/cmd/provision_graph.go Outdated
Comment thread cli/azd/internal/cmd/provision_graph.go Outdated
Align remaining doc comments to 'canceled' terminology (events.go outcome
comment, provision_graph.go sentinel/UX comments).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 36 out of 48 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

cli/azd/pkg/output/ux/provision_validation_report.go:112

  • azd-code-reviewer: The JSON envelope message here still says "validation: ..." even though the feature is now consistently called "provision validation" elsewhere. This string can show up in JSON output/logging, so keeping the label consistent makes it easier to interpret and search.
    cli/azd/docs/design/provision-validation.md:200
  • azd-code-reviewer: This design doc describes check functions returning *ProvisionValidationCheckResult, but the implementation now returns []ProvisionValidationCheckResult (a slice) from each check function. Updating the type in the doc keeps the design reference accurate for anyone adding new validation rules.

- Prefix JSON envelope message with 'provision validation:' for label consistency
- Correct remaining design-doc check return type to []ProvisionValidationCheckResult

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 36 out of 48 changed files in this pull request and generated 1 comment.

Comment thread cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go
…t feedback)

Previously validateProvision wrapped both the local client-side validation and
the server-side ARM ValidatePreflight call in the validation.provision span, so
ARM preflight failures/latency were misattributed to azd's local validation event
(span status could be error while validation.provision.outcome was passed/skipped).

Extract traceLocalProvisionValidation to own the span; run the ARM preflight call
outside it while still returning its error to the caller.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 36 out of 48 changed files in this pull request and generated no new comments.

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.

Rename "preflight" to "validation" and fix terminology

2 participants