{"record":{"id":"21ade8959766e932","repo":"apache/superset","slug":"publisher-cannot-be-empty","errorCode":null,"errorMessage":"Publisher cannot be empty","messagePattern":"Publisher cannot be empty","errorType":"exception","errorClass":"ExtensionNameError","httpStatus":null,"severity":"error","filePath":"superset-extensions-cli/src/superset_extensions_cli/utils.py","lineNumber":230,"sourceCode":"    Raises:\n        ExtensionNameError: If name is invalid\n    \"\"\"\n    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:","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-extensions-cli/src/superset_extensions_cli/utils.py#L212-L248","documentation":"validate_publisher is the first check in publisher-namespace validation for the extensions CLI: an empty publisher string is rejected outright ('Publisher cannot be empty'). The publisher namespace (e.g. 'my-org') scopes extension package names, so it must be non-empty before the regex format check runs.","triggerScenarios":"Running an extensions CLI command that takes --publisher with an empty value (empty flag argument or empty environment/config value feeding it).","commonSituations":"Scripts passing \"${PUBLISHER}\" when the variable is unset; CI config with a blank publisher field; interactive prompt skipped/emptied.","solutions":["Supply a non-empty publisher namespace, e.g. --publisher my-org.","Fix the automation: default the publisher variable and fail fast when it is unset (e.g. : \"${PUBLISHER:?publisher required}\").","Follow the format rule too: starts with a letter, lowercase letters/digits/hyphens only."],"exampleFix":"# before\n$ superset-extension new my-ext --publisher \"\"\n# after\n$ superset-extension new my-ext --publisher my-org","handlingStrategy":"validation","validationCode":"def publisher_is_valid(publisher: str) -> bool:\n    return bool(publisher)  # plus: publisher[0].isalpha() and rest is [a-z0-9-]","typeGuard":null,"tryCatchPattern":"try:\n    validate_publisher(publisher)\nexcept ExtensionNameError as e:\n    print(f'Fix --publisher: {e}')\n    sys.exit(2)","preventionTips":["Default the publisher in scripts and fail fast when unset: bash '\"${PUBLISHER:?publisher required}\"'.","Use the documented shape: starts with a letter, lowercase letters/digits/hyphens (e.g. my-org)."],"tags":["cli","validation","publisher","scaffolding"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}