Skip to content

fix: proactively reject invalid connection qualifiedNames before Atlas POST (APP-2263)#2504

Merged
cmgrote merged 1 commit into
mainfrom
APP-2263
May 18, 2026
Merged

fix: proactively reject invalid connection qualifiedNames before Atlas POST (APP-2263)#2504
cmgrote merged 1 commit into
mainfrom
APP-2263

Conversation

@cmgrote
Copy link
Copy Markdown
Collaborator

@cmgrote cmgrote commented May 18, 2026

Summary

  • Adds ErrorCode.INVALID_CONNECTION_QN (ATLAN-JAVA-400-055) with a message directing customers to use hyphens instead of underscores in the connectorType segment
  • Layer 1 (SDK): Connection.creator() for custom String connectorName now validates the synthesized qualifiedName via StringUtils.isValidConnectionQN before building the entity — throws InvalidRequestException(INVALID_CONNECTION_QN) client-side, before any Atlas POST. Covers cab/ConnectionImporter and AbstractCrawler callers.
  • Layer 2 (aim): ConnectionImporter.getBuilder() validates any CSV-supplied qualifiedName override before applying it to the builder — no Atlas POST occurs for a malformed connection. Covers asset-import and all RAB workflows (which pipe through com.atlan.pkg.aim.Importer).

Context

APP-2263 — customer hit a phantom Connection orphan when using connectorType dev_cmdr (underscore) in Relational Assets Builder. Atlas accepted the entity; the SDK validator rejected it afterwards; the import threw IllegalStateException with the Connection already persisted and unreachable through standard delete paths.

This is Hardening #3 from the ticket: fail fast client-side so no orphan is ever created. The regex itself is unchanged — underscore remains invalid; customers should use hyphens (dev-cmdr).

Test plan

  • ./gradlew :sdk:test --tests "com.atlan.util.StringUtilsTest" — 16 tests pass, including 2 new regression guards pinning that underscore and uppercase in connectorType are rejected
  • ./gradlew :sdk:test — full 415-test SDK suite passes
  • ./gradlew :samples:packages:asset-import:compileKotlin — Kotlin compiles cleanly
  • Manual: run customer's reproducer CSV (qualifiedName=default/dev_cmdr/<epoch>) through com.atlan.pkg.aim.Importer.main and confirm InvalidRequestException fires before any Atlas POST, with no phantom Connection left behind

🤖 Generated with Claude Code

…s POST (APP-2263)

Adds two-layer defense-in-depth to prevent phantom Connection orphans when
a custom connectorType contains invalid characters (e.g. underscores):

- Layer 1 (SDK): Connection.creator() for custom String connectorName now
  validates the synthesized qualifiedName via StringUtils.isValidConnectionQN
  before building the entity, throwing InvalidRequestException(INVALID_CONNECTION_QN)
  if it fails. Covers cab/ConnectionImporter and AbstractCrawler callers.

- Layer 2 (aim): ConnectionImporter.getBuilder() validates any CSV-supplied
  qualifiedName override before applying it to the builder, so no Atlas POST
  occurs for a malformed connection. Covers asset-import and RAB workflows.

Adds ErrorCode.INVALID_CONNECTION_QN (ATLAN-JAVA-400-055) with a message
directing customers to use hyphens instead of underscores in connectorType.

Adds regression-guard tests in StringUtilsTest pinning that underscore and
uppercase in the connectorType segment are rejected by isValidConnectionQN.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Chris (He/Him) <cgrote@gmail.com>
@cmgrote cmgrote added the bug Something isn't working label May 18, 2026
@cmgrote cmgrote merged commit 80feff9 into main May 18, 2026
7 checks passed
Aryamanz29 added a commit to atlanhq/atlan-python that referenced this pull request May 22, 2026
… invalid connection QN (BLDX-1294)

Aligns with the Java SDK convention from atlanhq/atlan-java#2504 which
added ErrorCode.INVALID_CONNECTION_QN (ATLAN-JAVA-400-055) for the same
class of failure. Cross-SDK error reporting now matches: typed exception
class + stable error code that customer log-aggregation can group on.

Replaces the bare ValueError raised by _validate_connector_type_value
with InvalidRequestError carrying ErrorCode.INVALID_CONNECTION_QN
(ATLAN-PYTHON-400-079). Message + user-action mirror the Java side.

Tests updated to assert on:
- isinstance(exc, InvalidRequestError)
- "ATLAN-PYTHON-400-079" in str(exc)
- bad slug surfaced in exc message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant