Skip to content

Commit

Permalink
v1.10.0
Browse files Browse the repository at this point in the history
### New Features
* The SearchBar now supports displaying a loading indicator while a search is running.
* The SearchBar also now has support for voice search.
* We now support several new languages, including simplified/traditional Chinese and several variants of Arabic.
* `universalLimit` config option (#1444)
* Session tracking using the browser's session storage (#1452)
* `querySource` can now be set at runtime using `ANSWERS.setQuerySource()` (#1464)
* Display email validation error in QuestionSubmission (#1505)
* Support for DirectAnswers on vertical searches (#1483)
* Support providerOptions on the map (#1484)
* Create entry points for multi-lang SDK bundles (#1501) 

### Speed Improvements
* replace IconComponent usages with handlebars partials (#1445) (#1451) (#1458)

### Infrastructure
* Change CircleCI node_modules caching strategy to use package-lock.json instead of package.json (#1457)
* `canary/latest` assets are now built with i18n support (#1459)
* More tests + acceptance testing improvements
* Automated publishing for the standalone SearchBar assets (#1529)

### SearchBar-only release notes
* The SearchBar now supports displaying a loading indicator while a search is running.
* The SearchBar also now has support for voice search.
  • Loading branch information
oshi97 authored Aug 24, 2021
2 parents dffb8eb + 6e7b568 commit 7f600ea
Show file tree
Hide file tree
Showing 149 changed files with 11,374 additions and 3,179 deletions.
162 changes: 121 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ commands:
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v2-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v2-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
key: v2-dependencies-{{ checksum "package-lock.json" }}
deploy-to-aws:
description: "Deploys the dist directory to a given subdirectory of the answers bucket"
parameters:
Expand All @@ -27,6 +27,9 @@ commands:
cache-control:
type: string
default: "no-cache"
deploy-bucket:
type: string
default: answers
steps:
- attach_workspace:
at: ~/answers
Expand All @@ -38,7 +41,7 @@ commands:
echo -e $AWS_PROD_PROFILE >> ~/.aws/config
- aws-s3/copy:
from: dist
to: '${AWS_DEPLOY_BUCKET}<< parameters.subdirectory >>'
to: 's3://assets.sitescdn.net/<< parameters.deploy-bucket >><< parameters.subdirectory >>'
arguments: |
--acl public-read \
--cache-control << parameters.cache-control >> \
Expand Down Expand Up @@ -71,6 +74,18 @@ jobs:
paths:
- dist
- .circleci
build_search_bar:
docker:
- image: circleci/node:14.5
working_directory: ~/answers
steps:
- setup-workspace
- run: npm run build-search-bar-only
- persist_to_workspace:
root: .
paths:
- dist
- .circleci
# run the jest unit tests
unit_test:
docker:
Expand All @@ -91,7 +106,18 @@ jobs:
- setup-workspace
- attach_workspace:
at: ~/answers
- run: npx testcafe chrome:headless,firefox:headless tests/acceptance/acceptancesuites/*.js -q
- run: ./.circleci/run_headless_acceptance.sh
headless_acceptance_test_search_bar:
docker:
- image: circleci/node:14.5-browsers
working_directory: ~/answers
steps:
- setup-workspace
- attach_workspace:
at: ~/answers
- run:
name: Search Bar Acceptance Tests
command: npx testcafe -c 3 "chrome:headless,firefox:headless" --config-file ./.circleci/testcafe_search_bar.json -q
# run the browserstack testcafe acceptance tests
browserstack_acceptance_test:
docker:
Expand All @@ -102,22 +128,17 @@ jobs:
- attach_workspace:
at: ~/answers
- run: ./.circleci/run_browserstack_acceptance.sh
# verify all translations are present
translation_test:
useragent_acceptance_test:
docker:
- image: circleci/node:14.5
- image: circleci/node:14.5-browsers
working_directory: ~/answers
steps:
- setup-workspace
- attach_workspace:
at: ~/answers
- run:
name: Verify translation files
command: |
sudo apt-get install -qq gettext
./.circleci/run_translation_verification.sh
# verify that the third party notices file is up to date
third_party_notices_test:
- run: ./.circleci/run_useragent_acceptance.sh
# verify all translations are present
translation_test:
docker:
- image: circleci/node:14.5
working_directory: ~/answers
Expand All @@ -126,8 +147,10 @@ jobs:
- attach_workspace:
at: ~/answers
- run:
name: Verify third party notices
command: ./.circleci/validate_third_party_notices.sh
name: Verify translation files
command: |
sudo apt-get install -qq gettext
./.circleci/run_translation_verification.sh
# deploy to S3 in the root folder, overwriting the existing latest version
deploy_latest:
docker:
Expand Down Expand Up @@ -177,6 +200,29 @@ jobs:
- deploy-to-aws:
subdirectory: '/${MAJOR_VERSION}'
cache-control: 'max-age=43200'
# deploys assets to a long-lived-cache folder in the S3 bucket named by release tag
deploy_search_bar_version:
docker:
- image: circleci/python:2.7
working_directory: ~/answers
steps:
- deploy-to-aws:
deploy-bucket: 'answers-search-bar'
subdirectory: '/${CIRCLE_TAG##search-bar-}'
cache-control: 'max-age=31536000'
- run:
name: "Get major and minor version substrings"
command: |
echo "export MINOR_VERSION="$(echo "${CIRCLE_TAG##search-bar-}" | cut -d '.' -f 1,2)"" >> $BASH_ENV
echo "export MAJOR_VERSION="$(echo "${CIRCLE_TAG##search-bar-}" | cut -d '.' -f 1)"" >> $BASH_ENV
- deploy-to-aws:
deploy-bucket: 'answers-search-bar'
subdirectory: '/${MINOR_VERSION}'
cache-control: 'max-age=43200'
- deploy-to-aws:
deploy-bucket: 'answers-search-bar'
subdirectory: '/${MAJOR_VERSION}'
cache-control: 'max-age=43200'
workflows:
version: 2
build_and_deploy:
Expand All @@ -185,6 +231,7 @@ workflows:
filters:
branches:
ignore:
- develop
- master
- /^support\/.*/
- /^hotfix\/.*/
Expand All @@ -199,39 +246,25 @@ workflows:
- browserstack_acceptance_test:
requires:
- build
- translation_test:
- useragent_acceptance_test:
requires:
- build
- third_party_notices_test:
- translation_test:
requires:
- build
- deploy_canary:
filters:
branches:
only: develop
requires:
- unit_test
- headless_acceptance_test
- browserstack_acceptance_test
- translation_test
- third_party_notices_test
- deploy_branch:
filters:
branches:
ignore:
- develop
requires:
- unit_test
- browserstack_acceptance_test
- useragent_acceptance_test
- headless_acceptance_test
- translation_test
- third_party_notices_test
build_and_deploy_i18n:
jobs:
- build_i18n:
filters:
branches:
only:
- develop
- /^support\/.*/
- /^hotfix\/.*/
- /^feature\/.*-i18n/
Expand All @@ -245,19 +278,32 @@ workflows:
- browserstack_acceptance_test:
requires:
- build_i18n
- translation_test:
- useragent_acceptance_test:
requires:
- build_i18n
- third_party_notices_test:
- translation_test:
requires:
- build_i18n
- deploy_branch:
filters:
branches:
ignore:
- develop
requires:
- unit_test
- browserstack_acceptance_test
- useragent_acceptance_test
- headless_acceptance_test
- translation_test
- third_party_notices_test
- deploy_canary:
filters:
branches:
only: develop
requires:
- unit_test
- headless_acceptance_test
- browserstack_acceptance_test
- useragent_acceptance_test
build_and_deploy_hold:
jobs:
- build_i18n:
Expand Down Expand Up @@ -285,13 +331,13 @@ workflows:
only: /^v.*/
requires:
- build_i18n
- translation_test:
- useragent_acceptance_test:
filters:
tags:
only: /^v.*/
requires:
- build_i18n
- third_party_notices_test:
- translation_test:
filters:
tags:
only: /^v.*/
Expand All @@ -305,9 +351,9 @@ workflows:
requires:
- unit_test
- browserstack_acceptance_test
- useragent_acceptance_test
- headless_acceptance_test
- translation_test
- third_party_notices_test
- deploy_latest:
filters:
branches:
Expand All @@ -322,3 +368,37 @@ workflows:
ignore: /.*/
requires:
- hold
build_and_deploy_search_bar:
jobs:
- build_search_bar:
filters:
tags:
only: /^search-bar-v.*/
branches:
ignore: /.*/
- headless_acceptance_test_search_bar:
filters:
tags:
only: /^search-bar-v.*/
requires:
- build_search_bar
- translation_test:
filters:
tags:
only: /^search-bar-v.*/
requires:
- build_search_bar
- hold:
type: approval
filters:
tags:
only: /^search-bar-v.*/
requires:
- headless_acceptance_test_search_bar
- translation_test
- deploy_search_bar_version:
filters:
tags:
only: /^search-bar-v.*/
requires:
- hold
10 changes: 9 additions & 1 deletion .circleci/run_browserstack_acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ export BROWSERSTACK_BUILD_ID="${CIRCLE_BRANCH} - ${CIRCLE_BUILD_NUM}"
COMMIT_MSG_TITLE=$(git log -n 1 --pretty=format:%s)
export BROWSERSTACK_TEST_RUN_NAME=$COMMIT_MSG_TITLE

npx testcafe "browserstack:[email protected],browserstack:safari" tests/acceptance/acceptancesuites/*.js -q
if [[ $CIRCLE_BRANCH == release/*
|| $CIRCLE_BRANCH == hotfix/*
|| $CIRCLE_BRANCH == master
|| $CIRCLE_BRANCH == support/* ]]
then
npx testcafe "browserstack:[email protected],browserstack:safari" --config-file ./.circleci/testcafe.json -q
else
npx testcafe -c 2 "browserstack:[email protected]" --config-file ./.circleci/testcafe.json -q
fi
11 changes: 11 additions & 0 deletions .circleci/run_headless_acceptance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [[ $CIRCLE_BRANCH == release/*
|| $CIRCLE_BRANCH == hotfix/*
|| $CIRCLE_BRANCH == master
|| $CIRCLE_BRANCH == support/* ]]
then
npx testcafe -c 3 "chrome:headless,firefox:headless" --config-file ./.circleci/testcafe.json -q
else
npx testcafe -c 3 "chrome:headless" --config-file ./.circleci/testcafe.json -q
fi
28 changes: 24 additions & 4 deletions .circleci/run_translation_verification.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
#!/bin/bash

# Verifiy that the messages.pot file in the repo is up to date
# If there are any git diffs after translations are extracted, the checked-in file is out of date
npm run extract-translations
git diff --exit-code conf/i18n/translations/messages.pot > /dev/null # send stdout to /dev/null to reduce clutter in the CI output
diff_exit_code=$?

cd conf/i18n/translations
if test $diff_exit_code -eq 1
then
echo "Extracted translations are out of date. Run 'npm run extract-translations' and commit the updated pot file."
exit 1
else
echo "The messages.pot translation file is up to date."
fi

for po_file in *.po
do msgcmp $po_file messages.pot
done
# Verify that translations are present for all languages
cd conf/i18n/translations
if [[ $CIRCLE_BRANCH == release/*
|| $CIRCLE_BRANCH == hotfix/*
|| $CIRCLE_BRANCH == master
|| $CIRCLE_BRANCH == support/* ]]
then
for po_file in *.po
do msgcmp $po_file messages.pot
done
else
echo "Skipping the verification that all translations are present"
fi
8 changes: 8 additions & 0 deletions .circleci/run_useragent_acceptance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
export BROWSERSTACK_USE_AUTOMATE="1"
export BROWSERSTACK_PROJECT_NAME="Answers SDK"
export BROWSERSTACK_BUILD_ID="${CIRCLE_BRANCH} - ${CIRCLE_BUILD_NUM}"
COMMIT_MSG_TITLE=$(git log -n 1 --pretty=format:%s)
export BROWSERSTACK_TEST_RUN_NAME=$COMMIT_MSG_TITLE

npx testcafe chrome:headless,firefox:headless,browserstack:safari,browserstack:edge tests/acceptance/useragent/useragentsuite.js --config-file ./.circleci/testcafe.json
5 changes: 5 additions & 0 deletions .circleci/testcafe.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src": ["tests/acceptance/acceptancesuites/*.js", "!tests/acceptance/acceptancesuites/searchbaronlysuite.js"],
"appCommand": "npx serve -l tcp://0.0.0.0:9999",
"appInitDelay": 4000
}
5 changes: 5 additions & 0 deletions .circleci/testcafe_search_bar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"src": ["tests/acceptance/acceptancesuites/searchbaronlysuite.js"],
"appCommand": "npx serve -l tcp://0.0.0.0:9999",
"appInitDelay": 4000
}
Loading

0 comments on commit 7f600ea

Please sign in to comment.