From 930a5fa1c4da32fbc7ac646211a13a1eec46d390 Mon Sep 17 00:00:00 2001 From: digital88 Date: Thu, 20 Mar 2025 23:51:10 +0300 Subject: [PATCH 1/2] add missing exports and fix sonar suggestions --- packages/modules/couchbase/src/bucket-definition.ts | 2 +- packages/modules/couchbase/src/couchbase-container.ts | 6 +++--- packages/modules/couchbase/src/couchbase-service.ts | 4 ++-- packages/modules/couchbase/src/index.ts | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/modules/couchbase/src/bucket-definition.ts b/packages/modules/couchbase/src/bucket-definition.ts index 7da9ed997..a1fc633ad 100644 --- a/packages/modules/couchbase/src/bucket-definition.ts +++ b/packages/modules/couchbase/src/bucket-definition.ts @@ -4,7 +4,7 @@ export class BucketDefinition { private quota = 100; private numOfReplicas = 0; - constructor(private name: string) {} + constructor(private readonly name: string) {} withReplicas(numOfReplicas: number) { const minThreshold = 0; diff --git a/packages/modules/couchbase/src/couchbase-container.ts b/packages/modules/couchbase/src/couchbase-container.ts index 76ae5c877..f5f589462 100644 --- a/packages/modules/couchbase/src/couchbase-container.ts +++ b/packages/modules/couchbase/src/couchbase-container.ts @@ -60,7 +60,7 @@ export class CouchbaseContainer extends GenericContainer { withServiceQuota(service: CouchbaseService, quotaMb: number) { if (!service.hasQuota()) { - throw new Error(`The provided service (${service}) has no quota to configure`); + throw new Error(`The provided service (${service.getIdentifier()}) has no quota to configure`); } if (quotaMb < service.getMinimumQuotaMb()) { @@ -253,14 +253,14 @@ export class CouchbaseContainer extends GenericContainer { } private async setMemoryQuotas(container: StartedTestContainer) { - log.debug(`Custom service memory quotas: ${this.customServiceQuotas}`); for (const service of this.enabledServices) { if (!service.hasQuota()) { continue; } const body = new URLSearchParams(); - const quota = this.customServiceQuotas.get(service) || service.getMinimumQuotaMb(); + const quota = this.customServiceQuotas.get(service) ?? service.getMinimumQuotaMb(); + log.debug(`Custom service memory quotas: ${service.getIdentifier()} - ${quota} Mb.`); if (service.getIdentifier() === CouchbaseService.KV.getIdentifier()) { body.set("memoryQuota", quota.toString()); diff --git a/packages/modules/couchbase/src/couchbase-service.ts b/packages/modules/couchbase/src/couchbase-service.ts index 833bfdebd..51a5eecb5 100644 --- a/packages/modules/couchbase/src/couchbase-service.ts +++ b/packages/modules/couchbase/src/couchbase-service.ts @@ -1,7 +1,7 @@ export class CouchbaseService { constructor( - private identifier: string, - private minimumQuotaMb: number + private readonly identifier: string, + private readonly minimumQuotaMb: number ) {} static readonly KV = new CouchbaseService("kv", 256); diff --git a/packages/modules/couchbase/src/index.ts b/packages/modules/couchbase/src/index.ts index 7c0e553ea..fb9844eb4 100644 --- a/packages/modules/couchbase/src/index.ts +++ b/packages/modules/couchbase/src/index.ts @@ -1 +1,3 @@ +export { BucketDefinition } from "./bucket-definition"; export { CouchbaseContainer, StartedCouchbaseContainer } from "./couchbase-container"; +export { CouchbaseService } from "./couchbase-service"; From 03a4a98502a4979f94a89c085a6af21a643de72b Mon Sep 17 00:00:00 2001 From: digital88 Date: Fri, 21 Mar 2025 00:18:10 +0300 Subject: [PATCH 2/2] moved couchbase out of no_build_modules --- .github/scripts/changed-modules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/changed-modules.sh b/.github/scripts/changed-modules.sh index dcda2c6b2..34c0439de 100755 --- a/.github/scripts/changed-modules.sh +++ b/.github/scripts/changed-modules.sh @@ -60,7 +60,7 @@ while IFS= read -r file; do done < <(find "${ROOT_DIR}" -maxdepth 1 -type f -not -name "package.json" -not -name "package-lock.json") # define an array of modules that won't be part of the build -readonly no_build_modules=("couchbase") +readonly no_build_modules=() # modules is an array that will store the paths of all the modules in the repository. modules=()