From fe56db540042466b75e4e760e6348d2074c694ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20V=C4=82LCIU?= Date: Thu, 7 Mar 2024 10:32:57 +0200 Subject: [PATCH] chore(catalog-backend): apply changes required on code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * apply changes required on code review; * rephrase the changeset description to be clearer; Signed-off-by: Valentin VĂLCIU --- .changeset/tricky-donkeys-wink.md | 2 +- .../src/database/operations/stitcher/buildEntitySearch.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/tricky-donkeys-wink.md b/.changeset/tricky-donkeys-wink.md index 37e5a8c5cb..2d2f610dbf 100644 --- a/.changeset/tricky-donkeys-wink.md +++ b/.changeset/tricky-donkeys-wink.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': patch --- -Stop failing on stitching when the entity contains deeply nested properties or long keys. +Do not fail on stitching when the entity contains `null` values associated to deeply nested or long keys. diff --git a/plugins/catalog-backend/src/database/operations/stitcher/buildEntitySearch.ts b/plugins/catalog-backend/src/database/operations/stitcher/buildEntitySearch.ts index 75962ce2fb..53e8d4c1cd 100644 --- a/plugins/catalog-backend/src/database/operations/stitcher/buildEntitySearch.ts +++ b/plugins/catalog-backend/src/database/operations/stitcher/buildEntitySearch.ts @@ -133,7 +133,7 @@ export function mapToRows(input: Kv[], entityId: string): DbSearchRow[] { for (const { key: rawKey, value: rawValue } of input) { const key = rawKey.toLocaleLowerCase('en-US'); - if (MAX_KEY_LENGTH < key.length) { + if (key.length > MAX_KEY_LENGTH) { continue; } if (rawValue === undefined || rawValue === null) {