From f03fc23ff1b3daf993abcc18b00cc38ccb507c06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:41:29 +0300 Subject: [PATCH 01/10] Update auth service staging image tag to stage-9267ecdf-1734100799 --- k8s/auth-service/values-stage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/auth-service/values-stage.yaml b/k8s/auth-service/values-stage.yaml index 32f9f2d950..5c6329935c 100644 --- a/k8s/auth-service/values-stage.yaml +++ b/k8s/auth-service/values-stage.yaml @@ -6,7 +6,7 @@ app: replicaCount: 2 image: repository: eu.gcr.io/airqo-250220/airqo-stage-auth-api - tag: stage-c701f88b-1734080836 + tag: stage-9267ecdf-1734100799 nameOverride: '' fullnameOverride: '' podAnnotations: {} From 6516f0597f71acc2a3f6dc7a365bfa905e659d14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:41:54 +0300 Subject: [PATCH 02/10] Update AirQo exceedance production image tag to prod-455774ec-1734100845 --- k8s/exceedance/values-prod-airqo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/exceedance/values-prod-airqo.yaml b/k8s/exceedance/values-prod-airqo.yaml index 8d7efe12cf..f79ab54d1e 100644 --- a/k8s/exceedance/values-prod-airqo.yaml +++ b/k8s/exceedance/values-prod-airqo.yaml @@ -4,6 +4,6 @@ app: configmap: env-exceedance-production image: repository: eu.gcr.io/airqo-250220/airqo-exceedance-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' From 240319fbb1329b4168c143f33f7324538957cb54 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:42:05 +0300 Subject: [PATCH 03/10] Update KCCA exceedance production image tag to prod-455774ec-1734100845 --- k8s/exceedance/values-prod-kcca.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/exceedance/values-prod-kcca.yaml b/k8s/exceedance/values-prod-kcca.yaml index c569cacf14..ca6f623d9b 100644 --- a/k8s/exceedance/values-prod-kcca.yaml +++ b/k8s/exceedance/values-prod-kcca.yaml @@ -4,6 +4,6 @@ app: configmap: env-exceedance-production image: repository: eu.gcr.io/airqo-250220/kcca-exceedance-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' From 0096c5e9b043549990c4adab43c96f76760af0ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:42:18 +0300 Subject: [PATCH 04/10] Update auth service production image tag to prod-455774ec-1734100845 --- k8s/auth-service/values-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/auth-service/values-prod.yaml b/k8s/auth-service/values-prod.yaml index cba217b6c5..2789470f1a 100644 --- a/k8s/auth-service/values-prod.yaml +++ b/k8s/auth-service/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-auth-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} From b14203ed4f8712d74a81c759bc12931c3a91a57d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:42:43 +0300 Subject: [PATCH 05/10] Update website production image tag to prod-455774ec-1734100845 --- k8s/website/values-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/website/values-prod.yaml b/k8s/website/values-prod.yaml index 0f78abe6f2..5ea1677fed 100644 --- a/k8s/website/values-prod.yaml +++ b/k8s/website/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-website-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} From a2b3c0f133531f625746f189b3f11b702f6914a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:43:57 +0300 Subject: [PATCH 06/10] Update analytics production image tag to prod-455774ec-1734100845 --- k8s/analytics/values-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/analytics/values-prod.yaml b/k8s/analytics/values-prod.yaml index 6f4d7cfebb..c35645a488 100644 --- a/k8s/analytics/values-prod.yaml +++ b/k8s/analytics/values-prod.yaml @@ -8,7 +8,7 @@ images: celeryWorker: eu.gcr.io/airqo-250220/airqo-analytics-celery-worker reportJob: eu.gcr.io/airqo-250220/airqo-analytics-report-job devicesSummaryJob: eu.gcr.io/airqo-250220/airqo-analytics-devices-summary-job - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 api: name: airqo-analytics-api label: analytics-api From 308407bad63a6991381ab70761fcbc43014294d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:44:25 +0300 Subject: [PATCH 07/10] Update predict production image tag to prod-455774ec-1734100845 --- k8s/predict/values-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/predict/values-prod.yaml b/k8s/predict/values-prod.yaml index 444d824252..7cfdf4aa02 100644 --- a/k8s/predict/values-prod.yaml +++ b/k8s/predict/values-prod.yaml @@ -7,7 +7,7 @@ images: predictJob: eu.gcr.io/airqo-250220/airqo-predict-job trainJob: eu.gcr.io/airqo-250220/airqo-train-job predictPlaces: eu.gcr.io/airqo-250220/airqo-predict-places-air-quality - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 api: name: airqo-prediction-api label: prediction-api From 01199ff9bd254c158e49c4915332648a603dbc88 Mon Sep 17 00:00:00 2001 From: baalmart Date: Fri, 13 Dec 2024 17:47:13 +0300 Subject: [PATCH 08/10] consider removal of duplicates of all fields and not just selected_sites --- src/auth-service/utils/create-preference.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/auth-service/utils/create-preference.js b/src/auth-service/utils/create-preference.js index 35d4fb1578..655223511c 100644 --- a/src/auth-service/utils/create-preference.js +++ b/src/auth-service/utils/create-preference.js @@ -76,11 +76,7 @@ const prepareUpdate = (body, fieldsToUpdate, fieldsToAddToSet) => { : [update[field]]; // Remove duplicates for specific fields - const uniqueArray = - field === "selected_sites" - ? removeDuplicates(processedArray) - : processedArray; - + const uniqueArray = removeDuplicates(processedArray); update["$set"] = update["$set"] || {}; update["$set"][field] = uniqueArray; delete update[field]; @@ -97,10 +93,7 @@ const prepareUpdate = (body, fieldsToUpdate, fieldsToAddToSet) => { })); // Remove duplicates for specific fields - const uniqueArray = - field === "selected_sites" - ? removeDuplicates(processedArray) - : processedArray; + const uniqueArray = removeDuplicates(processedArray); update["$set"] = update["$set"] || {}; update["$set"][field] = uniqueArray; @@ -392,7 +385,8 @@ const preferences = { }; } - const update = prepareUpdate(body, fieldsToUpdate, fieldsToAddToSet); + // const update = prepareUpdate(body, fieldsToUpdate, fieldsToAddToSet); + const update = body; const options = { upsert: true, new: true }; const modifyResponse = await PreferenceModel(tenant).findOneAndUpdate( From 5bca028dfa19d325a0175ab88a3ae1d2e269345c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:50:40 +0300 Subject: [PATCH 09/10] Update spatial production image tag to prod-455774ec-1734100845 --- k8s/spatial/values-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/spatial/values-prod.yaml b/k8s/spatial/values-prod.yaml index 03977e24cb..670474b0b0 100644 --- a/k8s/spatial/values-prod.yaml +++ b/k8s/spatial/values-prod.yaml @@ -6,7 +6,7 @@ app: replicaCount: 3 image: repository: eu.gcr.io/airqo-250220/airqo-spatial-api - tag: prod-77f19000-1734097532 + tag: prod-455774ec-1734100845 nameOverride: '' fullnameOverride: '' podAnnotations: {} From f73622d8b98bde29080bbfa4f51178deeaf75322 Mon Sep 17 00:00:00 2001 From: baalmart Date: Fri, 13 Dec 2024 18:02:21 +0300 Subject: [PATCH 10/10] restoring the duplicate removal functionality --- src/auth-service/utils/create-preference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth-service/utils/create-preference.js b/src/auth-service/utils/create-preference.js index 655223511c..a7ba134320 100644 --- a/src/auth-service/utils/create-preference.js +++ b/src/auth-service/utils/create-preference.js @@ -385,8 +385,8 @@ const preferences = { }; } - // const update = prepareUpdate(body, fieldsToUpdate, fieldsToAddToSet); - const update = body; + const update = prepareUpdate(body, fieldsToUpdate, fieldsToAddToSet); + const options = { upsert: true, new: true }; const modifyResponse = await PreferenceModel(tenant).findOneAndUpdate(