From 9f40eb181f518088e8e580e8d2e222cbcb2c8e6b Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 10 Jun 2021 17:18:04 +0300 Subject: [PATCH 1/2] fix(registry): Fix onlyIfPresent config on batch Follow up to #249. --- src/targets/registry.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/targets/registry.ts b/src/targets/registry.ts index ac9304033..b127700dc 100644 --- a/src/targets/registry.ts +++ b/src/targets/registry.ts @@ -33,6 +33,7 @@ import { } from '../utils/registry'; import { isDryRun } from '../utils/helpers'; import { filterAsync, withRetry } from '../utils/async'; +import { ResourceConflictException } from '@aws-sdk/client-lambda'; /** "registry" target options */ export interface RegistryConfig { @@ -105,11 +106,19 @@ export class RegistryTarget extends BaseTarget { */ public getRegistryConfig(): RegistryConfig[] { const items = Object.entries(BATCH_KEYS).flatMap(([key, type]) => - Object.entries(this.config[key] || {}).map(([canonicalName, conf]) => ({ - ...(conf as Record), - type, - canonicalName, - })) + Object.entries(this.config[key] || {}).map(([canonicalName, conf]) => { + const config = conf as Record; + const result = Object.assign(Object.create(null), config, { + type, + canonicalName, + }); + + if (typeof config.onlyIfPresent === 'string') { + result.onlyIfPresent = stringToRegexp(config.onlyIfPresent); + } + + return result; + }) ); if (items.length === 0 && this.config.type) { From 024313b14f48150d0b70551d7beb069d845e4fc5 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Thu, 10 Jun 2021 17:19:00 +0300 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 4 ++++ src/targets/registry.ts | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6315acf64..0c422c52d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.24.1 + +- fix(registry): Fix onlyIfPresent config on batch (#259) + ## 0.24.0 - ref(zeus): Remove all Zeus support (#253) diff --git a/src/targets/registry.ts b/src/targets/registry.ts index b127700dc..dd82aac19 100644 --- a/src/targets/registry.ts +++ b/src/targets/registry.ts @@ -33,7 +33,6 @@ import { } from '../utils/registry'; import { isDryRun } from '../utils/helpers'; import { filterAsync, withRetry } from '../utils/async'; -import { ResourceConflictException } from '@aws-sdk/client-lambda'; /** "registry" target options */ export interface RegistryConfig {