Skip to content

Commit

Permalink
Merge branch 'trunk' into bugfix_typos
Browse files Browse the repository at this point in the history
  • Loading branch information
brent-hoover authored Jan 19, 2024
2 parents 01f0f84 + b04166d commit 6b302bd
Show file tree
Hide file tree
Showing 1,138 changed files with 33,337 additions and 3,873 deletions.
9 changes: 0 additions & 9 deletions .changeset/lazy-zoos-listen.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/smart-balloons-draw.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/sweet-dolphins-wonder.md

This file was deleted.

72 changes: 62 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults: &defaults
DOCKER_NAMESPACE: "reactioncommerce"
DOCKER_NAME: "reaction"
docker:
- image: cimg/node:14.20.0
- image: cimg/node:18.10.0

install_pnpm: &install_pnpm
- run:
Expand Down Expand Up @@ -91,17 +91,22 @@ jobs:
- <<: *pnpm_install
- run:
name: Test Unit
no_output_timeout: 30m
command: pnpm test
resource_class: xlarge

test-integration-query:
<<: *defaults
docker:
- image: cimg/node:14.20.0
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
steps:
- checkout
- restore_cache:
Expand All @@ -119,16 +124,20 @@ jobs:
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
pnpm run test:integration:query
resource_class: xlarge

test-integration-mutation:
test-integration-mutation1:
<<: *defaults
docker:
- image: cimg/node:14.20.0
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
steps:
- checkout
- restore_cache:
Expand All @@ -145,7 +154,39 @@ jobs:
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
pnpm run test:integration:mutation
pnpm run test:integration:mutation1
resource_class: xlarge

test-integration-mutation2:
<<: *defaults
docker:
- image: cimg/node:18.10.0
# Integration tests need MongoDB server running and accessible on port 27017
- image: mongo:4.0
command: mongod --oplogSize 128 --replSet rs0 --storageEngine=wiredTiger
ports:
- "27017:27017"
- image: redis
ports:
- "6379:6379"
steps:
- checkout
- restore_cache:
keys:
- reaction-v7-node-modules-{{ checksum "package.json" }}-{{ checksum "pnpm-lock.yaml" }}
- reaction-v7-node-modules-{{ .Branch }}
- <<: *install_pnpm
- <<: *pnpm_install
- run:
name: Run Integration Mutation Tests
environment:
MONGO_URL: mongodb://localhost:27017/test
MONGO_USE_UNIFIED_TOPOLOGY: false
command: |
sudo apt update && sudo apt-get install -y mongodb
mongo --eval "rs.initiate()"
pnpm run test:integration:mutation2
resource_class: xlarge

release:
<<: *defaults
Expand All @@ -167,8 +208,8 @@ jobs:
- run:
name: Check should build new image
command: |
VERSION=$(cat ./apps/reaction/package.json | grep -m 1 version | sed 's/[^0-9.]//g')
if curl --silent -f --head -lL https://hub.docker.com/v2/repositories/${DOCKER_REPOSITORY}/tags/${VERSION}/ > /dev/null; then
head_commit=$(git log -1 --oneline | grep -m 1 releases)
if [[ $head_commit != *"/releases/docker-image"* ]]; then
circleci-agent step halt
fi
- run:
Expand All @@ -189,6 +230,7 @@ jobs:
echo "ROOT_URL=http://localhost:3000" >> .env
echo "STORE_URL=http://localhost:4000" >> .env
echo "STRIPE_API_KEY=YOUR_PRIVATE_STRIPE_API_KEY" >> .env
echo "REDIS_SERVER=redis://127.0.0.1:6379" >> .env
- run:
name: Create reaction.localhost network
command: docker network create "reaction.localhost" || true
Expand Down Expand Up @@ -237,7 +279,10 @@ workflows:
- test-integration-query:
requires:
- install-dependencies
- test-integration-mutation:
- test-integration-mutation1:
requires:
- install-dependencies
- test-integration-mutation2:
requires:
- install-dependencies
- release:
Expand All @@ -252,12 +297,19 @@ workflows:
- graphql-lint
- test-unit
- test-integration-query
- test-integration-mutation
- test-integration-mutation1
- test-integration-mutation2
- docker-build-push:
context: reaction-publish-docker
filters:
branches:
only:
- trunk
requires:
- release
- dockerfile-lint
- eslint
- graphql-lint
- test-unit
- test-integration-query
- test-integration-mutation1
- test-integration-mutation2
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
babelOptions: {
plugins: ["@babel/plugin-syntax-import-assertions"]
},
ecmaFeatures: {
impliedStrict: true
},
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docker release
on:
pull_request:
types:
- closed

permissions: {}

jobs:
create-docker-release-pr:
if: github.event.pull_request.merged == true && github.base_ref == 'trunk' && github.head_ref == 'changeset-release/trunk'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get new docker version
id: get-docker-version
run: |
VERSION=$(cat ./apps/reaction/package.json | grep -m 1 version | sed 's/[^0-9.]//g')
echo "NEW_DOCKER_IMAGE_VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "New release docker version is $VERSION"
- name: Check should build new image
id: should-build-new-image
run: |
if curl --silent -f --head -lL https://hub.docker.com/v2/repositories/reactioncommerce/reaction/tags/${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }}/ > /dev/null; then
echo "RESULT=false" >> $GITHUB_OUTPUT
else
echo "RESULT=true" >> $GITHUB_OUTPUT
fi
- name: Set git user
if: steps.should-build-new-image.outputs.RESULT == 'true'
run: |
echo ${{ steps.should-build-new-image.outputs.RESULT }}
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Update docker-compose file
if: steps.should-build-new-image.outputs.RESULT == 'true'
run: |
yes | cp -i docker-compose.circleci.yml docker-compose.yml
sed -i "s/REACTION_VERSION/${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }}/g" ./docker-compose.yml
- name: Create Pull Request
if: steps.should-build-new-image.outputs.RESULT == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Docker image release ${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }}
body: "Release docker image ${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }}"
branch: "releases/docker-image-${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }}"
commit-message: "feat: update docker-compose file to ${{ steps.get-docker-version.outputs.NEW_DOCKER_IMAGE_VERSION }} [Docker Release]"
signoff: true
16 changes: 8 additions & 8 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -29,13 +29,13 @@ jobs:
key: reaction-v6-node-modules-${{ hashFiles('package.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
path: "**/node_modules"

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14
node-version: "18.10.0"

- name: Install pnpm
run: npm i -g pnpm@latest
run: npm i -g pnpm@7.11.0

- name: Install dependencies
run: pnpm install --ignore-scripts
Expand Down Expand Up @@ -84,19 +84,19 @@ jobs:
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14
node-version: "18.10.0"

- name: Install pnpm
run: npm i -g pnpm@latest
run: npm i -g pnpm@7.11.0

- name: Install dependencies
run: pnpm install --ignore-scripts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand All @@ -27,13 +27,13 @@ jobs:
key: reaction-v6-node-modules-${{ hashFiles('package.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
path: "**/node_modules"

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14
node-version: "18.10.0"

- name: Install pnpm
run: npm i -g pnpm@latest
run: npm i -g pnpm@7.11.0

- name: Install Dependencies
run: pnpm install --ignore-scripts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tagging-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
if: github.event.pull_request.merged == true && github.base_ref == 'trunk' && github.head_ref == 'changeset-release/trunk'
permissions:
contents: write # to create release (changesets/action)
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand All @@ -22,14 +22,14 @@ jobs:
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 14
node-version: "18.10.0"

- name: Install dependencies
run: |
npm i -g pnpm@latest
npm i -g pnpm@7.11.0
pnpm install -r --ignore-scripts
- name: Get tag version
id: get-tag-version
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,7 @@ yalc-packages

# Build
dist

# Editor
.vscode
.idea
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.20.0
18.10.0
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ instructions

## Install PNPM
```bash
npm i -g pnpm@latest
npm i -g pnpm@7.11.0
```

## Clone and Start the source
Expand Down
2 changes: 2 additions & 0 deletions apps/reaction/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MONGO_URL=mongodb://mongo.reaction.localhost:27017/reaction
ROOT_URL=http://localhost:3000
STRIPE_API_KEY=YOUR_PRIVATE_STRIPE_API_KEY
REDIS_SERVER=redis://127.0.0.1:6379
MAIL_URL=smtp://localhost:1025
Loading

0 comments on commit 6b302bd

Please sign in to comment.