Skip to content

Conversation

@polatengin
Copy link
Contributor

@polatengin polatengin commented Jan 20, 2026

Fixes #1031

Added a domain format regex and apply it to dataverse.domain validation in the environment resource.
Added unit tests to cover valid lowercase domains and invalid domain characters.

@polatengin polatengin self-assigned this Jan 20, 2026
@polatengin polatengin requested a review from a team as a code owner January 20, 2026 21:46
Copilot AI review requested due to automatic review settings January 20, 2026 21:46
Copy link
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 pull request adds domain name format validation to the Power Platform environment resource by introducing a regex pattern that enforces domain names to start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. The PR adds corresponding unit tests to verify valid and invalid domain formats.

Changes:

  • Added DomainNameRegex constant to enforce domain naming rules
  • Applied regex validation to the dataverse.domain attribute in the environment resource schema
  • Added two unit tests: one for valid domain format and one for invalid characters

Reviewed changes

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

File Description
internal/helpers/regex.go Added new DomainNameRegex constant with pattern ^[a-z][a-z0-9-]*$
internal/services/environment/resource_environment.go Applied RegexMatches validator to domain attribute with descriptive error message
internal/services/environment/resource_environment_test.go Added two unit tests for domain format validation: one with valid format and one with invalid characters

@polatengin polatengin enabled auto-merge (squash) January 21, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Environment domain - Provider produced inconsistent result after apply

2 participants