Skip to content

Commit

Permalink
Merge pull request #491 from reactioncommerce/release-v2.0.0-rc.9
Browse files Browse the repository at this point in the history
Release v2.0.0 rc.9
  • Loading branch information
spencern authored Jan 25, 2019
2 parents c0365c2 + 44f9a49 commit 23c127a
Show file tree
Hide file tree
Showing 224 changed files with 9,229 additions and 4,629 deletions.
34 changes: 12 additions & 22 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"presets": [
["next/babel", {
[ "next/babel", {
"preset-env": {
"modules": "commonjs",
"targets": {
"node": "current",
"browsers": [
Expand All @@ -11,31 +10,22 @@
]
}
}
}]
} ]
],
"plugins": [
"babel-plugin-styled-components",
[ "module-resolver", { "root": [ "./src" ] } ],
[ "@babel/plugin-proposal-decorators", { "legacy": true } ],
[ "@babel/plugin-proposal-class-properties", { "loose": true } ]
],
"env": {
"development": {
"plugins": [
"babel-plugin-styled-components",
["module-resolver", {"root": ["./src", "./config"]}],
"transform-decorators-legacy",
"transform-class-properties"
]
},
"production": {
"plugins": [
"babel-plugin-styled-components",
["module-resolver", {"root": ["./src", "./config"]}],
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }]
]
},
"jesttest": {
"plugins": [
"babel-plugin-styled-components",
["module-resolver", {"root": ["./src", "./config"]}],
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }]
[ "module-resolver", { "root": [ "./src" ] } ],
[ "@babel/plugin-proposal-decorators", { "legacy": true } ],
[ "@babel/plugin-proposal-class-properties", { "loose": true } ],
"dynamic-import-node"
]
}
}
Expand Down
69 changes: 51 additions & 18 deletions .circleci/bin/ecs-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,67 @@
#!/bin/bash

sudo apt-get -y install python3-pip wget
sudo apt-get -y install python3-pip wget jq
sudo pip3 install awscli
wget https://github.com/mikefarah/yq/releases/download/2.0.1/yq_linux_amd64 -O /tmp/yq
sudo mv /tmp/yq /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq

if [ -z "${AWS_REGION}" ]; then
AWS_REGION=us-west-2
AWS_REGION=us-west-2
fi

if [ "${CLOUDFORMATION_AWS_ACCESS_KEY_ID}" ]; then
AWS_ACCESS_KEY_ID=${CLOUDFORMATION_AWS_ACCESS_KEY_ID}
fi
ENVIRONMENT=staging
SERVICE_DIR_NAME=.reaction/devops/aws/services
export storefront_CIRCLE_SHA1=$CIRCLE_SHA1

if [ "${CLOUDFORMATION_AWS_SECRET_ACCESS_KEY}" ]; then
AWS_SECRET_ACCESS_KEY=${CLOUDFORMATION_AWS_SECRET_ACCESS_KEY}
fi
SERVICES=$(ls ${SERVICE_DIR_NAME})

for SERVICE in $SERVICES; do
DISABLED=$(echo $SERVICE | grep disabled)
if [ "${DISABLED}" == "${SERVICE}" ]; then
continue
fi
echo "START PROCESSING SERVICE ${SERVICE}"

cd ${SERVICE_DIR_NAME}/${SERVICE}

PROPEL_CONFIG_FILE="propel-${ENVIRONMENT}.yaml"
if [ ! -f ${PROPEL_CONFIG_FILE} ]; then
echo "Propel configuration file not found!"
exit 1
fi

ENV_NAME_UPPERCASE=$(echo $ENVIRONMENT | awk '{print toupper($0)}')
AWS_ACCESS_KEY_ID_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY_VAR_NAME=CLOUDFORMATION_${ENV_NAME_UPPERCASE}_AWS_SECRET_ACCESS_KEY

if [ "${!AWS_ACCESS_KEY_ID_VAR_NAME}" ]; then
AWS_ACCESS_KEY_ID=${!AWS_ACCESS_KEY_ID_VAR_NAME}
fi

if [ "${!AWS_SECRET_ACCESS_KEY_VAR_NAME}" ]; then
AWS_SECRET_ACCESS_KEY=${!AWS_SECRET_ACCESS_KEY_VAR_NAME}
fi

mkdir -p ~/.aws
echo "[default]" > ~/.aws/credentials
echo "aws_access_key_id = ${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials
echo "aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials

mkdir ~/.aws
echo "[default]" > ~/.aws/credentials
echo "aws_access_key_id = ${AWS_ACCESS_KEY_ID}" >> ~/.aws/credentials
echo "aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}" >> ~/.aws/credentials
echo "[default]" > ~/.aws/config
echo "region = ${AWS_REGION}" >> ~/.aws/config

echo "[default]" > ~/.aws/config
echo "region = ${AWS_REGION}" >> ~/.aws/config
echo Running aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel
aws s3 cp s3://${S3_PROPEL_ARTIFACTS_BUCKET}/propel-linux-amd64 ./propel

aws s3 cp --recursive s3://${S3_ECS_DEPLOY_BUCKET}/staging/devops .
sudo mv propel /usr/local/bin/propel
sudo chmod +x /usr/local/bin/propel

find aws -name \*sh | xargs chmod +x
cd aws/app-starterkit
./update-app-stack.sh sk-service
RELEASE_DESCRIPTION="CircleCI build URL: ${CIRCLE_BUILD_URL}"
echo storefront_CIRCLE_SHA1=$storefront_CIRCLE_SHA1
propel release create --deploy --descr "${RELEASE_DESCRIPTION}" -f ${PROPEL_CONFIG_FILE}

echo "END PROCESSING SERVICE ${SERVICE}"

cd -
done
45 changes: 28 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,6 @@ jobs:
--name reactionapp_next_starterkit \
"$DOCKER_REPOSITORY:$CIRCLE_SHA1" \
yarn run test:ci
- run:
name: Integration Test
command: |
docker run \
--env-file docker-cache/.env \
--name reactionapp_next_starterkit_int \
"$DOCKER_REPOSITORY:$CIRCLE_SHA1" \
yarn run test:integration
# - run:
# name: Install Broken Link Checker
# command: |
# yarn add broken-link-checker
# - run:
# name: Broken Link Test
# command: |
# ./node_modules/.bin/blc ${STAGING_URL} -ro -filter=3 -e
- run:
name: Copy test artifacts from Remote Docker
command: |
Expand All @@ -224,6 +208,29 @@ jobs:
- store_artifacts:
path: reports

e2e-test:
<<: *defaults
steps:
- setup_remote_docker
- attach_workspace:
at: docker-cache
- run:
name: Load Docker Image
command: |
docker load < docker-cache/docker-image.tar
- run:
name: Integration Test
command: |
docker run -e URL=${STAGING_URL} --env-file docker-cache/.env --name reaction_app_next_starterkit "$DOCKER_REPOSITORY:$CIRCLE_SHA1" yarn run test:integration
- run:
name: Install Broken Link Checker
command: |
yarn add broken-link-checker
- run:
name: Broken Link Test
command: |
./node_modules/.bin/blc ${STAGING_URL} -ro -filter=3 -e
snyk-security:
<<: *defaults
steps:
Expand Down Expand Up @@ -278,4 +285,8 @@ workflows:
- docker-push
filters:
branches:
only: /^master$/
only: /^develop$/
- e2e-test:
requires:
- deploy-to-ecs

29 changes: 14 additions & 15 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
NODE_ENV=development
INTERNAL_GRAPHQL_URL=http://reaction.api.reaction.localhost:3000/graphql-alpha
CANONICAL_URL=http://localhost:4000
ENABLE_SPA_ROUTING=true
EXTERNAL_GRAPHQL_URL=http://localhost:3000/graphql-alpha
FAVICON_URL=https://assets.reactioncommerce.com/favicon
PLACEHOLDER_IMAGE_URL_GALLERY=/resources/placeholder.gif
PLACEHOLDER_IMAGE_URL_GRID=/resources/placeholder.gif
SEGMENT_ANALYTICS_SKIP_MINIMIZE=true
SEGMENT_ANALYTICS_WRITE_KEY=ENTER_KEY_HERE
KEYCLOAK_REALM=default
KEYCLOAK_CLIENT_ID=reaction-next-starterkit
KEYCLOAK_URL=http://localhost:8080/auth
KEYCLOAK_REDIRECT_URI=http://localhost:4000/auth
STRIPE_PUBLIC_API_KEY=ENTER_STRIPE_PUBLIC_KEY_HERE
INTERNAL_GRAPHQL_URL=http://reaction.api.reaction.localhost:3000/graphql-alpha
NODE_ENV=development
OAUTH2_ADMIN_PORT=4445
OAUTH2_AUTH_URL=http://localhost:4444/oauth2/auth
OAUTH2_TOKEN_URL=http://hydra:4444/oauth2/token
OAUTH2_CLIENT_ID=reaction-next-starterkit
OAUTH2_CLIENT_SECRET=CHANGEME
OAUTH2_HOST=hydra.auth.reaction.localhost
OAUTH2_IDP_HOST_URL=http://reaction.api.reaction.localhost:3000/
OAUTH2_REDIRECT_URL=http://localhost:4000/callback
PASSPORT_SESSION_SECRET=CHANGEME
CANONICAL_URL=http://example.com
OAUTH2_TOKEN_URL=http://hydra.auth.reaction.localhost:4444/oauth2/token
PORT=4000
SEGMENT_ANALYTICS_SKIP_MINIMIZE=true
SEGMENT_ANALYTICS_WRITE_KEY=ENTER_KEY_HERE
SESSION_MAX_AGE_MS=2592000000
SESSION_SECRET=CHANGEME
STRIPE_PUBLIC_API_KEY=ENTER_STRIPE_PUBLIC_KEY_HERE
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build/*
node_modules/*
reports/*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
.vscode
.idea
.c9
.env
.env*
!.env.example*
*.csv
*.dat
*.gz
Expand Down
2 changes: 1 addition & 1 deletion .graphqlrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"request": {
"url": "http://localhost:3030/graphql-alpha"
"url": "http://localhost:3000/graphql-alpha"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
environment:
name: staging
service:
name: sk-storefront
cluster: core
certificate_arn: arn:aws:acm:us-west-2:773713188930:certificate/c2979a7a-7b84-43ed-b3a7-24b0256a1b9f
root_domain: staging.reactioncommerce.com
dns_name: storefront
desired_task_count: 1
min_task_count: 0
max_task_count: 8
min_healthy_percent: 100
max_percent: 200
alb_listener_port: 80
alb_listener_path: /
alb_health_check_path: /
task-definition:
name: staging-storefront
containers:
- name: storefront
cpu: 500
memory: 1800
port_mappings:
- container_port: 4000
host_port: 4000
image: reactioncommerce/reaction-next-starterkit
image_tag: develop
env_params:
- name: INTERNAL_GRAPHQL_URL
- name: EXTERNAL_GRAPHQL_URL
- name: FAVICON_URL
- name: PLACEHOLDER_IMAGE_URL_GALLERY
- name: PLACEHOLDER_IMAGE_URL_GRID
- name: SEGMENT_ANALYTICS_SKIP_MINIMIZE
- name: SEGMENT_ANALYTICS_WRITE_KEY
- name: STRIPE_PUBLIC_API_KEY
- name: OAUTH2_AUTH_URL
- name: OAUTH2_TOKEN_URL
- name: OAUTH2_CLIENT_ID
- name: OAUTH2_CLIENT_SECRET
- name: OAUTH2_REDIRECT_URL
- name: PASSPORT_SESSION_SECRET
- name: CANONICAL_URL
File renamed without changes.
12 changes: 2 additions & 10 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
version: v1.12.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'npm:braces:20180219':
- '*':
reason: Waiting for Next.js 6 to update to Babel 7 beta.47 (https://github.com/babel/babel/issues/8034)
expires: 2018-09-30T00:00:00.000Z
'npm:chownr:20180731':
- '*':
reason: Waiting on next-routes(https://github.com/fridays/next-routes) to fix this vulnerability
expires: 2018-09-30T00:00:00.000Z
'npm:mem:20180117':
- '*':
reason: Waiting on next-routes(https://github.com/fridays/next-routes) to fix this vulnerability
expires: 2018-09-30T00:00:00.000Z
reason: This vulnerability only affects packages used in development, such as webpack, more details at https://github.com/isaacs/chownr/issues/14#issuecomment-421662375
expires: 2019-01-31T00:00:00.000Z
patch: {}
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# v2.0.0-rc.9
This is our first release candidate for this project - we're going to be synchronizing releases across the differents parts of the Reaction Commerce ecosystem, so that's why we're starting with rc.8. This project should be considered `pre-release` until we've released the final 2.0.0 version.

## Features
- feat: Improve loading pattern for tags and navItems (#461)
- feat(tlp metadata): render metafield as metadata on TLP (#453)
- feat(tlp title): add tag listing page's display title (#450)
- feat: 443: PDP: Remove Tags display (#447)
- feat: Add subtotal to CartItems (#437) .. Resolves #240
- feat: Simplify customization (#454)
- feat: Use new `order.referenceId` as displayed order ID (#434)
- feat: 366 nnnnat address validation (#421)
- feat: Enable/Disable Single-page app routing (#419)
- feat: Renew access tokens on 401 errors using redirects to auth endpoint (#399)
- feat: Add "Order Completed" event tracking (#388)
- feat: Add tracking to checkout flow (#384)
- feat: Add tracking for "Product Removed" + "Cart Viewed" events (#372)
- feat: Create hydra client on startup (#363)
- feat: Add tracking for "Product Added" Segment event (#361)
- feat: 353 nnnnat status labels (#358)
- feat: update node to version 10 (#347)
- feat: Add sign in/up info in auth URL generated by Passport (#320)

## Fixes
- fix: Fix infinite loader when cart empty (#474)
- fix: fix logic for retrying 401s with silent re-auth (#471)
- fix: Add proper isMounted checking (#455)
- fix: Fix error when clicking links when ENABLE_SPA_LINKS=false (#442)
- fix: Add null check (#429)
- fix: incorrect logger.debug (#428)
- fix: show tax total in all summaries (#424)
- fix(414): Fullname is not saved or displayed (#420)
- fix(config): add canonicalUrl to publicRuntimeConfig (#418)
- fix(340): catch Stripe Payment error and save error message (#406)
- fix(385): Fix Product title & image URLs in Cart, MiniCart, FinalReviewCheckoutAction (#412)
- fix: SSR issues with product grids and PDP pages (#407)
- fix: integration test finished before resolving (#401)
- fix: 369 compareAtPrice (#383)
- fix: Remove unused scopes and grant_type (#390)
- fix: Update src/lib/theme/components.js (#392)
- fix: PDP Mobile re-org (#373)
- fix: Add metafields to product query (#378) .. Resolves #375
- fix: Mobile nav design & bug fixes (#346)
- fix: issue cause by using Router from `next/routes` on the server (#368)
- fix: Always use https for npm registry (#365)
- fix: Duplicated initials in logged in indicator (#343)
- fix: clear a user's cart after placing an order, and remove MiniCart popper from order completed page. (#332)
- fix: add padding to cart items in order complete page (#338)
- fix: Replace passport server-side sessions with cookie session (#349)
- fix: MiniCart popper occasionally being drawn at the wrong position. (#336)

## Docs
- docs: update install instructions to link to the official Docs (#382)
- docs: numbering bug (#337)

## Performance Improvements
- perf: Performance improvements (#396)

## Refactors
- refactor: inventory status fixes and updated UI design (#459)
- refactor: unsplit first and last name fields in Checkout saving (#386)
- refactor: static assets (#367)
- refactor: progressive image (#362) .. Resolves #227

## Chores
- chore: integrate ssr test + broken link checker to CI (#473)
- chore: update the component library to 0.60.1 (#464)
- chore: Add logger messages for 401 error (#423)
- chore: upgrade reactioncommerce/components to latest (#425)
- chore: Deploy develop branch to staging environment in ECS (#355)
- chore: Enable Webpack tree shaking (#352)
- chore upgrade babel and next (#341)
- chore: Set project license to Apache 2.0 (#339)
Loading

0 comments on commit 23c127a

Please sign in to comment.