From 51b801f743b2b7626f5a09ac25b515d2f9461b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 4 Sep 2023 11:59:35 +0200 Subject: [PATCH] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/stupid-ants-change.md | 5 +++++ .../src/service/JsonRulesEngineFactChecker.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/stupid-ants-change.md diff --git a/.changeset/stupid-ants-change.md b/.changeset/stupid-ants-change.md new file mode 100644 index 0000000000..c78c5e4250 --- /dev/null +++ b/.changeset/stupid-ants-change.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights-backend-module-jsonfc': patch +--- + +Handle extracting facts from 'not' conditions too diff --git a/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts b/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts index 721c9b3c62..6c1c559fc4 100644 --- a/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts +++ b/plugins/tech-insights-backend-module-jsonfc/src/service/JsonRulesEngineFactChecker.ts @@ -222,6 +222,12 @@ export class JsonRulesEngineFactChecker this.retrieveIndividualFactReferences(con), ), ); + } else if ('not' in condition) { + results = results.concat( + this.retrieveIndividualFactReferences(condition.not), + ); + } else if ('condition' in condition) { + // ignore the ConditionReference type } else { results.push(condition.fact); }