From b2de501bda312d65c055976562d877bcf3921a45 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 17 Aug 2023 17:54:26 +0200 Subject: [PATCH] linguist-backend: fix config value being required Signed-off-by: Patrik Oldsberg --- .changeset/new-sheep-cover.md | 5 +++++ plugins/linguist-backend/src/service/router.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changeset/new-sheep-cover.md diff --git a/.changeset/new-sheep-cover.md b/.changeset/new-sheep-cover.md new file mode 100644 index 0000000000..390de1a9b3 --- /dev/null +++ b/.changeset/new-sheep-cover.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-linguist-backend': patch +--- + +When creating the router using `createRouterFromConfig` or using the plugin for the new backend system the `linguist.useSourceLocation` configuration is now optional. diff --git a/plugins/linguist-backend/src/service/router.ts b/plugins/linguist-backend/src/service/router.ts index 02ff05f398..d29943c38b 100644 --- a/plugins/linguist-backend/src/service/router.ts +++ b/plugins/linguist-backend/src/service/router.ts @@ -150,9 +150,8 @@ export async function createRouterFromConfig(routerOptions: RouterOptions) { ); } pluginOptions.batchSize = config.getOptionalNumber('linguist.batchSize'); - pluginOptions.useSourceLocation = config.getBoolean( - 'linguist.useSourceLocation', - ); + pluginOptions.useSourceLocation = + config.getOptionalBoolean('linguist.useSourceLocation') ?? false; pluginOptions.age = config.getOptionalConfig('linguist.age') as | HumanDuration | undefined;