From 42e8912a809dc09f0ee94ac2e72368c2beb66009 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:08:14 -0400 Subject: [PATCH 1/3] Merge master (v1.17.1) into develop (#1873) --- THIRD-PARTY-NOTICES | 2 +- package-lock.json | 189 ++++++++++-------- package.json | 2 +- src/core/models/highlightedvalue.js | 50 +++++ .../filters/filteroptionscomponent.js | 7 +- .../filters/filteroptionscomponent.js | 6 +- 6 files changed, 171 insertions(+), 85 deletions(-) diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index b8c50283e..48c27b4d7 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -5322,7 +5322,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following NPM package may be included in this product: - - readable-stream@2.3.7 + - readable-stream@2.3.8 This package contains the following license and notice below: diff --git a/package-lock.json b/package-lock.json index 51d24f408..fb178f341 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@yext/answers-search-ui", - "version": "1.17.0", + "version": "1.17.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@yext/answers-search-ui", - "version": "1.17.0", + "version": "1.17.1", "license": "BSD-3-Clause", "dependencies": { "@mapbox/mapbox-gl-language": "^0.10.1", @@ -4159,15 +4159,14 @@ } }, "node_modules/asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "minimalistic-assert": "^1.0.0" } }, "node_modules/asn1.js/node_modules/bn.js": { @@ -4746,9 +4745,9 @@ "dev": true }, "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, "node_modules/boolbase": { @@ -5011,34 +5010,37 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", "dev": true, "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.5", + "hash-base": "~3.0", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" } }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/browserify-sign/node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" }, "engines": { - "node": ">= 6" + "node": ">=4" } }, "node_modules/browserslist": { @@ -6924,9 +6926,9 @@ } }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", "dev": true, "dependencies": { "bn.js": "^4.11.9", @@ -15405,16 +15407,33 @@ } }, "node_modules/parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", "dev": true, "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-asn1/node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" } }, "node_modules/parse-filepath": { @@ -17099,9 +17118,9 @@ } }, "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -25898,15 +25917,14 @@ } }, "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "minimalistic-assert": "^1.0.0" }, "dependencies": { "bn.js": { @@ -26348,9 +26366,9 @@ "dev": true }, "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true }, "boolbase": { @@ -26569,31 +26587,31 @@ } }, "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.5", + "hash-base": "~3.0", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" }, "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", "dev": true, "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } } } @@ -28094,9 +28112,9 @@ "dev": true }, "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", "dev": true, "requires": { "bn.js": "^4.11.9", @@ -34859,16 +34877,29 @@ } }, "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", "dev": true, "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + } } }, "parse-filepath": { @@ -36104,9 +36135,9 @@ } }, "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", diff --git a/package.json b/package.json index c47cfe445..056403324 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yext/answers-search-ui", - "version": "1.17.0", + "version": "1.17.1", "description": "Javascript Search Programming Interface", "main": "dist/answers-umd.js", "repository": { diff --git a/src/core/models/highlightedvalue.js b/src/core/models/highlightedvalue.js index 50d5c959d..e2b748b24 100644 --- a/src/core/models/highlightedvalue.js +++ b/src/core/models/highlightedvalue.js @@ -18,6 +18,15 @@ export default class HighlightedValue { return this.buildHighlightedValue(this.value, this.matchedSubstrings); } + /** + * get highlighted value elements + * @returns {Array} + */ + getElements () { + this._sortMatchedSubstrings(); + return this._buildHighlightedElements(this.value, this.matchedSubstrings); + } + /** * get highlighted value string * @param {Function} transformFunction takes a string and returns the transformed string @@ -135,6 +144,47 @@ export default class HighlightedValue { return highlightedValue; } + /** + * introduces highlighting to input data according to highlighting specifiers and returns a + * list of elements/strings + * + * @param {Object} val input object to apply highlighting to + * @param {Object} highlightedSubstrings highlighting specifiers to apply to input object + * @returns {Array} a list of elements/strings representing the val with + * highlighting applied. Example returned value : + * [ + * 'Save time & bank on your terms at over 1,800', + * ATM, + * ] + */ + _buildHighlightedElements (val, highlightedSubstrings) { + const highlightedElements = []; + let nextStart = 0; + + for (let j = 0; j < highlightedSubstrings.length; j++) { + const start = Number(highlightedSubstrings[j].offset); + const end = start + highlightedSubstrings[j].length; + + if (nextStart < start) { + highlightedElements.push(val.slice(nextStart, start)); + } + + if (start < end) { + const highlightedText = document.createElement('strong'); + highlightedText.textContent = val.slice(start, end); + highlightedElements.push(highlightedText); + } + + if (j === highlightedSubstrings.length - 1 && end < val.length) { + highlightedElements.push(val.slice(end)); + } + + nextStart = end; + } + + return highlightedElements; + } + _sortMatchedSubstrings () { this.matchedSubstrings.sort((a, b) => { if (a.offset < b.offset) { diff --git a/src/ui/components/filters/filteroptionscomponent.js b/src/ui/components/filters/filteroptionscomponent.js index 241f9435c..b14f38c4d 100644 --- a/src/ui/components/filters/filteroptionscomponent.js +++ b/src/ui/components/filters/filteroptionscomponent.js @@ -455,10 +455,13 @@ export default class FilterOptionsComponent extends Component { if (matchedSubstring) { filterOption.classList.add('displaySearch'); filterOption.classList.remove('hiddenSearch'); - labelEl.textContent = new HighlightedValue({ + const highlightedElements = new HighlightedValue({ value: labelText, matchedSubstrings: [matchedSubstring] - }).get(); + }).getElements(); + + labelEl.textContent = ''; + highlightedElements.forEach(el => labelEl.append(el)); } else { filterOption.classList.add('hiddenSearch'); filterOption.classList.remove('displaySearch'); diff --git a/tests/ui/components/filters/filteroptionscomponent.js b/tests/ui/components/filters/filteroptionscomponent.js index feef18c2a..4f04e3400 100644 --- a/tests/ui/components/filters/filteroptionscomponent.js +++ b/tests/ui/components/filters/filteroptionscomponent.js @@ -153,8 +153,10 @@ describe('filter options component', () => { const filterOptionEl = filterOptionEls.at(index); expect(filterOptionEl.hasClass(index === 0 ? 'displaySearch' : 'hiddenSearch')).toBeTruthy(); expect(filterOptionEl.hasClass(index === 0 ? 'hiddenSearch' : 'displaySearch')).toBeFalsy(); - expect(filterOptionEl.find('.js-yxt-FilterOptions-optionLabel--name').text().trim()) - .toEqual(index === 0 ? 'ciri' : options[index].label); + const labelNameEl = filterOptionEl.find('.js-yxt-FilterOptions-optionLabel--name'); + if (index === 0) { + expect(labelNameEl.find('strong').text()).toEqual('cir'); + } } }); From ee4333d6264ece2370d1472aca20087ed05e50d1 Mon Sep 17 00:00:00 2001 From: EmilyZhang777 <48967088+EmilyZhang777@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:00:43 -0500 Subject: [PATCH 2/3] Create CODEOWNERS (#1875) --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..ba445ca2b --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @yext/watson From 7ab71e933e1ee21e831688999601a766603c6644 Mon Sep 17 00:00:00 2001 From: Jesuye David <12143814+jesuyedavid@users.noreply.github.com> Date: Fri, 10 May 2024 20:23:24 -0400 Subject: [PATCH 3/3] Update Workflow Versions to Remove node16 Deprecation Warnings (#1877) Notable Changes: 1. We added two new jobs: `merge_multiple_artifacts` and `overwrite_artifact` in `.github/workflows/build_i18n.yml` to handle merging multiple locale files into the `build-output-US` and `build-output-EU` artifacts. This was necessary since we have to handle no longer being able to have multiple jobs in the same workflow write to one artifact name and mutate it, [a breaking change](https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#multiple-uploads-to-the-same-named-artifact) in `action/upload-artifact@v4`. Since `build_and_deploy_i18n.yml` calls both `build.yml` and `build_i18n.yml`, we can't have both write an artifact called `build-output-US` unless we pass the `overwrite: true` input in the latter. The `action/upload-artifact/merge@v4` doesn't allow overwriting, so we need an additional step of merging and uploading with a temporary name and then downloading the merged artifact and re-uploading to overwrite the correct name. 2. We bumped `google-github-actions/auth` and `google-github-actions/upload-cloud-storage` from v0 to v2 3. Updated `actions/checkout`, `actions/setup-node`, `actions/upload-artifact`, `actions/download-artifact`, and `aws-actions/configure-aws-credentials` actions to v4 [J=WAT-4020](https://yexttest.atlassian.net/browse/WAT-4020) TEST=manual Testing was done in a forked repo. View [actions](https://github.com/jesuyedavid/answers-search-ui/actions) to see testing details and test commits. We also checked the US/EU build artifact unzipped files to ensure they are uploaded to AWS/GCP properly and that they look similar to build files prior to this update. Finally, we did local testing from the Answers-Hitchhiker-Theme repo's test site that pointed to our dev assets in AWS. The `dev` bucket in GCP did not have the correct permissions to allow local testing, so this local testing will be done after merging this PR and the changes from develop are pushed to `canary` in GCP. --- .github/workflows/acceptance.yml | 6 +-- .github/workflows/acceptance_search_bar.yml | 6 +-- .github/workflows/build.yml | 6 +-- .github/workflows/build_i18n.yml | 39 ++++++++++++++++--- .github/workflows/deploy.yml | 6 +-- .github/workflows/deploy_hold.yml | 14 +++---- .github/workflows/main.yml | 2 +- .github/workflows/miscellaneous_tests.yml | 4 +- .../workflows/should_deploy_major_version.yml | 2 +- .github/workflows/unit_test.yml | 6 +-- 10 files changed, 59 insertions(+), 32 deletions(-) diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index e770c6443..241bd4386 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -7,15 +7,15 @@ jobs: name: Headless Acceptance runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' - run: npm ci - name: Download build-output-US artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-US path: dist/ diff --git a/.github/workflows/acceptance_search_bar.yml b/.github/workflows/acceptance_search_bar.yml index 4eb2ff274..3b2d3e5e9 100644 --- a/.github/workflows/acceptance_search_bar.yml +++ b/.github/workflows/acceptance_search_bar.yml @@ -6,15 +6,15 @@ jobs: name: Headless Acceptance runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' - run: npm ci - name: Download build-output-US artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-US path: dist/ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d37dc2fdf..709ee246f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,18 +13,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' - run: npm ci - run: npm run ${{ inputs.build_script }} - name: Create build-output-US artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-output-US path: dist/ diff --git a/.github/workflows/build_i18n.yml b/.github/workflows/build_i18n.yml index bf11c277d..5654260fa 100644 --- a/.github/workflows/build_i18n.yml +++ b/.github/workflows/build_i18n.yml @@ -18,10 +18,10 @@ jobs: outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' @@ -36,11 +36,11 @@ jobs: matrix: language: ${{ fromJson(needs.create_language_matrix.outputs.matrix) }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' @@ -51,7 +51,34 @@ jobs: npm run size fi - name: Create build-output-${{ inputs.cloud_region }} artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: build-output-${{ inputs.cloud_region }} + name: build-output-${{ inputs.cloud_region }}-${{ matrix.language }} path: dist/ + + merge_multiple_artifacts: + needs: build + runs-on: ubuntu-latest + steps: + - name: Merge into build-output-${{ inputs.cloud_region }}-temp Artifact + uses: actions/upload-artifact/merge@v4 + with: + name: build-output-${{ inputs.cloud_region }}-temp + pattern: build-output-${{ inputs.cloud_region }}-* + delete-merged: true + + overwrite_artifact: + needs: merge_multiple_artifacts + runs-on: ubuntu-latest + steps: + - name: Download build-output-${{ inputs.cloud_region }}-temp artifact + uses: actions/download-artifact@v4 + with: + name: build-output-${{ inputs.cloud_region }}-temp + path: dist/ + - name: Overwrite build-output-${{ inputs.cloud_region }} artifact + uses: actions/upload-artifact@v4 + with: + name: build-output-${{ inputs.cloud_region }} + path: dist/ + overwrite: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 93764c536..8d6c68608 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,14 +24,14 @@ jobs: deploy-aws: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download build-output-US artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-US path: dist/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/deploy_hold.yml b/.github/workflows/deploy_hold.yml index d79691c01..82c0defa0 100644 --- a/.github/workflows/deploy_hold.yml +++ b/.github/workflows/deploy_hold.yml @@ -27,14 +27,14 @@ jobs: runs-on: ubuntu-latest environment: production # sets in github repo with reviewer requirement protection rule steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download build-output-US artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-US path: dist/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1-node16 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -50,19 +50,19 @@ jobs: runs-on: ubuntu-latest environment: production # sets in github repo with reviewer requirement protection rule steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Download build-output-EU artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-EU path: dist/ - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v0 + uses: google-github-actions/auth@v2 with: credentials_json: '${{ secrets.GCP_SA_KEY }}' - name: Deploy to GCP Bucket - uses: google-github-actions/upload-cloud-storage@v0 + uses: google-github-actions/upload-cloud-storage@v2 with: path: dist/ parent: false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc66f5ca7..e97c52ac8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,5 +21,5 @@ jobs: image: returntocorp/semgrep if: (github.actor != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: semgrep ci diff --git a/.github/workflows/miscellaneous_tests.yml b/.github/workflows/miscellaneous_tests.yml index 445951b88..a3111b4ba 100644 --- a/.github/workflows/miscellaneous_tests.yml +++ b/.github/workflows/miscellaneous_tests.yml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' diff --git a/.github/workflows/should_deploy_major_version.yml b/.github/workflows/should_deploy_major_version.yml index f2fe4ef6b..3525dcc91 100644 --- a/.github/workflows/should_deploy_major_version.yml +++ b/.github/workflows/should_deploy_major_version.yml @@ -17,7 +17,7 @@ jobs: outputs: should_deploy_major_version: ${{ steps.vars.outputs.should_deploy_major_version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: allow for major version deployment if the next minor version from current tag does not exist diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 4a5581511..f09fa90c8 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 cache: 'npm' - run: npm ci - name: Download build-output-US artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: build-output-US path: dist/