From 803829e17c95642234ce2e7ee5c16c14343801ec Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 10:23:27 -0400 Subject: [PATCH 01/12] fix --- upsertGitHubTag/deployment/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index c91a281..e7fda98 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -267,9 +267,9 @@ function logPayloadToS3(body, deliveryId) { // If bucket name is not null (had to put this for the integration test) if (process.env.BUCKET_NAME) { const uploadDate = new Date(); - const bucketPath = `${uploadDate.getFullYear()} - -${uploadDate.getMonth() + 1} - -${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid + const bucketPath = `${uploadDate.getFullYear()}` + + `-${uploadDate.getMonth() + 1}` + + `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From 9f2c7bec464ff5814b3b8c64f9c6fb54ddc1dbc3 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 10:25:48 -0400 Subject: [PATCH 02/12] eslint --- upsertGitHubTag/deployment/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index e7fda98..6e1c91d 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -267,9 +267,10 @@ function logPayloadToS3(body, deliveryId) { // If bucket name is not null (had to put this for the integration test) if (process.env.BUCKET_NAME) { const uploadDate = new Date(); - const bucketPath = `${uploadDate.getFullYear()}` + - `-${uploadDate.getMonth() + 1}` + - `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid + const bucketPath = + `${uploadDate.getFullYear()}` + + `-${uploadDate.getMonth() + 1}` + + `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From 1809ec96da02e35336c05819b1d274df93220e18 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 10:28:09 -0400 Subject: [PATCH 03/12] eslint --- upsertGitHubTag/deployment/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index 6e1c91d..0212439 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,9 +268,9 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const uploadDate = new Date(); const bucketPath = - `${uploadDate.getFullYear()}` + - `-${uploadDate.getMonth() + 1}` + - `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid + `${uploadDate.getFullYear()}` + + `-${uploadDate.getMonth() + 1}` + + `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From 76ed7a8fdef76b9867f2179d76f4dc240d154fbb Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 16:06:45 -0400 Subject: [PATCH 04/12] review feedback --- upsertGitHubTag/deployment/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index 0212439..39c9bf5 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -266,11 +266,12 @@ function processEvent(event, callback) { function logPayloadToS3(body, deliveryId) { // If bucket name is not null (had to put this for the integration test) if (process.env.BUCKET_NAME) { - const uploadDate = new Date(); + const date = new Date(); + const uploadYear = date.getFullYear(); + const uploadMonth = (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1); + const uploadDate = (date.getDate() < 10 ? '0' : '') + date.getDate(); const bucketPath = - `${uploadDate.getFullYear()}` + - `-${uploadDate.getMonth() + 1}` + - `-${uploadDate.getDate()}/${deliveryId}`; //formats path to YYYY-MM-DD/deliveryid + `${uploadYear}-${uploadMonth}-${uploadDate.getDate()}/${deliveryId}`; const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From 75aa9f95f66183d0cc23049dc27bfb788cb4932f Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 16:10:18 -0400 Subject: [PATCH 05/12] review feedback --- upsertGitHubTag/deployment/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index 39c9bf5..a9ab200 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,8 +268,10 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const date = new Date(); const uploadYear = date.getFullYear(); - const uploadMonth = (date.getMonth() + 1 < 10 ? '0' : '') + (date.getMonth() + 1); - const uploadDate = (date.getDate() < 10 ? '0' : '') + date.getDate(); + const uploadMonth = + (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May + const uploadDate = + (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate.getDate()}/${deliveryId}`; From 4c1e6a5074f04836b8fabd6f48ece9e6d7d57821 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 16:11:38 -0400 Subject: [PATCH 06/12] review feedback --- upsertGitHubTag/deployment/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index a9ab200..46dda2d 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,12 +268,9 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const date = new Date(); const uploadYear = date.getFullYear(); - const uploadMonth = - (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May - const uploadDate = - (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date - const bucketPath = - `${uploadYear}-${uploadMonth}-${uploadDate.getDate()}/${deliveryId}`; + const uploadMonth = (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May + const uploadDate = (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date + const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate.getDate()}/${deliveryId}`; const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From 76c6e2440312dc64bca74f6783deb8d4d3350acd Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 16:12:13 -0400 Subject: [PATCH 07/12] oops --- upsertGitHubTag/deployment/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index 46dda2d..ced99fc 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -270,7 +270,7 @@ function logPayloadToS3(body, deliveryId) { const uploadYear = date.getFullYear(); const uploadMonth = (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May const uploadDate = (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date - const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate.getDate()}/${deliveryId}`; + const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`; const command = new PutObjectCommand({ Bucket: process.env.BUCKET_NAME, From c05d328b13593ca2b16f42f32d02028e992d6b21 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Thu, 2 May 2024 16:13:24 -0400 Subject: [PATCH 08/12] lint --- upsertGitHubTag/deployment/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index ced99fc..c66e511 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,7 +268,8 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const date = new Date(); const uploadYear = date.getFullYear(); - const uploadMonth = (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May + const uploadMonth = + (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May const uploadDate = (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`; From fae755b1d15a92440a94a16bc39a5e1b40a388f9 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Fri, 3 May 2024 11:04:25 -0400 Subject: [PATCH 09/12] padstart --- upsertGitHubTag/deployment/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index c66e511..ade017c 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -269,8 +269,8 @@ function logPayloadToS3(body, deliveryId) { const date = new Date(); const uploadYear = date.getFullYear(); const uploadMonth = - (date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1); // ex. get 05 instead of 5 for May - const uploadDate = (date.getDate() < 10 ? "0" : "") + date.getDate(); // ex. get 05 instead of 5 for the 5th date + (date.getMonth() + 1).padStart(2, '0'); // ex. get 05 instead of 5 for May + const uploadDate = date.getDate().toString().padStart(2, '0'); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`; const command = new PutObjectCommand({ From f6e708e020a1ae548f68886fafcca6e9c332fcd7 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Fri, 3 May 2024 11:21:49 -0400 Subject: [PATCH 10/12] padstart --- upsertGitHubTag/deployment/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index ade017c..dc40ba3 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -269,8 +269,8 @@ function logPayloadToS3(body, deliveryId) { const date = new Date(); const uploadYear = date.getFullYear(); const uploadMonth = - (date.getMonth() + 1).padStart(2, '0'); // ex. get 05 instead of 5 for May - const uploadDate = date.getDate().toString().padStart(2, '0'); // ex. get 05 instead of 5 for the 5th date + (date.getMonth() + 1).padStart(2, "0"); // ex. get 05 instead of 5 for May + const uploadDate = date.getDate().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`; const command = new PutObjectCommand({ From 54596bf939212acdc7af9c35360d1c3b64345a3b Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Fri, 3 May 2024 11:23:36 -0400 Subject: [PATCH 11/12] padstart --- upsertGitHubTag/deployment/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index dc40ba3..76ac23c 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,8 +268,7 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const date = new Date(); const uploadYear = date.getFullYear(); - const uploadMonth = - (date.getMonth() + 1).padStart(2, "0"); // ex. get 05 instead of 5 for May + const uploadMonth = (date.getMonth() + 1).padStart(2, "0"); // ex. get 05 instead of 5 for May const uploadDate = date.getDate().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`; From 1de63ed8d1b6ca5c50f83614d1e55995796dc760 Mon Sep 17 00:00:00 2001 From: hyunnaye Date: Fri, 3 May 2024 15:20:32 -0400 Subject: [PATCH 12/12] padstart --- upsertGitHubTag/deployment/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upsertGitHubTag/deployment/index.js b/upsertGitHubTag/deployment/index.js index 76ac23c..144b103 100644 --- a/upsertGitHubTag/deployment/index.js +++ b/upsertGitHubTag/deployment/index.js @@ -268,7 +268,7 @@ function logPayloadToS3(body, deliveryId) { if (process.env.BUCKET_NAME) { const date = new Date(); const uploadYear = date.getFullYear(); - const uploadMonth = (date.getMonth() + 1).padStart(2, "0"); // ex. get 05 instead of 5 for May + const uploadMonth = (date.getMonth() + 1).toString().padStart(2, "0"); // ex. get 05 instead of 5 for May const uploadDate = date.getDate().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th date const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`;