fix(resource): use namespace column instead of name heuristic in db_to_spec() for built_in field #3266

Merged
freemo merged 1 commits from fix/resource-registry-db-to-spec-builtin-namespace-column into master 2026-04-05 21:13:57 +00:00

1 Commits

Author SHA1 Message Date
freemo 21a551cd6f fix(resource): use namespace column instead of name heuristic in db_to_spec() for built_in field
CI / lint (pull_request) Failing after 21s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 52s
CI / quality (pull_request) Successful in 36s
CI / coverage (pull_request) Has been skipped
CI / build (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 7m5s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 17m36s
CI / integration_tests (pull_request) Successful in 23m17s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Has been skipped
Replace the name-based heuristic ("/" not in name) in db_to_spec() with
the authoritative namespace column check (str(raw_ns) == "builtin"),
consistent with the existing _load_type_registry() implementation.

The old heuristic would misclassify custom resource types whose names
contain no "/" as built-in, potentially blocking their removal via
remove_type(). The namespace column is set to "builtin" by spec_to_db()
for all built-in types and to the actual namespace prefix for custom types,
making it the correct source of truth.

A name-heuristic fallback is retained for legacy rows where the namespace
column is NULL (e.g. rows inserted directly without going through
spec_to_db()).

New BDD scenarios added to resource_registry_service_coverage.feature:
- _db_to_spec sets built_in True when namespace column is "builtin"
- _db_to_spec sets built_in False when namespace column is not "builtin"

ISSUES CLOSED: #3013
2026-04-05 08:29:36 +00:00