Skip to content

Add namespace format validation (pre-review regex check) to namespace approval bot #16092

Closed

Description

Namespace Format Validation — Pre-Review Check

Add automated format validation for ARM namespace strings before they reach manual review. Service teams often submit incorrectly formatted namespaces, and catching these early reduces noise for reviewers.

Related PR: Azure/azure-rest-api-specs#44085 (namespace approval automation)

Per-Language Regex Rules

.NET

  • Regex: ^Azure\.ResourceManager\.(?:[A-Z][a-zA-Z0-9]*)(?:\.[A-Z][a-zA-Z0-9]*)?$
  • 3-level: Azure.ResourceManager.{Name} / 4-level: Azure.ResourceManager.{SuperService}.{Name}
  • PascalCase enforced

Java

  • Artifact (Maven): ^azure-resourcemanager-[a-z0-9]+(?:-[a-z0-9]+)?$
  • Package: ^com\.azure\.resourcemanager\.[a-z0-9]+(?:\.[a-z0-9]+)?$
  • 3-level and 4-level, lowercase enforced

Go

  • Regex: ^sdk/resourcemanager/(?:[a-z0-9]+)/(?:arm[a-z0-9]+)$
  • 3-level: sdk/resourcemanager/{name}/arm{name} / 4-level: sdk/resourcemanager/{group}/arm{name}
  • Lowercase enforced

JavaScript

  • Regex: ^@azure/arm-[a-z0-9]+$
  • Only 3-level, lowercase enforced

Python

  • Regex: ^azure-mgmt-[a-z0-9]+$
  • Only 3-level, lowercase enforced

Requirements

  • Validate extracted namespace strings against the regex patterns above
  • Flag invalid formats in the bot's status comment (e.g., "⚠️ Invalid format") before the PR goes to manual review
  • Store regex rules in a config file (YAML or constants module) so approvers can update them independently
  • Include unit tests so rules can be adjusted autonomously without breaking existing validations

/cc Arthur Ma (@ArthurMa1978) Laurent Mazuel (@lmazuel) Sameeksha Vaity (@samvaity)

Activity

  1. samvaity commented on Jul 27, 2026

    @samvaity
    MemberAuthor

    Closing as done - namespace format validation is already handled in our current flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions