From bbaeaaac57875c111cde1175498f850a9c98309a Mon Sep 17 00:00:00 2001 From: Meftun Akarsu Date: Sat, 20 Jun 2026 22:43:10 +0300 Subject: [PATCH] fix(mdcode): use project id, not the literal "projects", in the aspect-type cache key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When caching a required aspect type, CatalogSnapshot splits the aspect-type resource name (projects/{project}/locations/{location}/aspectTypes/{type}) on '/' and fetches it with getAspectType(parts[1], parts[3], parts[5]) — correct — but then registers the compact alias key as `${parts[0]}.${parts[3]}.${parts[5]}`, where parts[0] is the literal string 'projects'. So the key becomes e.g. 'projects.global.bigquery-table' instead of '{project}.global.bigquery-table'. That wrong key breaks the dedup check and leaks an invalid value into lookupEntry's aspectTypes query param. Fix: use parts[1] (the project id), matching the established convention in gcp/dataplex.ts::_nameToTypeRef (`${nameParts[1]}.${nameParts[3]}.${nameParts[5]}`). --- toolbox/mdcode/src/libts/snapshot.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox/mdcode/src/libts/snapshot.ts b/toolbox/mdcode/src/libts/snapshot.ts index a3837e0..8057d2c 100644 --- a/toolbox/mdcode/src/libts/snapshot.ts +++ b/toolbox/mdcode/src/libts/snapshot.ts @@ -155,7 +155,7 @@ export class CatalogSnapshot { throw new Error(`Unable to load type information for aspect type ${requiredAspect.type}`); } this._aspectTypes.set(res.result.name, res.result); - this._aspectTypes.set(`${parts[0]}.${parts[3]}.${parts[5]}`, res.result); + this._aspectTypes.set(`${parts[1]}.${parts[3]}.${parts[5]}`, res.result); } } }