From 73992f108b73b8c235022dff38962e798c6564e8 Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Mon, 30 Jan 2023 17:30:47 -0800 Subject: [PATCH 01/45] dont return autocorrect suggestion for `Did You Mean` if there will be no document results --- .../node_app/controllers/textSuggestionController.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/node_app/controllers/textSuggestionController.js b/backend/node_app/controllers/textSuggestionController.js index fd45830a2..2fcd21d1e 100644 --- a/backend/node_app/controllers/textSuggestionController.js +++ b/backend/node_app/controllers/textSuggestionController.js @@ -49,6 +49,18 @@ class TextSuggestionController { } if (corrected.length > 0 && esClientName !== 'eda') { req.body.searchText = corrected; + const clientObj = { + esClientName: esClientName, + esIndex: index, + }; + const originalText = req.body.searchText; + req.body.searchText = corrected; + // If the auto-corrected text doesn't return any results, don't suggest it to the user. + const correctedResults = this.searchUtility.documentSearch(null, req.body, clientObj, userId); + if (Object.keys(correctedResults).length === 0) { + req.body.searchText = originalText; + corrected = ''; + } } if (suggestionsFlag === true) { const data_presearch = await this.getPresearchSuggestion({ From 8cef17e9b81cd67e3c89fdec7b523fa9d6872e43 Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Tue, 31 Jan 2023 08:51:51 -0800 Subject: [PATCH 02/45] update text suggestion controller test --- .../test/controllers/textSuggestionController.test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/test/controllers/textSuggestionController.test.js b/backend/test/controllers/textSuggestionController.test.js index 878e162c0..0a1f8d639 100644 --- a/backend/test/controllers/textSuggestionController.test.js +++ b/backend/test/controllers/textSuggestionController.test.js @@ -364,6 +364,13 @@ describe('TextSuggestionController', function () { return []; } }, + documentSearch(body) { + if (body) { + return { test: 'test' }; + } else { + return {}; + } + }, }; it('should return parsed data', async () => { @@ -411,7 +418,7 @@ describe('TextSuggestionController', function () { await target.getTextSuggestion(req, res); const expected = { - autocorrect: ['navy'], + autocorrect: [], presearchTitle: [ 'H.R. 4402: To authorize the Secretary of the Navy to establish a surface danger zone over the Guam National Wildlife Refuge or any portion thereof to support the operation of a live-fire training range complex.', 'H.R. 3183: An Act To designate the facility of the United States Postal Service located at 13683 James Madison Highway in Palmyra, Virginia, as the U.S. Navy Seaman Dakota Kyle Rigsby Post Office.', From d0a49a8aec227f253d4553db93a90895ad16cd6e Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Tue, 31 Jan 2023 12:39:44 -0800 Subject: [PATCH 03/45] boost title matches over paragraph/ other matches: - use dis_max query on title-related fields and apply significant boost - use dis_max query on keywords and entities. no need for more-matches-is-better approach here - decrease boost of paragraph matches - trim leading & trailing whitespace from query text --- backend/node_app/utils/searchUtility.js | 109 ++++++++++++++---------- 1 file changed, 63 insertions(+), 46 deletions(-) diff --git a/backend/node_app/utils/searchUtility.js b/backend/node_app/utils/searchUtility.js index 378286eaf..6bb8cecf7 100644 --- a/backend/node_app/utils/searchUtility.js +++ b/backend/node_app/utils/searchUtility.js @@ -646,6 +646,7 @@ class SearchUtility { : 'paragraphs.par_raw_text_t.gc_english'; const analyzer = this.isVerbatim(searchText) ? 'standard' : 'gc_english'; const plainQuery = this.isVerbatim(searchText) ? parsedQuery.replace(/["']/g, '') : parsedQuery; + const plainQueryTrimmed = plainQuery.trim(); let mainKeywords = this.remove_stopwords(plainQuery) .replace(/["']/gi, '') .replace(/ OR | AND /gi, ' ') @@ -715,7 +716,7 @@ class SearchUtility { fuzzy_max_expansions: 100, fuzziness: 'AUTO', analyzer, - boost: 0.5, + boost: 0.05, }, }, ], @@ -725,62 +726,78 @@ class SearchUtility { }, }, { - wildcard: { - keyw_5: { - value: `*${plainQuery}*`, - boost: 5, - }, - }, - }, - { - wildcard: { - 'display_title_s.search': { - value: `*${plainQuery}*`, - boost: 15, - case_insensitive: true, - }, - }, - }, - { - fuzzy: { - 'display_title_s.search': { - value: `${plainQuery.trim()}`, - fuzziness: 'AUTO', // https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#fuzziness - transpositions: false, // do not allow edits to include transpositions of adjacent characters (e.g., ba -> ab) - boost: 15, - }, + dis_max: { + queries: [ + { + wildcard: { + 'display_title_s.search': { + value: `*${plainQueryTrimmed}*`, + case_insensitive: true, + }, + }, + }, + { + fuzzy: { + 'display_title_s.search': { + value: `${plainQueryTrimmed}`, + fuzziness: 'AUTO', + transpositions: false, + }, + }, + }, + { + match_phrase: { + 'display_title_s.search': plainQueryTrimmed, + }, + }, + { + wildcard: { + 'filename.search': { + value: `*${plainQueryTrimmed}*`, + case_insensitive: true, + }, + }, + }, + { + wildcard: { + doc_num: { + value: `*${plainQueryTrimmed}*`, + }, + }, + }, + ], + boost: 150, }, }, { - wildcard: { - 'filename.search': { - value: `*${plainQuery}*`, - boost: 10, - case_insensitive: true, - }, + dis_max: { + queries: [ + { + wildcard: { + 'top_entities_t.search': { + value: `*${plainQueryTrimmed}*`, + }, + }, + }, + { + wildcard: { + keyw_5: { + value: `*${plainQueryTrimmed}*`, + }, + }, + }, + ], + boost: 5, }, }, { wildcard: { 'display_source_s.search': { - value: `*${plainQuery}*`, - boost: 4, - }, - }, - }, - { - wildcard: { - 'top_entities_t.search': { - value: `*${plainQuery}*`, - boost: 5, + value: `*${plainQueryTrimmed}*`, + boost: 10, }, }, }, - { - match_phrase: { - 'display_title_s.search': plainQuery, - }, - }, ], minimum_should_match: 1, From 6f60a440e9279a140797fab1a611554275f880df Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Tue, 31 Jan 2023 13:25:11 -0800 Subject: [PATCH 04/45] add term query for doc_num --- backend/node_app/utils/searchUtility.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/node_app/utils/searchUtility.js b/backend/node_app/utils/searchUtility.js index 6bb8cecf7..48df481ea 100644 --- a/backend/node_app/utils/searchUtility.js +++ b/backend/node_app/utils/searchUtility.js @@ -765,6 +765,13 @@ class SearchUtility { }, }, }, + { + term: { + doc_num: { + value: plainQueryTrimmed, + }, + }, + }, ], boost: 150, }, From 1ecb0e54dd584dd8083c3b2f533b233055ccd1cc Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Wed, 1 Feb 2023 08:51:10 -0800 Subject: [PATCH 05/45] rm duplicated line --- backend/node_app/controllers/textSuggestionController.js | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/node_app/controllers/textSuggestionController.js b/backend/node_app/controllers/textSuggestionController.js index 2fcd21d1e..fa35e8923 100644 --- a/backend/node_app/controllers/textSuggestionController.js +++ b/backend/node_app/controllers/textSuggestionController.js @@ -48,7 +48,6 @@ class TextSuggestionController { this.logger.error(message, 'JBVZKTP', userId); } if (corrected.length > 0 && esClientName !== 'eda') { - req.body.searchText = corrected; const clientObj = { esClientName: esClientName, esIndex: index, From 704ccc7d9589f756130bc86c1b2b9374f2f56d87 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 08:53:53 -0800 Subject: [PATCH 06/45] rebase advana-library refactor off of dev and add the chart changes --- .gitlab-ci.yml | 23 +- Dockerfile.prod | 8 +- chart/Chart.lock | 6 + chart/Chart.yaml | 11 +- chart/charts/advana-library-1.0.2.tgz | Bin 0 -> 5324 bytes chart/deploy.sh | 1 - chart/templates/NOTES.txt | 12 +- chart/templates/_helpers.tpl | 24 +- chart/templates/deployment.yaml | 120 +-------- chart/templates/env_config_secret.yaml | 14 - chart/templates/externalsecret.yaml | 2 + chart/templates/file_config_secret.yaml | 14 - chart/templates/ingress.yaml | 38 +-- chart/templates/job.yaml | 2 + chart/templates/one_time_job.yaml | 6 - chart/templates/secrets.yaml | 5 + chart/templates/service.yaml | 16 +- chart/templates/serviceaccount.yaml | 14 +- chart/values.yaml | 341 ++++++++++++++---------- 19 files changed, 280 insertions(+), 377 deletions(-) create mode 100644 chart/Chart.lock create mode 100644 chart/charts/advana-library-1.0.2.tgz delete mode 100644 chart/deploy.sh delete mode 100644 chart/templates/env_config_secret.yaml create mode 100644 chart/templates/externalsecret.yaml delete mode 100644 chart/templates/file_config_secret.yaml create mode 100644 chart/templates/job.yaml create mode 100644 chart/templates/secrets.yaml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e67802f6..d4b50473f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -204,9 +204,10 @@ dev-overrides: VALUES_FILE: "dev.values.yaml" extends: - ".helm-overrides" + # TODO: temporarily pull values from library branch for refactored chart's values script: - | - git clone https://dev:${GITLAB_TOKEN}@gitlab.advana.boozallencsn.com/advana/gamechanger/gamechanger-ci-cd.git + git clone -b library https://dev:${GITLAB_TOKEN}@gitlab.advana.boozallencsn.com/advana/gamechanger/gamechanger-ci-cd.git mv gamechanger-ci-cd/${VALUES_FILE} "${HELM_UPGRADE_VALUES_FILE}" rm -rf gamechanger-ci-cd @@ -242,11 +243,11 @@ trigger: --set image.tag=${CI_COMMIT_SHA}-oci --set appVersion=${BUILD_VERSION} --set ingress.enabled=true - --set ingress.web.hostname=${HELM_RELEASE_NAME} - --set env.REACT_APP_BACKEND_URL=${DEV_URL} - --set env.REACT_APP_USER_TOKEN_ENDPOINT=${DEV_URL}/api/auth/token - --set env.REACT_APP_LOGIN_ROUTE=${DEV_URL}/login - --set env.APPROVED_API_CALLERS=${DEV_URL} + --set global.appName=${HELM_RELEASE_NAME} + --set deployment.web.container.gamechanger-web.env.REACT_APP_BACKEND_URL=${DEV_URL} + --set deployment.web.container.gamechanger-web.env.REACT_APP_USER_TOKEN_ENDPOINT=${DEV_URL}/api/auth/token + --set deployment.web.container.gamechanger-web.env.REACT_APP_LOGIN_ROUTE=${DEV_URL}/login + --set deployment.web.container.gamechanger-web.env.APPROVED_API_CALLERS=${DEV_URL} - if: $DEPLOY_TO_PERSONAL != "false" variables: UPSTREAM_COMMIT_BRANCH: ${CI_COMMIT_BRANCH} @@ -260,11 +261,11 @@ trigger: --set image.tag=${CI_COMMIT_SHA}-oci --set appVersion=${BUILD_VERSION} --set ingress.enabled=true - --set ingress.web.hostname=${HELM_RELEASE_NAME} - --set env.REACT_APP_BACKEND_URL=${DEV_URL} - --set env.REACT_APP_USER_TOKEN_ENDPOINT=${DEV_URL}/api/auth/token - --set env.REACT_APP_LOGIN_ROUTE=${DEV_URL}/login - --set env.APPROVED_API_CALLERS=${DEV_URL} + --set global.appName=${HELM_RELEASE_NAME} + --set deployment.web.container.gamechanger-web.env.REACT_APP_BACKEND_URL=${DEV_URL} + --set deployment.web.container.gamechanger-web.env.REACT_APP_USER_TOKEN_ENDPOINT=${DEV_URL}/api/auth/token + --set deployment.web.container.gamechanger-web.env.REACT_APP_LOGIN_ROUTE=${DEV_URL}/login + --set deployment.web.container.gamechanger-web.env.APPROVED_API_CALLERS=${DEV_URL} - if: $CI_COMMIT_BRANCH == "main" # trigger: # strategy: "depend" diff --git a/Dockerfile.prod b/Dockerfile.prod index 24eff6427..94b21828e 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -97,7 +97,13 @@ RUN cd "${APP_BACKEND_DIR}" && \ echo "//${_registry_fqdn}/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc && \ echo "@${NPM_PROFILE}:registry=${NPM_REGISTRY}" >> .npmrc \ )) && \ - npm install --production + npm install --production + +USER root + +RUN yum remove git -y + +USER "${APP_UID}":"${APP_GID}" COPY --chown="${APP_UID}":"${APP_GID}" ./backend "${APP_BACKEND_DIR}" COPY --from=builder --chown="${APP_UID}":"${APP_GID}" "${APP_FRONTEND_DIR}/build" "${APP_BACKEND_DIR}/build" diff --git a/chart/Chart.lock b/chart/Chart.lock new file mode 100644 index 000000000..a5ca525ff --- /dev/null +++ b/chart/Chart.lock @@ -0,0 +1,6 @@ +dependencies: + - name: advana-library + repository: oci://092912502985.dkr.ecr.us-east-1.amazonaws.com/platform/charts + version: 1.0.2 +digest: sha256:01cdd204f42640bd6a23d2344ee4a82ab1c21ce09cbffd35f457fa5d027008c1 +generated: "2023-01-26T11:09:50.284308-08:00" diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 1ddd0232e..fa8b3cfe7 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,8 +1,15 @@ apiVersion: v2 -name: gamechanger-web-source +name: gamechanger-web description: A Helm chart for Kubernetes type: application version: 1.0.0 -appVersion: "1.0.0" +appVersion: "1.31.0.20230130" +dependencies: + - name: advana-library + version: 1.0.2 + # repository: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library + repository: oci://092912502985.dkr.ecr.us-east-1.amazonaws.com/platform/charts + tags: + - library diff --git a/chart/charts/advana-library-1.0.2.tgz b/chart/charts/advana-library-1.0.2.tgz new file mode 100644 index 0000000000000000000000000000000000000000..ce235b85d420023ad404cba753aa9d6fbe8c850e GIT binary patch literal 5324 zcmV;-6f^4|iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<`bKAC){hKrS4mdfTv2s6A56g1vnchs!>0SG4(`MqfH#avo z4Mai`Vv1l1NQvY6KKl(GBmoehBwLpAASUBbAg~MUE_U(SC5+cFg}nq%bC_TEFBULo z;Wb<)U+pgq27|$5JQn{C1_S&5!Dux6YB)Zbj86xX$zc4|U^pI}4ZZ?{J+{G{R+Pc~ ztHHf-*`51D63p-)D5sdD=U_bwV3w6X2jL(b1Tmsfjx#2*o`WAyvII(6K*Xg5%t#I> zgJ}$N`~k%vMp;6xmnda4NZ}Hl15?NXcAcT~0!Xkf@D0O3I0_z{AYWLr#y>;LEP)Ks z{+|&^XL!DZS;(^cX@d>pe>6Thv&R4A?Ch)^|A$C7H~nW%f(x=-k`#QOuEB+1`%9QT z37++DZ=VD=H$4!e8BP)CM50`X(sfvhM+fwZVt59ghJV0hg(xorZf_mAs^&|Wfuddx z(>Vf9%NM`ECHjZMH+85+TfyI)LU5HZs}lk*012F;gbIiNh<2t?vWhE$$^sqm6#NZRoW>|+V5}+w z0JAK-T1`=&B8F&)Ngtv;99AOim`2 z{XZKGC$0TIL^4$Ci<0FHO0|*;O`Xc|TIjl}h^;ZJH-#xGGc<$bR(&wbXur~bdSl%R z(AHS9Rg&Z~qW zDa0?#Nc=oa34?sGO7+H6xn(u40r^I&Xp)Sl#3a$~MAE_UlS}}V@?ub>9F+5fOkon@ zC7h#It0cKZQI42SCi~TWX+=@K#u0iRMO+GhDTbw(K8E#|+KlA5PEosb2R!X|#XvU1 zbtc5%5=E;Vv+E0zGW4DqZ8F}tyLh}@QT7t$bM)&P40CgJjN00y4uif zB3nXT)6e^Nq`A$_T&(l68fiGijKhIAMY%3PdcG|`$^;l?loc@YY(r4M=xI~i8W5vo zB@5I`zh)ZlBoH=|nlwo z|1~}Tns(G;Qq~J|G{=?!NkRNJv}cW!0exKM^tCO4Na5{PY0C{&ZP+%|m7){$ai zwvHOOw_QtotW;ROP%fHV>n7)_ciV7li+%kau=}`W?z(@OJS(l8$8c`LEm>5tO8#iz zlLw=ZNfq$VfJ5#jy_pkjSiVQr(mir4+uf6no_RFYuHEm@nRe~ouHD}!De^1)g_$tsVKEp}!8Uh%d&X`jJrvE51gQn}dfqvBG7o%8-}W**JknN955 zl{K49NwYz7G0kJfc1OKW3+BXT@h{?e8q_1*1HS<|9& ziDx&bjZb=*IqZpLy&=2VI)C$?LN7ddv{dZJU_huhu{APy=N#-VWM^p z@8JWq!T)!7YWx3>27}Yn*8k@a$@KqKESLBHn;d`*+0gue45dsN$&sO%MUF!~Yj1%C z%0yMnag9u4uhl|hHMNA!?T-`6t;_YODA`l+LrnVX;S@1gx+B@NbGsy|Id!d1(!KV{ zWB6T`ZX>camz;L5(M+{K-;y?XT4I#lw@N7D^LMJ?&5bx@<|NV1s*0alf6cS0qJVWq zHLjo{7YYr0Bk0XwKR%Vc*W}m#iwxd7@`Fs9;y;YWBg_Bu^z^Lt|2#-C^#2be#~(<_ zVDgH@&y}Yk${P&9B7=49zm=0`ld~uv#Xd*Jx?5;fu)iJ|I@#Nw&)Z*A^zt`xepe}S zrzdTtzjbd~L+{^}C`+8aHat>whH5X1;_!V#@#{5euYUiX;RJsW zv-MXfk5J0=Yfe2NqY=GU=U~N5y*L-s=J%2$QMRhGB$DTAl*2jF5Y@Y|WpnJch`(nq z(URoXd+yv)0KI$vwrSL7Zcsn5ei5qKUWv6JmQ_8(3kWwkVp7~x)qRR=NYjJs(MY^^p*(gS` zY(3tEXK!*0>hfcU9oaMp?>GKb0~Fkg0<3ibxQ4af?D}~_X~2?#E=+MvTdOPxEmkS~ z(Xl=$!0^{pn_7wA|RKr=&PvV=HQ>~L%nI-u0Kq4PsQ+%p#>&<#AOQ2Qv~tNnC5x|o%(5~L6A zy@<0N-fyE2FBsELE;Gm$-ix?ZdqPppI)Cbk+HzsRpPa{2N*##;zg=fd+UMym>ZeKt z1sJexf;4zvWl)sVA42QnNnt~;jL{zS*`3A z^*9S=IH#;D?`~Va#p&>0E1aVkbkt-5=qS0+>g`%$DgthW9pB9)H$ycTJ5YH8eYLya zpCct3T?=eoW$(Rw_L~#__5WKkJ;?t5$zVLG?f*{(?fLIPlCl2(Cz&>^{oj(QH{#=4 zGPMtG-;$}CiM%CKJEm7{7k|nJu@>D?G{sns9aYAq@_g)lO+(@N*tn-qv;`cepWS%ctVwfZ0j#P6rHS*=;aJwr+ZT!VH z{$d+{v5n!-#&Bq3IBd_5HiiSRE;sKO!@)mcdB|7}d&Jrt(_sT{a3|z#M2DUCyg$~6 z4sA5X)`$FK@RPg?w^|?a&w-1r5BaCZv(|_FkQ{O^@Y`sN?Ml8~$+s){b|v4gG7=HPkY?`v^FNA zy)bNJGPW@p+n9`POvW}QV;hsPjmcO;waxQmdu;4C`Tc+7)%|_A0Bwl>F_=tF?f4&~ zv$NL!=Md@UrvI#P|B)OQ4nQvdpTeJ|cY7NwP_hi^q8}}w+OD)c2E-fbLK8S%*L^+| zQelMb!z%u=?)$MWoQK5mRIN^>p0)Ao0JDTCoTIomy|$c4F3a6!9Y7#RR;ttuM6>(Z zb2h>2i&Xg`=}p)p|NY~iqu$H#-x&YzbaG;k|KUkH{tuFbFn|9(gJ}%d0*Q$iAT#kS zhH&T=Z7G|*>ZNhgEN5xOT#uLib&c{I$9z)7@>Lpv$%%Nx%gfblhTn@BoNKIIP)RkJhZ%T>lLSl= zSW(_i3ZQ7bYORm5l?P%^*NTdk#oLmes*JzDHUyWK8zi7qMQYlCr&T*kLP#(*pFGu8 zBX`FJ8vdUh8<@nqy^y&d4bjth$_I)vJe;3`uS!T{DPa)&yj6Cw=j)0=Y5AivXytn6 zUpt`lXXmaX$sXv%u_~1AeO&ri6gAkix-+0lP|b2+V~H@5%~J)fYb{pUbc4sD?f~4C z;gxH0v=fGodgvI?G`UfsbAqy`#&6v>h}M1)Y|_;B*Xvz7tZpA z2mnGPR1APuBnFg0wvx+jKA(+P0(w0$Z_K!ss(EC~?Au!~M+{^neiBGH37Ovo3a}oqJyWojanM3>NMUUC4_R@kf4t{qvsUhE)KJ7)T4oGEaMClq*^WBtP%>8)G!x z-dX{aZoEOHzKjiyHZ>-{{?FnA#eW};CX;&n_jdhvkYwopS0sLcX}-!BCh5Pg;(6mo zK(cuH0I}cApcz@cMWSRaeoQ9rB5MI;oPGJs}%a<`bxWZm*!H zR-$;JZ&?+v$}KDV29^#0{0$hnWI0afKwi8OM4V2>D2;a5^EohTXa_c3(bkPbI`ykp0C7w_X8F*BSLZjJoWH)8aGQB?5_3>{E$1<^YY9#r&y z`}uOS+_Qwou5nmtXBlcH@m{tEt`UBQ)hbhI7}w z?TyFXTx^=e~4t* zJ$2!^!Okh6cz|<11&39^K$sZ?#0F>t18Fp7s#E(r{Hs1)RJQm2rptGXx9gGJ{tp;| z`iwAtZS}W`@1k$QSJ788GwcfU#aroZiV>$nQU+3Ssle9lI?gS3n;w3F25qDMS9e11 zV+J|mM z9&5p&pT&8IvFES4wsZM5xss*-!v#u~c%G6R?GMKW{XaN8vHd^CC++v&4wH_+E65ni zQwkUXlJnr*0;OQO!byzNImlpi1?Px{!4ddvfhnM?OwQiu0woEUCuAxwo8ff+50Ik- zGQ39OQ>t1%Oyl4Pq-ZWw7&y*yG{f&vEY;w@bVKlKnp^{tikiGhAVWDwaEihpd~x~b zB_lZsjzDqxa&ZY_oYNqjW7ZdcW%Gk@`XTR&zeUDk-sgXcpLCt}D?n2iU9B=O!wI6n zvyi^af@k3rUIouWw&c$w$MfLX{{=_j513=JqTt6D-_sz>a`F~MEC_LoU|$x`$=e`Y z(}={V|0$?cYy7|d{`rfS--pY1pEx$&|2-L6vm80NiDFHyZoCU#i@IODG zWNBvq@9~1MjGp)Vh5vU&ieZjFpcqu^OBx2j z(GmEa!Z`|pVF-R)ici48!iO?O8R9dV=sFP7oj1}Q?iwzWH!|bR8~#H)mxVE+=YbwY z#1!!&G*mIK9EO8%pfZm@6QIv-(+Cz}C-Y|qq_<^MG9d+R-LSDeR>MHN7 zj_}Q!H=LlqXL04ds1qnCOY#3XqcmcJm8fO_qNspherU1)QY{&^%XMxZIi}@R9p&a; eV14X?(WW-FsZF1G`u_j`0RR6oJbmu~+5iBO9+VmY literal 0 HcmV?d00001 diff --git a/chart/deploy.sh b/chart/deploy.sh deleted file mode 100644 index e20f6505d..000000000 --- a/chart/deploy.sh +++ /dev/null @@ -1 +0,0 @@ -helm upgrade --install gamechanger-chart gamechanger-chart -f gamechanger-chart/values.yaml -f gamechanger-chart/values.dev.yaml \ No newline at end of file diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt index 5f634f15c..72ca2f473 100644 --- a/chart/templates/NOTES.txt +++ b/chart/templates/NOTES.txt @@ -1,7 +1,11 @@ +{{ include "common.notes" $ }} +{{- range $deploymentName, $deploymentValues := $.Values.deployment }} +{{- range $typeName, $typeValues := $deploymentValues.service }} +{{- if eq ($typeName | toString ) "NodePort" }} 1. Get the application URL by running these commands: -{{- if .Values.service }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get --namespace {{ $.Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" $ }}-{{ $deploymentName }}-{{ lower $typeName }}) + export NODE_IP=$(kubectl get nodes --namespace {{ $.Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- end }} - +{{- end }} +{{- end }} diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index d058e1ff6..39e3fd04d 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -77,6 +77,18 @@ Env Config Secret Name {{- printf "%s.%s" (include "chart.fullname" .) "env-config-secret" }} {{- end }} +{{- define "chart.envConfigSecretNameVault" }} +{{- printf "%s.%s" (include "chart.fullname" .) "env-config-secret-vault" }} +{{- end }} + +{{- define "chart.vaultKey" }} +{{- printf "%s/%s" (.Values.vaultKey) (include "chart.fullname" .) }} +{{- end }} + +{{- define "chart.vaultCertsKey" }} +{{- printf "%s/%s" (include "chart.vaultKey" .) "certs" }} +{{- end }} + {{/* File Config Secret Name @@ -96,7 +108,7 @@ Check File Config Defined One Time Job Name */}} {{- define "chart.oneTimeJobName" }} -{{- printf "%s.%s.%s" (include "chart.fullname" .) "one-time-job" (now | date "20060102-150405") }} +{{- printf "%s.%s" "job" (now | date "20060102-150405") }} {{- end }} {{/* @@ -135,6 +147,10 @@ Usage: {{- end }} {{- end -}} +#check if service type is defined +{{- define "app.isNodePort" }} +{{- if .Values.service.http.nodePort -}}{{- if .Values.service.https.nodePort -}}1{{- else -}}{{- end -}}{{- end -}} +{{- end }} {{/* Generate backend entry that is compatible with all Kubernetes API versions. @@ -220,8 +236,8 @@ Usage: {{- define "app.web.fqdn" -}} {{ $name := default (include "app.web.name" . | lower ) .Values.ingress.web.hostname }} -{{- if .Values.externalDomain -}} -{{- printf "%s.%s" $name .Values.externalDomain -}} +{{- if .Values.baseDomain -}} +{{- printf "%s.%s" $name .Values.baseDomain -}} {{- else -}} {{ printf "%s" $name }} {{- end -}} @@ -229,4 +245,4 @@ Usage: {{- define "app.web.name" -}} {{- printf "%s-web" (include "chart.fullname" .) -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 57df8f764..07ee0b512 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -1,118 +1,2 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "chart.fullname" . }} - labels: - {{- include "chart.labels" . | nindent 4 }} - {{- with .Values.deploymentAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "chart.selectorLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- /* checksum/ annotations are used here to force helm to redeploy when associated config values change */}} - checksum/env-config-secret: {{ include (print .Template.BasePath "/env_config_secret.yaml") . | sha256sum }} - {{- if (include "chart.isFileConfigDefined" .) }} - checksum/file-config-secret: {{ include (print .Template.BasePath "/file_config_secret.yaml") . | sha256sum }} - {{- end }} - {{- with .Values.podAnnotations -}}{{- toYaml . | nindent 8 }}{{- end }} - labels: - {{- include "chart.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "chart.serviceAccountName" . }} - {{- with .Values.podSecurityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if (include "chart.isFileConfigDefined" .) }} - volumes: - - name: file-config-vol - secret: - secretName: {{ include "chart.fileConfigSecretName" . | quote }} - {{- end }} - {{- if and .Values.scripts.runInitJob ( .Values.scripts.initJobScript | default "" | trim ) }} - initContainers: - - name: init-job - command: ["/bin/bash", "-c"] - args: - - | - {{- .Values.scripts.initJobScript | trim | nindent 16 }} - {{- with .Values.appContainerSecurityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: {{ include "chart.imageRepo" . | quote }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if (include "chart.isFileConfigDefined" .) }} - volumeMounts: - - name: file-config-vol - mountPath: {{ .Values.fileConfig.baseMountPath | quote }} - readOnly: true - {{- end }} - env: - - name: REACT_APP_VERSION - value: {{ default "1.0.0" .Chart.AppVersion | quote }} - - name: REACT_APP_VERSION - valueFrom: - secretKeyRef: - name: {{ include "chart.envConfigSecretName" . | quote }} - key: REACT_APP_VERSION - optional: true - envFrom: - - secretRef: - name: {{ include "chart.envConfigSecretName" . | quote }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - {{- with .Values.startCommand }} - command: - {{- range . }} - {{- printf "- %s" (. | quote) | nindent 12 }} - {{- end -}} - {{- end }} - {{- if (include "chart.isFileConfigDefined" .) }} - volumeMounts: - - name: file-config-vol - mountPath: {{ .Values.fileConfig.baseMountPath | quote }} - readOnly: true - {{- end }} - {{- with .Values.appContainerSecurityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - image: {{ include "chart.imageRepo" . | quote }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: REACT_APP_VERSION - value: {{ default "1.0.0" .Chart.AppVersion | quote }} - - name: REACT_APP_VERSION - valueFrom: - secretKeyRef: - name: {{ include "chart.envConfigSecretName" . | quote }} - key: REACT_APP_VERSION - optional: true - envFrom: - - secretRef: - name: {{ include "chart.envConfigSecretName" . | quote }} - {{- with .Values.service }} - ports: - {{- range (list .http .https) }} - - name: {{ .name }} - containerPort: {{ .targetPort }} - protocol: {{ .protocol }} - {{- end }} - {{- end }} - {{- with .Values.probes -}}{{- toYaml . | nindent 10}}{{- end }} - {{- with .Values.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_deployment.tpl +{{ include "common.deployment" $ }} diff --git a/chart/templates/env_config_secret.yaml b/chart/templates/env_config_secret.yaml deleted file mode 100644 index 8dd5f4df8..000000000 --- a/chart/templates/env_config_secret.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.env -}} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "chart.envConfigSecretName" . }} - labels: - {{- include "chart.labels" . | nindent 8 }} -data: - {{- range $key, $val := .Values.env }} - {{- if not (typeOf $val | eq "") -}} - {{- printf "%s: %s" $key ($val | toString | b64enc | quote) | nindent 4 }} - {{- end -}} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/chart/templates/externalsecret.yaml b/chart/templates/externalsecret.yaml new file mode 100644 index 000000000..7b7bf2db4 --- /dev/null +++ b/chart/templates/externalsecret.yaml @@ -0,0 +1,2 @@ +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_externalsecret.tpl +{{ include "common.externalsecret" $ }} diff --git a/chart/templates/file_config_secret.yaml b/chart/templates/file_config_secret.yaml deleted file mode 100644 index 726f1b694..000000000 --- a/chart/templates/file_config_secret.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if (include "chart.isFileConfigDefined" .) }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "chart.fileConfigSecretName" . }} - labels: - {{- include "chart.labels" . | nindent 8 }} -data: - {{- range $key, $val := .Values.fileConfig.files }} - {{- if not (typeOf $val | eq "") -}} - {{- printf "%s: %s" $key ($val | toString | b64enc | quote) | nindent 4 }} - {{- end -}} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml index c85dbe7a7..6ac233722 100644 --- a/chart/templates/ingress.yaml +++ b/chart/templates/ingress.yaml @@ -1,36 +1,2 @@ -{{- $fqdn := include "app.web.fqdn" . }} -{{- if eq .Values.ingress.controller "gce" }} - {{- $_ := set . "web_path" "/*" -}} -{{- else if eq .Values.ingress.controller "ncp" }} - {{- $_ := set . "web_path" "/.*" -}} -{{- else }} - {{- $_ := set . "web_path" "/" -}} -{{- end }} -{{- if eq .Values.ingress.enabled true }} -apiVersion: {{ template "chart.capabilities.ingress.apiVersion" . }} -kind: Ingress -metadata: - name: {{ include "chart.fullname" . }} - labels: {{- include "chart.labels" . | nindent 4 }} - annotations: - kubernetes.io/ingress.class: nginx - meta.helm.sh/release-name: {{ include "chart.fullname" . }} - meta.helm.sh/release-namespace: {{ include "chart.fullname" . }} - nginx.ingress.kubernetes.io/server-snippet: {{- .Values.ingress.serversnippets | toYaml | indent 4 }} -spec: - rules: - - host: {{ $fqdn | quote }} - http: - paths: - - backend: - service: - name: {{ include "chart.fullname" . }} - port: - number: 80 - path: / - pathType: ImplementationSpecific - tls: - - hosts: - - {{ $fqdn | quote }} - secretName: {{ .Values.ingress.web.tlsSecretName }} -{{- end }} +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_ingress.tpl +{{ include "common.ingress" $ }} diff --git a/chart/templates/job.yaml b/chart/templates/job.yaml new file mode 100644 index 000000000..8d462472a --- /dev/null +++ b/chart/templates/job.yaml @@ -0,0 +1,2 @@ +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_job.tpl +{{ include "common.job" $ }} diff --git a/chart/templates/one_time_job.yaml b/chart/templates/one_time_job.yaml index ebf2bb3da..e1f5343df 100644 --- a/chart/templates/one_time_job.yaml +++ b/chart/templates/one_time_job.yaml @@ -50,12 +50,6 @@ spec: env: - name: REACT_APP_VERSION value: {{ default "1.0.0" .Chart.AppVersion | quote }} - - name: REACT_APP_VERSION - valueFrom: - secretKeyRef: - name: {{ include "chart.envConfigSecretName" . | quote }} - key: REACT_APP_VERSION - optional: true envFrom: - secretRef: name: {{ include "chart.envConfigSecretName" . | quote }} diff --git a/chart/templates/secrets.yaml b/chart/templates/secrets.yaml new file mode 100644 index 000000000..d65a4929b --- /dev/null +++ b/chart/templates/secrets.yaml @@ -0,0 +1,5 @@ +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/secret.tpl +{{ include "common.env.secret" $ }} +{{ include "common.volume.secret" $ }} +{{ include "common.tls.secret" $ }} +{{ include "common.dockerconfigjson.secret" $ }} \ No newline at end of file diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index 31cc48263..5c698dfb7 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -1,14 +1,2 @@ -{{- if .Values.service -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ include "chart.fullname" . }} - labels: - {{- include "chart.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - {{- toYaml (list .Values.service.http .Values.service.https) | nindent 4 }} - selector: - {{- include "chart.selectorLabels" . | nindent 4 }} -{{- end }} +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_service.tpl +{{ include "common.service" $ }} diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml index 26a57fa86..b2e9b3ea9 100644 --- a/chart/templates/serviceaccount.yaml +++ b/chart/templates/serviceaccount.yaml @@ -1,12 +1,2 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "chart.serviceAccountName" . }} - labels: - {{- include "chart.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} +# see: https://gitlab.advana.boozallencsn.com/platform/charts/advana-library/-/blob/main/templates/_serviceaccount.tpl +{{ include "common.serviceaccount" $ }} diff --git a/chart/values.yaml b/chart/values.yaml index 29965ea38..bb90043ac 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1,21 +1,17 @@ -# DEFAULT VALUES +############################################################################### +## Global Values ## +############################################################################### -# replicaCount - = 1> -# Number of app pod replicas to launch in the load-balancing group. -# -# Tips: -# - when troubleshooting, set to 1 to avoid dealing with complications of load-balanced traffic -replicaCount: 1 +global: + awsRegion: us-east-1 + appName: gamechanger + # main domain for the application dev.advana.us for dev tests.advana.us for test + baseDomain: "dev.advana.us" # advana.example.local + registry: docker.io + imagePullSecrets: {} -# startCommand - -# Entrypoint/command to be executed by the main application pod. -# Will completely override any entrypoint/cmd baked into the container. -# -# Tips: -# - when troubleshooting, set to ["sleep", "infinity"] then exec into container and tweak/relaunch app as necessary -startCommand: - - node - - index.js +# DEFAULT VALUES +vaultKey: kv/aws-us-gov/default/prod # scripts - # BASH scripts that run during various points in the deployment @@ -39,37 +35,11 @@ scripts: echo "This job runs every time helm upgrade/install runs, unless explicitly disabled" echo "Can be disabled at will by setting scripts.runOneTimeJob=false" -# probes - -# Probes for determining pod/container health, as per ... -# https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ -# -# Tips: -# - if troubleshooting, set to empty object {}; to avoid k8s restarting container and blocking traffic to it -probes: {} - -# podAnnotations - additional pod annotations -podAnnotations: - iam.amazonaws.com/role: advana/k8s/s3.wildcard - -# service - -# Port details of the service used to open application pod to connections from outside. -# Note: must be of type NodePort and only http/https keys are supported. -# For syntax, refer to service.spec.ports[*] definitions of the NodePort service https://kubernetes.io/docs/concepts/services-networking/service/#nodeport -service: - http: - port: 80 - targetPort: 8990 - protocol: TCP - name: http - https: - port: 443 - targetPort: 8443 - protocol: TCP - name: https - # image - # Main app image details - also used to run all jobs defined in .Values.scripts image: + registry: 092912502985.dkr.ecr.us-east-1.amazonaws.com + repository: advana/gamechanger/gamechanger-web pullPolicy: Always tag: "latest" @@ -82,21 +52,98 @@ nameOverride: "" # Has no effect on helm-provided .Chart.Name variable. fullnameOverride: "" -# podSecurityContext - -# Sets security context for main application and job pods. -# This primarily comes into play when mounting files and volumes, but has other uses. -# For more on what goes in here, reference https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -podSecurityContext: - fsGroup: 1001 +# deployment - +# Sets all configuration for the deployment resource yaml. +# +# TODO: done, tplify secret name for envFrom +deployment: + web: + autoscaling: + enabled: false + # replicaCount - = 1> + # Number of app pod replicas to launch in the load-balancing group. + # + # Tips: + # - when troubleshooting, set to 1 to avoid dealing with complications of load-balanced traffic + replicaCount: 1 + # podAnnotations - additional pod annotations + podAnnotations: + checksum/env-config-secret: 2660c5692715b67c1b913eda4cc32d3f5df69736a1dca4b92a9aa1fb0f2f10a0 + checksum/file-config-secret: a65095aa0d9e48d2e2280cfbd183ac6c1695ade9d5b6c6ad126c75f1815afc33 + iam.amazonaws.com/role: advana/k8s/s3.wildcard + serviceAccountName: "{{ .Release.Name}}-gamechanger-web" + initContainer: {} + container: + gamechanger-web: + securityContext: + allowPrivilegeEscalation: false + runAsGroup: 1001 + runAsUser: 1001 + # startCommand - + # Entrypoint/command to be executed by the main application pod. + # Will completely override any entrypoint/cmd baked into the container. + # + # Tips: + # - when troubleshooting, set to ["sleep", "infinity"] then exec into container and tweak/relaunch app as necessary + command: + - "node" + - "index.js" + envFrom: + - secretRef: # TODO: done, need to make mr to template + name: '{{ .Release.Name | trunc 63 | trimSuffix "-" }}-{{ .Chart.Name }}.env-config-secret' + env: + REACT_APP_VERSION: '{{ default "1.0.0" .Chart.AppVersion }}' + resources: + requests: + cpu: "1" + memory: 512Mi + + # probes - + # Probes for determining pod/container health, as per ... + # https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ + # + # Tips: + # - if troubleshooting, set to empty object {}; to avoid k8s restarting container and blocking traffic to it + livenessProbe: + httpGet: + path: /health + port: 8443 + scheme: HTTPS + timeoutSeconds: 10 + readinessProbe: + httpGet: + path: /health + port: 8443 + scheme: HTTPS + timeoutSeconds: 10 + # service - + # Port details of the service used to open application pod to connections from outside. + # Note: must be of type NodePort and only http/https keys are supported. + # Only define service in the dev/test values. Advana-library chart will create another service if a different type is set in the default values.yaml + # For syntax, refer to service.spec.ports[*] definitions of the NodePort service https://kubernetes.io/docs/concepts/services-networking/service/#nodeport + # service: + # # Change this key between ClusterIP to NodePort as needed, making sure to comment out nodePort keys when using clusterIP. + # ClusterIP: #NodePort: + # ports: + # http: + # port: 80 + # protocol: TCP + # targetPort: 8990 + # # nodePort: 31007 + # https: + # port: 443 + # protocol: TCP + # targetPort: 8443 + # # nodePort: 31207 -# appContainerSecurityContext - +# podSecurityContext - # Security context for app and job containers. # It's useful to define this to match user-id and group-id of the application and its' files inside container # For more on what goes in here, reference https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -appContainerSecurityContext: +podSecurityContext: runAsUser: 1001 runAsGroup: 1001 - allowPrivilegeEscalation: false + # allowPrivilegeEscalation: false # serviceAccount - # Config of service account to be used by the app and job pods @@ -105,94 +152,108 @@ serviceAccount: # create - - whether to attempt creating the service account create: true # name - - override with custom name. useful if there is a pre-existing service account you should be using - name: "" + name: "{{ .Release.Name }}-gamechanger-web" -# @param external DNS subdomain; used to build sub-components FQDNs and configure web CORS (if enabled) -## -externalDomain: "" #"dev.advana.boozallencsn.com" ingress: enabled: false - ## @param ingress.certManager Set to true to add the `kubernetes.io/tls-acme: "true"` annotation to gamechanger ingresses - ## - certManager: true - ## @param ingress.controller The ingress controller type. Currently supports `default`, `gce` and `ncp` - ## leave as `default` for most ingress controllers. - ## set to `gce` if using the GCE ingress controller - ## set to `ncp` if using the NCP (NSX-T Container Plugin) ingress controller - ## - controller: default - ingressClassName: "" - serversnippets: | + tls: true + className: nginx # set if default IngressClass is not configured + annotations: + ingress.kubernetes.io/ssl-redirect: "true" + ingress.kubernetes.io/proxy-body-size: "0" + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" + nginx.ingress.kubernetes.io/proxy-body-size: "0" + nginx.ingress.kubernetes.io/server-snippet: | underscores_in_headers on; - web: - enabled: true - hostname: gamechanger - ## @param ingress.web.pathType Ingress path type - ## - pathType: ImplementationSpecific - ## @param ingress.web.annotations [object] Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. - ## Use this parameter to set the required annotations for cert-manager, see - ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations - ## e.g: - ## annotations: - ## kubernetes.io/ingress.class: nginx - ## cert-manager.io/cluster-issuer: cluster-issuer-name - ## - annotations: - ingress.kubernetes.io/ssl-redirect: "true" - ingress.kubernetes.io/proxy-body-size: "0" - nginx.ingress.kubernetes.io/ssl-redirect: "true" - nginx.ingress.kubernetes.io/proxy-body-size: "0" - tls: true - tlsSecretName: "advana.us-wildcard-tls" - ## @param ingress.web.selfSigned Create a TLS secret for this ingress record using self-signed certificates generated by Helm - ## - selfSigned: false - ## @param ingress.web.extraHosts An array with additional hostname(s) to be covered with the ingress record - ## e.g: - ## extraHosts: - ## - name: web.gamechanger.domain - ## path: / - ## - extraHosts: [] - ## @param ingress.web.secrets Custom TLS certificates as secrets - ## NOTE: 'key' and 'certificate' are expected in PEM format - ## NOTE: 'name' should line up with a 'secretName' set further up - ## If it is not set and you're using cert-manager, this is unneeded, as it will create a secret for you with valid certificates - ## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created valid for 365 days - ## It is also possible to create and manage the certificates outside of this helm chart - ## Please see README.md for more information - ## e.g: - ## secrets: - ## - name: web.gamechanger.domain-tls - ## key: |- - ## -----BEGIN RSA PRIVATE KEY----- - ## ... - ## -----END RSA PRIVATE KEY----- - ## certificate: |- - ## -----BEGIN CERTIFICATE----- - ## ... - ## -----END CERTIFICATE----- - ## - secrets: [] -# resources - -# Defines minimum and maximum cpu/memory requirements for each application pod (except one-time-job pods) -# For more on what goes in here, reference https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ -resources: - requests: - memory: "512Mi" - cpu: "1" - -# env - -# Map of environment variables to be defined for all containers (app & jobs) -# Keys correspond to env-var names (capitalization is important) and values are interpreted as strings -env: {} - -# fileConfig - -# Configuration for various text content meant to be exposed inside app containers as files rather than env vars -# This is useful for secrets and config files that are too long to be used as env vars (e.g. CA certificate bundles) -fileConfig: - # baseMountPath - - directory where the fileConfig.files will be exposed as actual files - baseMountPath: "/opt/app-root/src/secrets/" - # files - - files to be mounted in the baseMountPath. Key corresponds to filename, Value correspond to content. - files: {} + domain: "{{ $.Values.global.appName }}.{{ $.Values.global.baseDomain }}" + # hosts: + # "{{ $.Values.ingress.domain }}": + # paths: + # - path: / + # pathType: Prefix + # deploymentName: web-deployment + # serviceType: Nodeport + # serviceName: https + +############################################################################### +## Environment Specific Secret Values ## +############################################################################### + +secret: + ingress: + tls: + "{{ $.Values.ingress.domain }}": + # reference existing tls secret + secretName: advana.us-wildcard-tls + # or define new tls secret + # tls.crt: | + # -----BEGIN CERTIFICATE----- + # tls-crt + # -----END CERTIFICATE----- + # tls.key: | + # -----BEGIN RSA PRIVATE KEY----- + # tls-key + # -----END RSA PRIVATE KEY----- + + # public values that are stored as a secret object for convenience, remove if using values from vault + # put values from values.env here + env: + # secret - + # Map of environment variables to be defined for all containers (app & jobs) + # Keys correspond to env-var names (capitalization is important) and values are interpreted as strings + secret: + '{{ include "chart.envConfigSecretName" . }}': # TODO: done, how to use templated key as secret name + +secretstore: + "vault": + kind: ClusterSecretStore + externalsecret: + '{{ include "chart.envConfigSecretNameVault" . }}': # TODO: done, make MR to externalsecret template to tplify name + data: + - secretKey: TLS_KEY + remoteRef: + key: '{{ include "chart.vaultCertsKey" . }}' + property: key + - secretKey: TLS_CERT + remoteRef: + key: '{{ include "chart.vaultCertsKey" . }}' + property: cert + - secretKey: TLS_CA + remoteRef: + key: '{{ include "chart.vaultCertsKey" . }}' + property: ca + - secretKey: TLS_KEY_PASSPHRASE + remoteRef: + key: '{{ include "chart.vaultCertsKey" . }}' + property: passphrase + +# job - +# +# +job: + '{{ include "chart.oneTimeJobName" . }}': + podAnnotations: + checksum/secrets: '{{ include (print .Template.BasePath "/secrets.yaml") . | sha256sum }}' + restartPolicy: Never + container: + "init-scripts": + command: ["/bin/bash", "-c"] + args: + - | + {{- .Values.scripts.oneTimeJobScript | trim | nindent 16 }} + env: + REACT_APP_VERSION: '{{ default "1.0.0" .Chart.AppVersion }}' + envFrom: + - secretRef: + name: '{{ include "chart.envConfigSecretName" . }}' + +# volume - +# Configure which resources to attach to all pods as a volume +volume: + secret: + file-config-vol: + secretName: '{{ include "chart.fileConfigSecretName" . }}' + volumeMount: + mountPath: /opt/app-root/src/secrets/ + readOnly: true From 0e03bf23da5d18f5e3e2c3d6d3fa0d336137bc0d Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Wed, 1 Feb 2023 08:58:23 -0800 Subject: [PATCH 07/45] update expected test result for getElasticsearchQuery() --- backend/test/utils/searchUtility.test.js | 222 ++++++++++------------- 1 file changed, 97 insertions(+), 125 deletions(-) diff --git a/backend/test/utils/searchUtility.test.js b/backend/test/utils/searchUtility.test.js index 74109de3a..11adc5eba 100644 --- a/backend/test/utils/searchUtility.test.js +++ b/backend/test/utils/searchUtility.test.js @@ -1293,64 +1293,38 @@ describe('SearchUtility', function () { typeFilterString: [], }); const expected = { - _source: { - includes: ['pagerank_r', 'kw_doc_score_r', 'orgs_rs', 'topics_s'], + _source: { includes: ['pagerank_r', 'kw_doc_score_r', 'orgs_rs', 'topics_s'] }, + aggregations: { + doc_org_aggs: { terms: { field: 'display_org_s', size: 10000 } }, + doc_type_aggs: { terms: { field: 'display_doc_type_s', size: 10000 } }, }, - stored_fields: [ - 'filename', - 'title', - 'page_count', - 'doc_type', - 'doc_num', - 'ref_list', - 'id', - 'summary_30', - 'keyw_5', - 'p_text', - 'type', - 'p_page', - 'display_title_s', - 'display_org_s', - 'display_doc_type_s', - 'is_revoked_b', - 'access_timestamp_dt', - 'publication_date_dt', - 'crawler_used_s', - 'download_url_s', - 'source_page_url_s', - 'source_fqdn_s', - 'topics_s', - 'top_entities_t', - ], from: 0, - size: 20, - aggregations: { - doc_type_aggs: { - terms: { - field: 'display_doc_type_s', - size: 10000, - }, - }, - doc_org_aggs: { - terms: { - field: 'display_org_s', - size: 10000, - }, + highlight: { + boundary_scanner: 'word', + fields: { + 'display_source_s.search': {}, + 'display_title_s.search': {}, + 'filename.search': {}, + keyw_5: {}, + top_entities_t: {}, + topics_s: {}, }, + fragment_size: 10, + fragmenter: 'simple', + require_field_match: false, + type: 'unified', }, - track_total_hits: true, query: { bool: { + filter: [{ term: { is_revoked_b: 'false' } }], + minimum_should_match: 1, must: [], should: [ { nested: { - path: 'paragraphs', inner_hits: { _source: false, - stored_fields: ['paragraphs.page_num_i', 'paragraphs.par_raw_text_t'], from: 0, - size: 100, highlight: { fields: { 'paragraphs.par_raw_text_t': { @@ -1366,7 +1340,10 @@ describe('SearchUtility', function () { }, fragmenter: 'span', }, + size: 100, + stored_fields: ['paragraphs.page_num_i', 'paragraphs.par_raw_text_t'], }, + path: 'paragraphs', query: { bool: { should: [ @@ -1378,7 +1355,7 @@ describe('SearchUtility', function () { fuzzy_max_expansions: 100, fuzziness: 'AUTO', analyzer: 'gc_english', - boost: 0.5, + boost: 0.05, }, }, ], @@ -1388,106 +1365,101 @@ describe('SearchUtility', function () { }, }, { - wildcard: { - keyw_5: { - value: '*artificial intelligence*', - boost: 5, - }, - }, - }, - { - wildcard: { - 'display_title_s.search': { - value: '*artificial intelligence*', - boost: 15, - case_insensitive: true, - }, - }, - }, - { - fuzzy: { - 'display_title_s.search': { - value: 'artificial intelligence', - fuzziness: 'AUTO', - transpositions: false, - boost: 15, - }, - }, - }, - { - wildcard: { - 'filename.search': { - value: '*artificial intelligence*', - boost: 10, - case_insensitive: true, - }, + dis_max: { + boost: 150, + queries: [ + { + wildcard: { + 'display_title_s.search': { + case_insensitive: true, + value: '*artificial intelligence*', + }, + }, + }, + { + fuzzy: { + 'display_title_s.search': { + fuzziness: 'AUTO', + transpositions: false, + value: 'artificial intelligence', + }, + }, + }, + { match_phrase: { 'display_title_s.search': 'artificial intelligence' } }, + { + wildcard: { + 'filename.search': { + case_insensitive: true, + value: '*artificial intelligence*', + }, + }, + }, + { wildcard: { doc_num: { value: '*artificial intelligence*' } } }, + { term: { doc_num: { value: 'artificial intelligence' } } }, + ], }, }, { - wildcard: { - 'display_source_s.search': { - value: '*artificial intelligence*', - boost: 4, - }, + dis_max: { + boost: 5, + queries: [ + { + wildcard: { + 'top_entities_t.search': { value: '*artificial intelligence*' }, + }, + }, + { wildcard: { keyw_5: { value: '*artificial intelligence*' } } }, + ], }, }, { wildcard: { - 'top_entities_t.search': { - value: '*artificial intelligence*', - boost: 5, - }, - }, - }, - { - match_phrase: { - 'display_title_s.search': 'artificial intelligence', + 'display_source_s.search': { boost: 10, value: '*artificial intelligence*' }, }, }, { query_string: { + analyzer: 'gc_english', + boost: 10, fields: ['display_title_s.search'], query: '*artificial* AND *intelligence*', type: 'best_fields', - boost: 10, - analyzer: 'gc_english', - }, - }, - ], - minimum_should_match: 1, - filter: [ - { - term: { - is_revoked_b: 'false', }, }, ], }, }, - highlight: { - require_field_match: false, - fields: { - 'display_title_s.search': {}, - keyw_5: {}, - 'filename.search': {}, - 'display_source_s.search': {}, - top_entities_t: {}, - topics_s: {}, - }, - fragment_size: 10, - fragmenter: 'simple', - type: 'unified', - boundary_scanner: 'word', - }, - sort: [ - { - _score: { - order: 'desc', - }, - }, - { _id: 'desc' }, + size: 20, + sort: [{ _score: { order: 'desc' } }, { _id: 'desc' }], + stored_fields: [ + 'filename', + 'title', + 'page_count', + 'doc_type', + 'doc_num', + 'ref_list', + 'id', + 'summary_30', + 'keyw_5', + 'p_text', + 'type', + 'p_page', + 'display_title_s', + 'display_org_s', + 'display_doc_type_s', + 'is_revoked_b', + 'access_timestamp_dt', + 'publication_date_dt', + 'crawler_used_s', + 'download_url_s', + 'source_page_url_s', + 'source_fqdn_s', + 'topics_s', + 'top_entities_t', ], + track_total_hits: true, }; + assert.deepStrictEqual(actual, expected); }); From 9f481e7b4dcc8db8d431f26078e0bed8fb982282 Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Wed, 1 Feb 2023 09:11:49 -0800 Subject: [PATCH 08/45] update expected test result for getSingleDocumentHelper() --- .../modules/policy/policyGraphHandler.test.js | 380 +++++++++--------- 1 file changed, 201 insertions(+), 179 deletions(-) diff --git a/backend/test/modules/policy/policyGraphHandler.test.js b/backend/test/modules/policy/policyGraphHandler.test.js index f33f29f0e..be272cc58 100644 --- a/backend/test/modules/policy/policyGraphHandler.test.js +++ b/backend/test/modules/policy/policyGraphHandler.test.js @@ -3026,184 +3026,25 @@ describe('PolicyGraphHandler', function () { try { const actual = await target.callFunctionHelper(req, 'test'); const expected = { - query: { - _source: { includes: ['pagerank_r', 'kw_doc_score_r', 'orgs_rs', 'topics_s'] }, - stored_fields: [ - 'filename', - 'title', - 'page_count', - 'doc_type', - 'doc_num', - 'ref_list', - 'id', - 'summary_30', - 'keyw_5', - 'p_text', - 'type', - 'p_page', - 'display_title_s', - 'display_org_s', - 'display_doc_type_s', - 'is_revoked_b', - 'access_timestamp_dt', - 'publication_date_dt', - 'crawler_used_s', - 'download_url_s', - 'source_page_url_s', - 'source_fqdn_s', - 'topics_s', - 'top_entities_t', - ], - from: 0, - size: 20, - aggregations: { - doc_type_aggs: { terms: { field: 'display_doc_type_s', size: 10000 } }, - doc_org_aggs: { terms: { field: 'display_org_s', size: 10000 } }, - }, - track_total_hits: true, - query: { - bool: { - must: [], - should: [ - { - nested: { - path: 'paragraphs', - inner_hits: { - _source: false, - stored_fields: ['paragraphs.page_num_i', 'paragraphs.par_raw_text_t'], - from: 0, - size: 100, - highlight: { - fields: { - 'paragraphs.par_raw_text_t': { - fragment_size: 270, - number_of_fragments: 1, - type: 'plain', - }, - 'paragraphs.par_raw_text_t.gc_english': { - fragment_size: 270, - number_of_fragments: 1, - type: 'plain', - }, - }, - fragmenter: 'span', - }, - }, - query: { - bool: { - should: [ - { - query_string: { - query: 'artificial intelligence', - default_field: 'paragraphs.par_raw_text_t.gc_english', - default_operator: 'and', - fuzzy_max_expansions: 100, - fuzziness: 'AUTO', - analyzer: 'gc_english', - boost: 0.5, - }, - }, - ], - }, - }, - score_mode: 'sum', - }, - }, - { wildcard: { keyw_5: { value: '*artificial intelligence*', boost: 5 } } }, - { - wildcard: { - 'display_title_s.search': { - value: '*artificial intelligence*', - boost: 15, - case_insensitive: true, - }, - }, - }, - { - fuzzy: { - 'display_title_s.search': { - value: 'artificial intelligence', - fuzziness: 'AUTO', - transpositions: false, - boost: 15, - }, - }, - }, - { - wildcard: { - 'filename.search': { - value: '*artificial intelligence*', - boost: 10, - case_insensitive: true, - }, - }, - }, - { - wildcard: { - 'display_source_s.search': { value: '*artificial intelligence*', boost: 4 }, - }, - }, - { - wildcard: { - 'top_entities_t.search': { value: '*artificial intelligence*', boost: 5 }, - }, - }, - { match_phrase: { 'display_title_s.search': 'artificial intelligence' } }, - { - query_string: { - fields: ['display_title_s.search'], - query: '*artificial* AND *intelligence*', - type: 'best_fields', - boost: 10, - analyzer: 'gc_english', - }, - }, - ], - minimum_should_match: 1, - filter: [{ term: { is_revoked_b: 'false' } }, { terms: { id: ['Test'] } }], - }, - }, - highlight: { - require_field_match: false, - fields: { - 'display_title_s.search': {}, - keyw_5: {}, - 'filename.search': {}, - 'display_source_s.search': {}, - top_entities_t: {}, - topics_s: {}, - }, - fragment_size: 10, - fragmenter: 'simple', - type: 'unified', - boundary_scanner: 'word', - }, - sort: [{ _score: { order: 'desc' } }, { _id: 'desc' }], - }, - totalCount: 1, + doc_orgs: [], + doc_types: [], docs: [ { - display_title_s: 'DoDI 5000.02T: Operation of the Defense Acquisition System', - display_org_s: 'Dept. of Defense', + access_timestamp_dt: '2021-07-13T23:23:37', crawler_used_s: 'dod_issuances', + current_as_of: 'TEST', + display_doc_type_s: 'Instruction', + display_org_s: 'Dept. of Defense', + display_title_s: 'DoDI 5000.02T: Operation of the Defense Acquisition System', doc_num: '5000.02T', - summary_30: '', - top_entities_t: [ - 'DoD', - 'Program', - 'DoD Instruction', - 'HSI', - 'the Defense Acquisition System', - ], - topics_s: ['acquisition', 'enclosure', 'instruction', 'cybersecurity', 'change enclosure'], doc_type: 'DoDI', - title: 'Operation of the Defense Acquisition System', - type: 'document', - keyw_5: 'dodi 02t, formal coordination, information technology, formal coordinatio, acquisition programs, usd pubs@osd, training plans, systems engineering, qualification criteria, national intelligence', + esIndex: 'gamechanger', filename: 'DoDI 5000.02T CH 10.pdf', - access_timestamp_dt: '2021-07-13T23:23:37', id: 'DoDI 5000.02T CH 10.pdf_0', - display_doc_type_s: 'Instruction', + keyw_5: 'dodi 02t, formal coordination, information technology, formal coordinatio, acquisition programs, usd pubs@osd, training plans, systems engineering, qualification criteria, national intelligence', + pageHits: [], + page_count: 27, + publication_date_dt: '2015-01-07T00:00:00', ref_list: [ 'DoD 5000.04-M', 'DoD 5015.02-STD', @@ -3270,17 +3111,198 @@ describe('PolicyGraphHandler', function () { 'OMBM M-04-16', 'OMBM M-05-25', ], - publication_date_dt: '2015-01-07T00:00:00', - page_count: 27, - pageHits: [], - esIndex: 'gamechanger', - current_as_of: 'TEST', + summary_30: '', + title: 'Operation of the Defense Acquisition System', + top_entities_t: [ + 'DoD', + 'Program', + 'DoD Instruction', + 'HSI', + 'the Defense Acquisition System', + ], + topics_s: ['acquisition', 'enclosure', 'instruction', 'cybersecurity', 'change enclosure'], + type: 'document', }, ], - doc_types: [], - doc_orgs: [], - searchTerms: ['artificial', 'intelligence'], expansionDict: null, + query: { + _source: { includes: ['pagerank_r', 'kw_doc_score_r', 'orgs_rs', 'topics_s'] }, + aggregations: { + doc_org_aggs: { terms: { field: 'display_org_s', size: 10000 } }, + doc_type_aggs: { terms: { field: 'display_doc_type_s', size: 10000 } }, + }, + from: 0, + highlight: { + boundary_scanner: 'word', + fields: { + 'display_source_s.search': {}, + 'display_title_s.search': {}, + 'filename.search': {}, + keyw_5: {}, + top_entities_t: {}, + topics_s: {}, + }, + fragment_size: 10, + fragmenter: 'simple', + require_field_match: false, + type: 'unified', + }, + query: { + bool: { + filter: [{ term: { is_revoked_b: 'false' } }, { terms: { id: ['Test'] } }], + minimum_should_match: 1, + must: [], + should: [ + { + nested: { + inner_hits: { + _source: false, + from: 0, + highlight: { + fields: { + 'paragraphs.par_raw_text_t': { + fragment_size: 270, + number_of_fragments: 1, + type: 'plain', + }, + 'paragraphs.par_raw_text_t.gc_english': { + fragment_size: 270, + number_of_fragments: 1, + type: 'plain', + }, + }, + fragmenter: 'span', + }, + size: 100, + stored_fields: ['paragraphs.page_num_i', 'paragraphs.par_raw_text_t'], + }, + path: 'paragraphs', + query: { + bool: { + should: [ + { + query_string: { + query: 'artificial intelligence', + default_field: 'paragraphs.par_raw_text_t.gc_english', + default_operator: 'and', + fuzzy_max_expansions: 100, + fuzziness: 'AUTO', + analyzer: 'gc_english', + boost: 0.05, + }, + }, + ], + }, + }, + score_mode: 'sum', + }, + }, + { + dis_max: { + boost: 150, + queries: [ + { + wildcard: { + 'display_title_s.search': { + value: '*artificial intelligence*', + case_insensitive: true, + }, + }, + }, + { + fuzzy: { + 'display_title_s.search': { + value: 'artificial intelligence', + fuzziness: 'AUTO', + transpositions: false, + }, + }, + }, + { + match_phrase: { + 'display_title_s.search': 'artificial intelligence', + }, + }, + { + wildcard: { + 'filename.search': { + value: '*artificial intelligence*', + case_insensitive: true, + }, + }, + }, + { wildcard: { doc_num: { value: '*artificial intelligence*' } } }, + { term: { doc_num: { value: 'artificial intelligence' } } }, + ], + }, + }, + { + dis_max: { + boost: 5, + queries: [ + { + wildcard: { + 'top_entities_t.search': { + value: '*artificial intelligence*', + }, + }, + }, + { wildcard: { keyw_5: { value: '*artificial intelligence*' } } }, + ], + }, + }, + { + wildcard: { + 'display_source_s.search': { + boost: 10, + value: '*artificial intelligence*', + }, + }, + }, + { + query_string: { + analyzer: 'gc_english', + boost: 10, + fields: ['display_title_s.search'], + query: '*artificial* AND *intelligence*', + type: 'best_fields', + }, + }, + ], + }, + }, + size: 20, + sort: [{ _score: { order: 'desc' } }, { _id: 'desc' }], + stored_fields: [ + 'filename', + 'title', + 'page_count', + 'doc_type', + 'doc_num', + 'ref_list', + 'id', + 'summary_30', + 'keyw_5', + 'p_text', + 'type', + 'p_page', + 'display_title_s', + 'display_org_s', + 'display_doc_type_s', + 'is_revoked_b', + 'access_timestamp_dt', + 'publication_date_dt', + 'crawler_used_s', + 'download_url_s', + 'source_page_url_s', + 'source_fqdn_s', + 'topics_s', + 'top_entities_t', + ], + track_total_hits: true, + }, + searchTerms: ['artificial', 'intelligence'], + totalCount: 1, }; assert.deepStrictEqual(actual, expected); From 3e81518b9f78961ba0e4b51327c8e3f8e9287dc4 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 09:16:29 -0800 Subject: [PATCH 09/45] update react-scripts to latest --- frontend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 0e73f685d..a77c21690 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -70,7 +70,7 @@ "react-motion": "0.5.2", "react-pdf-highlighter": "5.3.0", "react-router-dom": "5.1.2", - "react-scripts": "4.0.3", + "react-scripts": "5.0.1", "react-table": "6.11.5", "react-tabs": "2.2.2", "react-text-annotate": "0.3.0", @@ -163,4 +163,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file From 62403d3d4e393132b0264b35851e03b6755914e0 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 10:34:06 -0800 Subject: [PATCH 10/45] fix chart name --- chart/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/Chart.yaml b/chart/Chart.yaml index fa8b3cfe7..8a2a37d55 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: gamechanger-web +name: gamechanger-web-source description: A Helm chart for Kubernetes type: application From e9e1351edd11ac71984785a91fdba313b3d20b29 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 11:48:54 -0800 Subject: [PATCH 11/45] add https-browserify to deal with webpack/react-scripts upgrade? --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index a77c21690..1d34e7ad5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,6 +45,7 @@ "html-react-parser": "1.2.4", "html2canvas": "1.1.4", "html2pdf.js": "0.10.1", + "https-browserify": "1.0.0", "js-file-download": "0.4.12", "jws": "3.1.4", "lodash": "4.17.21", From e2ef1385c43687d415b7450c434f89f58a6805c7 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 13:28:01 -0800 Subject: [PATCH 12/45] revert package version changes, try add webpack.config.js --- frontend/package.json | 3 +-- frontend/webpack.config.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 frontend/webpack.config.js diff --git a/frontend/package.json b/frontend/package.json index 1d34e7ad5..ebb05ee62 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,7 +45,6 @@ "html-react-parser": "1.2.4", "html2canvas": "1.1.4", "html2pdf.js": "0.10.1", - "https-browserify": "1.0.0", "js-file-download": "0.4.12", "jws": "3.1.4", "lodash": "4.17.21", @@ -71,7 +70,7 @@ "react-motion": "0.5.2", "react-pdf-highlighter": "5.3.0", "react-router-dom": "5.1.2", - "react-scripts": "5.0.1", + "react-scripts": "4.0.3", "react-table": "6.11.5", "react-tabs": "2.2.2", "react-text-annotate": "0.3.0", diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js new file mode 100644 index 000000000..c53d3fee8 --- /dev/null +++ b/frontend/webpack.config.js @@ -0,0 +1,17 @@ +const config = { + mode: 'production', // "production" | "development" | "none" + resolve: { + extensions: ['*', '.mjs', '.js', '.json'] + }, + module: { + rules: [ + { + test: /\.mjs$/, + include: /node_modules/, + type: 'javascript/auto' + } + ] + } +} + +module.exports = config \ No newline at end of file From e3ae54cbe05c5eecc2b2d7a1b7cd21116ffa0e2f Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 14:40:49 -0800 Subject: [PATCH 13/45] follow https://github.com/facebook/create-react-app/issues/11756\#issuecomment-1001162736 --- frontend/config-overrides.js | 14 ++++++++++++++ frontend/package.json | 11 ++++++----- frontend/webpack.config.js | 17 ----------------- 3 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 frontend/config-overrides.js delete mode 100644 frontend/webpack.config.js diff --git a/frontend/config-overrides.js b/frontend/config-overrides.js new file mode 100644 index 000000000..f434e943d --- /dev/null +++ b/frontend/config-overrides.js @@ -0,0 +1,14 @@ +const webpack = require('webpack'); +module.exports = function override(config, env) { + config.resolve.fallback = { + https: require.resolve('https-browserify'), + }; + config.plugins.push( + new webpack.ProvidePlugin({ + process: 'process/browser', + Buffer: ['buffer', 'Buffer'], + }), + ); + + return config; +} diff --git a/frontend/package.json b/frontend/package.json index ebb05ee62..25a88d311 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,6 +45,7 @@ "html-react-parser": "1.2.4", "html2canvas": "1.1.4", "html2pdf.js": "0.10.1", + "https-browserify": "^1.0.0", "js-file-download": "0.4.12", "jws": "3.1.4", "lodash": "4.17.21", @@ -70,7 +71,7 @@ "react-motion": "0.5.2", "react-pdf-highlighter": "5.3.0", "react-router-dom": "5.1.2", - "react-scripts": "4.0.3", + "react-scripts": "5.0.1", "react-table": "6.11.5", "react-tabs": "2.2.2", "react-text-annotate": "0.3.0", @@ -110,15 +111,15 @@ "scripts": { "109": "REACT_APP_GLUU_SSO=disabled REACT_APP_NODE_ENV=test109 yarn start", "analyze": "source-map-explorer 'build/static/js/*.js'", - "start": "react-scripts start", + "start": "react-app-rewired start", "dev": "REACT_APP_GLUU_SSO=disabled REACT_APP_NODE_ENV=development PORT=8080 yarn start", "devDecoupled": "REACT_APP_GLUU_SSO=disabled NODE_ENV=development REACT_APP_NODE_ENV=development REACT_APP_GC_DECOUPLED=1 yarn start", - "awsDocker": "REACT_APP_GLUU_SSO=disabled REACT_APP_NODE_ENV=aws PORT=8080 react-scripts --max_old_space_size=8096 start", - "build": "DISABLE_ESLINT_PLUGIN=true react-scripts --max_old_space_size=16000 build && npx compress-cra", + "awsDocker": "REACT_APP_GLUU_SSO=disabled REACT_APP_NODE_ENV=aws PORT=8080 react-app-rewired --max_old_space_size=8096 start", + "build": "DISABLE_ESLINT_PLUGIN=true react-app-rewired --max_old_space_size=16000 build && npx compress-cra", "test": "jest --watch", "jenkins-test": "jest", "test-coverage": "jest --coverage --coverageDirectory=coverage/jest", - "eject": "react-scripts eject", + "eject": "react-app-rewired eject", "jest-coverage": "jest --coverage", "sonarscan": "sonar-scanner", "eslint": "eslint --max-warnings 0 --fix --debug -c .eslintrc.json ./src/", diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js deleted file mode 100644 index c53d3fee8..000000000 --- a/frontend/webpack.config.js +++ /dev/null @@ -1,17 +0,0 @@ -const config = { - mode: 'production', // "production" | "development" | "none" - resolve: { - extensions: ['*', '.mjs', '.js', '.json'] - }, - module: { - rules: [ - { - test: /\.mjs$/, - include: /node_modules/, - type: 'javascript/auto' - } - ] - } -} - -module.exports = config \ No newline at end of file From 6a4726ac077c50109cd49f4044ca9d13341672c7 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 15:47:53 -0800 Subject: [PATCH 14/45] actually add react-app-rewired to package.json --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index 25a88d311..2b6d8c394 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -57,6 +57,7 @@ "pluralize": "8.0.0", "prop-types": "15.8.1", "react": "18.2.0", + "react-app-rewired": "2.2.1", "react-bottom-scroll-listener": "5.0.0", "react-collapse": "4.0.3", "react-datepicker": "3.3.0", From 82877add0fe740d4d4d176817300540c4ea5e739 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Wed, 1 Feb 2023 16:34:45 -0800 Subject: [PATCH 15/45] exact ver for https-browserify --- frontend/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/package.json b/frontend/package.json index 2b6d8c394..1966f30cf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,7 +45,7 @@ "html-react-parser": "1.2.4", "html2canvas": "1.1.4", "html2pdf.js": "0.10.1", - "https-browserify": "^1.0.0", + "https-browserify": "1.0.0", "js-file-download": "0.4.12", "jws": "3.1.4", "lodash": "4.17.21", From 4dd89c0f07139fbbad811a5d8bae578c48883456 Mon Sep 17 00:00:00 2001 From: Segerlu <111815126+Segerlu@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:46:42 -0500 Subject: [PATCH 16/45] Allows recently viewed section to hold 10 cards. adjusted query to only select distinct rows and ignore documen t trailing information --- .../controllers/appStatsController.js | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/backend/node_app/controllers/appStatsController.js b/backend/node_app/controllers/appStatsController.js index 7f1c7f865..58cb2fd07 100644 --- a/backend/node_app/controllers/appStatsController.js +++ b/backend/node_app/controllers/appStatsController.js @@ -288,18 +288,20 @@ class AppStatsController { connection.query( ` select - b.name as document, - CONVERT_TZ(a.server_time,'UTC','EST') as documenttime - from - matomo_log_link_visit_action a, - matomo_log_action b - where - a.idaction_name = b.idaction - and b.name like 'PDFViewer%gamechanger' - and hex(a.idvisitor) in (?) - order by - documenttime desc - limit 10`, + SUBSTRING_INDEX(b.name, '-', 2) as document, + max(CONVERT_TZ(a.server_time,'UTC','EST')) as documenttime + from + matomo_log_link_visit_action a, + matomo_log_action b + where + a.idaction_name = b.idaction + and b.name like 'PDFViewer%gamechanger' + and hex(a.idvisitor) in (?) + group by + document + order by + documenttime desc + limit 10`, [userId], (error, results) => { if (error) { From d574411a8690b76897bf8063111eae12f6ef8592 Mon Sep 17 00:00:00 2001 From: 627597 Date: Thu, 2 Feb 2023 12:49:52 -0500 Subject: [PATCH 17/45] reordered parameters to clickFn --- frontend/src/components/modules/policy/policyCardHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index f43894336..c7ba4e1f6 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -1346,9 +1346,9 @@ const renderPageHit = (page, key, hoveredHit, setHoveredHit, item, state, docume item.filename, state.cloneData.clone_name, state.searchText, - page.pageNumber, item.download_url_s, - documentIdx + documentIdx, + page.pageNumber ); }} > From f8324b272da27db9bcfcd477bf653e5975dd6846 Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Thu, 2 Feb 2023 11:00:12 -0800 Subject: [PATCH 18/45] try different config-overrides --- frontend/config-overrides.js | 24 ++++++++++++------------ frontend/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/config-overrides.js b/frontend/config-overrides.js index f434e943d..8c35e7c5d 100644 --- a/frontend/config-overrides.js +++ b/frontend/config-overrides.js @@ -1,14 +1,14 @@ -const webpack = require('webpack'); module.exports = function override(config, env) { - config.resolve.fallback = { - https: require.resolve('https-browserify'), - }; - config.plugins.push( - new webpack.ProvidePlugin({ - process: 'process/browser', - Buffer: ['buffer', 'Buffer'], - }), - ); + // New config, e.g. config.plugins.push... - return config; -} + config.module.rules = [...config.module.rules, + { + test: /\.m?js/, + resolve: { + fullySpecified: false + } + } + ] + + return config +} \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 1966f30cf..971ffdf6b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -120,7 +120,7 @@ "test": "jest --watch", "jenkins-test": "jest", "test-coverage": "jest --coverage --coverageDirectory=coverage/jest", - "eject": "react-app-rewired eject", + "eject": "react-scripts eject", "jest-coverage": "jest --coverage", "sonarscan": "sonar-scanner", "eslint": "eslint --max-warnings 0 --fix --debug -c .eslintrc.json ./src/", From 8f8d6f189162575cf2b7a7128cf5981f98809c88 Mon Sep 17 00:00:00 2001 From: 627597 Date: Thu, 2 Feb 2023 17:22:50 -0500 Subject: [PATCH 19/45] aligning calls to clickFn with current parameters --- .../modules/default/defaultCardHandler.js | 2 +- .../modules/policy/policyCardHandler.js | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/modules/default/defaultCardHandler.js b/frontend/src/components/modules/default/defaultCardHandler.js index 2aadf8028..684a20dcd 100644 --- a/frontend/src/components/modules/default/defaultCardHandler.js +++ b/frontend/src/components/modules/default/defaultCardHandler.js @@ -534,7 +534,7 @@ const getDisplayTitle = (item) => { return item.title; }; -export const clickFn = (filename, cloneName, searchText, sourceUrl, idx, pageNumber = 0) => { +export const clickFn = (filename, cloneName, searchText, sourceUrl, idx = null, pageNumber = 0) => { trackEvent( getTrackingNameForFactory(cloneName), 'CardInteraction', diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index c7ba4e1f6..921c72ce5 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -778,7 +778,16 @@ const getPublicationDate = (publication_date_dt) => { } }; -const CardHeaderHandler = ({ item, state, checkboxComponent, favoriteComponent, graphView, intelligentSearch }) => { +const CardHeaderHandler = ({ + item, + state, + checkboxComponent, + favoriteComponent, + graphView, + intelligentSearch, + idx, + page, +}) => { const [showDocIngestModal, setShowDocIngestModal] = useState(false); const displayTitle = getDisplayTitle(item); const isRevoked = item.is_revoked_b; @@ -792,9 +801,7 @@ const CardHeaderHandler = ({ item, state, checkboxComponent, favoriteComponent, const typeTextColor = getTypeTextColor(cardType); let { docTypeColor, docOrgColor } = getDocTypeStyles(displayType, displayOrg); - const publicationDate = getPublicationDate(item.publication_date_dt); - return ( undefined } @@ -1149,8 +1157,9 @@ const renderListViewPageHitsWithoutIntelligentSearch = ( item.filename, cloneName, searchText, - page.pageNumber, - item.download_url_s + item.download_url_s, + idx, + page.pageNumber ); }} > @@ -1262,8 +1271,9 @@ const renderListView = ( item.filename, cloneName, searchText, - page.pageNumber, - item.download_url_s + item.download_url_s, + idx, + page.pageNumber ); }} > @@ -1516,7 +1526,7 @@ const cardHandler = { href={'#'} onClick={(e) => { e.preventDefault(); - clickFn(filename, cloneName, searchText, 0, item.download_url_s); + clickFn(filename, cloneName, searchText, item.download_url_s, idx); }} > Open From ffa3fe6a5b1a625234f4c994c28ddb95a37b4608 Mon Sep 17 00:00:00 2001 From: 627597 Date: Thu, 2 Feb 2023 18:14:04 -0500 Subject: [PATCH 20/45] Corrected clickFn usages in jexnetCardHandler --- .../src/components/modules/jexnet/jexnetCardHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/modules/jexnet/jexnetCardHandler.js b/frontend/src/components/modules/jexnet/jexnetCardHandler.js index 784f715b5..738976ee3 100644 --- a/frontend/src/components/modules/jexnet/jexnetCardHandler.js +++ b/frontend/src/components/modules/jexnet/jexnetCardHandler.js @@ -199,7 +199,7 @@ const cardHandler = { item.filename, state.cloneData.clone_name, state.searchText, - page.pageNumber + null ); }} > @@ -277,6 +277,8 @@ const cardHandler = { item.filename, state.cloneData.clone_name, state.searchText, + null, + null, page.pageNumber ); }} @@ -361,6 +363,8 @@ const cardHandler = { item.filename, state.cloneData.clone_name, state.searchText, + null, + null, page.pageNumber ); }} @@ -436,7 +440,7 @@ const cardHandler = { href={'#'} onClick={(e) => { e.preventDefault(); - clickFn(filename, cloneName, searchText, 0); + clickFn(filename, cloneName, searchText, null); }} > Open From a38f58caee4d1429ac4de091838cfe0c99e877a3 Mon Sep 17 00:00:00 2001 From: 627597 Date: Thu, 2 Feb 2023 18:35:10 -0500 Subject: [PATCH 21/45] noticed a mistake --- frontend/src/components/modules/jexnet/jexnetCardHandler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/modules/jexnet/jexnetCardHandler.js b/frontend/src/components/modules/jexnet/jexnetCardHandler.js index 738976ee3..0808b5704 100644 --- a/frontend/src/components/modules/jexnet/jexnetCardHandler.js +++ b/frontend/src/components/modules/jexnet/jexnetCardHandler.js @@ -199,7 +199,9 @@ const cardHandler = { item.filename, state.cloneData.clone_name, state.searchText, - null + null, + null, + page.pageNumber ); }} > From d87dadd2e946bde9ff31f63ec1d883b4184872de Mon Sep 17 00:00:00 2001 From: Pete Sheurpukdi Date: Fri, 3 Feb 2023 10:10:56 -0800 Subject: [PATCH 22/45] get npm run build hotfix in --- frontend/config-overrides.js | 21 +++++++++------------ frontend/package.json | 5 ++--- frontend/yarn.lock | 15 +++++++++++---- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/frontend/config-overrides.js b/frontend/config-overrides.js index 8c35e7c5d..dc7131107 100644 --- a/frontend/config-overrides.js +++ b/frontend/config-overrides.js @@ -1,14 +1,11 @@ -module.exports = function override(config, env) { - // New config, e.g. config.plugins.push... +const webpack = require('webpack'); - config.module.rules = [...config.module.rules, - { - test: /\.m?js/, - resolve: { - fullySpecified: false - } - } - ] +module.exports = function override(config) { + config.module.rules.push({ + test: /\.mjs$/, + include: /node_modules/, + type: 'javascript/auto', + }); - return config -} \ No newline at end of file + return config; +}; diff --git a/frontend/package.json b/frontend/package.json index 971ffdf6b..25aae52fc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,7 +19,7 @@ "dependencies": { "@datapunt/matomo-tracker-react": "0.3.1", "@dod-advana/advana-platform-ui": "1.16.0", - "@dod-advana/advana-side-nav": "0.1.11", + "@dod-advana/advana-side-nav": "0.1.12", "@dod-advana/advana-tutorial-overlay": "0.2.4", "@emotion/react": "11.7.0", "@emotion/styled": "11.6.0", @@ -45,7 +45,6 @@ "html-react-parser": "1.2.4", "html2canvas": "1.1.4", "html2pdf.js": "0.10.1", - "https-browserify": "1.0.0", "js-file-download": "0.4.12", "jws": "3.1.4", "lodash": "4.17.21", @@ -72,7 +71,7 @@ "react-motion": "0.5.2", "react-pdf-highlighter": "5.3.0", "react-router-dom": "5.1.2", - "react-scripts": "5.0.1", + "react-scripts": "4.0.3", "react-table": "6.11.5", "react-tabs": "2.2.2", "react-text-annotate": "0.3.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 68a604f6c..6938e7138 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1248,10 +1248,10 @@ styled-components "5.2.3" underscore "1.13.1" -"@dod-advana/advana-side-nav@0.1.11": - version "0.1.11" - resolved "https://npm.pkg.github.com/download/@dod-advana/advana-side-nav/0.1.11/85ce1b25707c6073ca24f6ec025ffc3b0d4495f8#85ce1b25707c6073ca24f6ec025ffc3b0d4495f8" - integrity sha512-LNtSBK3BmqslGp8y0wyXMr7PDX8Kh941MESrb1ssdeOY6+hp+dKqrFMOsR7TjHBXg/alBkThWod7kBAsepAgcg== +"@dod-advana/advana-side-nav@0.1.12": + version "0.1.12" + resolved "https://npm.pkg.github.com/download/@dod-advana/advana-side-nav/0.1.12/b933c67f84073d6842fa1c9a9a64a7c3265f69be#b933c67f84073d6842fa1c9a9a64a7c3265f69be" + integrity sha512-HOE0+gPa4epAWahb0697kCm+ccaZgigTMwZS1QdYD1pzdU4CYxxkCnWoYvb56et85wYJFfwWqzNn2/xEGQQCrQ== dependencies: "@babel/plugin-proposal-class-properties" "7.13.0" "@babel/plugin-syntax-class-properties" "7.12.13" @@ -12456,6 +12456,13 @@ react-app-polyfill@^2.0.0: regenerator-runtime "^0.13.7" whatwg-fetch "^3.4.1" +react-app-rewired@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-2.2.1.tgz#84901ee1e3f26add0377ebec0b41bcdfce9fc211" + integrity sha512-uFQWTErXeLDrMzOJHKp0h8P1z0LV9HzPGsJ6adOtGlA/B9WfT6Shh4j2tLTTGlXOfiVx6w6iWpp7SOC5pvk+gA== + dependencies: + semver "^5.6.0" + react-bottom-scroll-listener@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/react-bottom-scroll-listener/-/react-bottom-scroll-listener-5.0.0.tgz#173ab652d2285ea8831a9b79f58d6fc70cf353d0" From ec2697b7b37a350d04b07685daaecd3c9c37d8ca Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Tue, 7 Feb 2023 16:43:16 -0500 Subject: [PATCH 23/45] Fixed snippet height --- frontend/src/components/cards/GCCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/cards/GCCard.js b/frontend/src/components/cards/GCCard.js index 989015690..a1b7b1887 100644 --- a/frontend/src/components/cards/GCCard.js +++ b/frontend/src/components/cards/GCCard.js @@ -93,7 +93,7 @@ const PolicyCardHandler = LoadableVisibility({ }, }); -const CARD_HEIGHT = 412; +const CARD_HEIGHT = 356; // Internet Explorer 6-11 const IS_IE = /*@cc_on!@*/ !!document.documentMode; From 0dd2986558a313ca5dae72e9aa6f225d02be007a Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Wed, 8 Feb 2023 10:04:15 -0500 Subject: [PATCH 24/45] current prog --- backend/node_app/modules/jbook/jbookExportHandler.js | 3 +++ backend/node_app/modules/jbook/jbookSearchUtility.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/backend/node_app/modules/jbook/jbookExportHandler.js b/backend/node_app/modules/jbook/jbookExportHandler.js index 8115dc097..c9cea5c94 100644 --- a/backend/node_app/modules/jbook/jbookExportHandler.js +++ b/backend/node_app/modules/jbook/jbookExportHandler.js @@ -84,6 +84,9 @@ class JBookExportHandler extends ExportHandler { cleanedReview = this.jbookSearchUtility.parseFields(findReview, false, 'reviewES'); } docs[i] = { ...doc, ...cleanedReview }; + console.log('AND NOW HERE is doc', doc); + console.log('AND NOW HERE is cleanedreview', cleanedReview); + console.log('AND HERE IS FULL DOC', docs[i]); } } diff --git a/backend/node_app/modules/jbook/jbookSearchUtility.js b/backend/node_app/modules/jbook/jbookSearchUtility.js index 915222c1c..6f405ed1b 100644 --- a/backend/node_app/modules/jbook/jbookSearchUtility.js +++ b/backend/node_app/modules/jbook/jbookSearchUtility.js @@ -34,6 +34,9 @@ class JBookSearchUtility { const mapping = this.getMapping(docType, fromFrontend); for (const field in data) { + if (field === 'id_s') { + continue; + } if (data[field] && data[field] !== null && Object.keys(mapping).includes(field) && doMapping) { const newKey = mapping[field].newName; newData[newKey] = mapping[field].processValue(data[field]); From 801f65f55fb018b4cbfd66de04f8570d26e81fc5 Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Wed, 8 Feb 2023 11:37:24 -0500 Subject: [PATCH 25/45] mainly changed environment variables --- frontend/src/components/modules/eda/edaSearchMatrixHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/modules/eda/edaSearchMatrixHandler.js b/frontend/src/components/modules/eda/edaSearchMatrixHandler.js index d823bb720..e8e4bcae3 100644 --- a/frontend/src/components/modules/eda/edaSearchMatrixHandler.js +++ b/frontend/src/components/modules/eda/edaSearchMatrixHandler.js @@ -200,7 +200,6 @@ const setEDASearchSetting = (field, value, state, dispatch) => { const getIssuingOrgData = (issuingOrgs) => { const COLORS = ['#010691', '#007506', '#ad0202', '#6c0299', '#006069', '#969902']; - console.log('issueingOrgs: ', issuingOrgs); // for the stats pie chart return Object.keys(issuingOrgs).map((org, index) => { let orgData = issuingOrgs[org]; From 1be8f276f93b2b14047e8e990480cce2732e6b6d Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Wed, 8 Feb 2023 11:50:36 -0500 Subject: [PATCH 26/45] removed console logs --- backend/node_app/modules/jbook/jbookExportHandler.js | 3 --- backend/node_app/modules/jbook/jbookSearchUtility.js | 3 --- 2 files changed, 6 deletions(-) diff --git a/backend/node_app/modules/jbook/jbookExportHandler.js b/backend/node_app/modules/jbook/jbookExportHandler.js index c9cea5c94..8115dc097 100644 --- a/backend/node_app/modules/jbook/jbookExportHandler.js +++ b/backend/node_app/modules/jbook/jbookExportHandler.js @@ -84,9 +84,6 @@ class JBookExportHandler extends ExportHandler { cleanedReview = this.jbookSearchUtility.parseFields(findReview, false, 'reviewES'); } docs[i] = { ...doc, ...cleanedReview }; - console.log('AND NOW HERE is doc', doc); - console.log('AND NOW HERE is cleanedreview', cleanedReview); - console.log('AND HERE IS FULL DOC', docs[i]); } } diff --git a/backend/node_app/modules/jbook/jbookSearchUtility.js b/backend/node_app/modules/jbook/jbookSearchUtility.js index 6f405ed1b..915222c1c 100644 --- a/backend/node_app/modules/jbook/jbookSearchUtility.js +++ b/backend/node_app/modules/jbook/jbookSearchUtility.js @@ -34,9 +34,6 @@ class JBookSearchUtility { const mapping = this.getMapping(docType, fromFrontend); for (const field in data) { - if (field === 'id_s') { - continue; - } if (data[field] && data[field] !== null && Object.keys(mapping).includes(field) && doMapping) { const newKey = mapping[field].newName; newData[newKey] = mapping[field].processValue(data[field]); From 1c19e91d6bf60ab5f3d9469d95e5ac2e8e065128 Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Wed, 8 Feb 2023 11:53:33 -0500 Subject: [PATCH 27/45] Added Color Mapping to orgColorMap --- frontend/src/utils/gamechangerUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/utils/gamechangerUtils.js b/frontend/src/utils/gamechangerUtils.js index 4ceb7d797..09c4d217a 100644 --- a/frontend/src/utils/gamechangerUtils.js +++ b/frontend/src/utils/gamechangerUtils.js @@ -481,6 +481,7 @@ export const orgColorMap = { 'Financial Mgmt. Reg': '#636363', Legislation: '#ffbf00', USSTRATCOM: '#00308f', // air force blue + 'United States Army Training and Doctrine Command': '#4b5320', // army green }; const linkColorMap = { From 832d4012dbcc78e4fee93da4a3b3f0f14b8d66a6 Mon Sep 17 00:00:00 2001 From: 616836 Date: Thu, 9 Feb 2023 09:45:20 -0500 Subject: [PATCH 28/45] increase width of page hit list --- frontend/src/components/modules/policy/policyCardHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index f43894336..9ca4c4a80 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -358,11 +358,11 @@ const StyledFrontCardContent = styled.div` .hits-container { display: grid; - grid-template-columns: 100px auto auto; + grid-template-columns: 110px auto auto; height: 100%; .page-hits { - min-width: 100px; + min-width: 110px; height: fit-content; max-height: 150px; overflow: auto; From 4cc497cf075b6e41f4d2af25825264bddacbd679 Mon Sep 17 00:00:00 2001 From: Segerlu <111815126+Segerlu@users.noreply.github.com> Date: Thu, 9 Feb 2023 16:15:40 -0500 Subject: [PATCH 29/45] Fixes the query to Motamo to not ignore the beginning of the title --- backend/node_app/controllers/appStatsController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/node_app/controllers/appStatsController.js b/backend/node_app/controllers/appStatsController.js index 58cb2fd07..685223de5 100644 --- a/backend/node_app/controllers/appStatsController.js +++ b/backend/node_app/controllers/appStatsController.js @@ -288,7 +288,7 @@ class AppStatsController { connection.query( ` select - SUBSTRING_INDEX(b.name, '-', 2) as document, + b.name as document, max(CONVERT_TZ(a.server_time,'UTC','EST')) as documenttime from matomo_log_link_visit_action a, From b534bda0faa16dbb9b31485338a13ea0670ce6f4 Mon Sep 17 00:00:00 2001 From: 627597 Date: Fri, 10 Feb 2023 09:55:03 -0500 Subject: [PATCH 30/45] Template addition and revisions --- .gitlab/issue_templates/bugfix.md | 6 ++++-- .gitlab/issue_templates/cosmetic.md | 13 +++++++++++++ .gitlab/issue_templates/feature.md | 8 +++++--- .gitlab/merge_request_templates/default_request.md | 5 ++++- 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .gitlab/issue_templates/cosmetic.md diff --git a/.gitlab/issue_templates/bugfix.md b/.gitlab/issue_templates/bugfix.md index cdad26e61..8b74a0224 100644 --- a/.gitlab/issue_templates/bugfix.md +++ b/.gitlab/issue_templates/bugfix.md @@ -2,7 +2,6 @@ - ## Steps to Reproduce the Bug @@ -11,5 +10,8 @@ +## Initial thoughts / Potential relevant files + + - \ No newline at end of file + diff --git a/.gitlab/issue_templates/cosmetic.md b/.gitlab/issue_templates/cosmetic.md new file mode 100644 index 000000000..1d9c21c6d --- /dev/null +++ b/.gitlab/issue_templates/cosmetic.md @@ -0,0 +1,13 @@ +## Description + + + +## Mockups (if applicable) + + + +## Initial thoughts / Potential relevant files + + + + diff --git a/.gitlab/issue_templates/feature.md b/.gitlab/issue_templates/feature.md index 970e01fca..fd3f9da67 100644 --- a/.gitlab/issue_templates/feature.md +++ b/.gitlab/issue_templates/feature.md @@ -1,11 +1,13 @@ ## Description - - + ## Mockups (if applicable) +## Initial thoughts / Potential relevant files + + - \ No newline at end of file + diff --git a/.gitlab/merge_request_templates/default_request.md b/.gitlab/merge_request_templates/default_request.md index 53332a49b..605a01588 100644 --- a/.gitlab/merge_request_templates/default_request.md +++ b/.gitlab/merge_request_templates/default_request.md @@ -12,6 +12,7 @@ ## Types of changes + - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Optimization (provides speedup with no functional changes) @@ -23,6 +24,7 @@ ## Requester Checklist: + - [ ] Documentation updated @@ -33,7 +35,8 @@ - [ ] Dev tools or other infrastructure changed ## Reviewer Checklist: - + +Not all of these may be required/applicable. - [ ] Review the Changelog/Code - [ ] Test locally and aggressively From e653b161f805c89094d50d1906a2e9853e61aa71 Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Fri, 10 Feb 2023 12:04:07 -0500 Subject: [PATCH 31/45] Fixed snippet increase in height --- backend/.env.template | 130 ------------------ backend/.npmrc.template | 3 - frontend/src/components/cards/GCCard.js | 2 +- .../modules/policy/policyCardHandler.js | 5 + 4 files changed, 6 insertions(+), 134 deletions(-) delete mode 100644 backend/.env.template delete mode 100644 backend/.npmrc.template diff --git a/backend/.env.template b/backend/.env.template deleted file mode 100644 index f21c95b02..000000000 --- a/backend/.env.template +++ /dev/null @@ -1,130 +0,0 @@ -POSTGRES_HOST_GAME_CHANGER= -POSTGRES_HOST_GC_ORCHESTRATION= -POSTGRES_HOST_UOT= -POSTGRES_USER_GAME_CHANGER= -POSTGRES_USER_GC_ORCHESTRATION= -POSTGRES_USER_UOT= -POSTGRES_PASSWORD_GAME_CHANGER= -POSTGRES_PASSWORD_GC_ORCHESTRATION= -POSTGRES_PASSWORD_UOT= -POSTGRES_HOST_EDA= -POSTGRES_USER_EDA= -POSTGRES_PASSWORD_EDA= - -GAMECHANGER_ELASTICSEARCH_HOST= -GAMECHANGER_ELASTICSEARCH_PORT= -GAMECHANGER_ELASTICSEARCH_USER= -GAMECHANGER_ELASTICSEARCH_PASSWORD= -GAMECHANGER_ELASTICSEARCH_CA= -GAMECHANGER_ELASTICSEARCH_INDEX= -GAMECHANGER_ELASTICSEARCH_PROTOCOL= -GAMECHANGER_ELASTICSEARCH_SUGGEST_INDEX= -GAMECHANGER_ELASTICSEARCH_ENTITIES_INDEX= -GAMECHANGER_ELASTICSEARCH_HISTORY_INDEX= - -EDA_ELASTICSEARCH_HOST= -EDA_ELASTICSEARCH_PORT= -EDA_ELASTICSEARCH_USER= -EDA_ELASTICSEARCH_PASSWORD= -EDA_ELASTICSEARCH_CA= -EDA_ELASTICSEARCH_CA_FILEPATH= -EDA_ELASTICSEARCH_INDEX= -EDA_ELASTICSEARCH_FILTER_PICKLIST_INDEX= -EDA_ELASTICSEARCH_PROTOCOL= -EDA_DATA_HOST= - -HERMES_ELASTICSEARCH_INDEX= - -NEO4J_URL= -NEO4J_USER= -NEO4J_PASSWORD= -MYSQL_HOST_MATOMO= -MYSQL_USER_MATOMO= -MYSQL_PASSWORD_MATOMO= -DATA_CATALOG_HOST= -DATA_CATALOG_PORT= -DATA_CATALOG_USER= -DATA_CATALOG_PASSWORD= -DATA_CATALOG_CA= - -EMAIL_TRANSPORT_HOST= -EMAIL_TRANSPORT_PORT= - -DOCKER= -REDIS_URL= -PG_HOST= -DATA_API_HOST= -IMPALA_HOST= -GAMECHANGER_ML_API_HOST= -GAMECHANGER_ML_API_TRAIN_HOST= - -S3_REGION= - -PG_HOST= -PG_PORT= -PG_UM_DB= -PG_DST_DB= -PG_USER= -PG_PASSWORD= -PG_LOGGING= - -SECURE_SESSION= -DISABLE_SSO= - -APPROVED_API_CALLERS= -EXPRESS_TRUST_PROXY= - -TLS_KEY_PASSPHRASE= -TLS_KEY= -TLS_CERT= -TLS_CERT_CA= - -SAML_ISSUER= -SAML_CALLBACK_URL= -SAML_ENTRYPOINT= -SAML_CERT= -COOKIE_DOMAIN= - -EMAIL_ADDRESS= - -QLIK_URL= -QLIK_WS_URL= -QLIK_SYS_ACCOUNT= -QLIK_AD_DOMAIN= -# QLIK_EXCLUDE_CUST_PROP_NAME= only here if you need to change for local dev -# QLIK_EXCLUDE_CUST_PROP_VAL= only here if you need to change for local dev -# QLIK_BUSINESS_DOMAIN_PROP_NAME=only here if you need to change for local dev -QLIK_CERT_CA= -QLIK_CERT_KEY= -QLIK_CERT= - -SERVICE_ACCOUNT_USER= -SERVICE_ACCOUNT_PASSWORD= -SERVICE_ACCOUNT_EMAIL= -SERVICE_ACCOUNT_PHONE= -SERVICE_ACCOUNT_ORG= -SERVICE_ACCOUNT_ENV= - -DISABLE_FRONT_END_CONFIG= -REACT_APP_GC_DECOUPLED= -REACT_APP_NODE_ENV= -REACT_APP_GLUU_SSO= -REACT_APP_BACKEND_URL= -REACT_APP_MATOMO_LINK= -REACT_APP_DATA_CATALOG_LINK= -REACT_APP_CLASSIFICATION_BANNER= -REACT_APP_CLASSIFICATION_BANNER_COLOR= -REACT_APP_MEGA_MENU_ENDPOINT= -REACT_APP_TUTORIAL_HREF= -REACT_APP_USER_TOKEN_ENDPOINT= -REACT_APP_SUPPORT_HREF= -REACT_APP_WIKI_HREF= -REACT_APP_LOGIN_ROUTE= - -JIRA_USERNAME= -JIRA_PASSWORD= -JIRA_DOMAIN= -JIRA_PROJECT_KEY= -JIRA_RATING_ID= -JIRA_FEEDBACK_TYPE= - diff --git a/backend/.npmrc.template b/backend/.npmrc.template deleted file mode 100644 index 045f941b6..000000000 --- a/backend/.npmrc.template +++ /dev/null @@ -1,3 +0,0 @@ -//npm.pkg.github.com/:_authToken= -@dod-advana:registry=https://npm.pkg.github.com - diff --git a/frontend/src/components/cards/GCCard.js b/frontend/src/components/cards/GCCard.js index a1b7b1887..989015690 100644 --- a/frontend/src/components/cards/GCCard.js +++ b/frontend/src/components/cards/GCCard.js @@ -93,7 +93,7 @@ const PolicyCardHandler = LoadableVisibility({ }, }); -const CARD_HEIGHT = 356; +const CARD_HEIGHT = 412; // Internet Explorer 6-11 const IS_IE = /*@cc_on!@*/ !!document.documentMode; diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index f43894336..b756274fd 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -395,6 +395,11 @@ const StyledFrontCardContent = styled.div` > .expanded-metadata { overflow-wrap: anywhere; grid-column: 2 / 4; + + .searchdemo-blockquote { + height: 90%; + overflow: auto; + } } } `; From 2a26bda393502b1db4186753f627d27f0b2c052e Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Mon, 13 Feb 2023 09:33:24 -0500 Subject: [PATCH 32/45] changed to opensearch --- backend/.env.template | 18 +++++++++--------- backend/node_app/config/constants.js | 16 ++++++++-------- generateCombinedEnv.sh | 14 +++++++------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/backend/.env.template b/backend/.env.template index f21c95b02..de3db9e03 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -22,15 +22,15 @@ GAMECHANGER_ELASTICSEARCH_SUGGEST_INDEX= GAMECHANGER_ELASTICSEARCH_ENTITIES_INDEX= GAMECHANGER_ELASTICSEARCH_HISTORY_INDEX= -EDA_ELASTICSEARCH_HOST= -EDA_ELASTICSEARCH_PORT= -EDA_ELASTICSEARCH_USER= -EDA_ELASTICSEARCH_PASSWORD= -EDA_ELASTICSEARCH_CA= -EDA_ELASTICSEARCH_CA_FILEPATH= -EDA_ELASTICSEARCH_INDEX= -EDA_ELASTICSEARCH_FILTER_PICKLIST_INDEX= -EDA_ELASTICSEARCH_PROTOCOL= +EDA_OPENSEARCH_HOST= +EDA_OPENSEARCH_PORT= +EDA_OPENSEARCH_USER= +EDA_OPENSEARCH_PASSWORD= +EDA_OPENSEARCH_CA= +EDA_OPENSEARCH_CA_FILEPATH= +EDA_OPENSEARCH_INDEX= +EDA_OPENSEARCH_FILTER_PICKLIST_INDEX= +EDA_OPENSEARCH_PROTOCOL= EDA_DATA_HOST= HERMES_ELASTICSEARCH_INDEX= diff --git a/backend/node_app/config/constants.js b/backend/node_app/config/constants.js index e916c1f1c..d9ce47cd4 100644 --- a/backend/node_app/config/constants.js +++ b/backend/node_app/config/constants.js @@ -135,14 +135,14 @@ module.exports = Object.freeze({ requestTimeout: 60000, }, EDA_ELASTIC_SEARCH_OPTS: { - protocol: process.env.EDA_ELASTICSEARCH_PROTOCOL || 'https', - host: process.env.EDA_ELASTICSEARCH_HOST || 'loclhost', - port: process.env.EDA_ELASTICSEARCH_PORT || '443', - user: process.env.EDA_ELASTICSEARCH_USER ? process.env.EDA_ELASTICSEARCH_USER : '', - password: process.env.EDA_ELASTICSEARCH_PASSWORD || 'password', - ca: process.env.EDA_ELASTICSEARCH_CA ? process.env.EDA_ELASTICSEARCH_CA.replace(/\\n/g, '\n') : '', - index: process.env.EDA_ELASTICSEARCH_INDEX || 'eda', - filterPicklistIndex: process.env.EDA_ELASTICSEARCH_FILTER_PICKLIST_INDEX || 'gc_eda_picklist', + protocol: process.env.EDA_OPENSEARCH_PROTOCOL || 'https', + host: process.env.EDA_OPENSEARCH_HOST || 'loclhost', + port: process.env.EDA_OPENSEARCH_PORT || '443', + user: process.env.EDA_OPENSEARCH_USER ? process.env.EDA_OPENSEARCH_USER : '', + password: process.env.EDA_OPENSEARCH_PASSWORD || 'password', + ca: process.env.EDA_OPENSEARCH_CA ? process.env.EDA_OPENSEARCH_CA.replace(/\\n/g, '\n') : '', + index: process.env.EDA_OPENSEARCH_INDEX || 'eda', + filterPicklistIndex: process.env.EDA_OPENSEARCH_FILTER_PICKLIST_INDEX || 'gc_eda_picklist', extSearchFields: ['*_eda_ext'], //['acomod_eda_ext','product_or_service_line_item_eda_ext'], extRetrieveFields: ['*_eda_ext'], // index: 'eda' diff --git a/generateCombinedEnv.sh b/generateCombinedEnv.sh index f6f65f036..f6da086c3 100755 --- a/generateCombinedEnv.sh +++ b/generateCombinedEnv.sh @@ -29,13 +29,13 @@ GAMECHANGER_ELASTICSEARCH_SUGGEST_INDEX="${GAMECHANGER_ELASTICSEARCH_SUGGEST_IND GAMECHANGER_ELASTICSEARCH_ENTITIES_INDEX="${GAMECHANGER_ELASTICSEARCH_ENTITIES_INDEX:-entities}" GAMECHANGER_ELASTICSEARCH_HISTORY_INDEX="${GAMECHANGER_ELASTICSEARCH_HISTORY_INDEX:-search_history}" -EDA_ELASTICSEARCH_HOST="${EDA_ELASTICSEARCH_HOST:-elasticsearch}" -EDA_ELASTICSEARCH_PORT="${EDA_ELASTICSEARCH_PORT:-9200}" -EDA_ELASTICSEARCH_USER="${EDA_ELASTICSEARCH_USER:-}" -EDA_ELASTICSEARCH_PASSWORD="${EDA_ELASTICSEARCH_PASSWORD:-}" -EDA_ELASTICSEARCH_CA_FILEPATH="${EDA_ELASTICSEARCH_CA_FILEPATH:-/etc/secrets/gamechanger.crt}" -EDA_ELASTICSEARCH_INDEX="${EDA_ELASTICSEARCH_INDEX:-gc_eda_2021_json}" -EDA_ELASTICSEARCH_PROTOCOL="${EDA_ELASTICSEARCH_PROTOCOL:-http}" +EDA_OPENSEARCH_HOST="${EDA_OPENSEARCH_HOST:-elasticsearch}" +EDA_OPENSEARCH_PORT="${EDA_OPENSEARCH_PORT:-9200}" +EDA_OPENSEARCH_USER="${EDA_OPENSEARCH_USER:-}" +EDA_OPENSEARCH_PASSWORD="${EDA_OPENSEARCH_PASSWORD:-}" +EDA_OPENSEARCH_CA_FILEPATH="${EDA_OPENSEARCH_CA_FILEPATH:-/etc/secrets/gamechanger.crt}" +EDA_OPENSEARCH_INDEX="${EDA_OPENSEARCH_INDEX:-gc_eda_2021_json}" +EDA_OPENSEARCH_PROTOCOL="${EDA_OPENSEARCH_PROTOCOL:-http}" EDA_DATA_HOST="${EDA_DATA_HOST:-}" HERMES_ELASTICSEARCH_INDEX="${HERMES_ELASTICSEARCH_INDEX:-hermes_test_1}" From 0de919a0393424a1108951ad4f08f4dbb0178ca0 Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Mon, 13 Feb 2023 10:39:32 -0500 Subject: [PATCH 33/45] Modification to height and adding templates back --- backend/.env.template | 130 ++++++++++++++++++ backend/.npmrc.template | 3 + frontend/src/components/cards/GCCard.js | 2 +- .../modules/policy/policyCardHandler.js | 4 +- 4 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 backend/.env.template create mode 100644 backend/.npmrc.template diff --git a/backend/.env.template b/backend/.env.template new file mode 100644 index 000000000..f21c95b02 --- /dev/null +++ b/backend/.env.template @@ -0,0 +1,130 @@ +POSTGRES_HOST_GAME_CHANGER= +POSTGRES_HOST_GC_ORCHESTRATION= +POSTGRES_HOST_UOT= +POSTGRES_USER_GAME_CHANGER= +POSTGRES_USER_GC_ORCHESTRATION= +POSTGRES_USER_UOT= +POSTGRES_PASSWORD_GAME_CHANGER= +POSTGRES_PASSWORD_GC_ORCHESTRATION= +POSTGRES_PASSWORD_UOT= +POSTGRES_HOST_EDA= +POSTGRES_USER_EDA= +POSTGRES_PASSWORD_EDA= + +GAMECHANGER_ELASTICSEARCH_HOST= +GAMECHANGER_ELASTICSEARCH_PORT= +GAMECHANGER_ELASTICSEARCH_USER= +GAMECHANGER_ELASTICSEARCH_PASSWORD= +GAMECHANGER_ELASTICSEARCH_CA= +GAMECHANGER_ELASTICSEARCH_INDEX= +GAMECHANGER_ELASTICSEARCH_PROTOCOL= +GAMECHANGER_ELASTICSEARCH_SUGGEST_INDEX= +GAMECHANGER_ELASTICSEARCH_ENTITIES_INDEX= +GAMECHANGER_ELASTICSEARCH_HISTORY_INDEX= + +EDA_ELASTICSEARCH_HOST= +EDA_ELASTICSEARCH_PORT= +EDA_ELASTICSEARCH_USER= +EDA_ELASTICSEARCH_PASSWORD= +EDA_ELASTICSEARCH_CA= +EDA_ELASTICSEARCH_CA_FILEPATH= +EDA_ELASTICSEARCH_INDEX= +EDA_ELASTICSEARCH_FILTER_PICKLIST_INDEX= +EDA_ELASTICSEARCH_PROTOCOL= +EDA_DATA_HOST= + +HERMES_ELASTICSEARCH_INDEX= + +NEO4J_URL= +NEO4J_USER= +NEO4J_PASSWORD= +MYSQL_HOST_MATOMO= +MYSQL_USER_MATOMO= +MYSQL_PASSWORD_MATOMO= +DATA_CATALOG_HOST= +DATA_CATALOG_PORT= +DATA_CATALOG_USER= +DATA_CATALOG_PASSWORD= +DATA_CATALOG_CA= + +EMAIL_TRANSPORT_HOST= +EMAIL_TRANSPORT_PORT= + +DOCKER= +REDIS_URL= +PG_HOST= +DATA_API_HOST= +IMPALA_HOST= +GAMECHANGER_ML_API_HOST= +GAMECHANGER_ML_API_TRAIN_HOST= + +S3_REGION= + +PG_HOST= +PG_PORT= +PG_UM_DB= +PG_DST_DB= +PG_USER= +PG_PASSWORD= +PG_LOGGING= + +SECURE_SESSION= +DISABLE_SSO= + +APPROVED_API_CALLERS= +EXPRESS_TRUST_PROXY= + +TLS_KEY_PASSPHRASE= +TLS_KEY= +TLS_CERT= +TLS_CERT_CA= + +SAML_ISSUER= +SAML_CALLBACK_URL= +SAML_ENTRYPOINT= +SAML_CERT= +COOKIE_DOMAIN= + +EMAIL_ADDRESS= + +QLIK_URL= +QLIK_WS_URL= +QLIK_SYS_ACCOUNT= +QLIK_AD_DOMAIN= +# QLIK_EXCLUDE_CUST_PROP_NAME= only here if you need to change for local dev +# QLIK_EXCLUDE_CUST_PROP_VAL= only here if you need to change for local dev +# QLIK_BUSINESS_DOMAIN_PROP_NAME=only here if you need to change for local dev +QLIK_CERT_CA= +QLIK_CERT_KEY= +QLIK_CERT= + +SERVICE_ACCOUNT_USER= +SERVICE_ACCOUNT_PASSWORD= +SERVICE_ACCOUNT_EMAIL= +SERVICE_ACCOUNT_PHONE= +SERVICE_ACCOUNT_ORG= +SERVICE_ACCOUNT_ENV= + +DISABLE_FRONT_END_CONFIG= +REACT_APP_GC_DECOUPLED= +REACT_APP_NODE_ENV= +REACT_APP_GLUU_SSO= +REACT_APP_BACKEND_URL= +REACT_APP_MATOMO_LINK= +REACT_APP_DATA_CATALOG_LINK= +REACT_APP_CLASSIFICATION_BANNER= +REACT_APP_CLASSIFICATION_BANNER_COLOR= +REACT_APP_MEGA_MENU_ENDPOINT= +REACT_APP_TUTORIAL_HREF= +REACT_APP_USER_TOKEN_ENDPOINT= +REACT_APP_SUPPORT_HREF= +REACT_APP_WIKI_HREF= +REACT_APP_LOGIN_ROUTE= + +JIRA_USERNAME= +JIRA_PASSWORD= +JIRA_DOMAIN= +JIRA_PROJECT_KEY= +JIRA_RATING_ID= +JIRA_FEEDBACK_TYPE= + diff --git a/backend/.npmrc.template b/backend/.npmrc.template new file mode 100644 index 000000000..045f941b6 --- /dev/null +++ b/backend/.npmrc.template @@ -0,0 +1,3 @@ +//npm.pkg.github.com/:_authToken= +@dod-advana:registry=https://npm.pkg.github.com + diff --git a/frontend/src/components/cards/GCCard.js b/frontend/src/components/cards/GCCard.js index 989015690..eb76f9fa5 100644 --- a/frontend/src/components/cards/GCCard.js +++ b/frontend/src/components/cards/GCCard.js @@ -93,7 +93,7 @@ const PolicyCardHandler = LoadableVisibility({ }, }); -const CARD_HEIGHT = 412; +const CARD_HEIGHT = 450; // Internet Explorer 6-11 const IS_IE = /*@cc_on!@*/ !!document.documentMode; diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index b756274fd..5997eca36 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -397,8 +397,8 @@ const StyledFrontCardContent = styled.div` grid-column: 2 / 4; .searchdemo-blockquote { - height: 90%; - overflow: auto; + height: 100%; + overflow-y: auto; } } } From c0734312cfa14f418685243fb8e9adc311ff46ad Mon Sep 17 00:00:00 2001 From: Melodie Butz Date: Mon, 13 Feb 2023 15:52:45 +0000 Subject: [PATCH 34/45] Revisions per suggestions from Melodie --- .gitlab/issue_templates/bugfix.md | 2 +- .gitlab/issue_templates/cosmetic.md | 2 +- .gitlab/issue_templates/feature.md | 2 +- .gitlab/merge_request_templates/default_request.md | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab/issue_templates/bugfix.md b/.gitlab/issue_templates/bugfix.md index 8b74a0224..f86debb3c 100644 --- a/.gitlab/issue_templates/bugfix.md +++ b/.gitlab/issue_templates/bugfix.md @@ -12,6 +12,6 @@ ## Initial thoughts / Potential relevant files - + diff --git a/.gitlab/issue_templates/cosmetic.md b/.gitlab/issue_templates/cosmetic.md index 1d9c21c6d..55a41d7e0 100644 --- a/.gitlab/issue_templates/cosmetic.md +++ b/.gitlab/issue_templates/cosmetic.md @@ -8,6 +8,6 @@ ## Initial thoughts / Potential relevant files - + diff --git a/.gitlab/issue_templates/feature.md b/.gitlab/issue_templates/feature.md index fd3f9da67..1aee8eda0 100644 --- a/.gitlab/issue_templates/feature.md +++ b/.gitlab/issue_templates/feature.md @@ -8,6 +8,6 @@ ## Initial thoughts / Potential relevant files - + diff --git a/.gitlab/merge_request_templates/default_request.md b/.gitlab/merge_request_templates/default_request.md index 605a01588..a753e5d35 100644 --- a/.gitlab/merge_request_templates/default_request.md +++ b/.gitlab/merge_request_templates/default_request.md @@ -13,6 +13,7 @@ ## Types of changes +- [ ] User interface improvement (non-breaking change that that improves the UI cosmetically) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Optimization (provides speedup with no functional changes) From 2c2b00ed0ad19cbb3523eef9a34bf6691c4b1719 Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Mon, 13 Feb 2023 14:28:10 -0500 Subject: [PATCH 35/45] Snippet height tweeks --- frontend/src/components/cards/GCCard.js | 2 +- .../src/components/modules/policy/policyCardHandler.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/cards/GCCard.js b/frontend/src/components/cards/GCCard.js index eb76f9fa5..989015690 100644 --- a/frontend/src/components/cards/GCCard.js +++ b/frontend/src/components/cards/GCCard.js @@ -93,7 +93,7 @@ const PolicyCardHandler = LoadableVisibility({ }, }); -const CARD_HEIGHT = 450; +const CARD_HEIGHT = 412; // Internet Explorer 6-11 const IS_IE = /*@cc_on!@*/ !!document.documentMode; diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index 5997eca36..8674403bb 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -344,8 +344,8 @@ const StyledListViewFrontCardContent = styled.div` const StyledFrontCardContent = styled.div` font-family: 'Noto Sans'; - overflow: auto; font-size: ${CARD_FONT_SIZE}px; + height: 100%; .current-as-of-div { display: flex; @@ -359,7 +359,7 @@ const StyledFrontCardContent = styled.div` .hits-container { display: grid; grid-template-columns: 100px auto auto; - height: 100%; + height: calc(100% - 24px); .page-hits { min-width: 100px; @@ -393,12 +393,12 @@ const StyledFrontCardContent = styled.div` } > .expanded-metadata { - overflow-wrap: anywhere; grid-column: 2 / 4; + height: 100%; + overflow: auto; .searchdemo-blockquote { height: 100%; - overflow-y: auto; } } } From b48de8f974509ebb6106f76dd42695658961f0f0 Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Mon, 13 Feb 2023 15:25:49 -0500 Subject: [PATCH 36/45] quick changing of setState --- .../components/modules/eda/edaDocumentsComparisonTool.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js b/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js index 07ca31fdd..211af504c 100644 --- a/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js +++ b/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js @@ -174,9 +174,9 @@ const EDADocumentsComparisonTool = ({ if (state.runDocumentComparisonSearch) { setLoading(true); setCollapseKeys([]); - + let newParagraphs = paragraphs; if (paragraphs.length === 1 && paragraphs[0].text.length > 5500) { - setParagraphs(modifyParagraphs(paragraphs[0])); + newParagraphs = modifyParagraphs(paragraphs[0]); } const filters = { @@ -188,9 +188,8 @@ const EDADocumentsComparisonTool = ({ contractsOrMods, idvPIID, }; - gameChangerAPI - .compareDocumentPOST({ cloneName: state.cloneData.clone_name, paragraphs: paragraphs, filters }) + .compareDocumentPOST({ cloneName: state.cloneData.clone_name, paragraphs: newParagraphs, filters }) .then((resp) => { if (resp.data.docs.length <= 0) { setNoResults(true); @@ -212,11 +211,13 @@ const EDADocumentsComparisonTool = ({ } setReturnedDocs(resp.data.docs); setState(dispatch, { runDocumentComparisonSearch: false }); + setParagraphs(newParagraphs); setLoading(false); }) .catch(() => { setReturnedDocs([]); setState(dispatch, { runDocumentComparisonSearch: false }); + setParagraphs(newParagraphs); setLoading(false); console.log('server error'); }); From 5a657483c3ea069102cf4b75df7e1aee8c6644ba Mon Sep 17 00:00:00 2001 From: Usman Qadri Date: Tue, 14 Feb 2023 10:35:46 -0500 Subject: [PATCH 37/45] fix undefined error --- .../src/components/modules/eda/edaDocumentsComparisonTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js b/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js index 211af504c..72a142483 100644 --- a/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js +++ b/frontend/src/components/modules/eda/edaDocumentsComparisonTool.js @@ -1027,7 +1027,7 @@ const EDADocumentsComparisonTool = ({ handlePdfOnLoad( 'pdfViewer', 'viewerContainer', - compareDocument.filename, + compareDocument?.filename, 'PDF Viewer' ) } From 1a624f51408ffbdc5f935eb71735c2cd278b5f15 Mon Sep 17 00:00:00 2001 From: 627597 Date: Tue, 14 Feb 2023 16:30:29 -0500 Subject: [PATCH 38/45] Aligning Recently Viewed docs to true filenames --- .../src/components/modules/policy/policyMainViewHandler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/modules/policy/policyMainViewHandler.js b/frontend/src/components/modules/policy/policyMainViewHandler.js index 7ac167786..4c882c93c 100644 --- a/frontend/src/components/modules/policy/policyMainViewHandler.js +++ b/frontend/src/components/modules/policy/policyMainViewHandler.js @@ -267,9 +267,12 @@ const handlePopPubs = async (pop_pubs, pop_pubs_inactive, state, dispatch, cance const handleLastOpened = async (last_opened_docs, state, dispatch, cancelToken, gameChangerAPI) => { let cleanedDocs = []; let filteredPubs = []; - + debugger; for (let doc of last_opened_docs) { - cleanedDocs.push(doc.document.split(' - ')[1].split('.pdf')[0]); + doc = doc.document; + let cleanedDoc = doc.substring(doc.indexOf('-') + 1, doc.lastIndexOf('-')).trim(); + cleanedDoc = cleanedDoc.substring(0, cleanedDoc.lastIndexOf('.')); + cleanedDocs.push(cleanedDoc); cleanedDocs = [...new Set(cleanedDocs)]; } try { From 53340dd4d6187718311d53487407efd9c5e16d3a Mon Sep 17 00:00:00 2001 From: 627597 Date: Tue, 14 Feb 2023 17:36:55 -0500 Subject: [PATCH 39/45] omg I left a debugger that is embarrassing --- frontend/src/components/modules/policy/policyMainViewHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/modules/policy/policyMainViewHandler.js b/frontend/src/components/modules/policy/policyMainViewHandler.js index 4c882c93c..98b37f12a 100644 --- a/frontend/src/components/modules/policy/policyMainViewHandler.js +++ b/frontend/src/components/modules/policy/policyMainViewHandler.js @@ -267,7 +267,6 @@ const handlePopPubs = async (pop_pubs, pop_pubs_inactive, state, dispatch, cance const handleLastOpened = async (last_opened_docs, state, dispatch, cancelToken, gameChangerAPI) => { let cleanedDocs = []; let filteredPubs = []; - debugger; for (let doc of last_opened_docs) { doc = doc.document; let cleanedDoc = doc.substring(doc.indexOf('-') + 1, doc.lastIndexOf('-')).trim(); From e503b0ed233f1101031faa5cf92f1379f17794f5 Mon Sep 17 00:00:00 2001 From: bravenlu <627673@bah.com> Date: Tue, 14 Feb 2023 17:42:35 -0500 Subject: [PATCH 40/45] adding left side snippet height --- frontend/src/components/modules/policy/policyCardHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/modules/policy/policyCardHandler.js b/frontend/src/components/modules/policy/policyCardHandler.js index 8674403bb..3a7d4d20c 100644 --- a/frontend/src/components/modules/policy/policyCardHandler.js +++ b/frontend/src/components/modules/policy/policyCardHandler.js @@ -363,13 +363,12 @@ const StyledFrontCardContent = styled.div` .page-hits { min-width: 100px; - height: fit-content; - max-height: 150px; overflow: auto; border: 1px solid rgb(189, 189, 189); border-top: 0px; position: relative; z-index: 1; + height: 100%; .page-hit { display: flex; @@ -380,6 +379,7 @@ const StyledFrontCardContent = styled.div` border-top: 1px solid rgb(189, 189, 189); cursor: pointer; color: #386f94; + border-bottom: 1px solid rgb(189, 189, 189); span { font-size: ${CARD_FONT_SIZE}px; From ce0458698ce665e401a575b5f23056a735ce87b2 Mon Sep 17 00:00:00 2001 From: 627597 Date: Wed, 15 Feb 2023 09:49:19 -0500 Subject: [PATCH 41/45] Resolved code smell and moved cleanedDocs deduping out of loop --- .../components/modules/policy/policyMainViewHandler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/modules/policy/policyMainViewHandler.js b/frontend/src/components/modules/policy/policyMainViewHandler.js index 98b37f12a..56e481f18 100644 --- a/frontend/src/components/modules/policy/policyMainViewHandler.js +++ b/frontend/src/components/modules/policy/policyMainViewHandler.js @@ -267,13 +267,13 @@ const handlePopPubs = async (pop_pubs, pop_pubs_inactive, state, dispatch, cance const handleLastOpened = async (last_opened_docs, state, dispatch, cancelToken, gameChangerAPI) => { let cleanedDocs = []; let filteredPubs = []; - for (let doc of last_opened_docs) { - doc = doc.document; - let cleanedDoc = doc.substring(doc.indexOf('-') + 1, doc.lastIndexOf('-')).trim(); + for (let { document } of last_opened_docs) { + let cleanedDoc = document.substring(document.indexOf('-') + 1, document.lastIndexOf('-')).trim(); cleanedDoc = cleanedDoc.substring(0, cleanedDoc.lastIndexOf('.')); cleanedDocs.push(cleanedDoc); - cleanedDocs = [...new Set(cleanedDocs)]; } + cleanedDocs = [...new Set(cleanedDocs)]; + try { filteredPubs = createFilteredPubs(cleanedDocs); From 5ac86d38b0b3ef70e0716adde921b5684cde6df5 Mon Sep 17 00:00:00 2001 From: 627597 Date: Wed, 15 Feb 2023 09:54:36 -0500 Subject: [PATCH 42/45] Added comment --- .../src/components/modules/policy/policyMainViewHandler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/modules/policy/policyMainViewHandler.js b/frontend/src/components/modules/policy/policyMainViewHandler.js index 56e481f18..bbad34844 100644 --- a/frontend/src/components/modules/policy/policyMainViewHandler.js +++ b/frontend/src/components/modules/policy/policyMainViewHandler.js @@ -267,6 +267,9 @@ const handlePopPubs = async (pop_pubs, pop_pubs_inactive, state, dispatch, cance const handleLastOpened = async (last_opened_docs, state, dispatch, cancelToken, gameChangerAPI) => { let cleanedDocs = []; let filteredPubs = []; + + // Extract filenames out of last_opened_docs, e.g.: + // 'Title 5 - Appendix' from 'PDFViewer - Title 5 - Appendix.pdf - gamechanger' for (let { document } of last_opened_docs) { let cleanedDoc = document.substring(document.indexOf('-') + 1, document.lastIndexOf('-')).trim(); cleanedDoc = cleanedDoc.substring(0, cleanedDoc.lastIndexOf('.')); From 67c0312c1f969ff12be95ab790e7fc9f7b1d0a00 Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Thu, 16 Feb 2023 10:20:11 -0800 Subject: [PATCH 43/45] add missing await in async function --- backend/node_app/controllers/textSuggestionController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/node_app/controllers/textSuggestionController.js b/backend/node_app/controllers/textSuggestionController.js index fa35e8923..090c5004c 100644 --- a/backend/node_app/controllers/textSuggestionController.js +++ b/backend/node_app/controllers/textSuggestionController.js @@ -55,7 +55,7 @@ class TextSuggestionController { const originalText = req.body.searchText; req.body.searchText = corrected; // If the auto-corrected text doesn't return any results, don't suggest it to the user. - const correctedResults = this.searchUtility.documentSearch(null, req.body, clientObj, userId); + const correctedResults = await this.searchUtility.documentSearch(null, req.body, clientObj, userId); if (Object.keys(correctedResults).length === 0) { req.body.searchText = originalText; corrected = ''; From 334feb1f02e5c12441a50ab408db4218b032a7c3 Mon Sep 17 00:00:00 2001 From: Olivia Kroop Date: Thu, 16 Feb 2023 10:53:07 -0800 Subject: [PATCH 44/45] fix conditional for text suggestion corrected results --- backend/node_app/controllers/textSuggestionController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/node_app/controllers/textSuggestionController.js b/backend/node_app/controllers/textSuggestionController.js index 090c5004c..f3d3695c8 100644 --- a/backend/node_app/controllers/textSuggestionController.js +++ b/backend/node_app/controllers/textSuggestionController.js @@ -56,7 +56,8 @@ class TextSuggestionController { req.body.searchText = corrected; // If the auto-corrected text doesn't return any results, don't suggest it to the user. const correctedResults = await this.searchUtility.documentSearch(null, req.body, clientObj, userId); - if (Object.keys(correctedResults).length === 0) { + + if (!correctedResults.totalCount) { req.body.searchText = originalText; corrected = ''; } From 452771fc18ad7fc25a75871594253105d9bbc5a2 Mon Sep 17 00:00:00 2001 From: Melodie Butz Date: Fri, 17 Feb 2023 11:22:41 -0800 Subject: [PATCH 45/45] don't use track_total_hits true, cap it at 10k --- backend/node_app/modules/eda/edaSearchUtility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/node_app/modules/eda/edaSearchUtility.js b/backend/node_app/modules/eda/edaSearchUtility.js index ee068c4c8..c41c965f0 100644 --- a/backend/node_app/modules/eda/edaSearchUtility.js +++ b/backend/node_app/modules/eda/edaSearchUtility.js @@ -1502,7 +1502,7 @@ class EDASearchUtility { }); return { - track_total_hits: true, + track_total_hits: 10000, size: 10, _source: { includes: ['pagerank_r', 'kw_doc_score_r', 'orgs_rs', 'file_location_eda_ext'],