{"record":{"id":"1ea025afcb0e5331","repo":"apache/superset","slug":"publisher-must-start-with-a-letter-and-contain-onl","errorCode":null,"errorMessage":"Publisher must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'my-org')","messagePattern":"Publisher must start with a letter and contain only lowercase letters, numbers, and hyphens \\(e\\.g\\., 'my-org'\\)","errorType":"exception","errorClass":"ExtensionNameError","httpStatus":null,"severity":"error","filePath":"superset-extensions-cli/src/superset_extensions_cli/utils.py","lineNumber":233,"sourceCode":"    if name.lower() in NPM_RESERVED:\n        raise ExtensionNameError(f\"'{name}' is a reserved npm package name\")\n\n\ndef validate_publisher(publisher: str) -> None:\n    \"\"\"\n    Validate publisher namespace format.\n\n    Args:\n        publisher: Publisher namespace (e.g., 'my-org')\n\n    Raises:\n        ExtensionNameError: If publisher is invalid\n    \"\"\"\n    if not publisher:\n        raise ExtensionNameError(\"Publisher cannot be empty\")\n\n    if not PUBLISHER_REGEX.match(publisher):\n        raise ExtensionNameError(\n            \"Publisher must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'my-org')\"\n        )\n\n\ndef validate_technical_name(name: str) -> None:\n    \"\"\"\n    Validate technical extension name format.\n\n    Args:\n        name: Technical extension name (e.g., 'dashboard-widgets')\n\n    Raises:\n        ExtensionNameError: If name is invalid\n    \"\"\"\n    if not name:\n        raise ExtensionNameError(\"Extension name cannot be empty\")\n\n    if not TECHNICAL_NAME_REGEX.match(name):","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-extensions-cli/src/superset_extensions_cli/utils.py#L215-L251","documentation":"Thrown by the superset-extensions CLI when the publisher namespace passed to a scaffolding/validation command fails PUBLISHER_REGEX. The publisher is the top-level namespace of an extension (e.g. 'my-org') and must be a DNS-like slug: it must start with a lowercase letter and contain only lowercase letters, digits, and hyphens. It is raised before any files are generated so that invalid names never reach the package/module-federation layer.","triggerScenarios":"Running a CLI command that takes a publisher argument (e.g. `superset-extensions create <publisher> <name>`) with values like 'My-Org' (uppercase), 'my_org' (underscore), 'my-org-' as input beginning with a hyphen, '123org' (starts with a digit), an empty string, or a name with spaces. Also triggered by programmatic calls to validate_publisher() with the same bad inputs.","commonSituations":"Teams scaffolding extensions from an existing GitHub org name that contains dots or underscores (e.g. 'my_org.io'), copy-pasting publisher names with trailing whitespace or capitalization from internal tooling, or scripts that interpolate publisher from environment variables that were never normalized.","solutions":["Change the publisher to an all-lowercase slug starting with a letter: digits, hyphens allowed after the first character (e.g. 'my-org', 'acme1').","If deriving from an org/domain automatically, normalize first: lowercase, strip whitespace, replace dots/underscores with hyphens, trim leading/trailing hyphens and strip any leading digits.","If you intended a different namespace scheme, re-run the CLI command with the corrected publisher argument rather than editing generated files afterwards."],"exampleFix":"# before\nsuperset-extensions create My_Org dashboard-widgets\n# ExtensionNameError: Publisher must start with a letter ...\n\n# after\nsuperset-extensions create my-org dashboard-widgets","handlingStrategy":"validation","validationCode":"import re\nPUBLISHER_RE = re.compile(r\"^[a-z][a-z0-9-]*$\")\n\ndef publisher_is_valid(publisher: str) -> bool:\n    return bool(publisher) and bool(PUBLISHER_RE.match(publisher))\n\n# before invoking the CLI:\nassert publisher_is_valid(publisher), f\"bad publisher: {publisher!r}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize org/domain strings into slugs (lowercase, [._] -> '-', trim hyphens, strip leading digits) before passing them as publisher.","Keep a single canonical publisher constant in your scaffolding scripts instead of free-typed arguments."],"tags":["cli","validation","naming","extensions","regex"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}