Skip to content

Commit

Permalink
Version 1.15.0
Browse files Browse the repository at this point in the history
## Version 1.15.0
### Changes
- Improvements to organization, reliability, and speed of acceptance tests.
- SDK releases are now deployed to GCP EU as well as AWS. (#1770)
- CI/CD pipeline was sped up. (#1743, #1744)
- The SDK now requires Node v14 or newer (previously the minimum version was v12). (#1751)

### Fixes
- The `searcher` attribute is now correctly passed in Direct Answer Analytics Events. (#1786)
  • Loading branch information
tmeyer2115 authored Nov 15, 2022
2 parents 84e6c55 + 522b117 commit 9c9b83f
Show file tree
Hide file tree
Showing 62 changed files with 7,746 additions and 2,941 deletions.
3 changes: 1 addition & 2 deletions .github/testcafe.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"src": ["tests/acceptance/acceptancesuites/*.js", "!tests/acceptance/acceptancesuites/searchbaronlysuite.js"],
"appCommand": "npx serve -l tcp://0.0.0.0:9999",
"appInitDelay": 4000,
"skipJsErrors": true
"appInitDelay": 4000
}
1 change: 1 addition & 0 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
with:
name: build-output
path: dist/
- run: npm i -D [email protected]
- run: ./.github/run_browserstack_acceptance.sh
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-${{ github.ref }}-1
cancel-in-progress: true
cancel-in-progress: true
7 changes: 4 additions & 3 deletions .github/workflows/build_and_deploy_hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:

jobs:
call_build:
uses: ./.github/workflows/build.yml
with:
build_script: build-locales
uses: ./.github/workflows/build_i18n.yml

call_unit_test:
uses: ./.github/workflows/unit_test.yml
Expand Down Expand Up @@ -44,6 +42,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_major_version:
needs:
Expand All @@ -60,6 +59,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_minor_version:
needs:
Expand All @@ -74,6 +74,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-hold-${{ github.ref }}-1
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build_and_deploy_i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
call_build:
uses: ./.github/workflows/build.yml
with:
build_script: build-locales
build_script: build-unminified-legacy

call_unit_test:
uses: ./.github/workflows/unit_test.yml
Expand All @@ -30,6 +30,9 @@ jobs:
secrets:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

call_build_locales:
uses: ./.github/workflows/build_i18n.yml

call_deploy:
if: github.ref_name != 'develop'
Expand All @@ -38,12 +41,14 @@ jobs:
- call_format_branch_name
- call_acceptance
- call_misc_tests
- call_build_locales
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_canary:
if: github.ref_name == 'develop'
Expand All @@ -52,12 +57,14 @@ jobs:
- call_format_branch_name
- call_acceptance
- call_misc_tests
- call_build_locales
uses: ./.github/workflows/deploy.yml
with:
directory: canary/latest
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_canary_sha:
if: github.ref_name == 'develop'
Expand All @@ -66,13 +73,15 @@ jobs:
- call_format_branch_name
- call_acceptance
- call_misc_tests
- call_build_locales
uses: ./.github/workflows/deploy.yml
with:
directory: canary/${{ github.sha }}
cache-control: 'max-age=31536000'
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-i18n-${{ github.ref }}-1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build_and_deploy_search_bar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
call_build:
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/build_i18n.yml
with:
build_script: build-search-bar-only

Expand Down Expand Up @@ -44,6 +44,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_major_version:
needs:
Expand All @@ -60,6 +61,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

call_deploy_minor_version:
needs:
Expand All @@ -74,6 +76,7 @@ jobs:
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}

concurrency:
group: ci-build-and-deploy-search-bars-${{ github.ref }}-1
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/build_i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Answers i18n assets

on:
workflow_call:
inputs:
build_script:
required: false
default: build-locales
type: string

jobs:
create_language_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- id: set-matrix
run: |
echo ::set-output name=matrix::$(node -e 'console.log(require("./conf/i18n/constants").ALL_LANGUAGES)')
build:
needs: create_language_matrix
runs-on: ubuntu-latest
strategy:
matrix:
language: ${{ fromJson(needs.create_language_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: LANGUAGE=${{ matrix.language }} npm run ${{ inputs.build_script }}
- run: |
if [ "${{ matrix.language }}" == "en" ]; then
npm run size
fi
- name: Create build-output artifact
uses: actions/upload-artifact@v2
with:
name: build-output
path: dist/
32 changes: 28 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy assets to AWS S3
name: Deploy assets to AWS S3 and GCP Cloud Storage

on:
workflow_call:
Expand All @@ -19,11 +19,12 @@ on:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
GCP_SA_KEY:
required: true

jobs:
deploy:
deploy-aws:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Download build-output artifact
Expand All @@ -42,4 +43,27 @@ jobs:
aws s3 cp ./dist/ s3://assets.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }} \
--acl public-read \
--recursive \
--cache-control ${{ inputs.cache-control }}
--cache-control ${{ inputs.cache-control }}
deploy-gcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download build-output artifact
uses: actions/download-artifact@v2
with:
name: build-output
path: dist/
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Deploy to GCP Bucket
uses: google-github-actions/upload-cloud-storage@v0
with:
path: dist/
parent: false
destination: assets-eu.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }}
headers: |-
cache-control: ${{ inputs.cache-control }}
34 changes: 30 additions & 4 deletions .github/workflows/deploy_hold.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy assets to AWS S3 with hold state setup in github's production environment
name: Deploy assets to AWS S3 and GCP Cloud Storage with hold state setup in github's production environment

on:
workflow_call:
Expand All @@ -19,11 +19,13 @@ on:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
GCP_SA_KEY:
required: true

jobs:
deploy:
deploy-aws:
runs-on: ubuntu-latest
environment: production # sets in github repo with reiewer requirement protection rule
environment: production # sets in github repo with reviewer requirement protection rule
steps:
- uses: actions/checkout@v2
- name: Download build-output artifact
Expand All @@ -42,4 +44,28 @@ jobs:
aws s3 cp ./dist/ s3://assets.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }} \
--acl public-read \
--recursive \
--cache-control ${{ inputs.cache-control }}
--cache-control ${{ inputs.cache-control }}
deploy-gcp:
runs-on: ubuntu-latest
environment: production # sets in github repo with reviewer requirement protection rule
steps:
- uses: actions/checkout@v3
- name: Download build-output artifact
uses: actions/download-artifact@v2
with:
name: build-output
path: dist/
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Deploy to GCP Bucket
uses: google-github-actions/upload-cloud-storage@v0
with:
path: dist/
parent: false
destination: assets-eu.sitescdn.net/${{ inputs.bucket }}/${{ inputs.directory }}
headers: |-
cache-control: ${{ inputs.cache-control }}
5 changes: 4 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
The Answers Search UI files listed in this repository are licensed under the below license.  All other features and products are subject to separate agreements
and certain functionality requires paid subscriptions to Yext products.

BSD 3-Clause License

Copyright (c) 2020, Yext
Copyright (c) 2022, Yext
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
31 changes: 24 additions & 7 deletions conf/gulp-tasks/library.gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ exports.dev = function devJSBundle () {
});
};

/**
* Creates the un-minified legacy JS bundle and compiles CSS.
* @returns {Promise<Function>}
*/
exports.unminifiedLegacy = function unminifiedLegacyJSBundle () {
return createBundleTaskFactory(DEFAULT_LOCALE).then(unminifiedLegacyTaskFactory => {
return new Promise(resolve => {
return parallel(
unminifiedLegacyTaskFactory.create(BundleType.LEGACY_IIFE),
compileCSS
)(resolve);
});
});
};

/**
* Creates a build task for each provided language and combines them into a series task.
* This function also supports locales, but it is named to reflect the current use case
Expand All @@ -54,9 +69,11 @@ function createJSBundlesForLanguages (languages, isSearchBarOnly = false) {
* Creates a task for building all of the localized SDK assets.
*
* @param {boolean} isSearchBarOnly If the task is for the SearchBar-only assets.
* @param {string[]} languages a list of languages to build js bundles for,
* with the corresponding language-locale pairs.
* @returns {Promise<Function>}
*/
function allLocaleJSBundles (isSearchBarOnly = false) {
function allLocaleJSBundles (isSearchBarOnly = false, languages) {
const assetNames = [
'answers.js',
'answers.min.js',
Expand All @@ -65,8 +82,8 @@ function allLocaleJSBundles (isSearchBarOnly = false) {
'answers-umd.js',
'answers-umd.min.js'];

return createJSBundlesForLanguages(ALL_LANGUAGES, isSearchBarOnly).then(() => {
copyAssetsForLocales(assetNames);
return createJSBundlesForLanguages(languages, isSearchBarOnly).then(() => {
copyAssetsForLocales(assetNames, languages);
});
}

Expand All @@ -78,12 +95,12 @@ exports.buildLanguages = function allLanguageJSBundles () {
return createJSBundlesForLanguages(ALL_LANGUAGES);
};

exports.buildLocales = function () {
return allLocaleJSBundles();
exports.buildLocales = function (languages = ALL_LANGUAGES) {
return allLocaleJSBundles(false, languages);
};

exports.buildSearchBarOnlyAssets = function () {
return allLocaleJSBundles(true);
exports.buildSearchBarOnlyAssets = function (languages = ALL_LANGUAGES) {
return allLocaleJSBundles(true, languages);
};

/**
Expand Down
Loading

0 comments on commit 9c9b83f

Please sign in to comment.