Skip to content

Commit

Permalink
Release/2024 02 23 (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan authored Mar 11, 2024
2 parents 9ffc4f2 + e711895 commit eeb50d0
Show file tree
Hide file tree
Showing 678 changed files with 86,328 additions and 12,359 deletions.
221 changes: 132 additions & 89 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
version: 2.1
orbs:
cypress: cypress-io/[email protected]
node: circleci/node@5

executors:
standard-node:
docker:
- image: "cimg/node:18.14.2"
- image: "cimg/postgres:12.10"
environment:
POSTGRES_USER: bloom-ci
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom
cypress-node:
docker:
- image: "cypress/base:18.14.1"
Expand All @@ -21,15 +12,29 @@ executors:
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom
JURISDICTION_NAME: Bloomington
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
NODE_ENV: "development"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
# DB URL for the jest tests per ormconfig.test.ts
TEST_DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
PARTNERS_PORTAL_URL: "http://localhost:3001"
JURISDICTION_NAME: Bloomington
standard-node:
docker:
- image: "cimg/node:18.14.2"
- image: "cimg/postgres:12.10"
environment:
POSTGRES_USER: bloom-ci
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom_prisma
JURISDICTION_NAME: Bloomington

jobs:
setup:
executor: standard-node
Expand All @@ -40,48 +45,95 @@ jobs:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/
setup-with-db:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:backend:core:dbsetup
lint:
setup-backend:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lint
jest-shared-helpers:
executor: standard-node
- checkout
- run: yarn backend:new:install
- save_cache:
key: build-cache-new-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/
cypress-public:
executor: cypress-node
resource_class: large
steps:
- checkout
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:shared:helpers
jest-backend:
executor: standard-node
- node/install-packages:
app-dir: sites/public
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: api
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: setup db and seed
command: yarn test:backend:new:dbsetup:withseed
- run:
name: run backend
command: yarn dev
background: true
working_directory: api
- run:
name: build and run public
command: yarn dev:server-wait-new && yarn build && yarn start
background: true
working_directory: sites/public
- run:
name: wait
command: yarn dev:public-wait
working_directory: sites/public
- run:
name: Run Cypress
command: npx cypress run
working_directory: sites/public
- store_artifacts:
path: sites/public/cypress/videos
- store_artifacts:
path: sites/public/cypress/screenshots
cypress-partners:
executor: cypress-node
resource_class: large
steps:
- checkout
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: sites/partners
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- node/install-packages:
app-dir: api
pkg-manager: yarn
cache-version: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: DB Setup + Backend Core Tests
command: |
yarn test:backend:core:dbsetup
yarn test:backend:core
yarn test:e2e:backend:core
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
# DB URL for the jest tests per ormconfig.test.ts
TEST_DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
CLOUDINARY_SIGNED_PRESET: "fake_secret"
CLOUDINARY_KEY: "fake_key"
CLOUDINARY_CLOUD_NAME: "exygy"
CLOUDINARY_SECRET: "fake_secret"
PARTNERS_PORTAL_URL: "http://localhost:3001"
name: setup db and seed
command: yarn test:backend:new:dbsetup:withseed
- run:
name: run backend
command: yarn dev
background: true
working_directory: api
- run:
name: build and run partners
command: yarn dev:server-wait-new && yarn build && yarn start
background: true
working_directory: sites/partners
- run:
name: wait
command: yarn dev:partners-wait
working_directory: sites/partners
- run:
name: Run Cypress
command: npx cypress run
working_directory: sites/partners
- store_artifacts:
path: sites/partners/cypress/videos
- store_artifacts:
path: sites/partners/cypress/screenshots
build-public:
executor: standard-node
steps:
Expand All @@ -106,21 +158,50 @@ jobs:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:app:public:unit
lint:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn lint
jest-shared-helpers:
executor: standard-node
steps:
- restore_cache:
key: build-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn test:shared:helpers
jest-backend:
executor: standard-node
steps:
- checkout
- restore_cache:
key: build-cache-new-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: DB Setup + New Backend Core Tests
working_directory: api
command: |
yarn install
yarn test:cov-ci
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
APP_SECRET: "CI-LONG-SECRET-KEY"
# DB URL for migration and seeds:
DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom_prisma"


workflows:
version: 2
build:
jobs:
- setup
- setup-backend
- lint:
requires:
- setup
- jest-shared-helpers:
requires:
- setup
- jest-backend:
requires:
- setup
- jest-backend
- build-public:
requires:
- setup
Expand All @@ -133,49 +214,11 @@ workflows:
- unit-test-partners:
requires:
- setup
- cypress/run:
name: "cypress-public"
- cypress-public:
requires:
- setup
executor: cypress-node
working_directory: sites/public
yarn: true
build: |
yarn test:backend:core:dbsetup
start: yarn dev:all-cypress
wait-on: "http://0.0.0.0:3000"
store_artifacts: true
- cypress/run:
name: "cypress-partners"
- setup-backend
- cypress-partners:
requires:
- setup
executor: cypress-node
working_directory: sites/partners
yarn: true
build: |
echo 'export FEATURE_LISTINGS_APPROVAL=FALSE' >> "$BASH_ENV"
source "$BASH_ENV"
yarn test:backend:core:dbsetup
start: |
yarn dev:all-cypress
command: |
npx cypress run --spec cypress/e2e/default/**/*.{js,jsx,ts,tsx}
wait-on: "http://0.0.0.0:3001"
store_artifacts: true
- cypress/run:
name: "cypress-partners-listings-approval"
requires:
- setup
executor: cypress-node
working_directory: sites/partners
yarn: true
build: |
echo 'export FEATURE_LISTINGS_APPROVAL=TRUE' >> "$BASH_ENV"
source "$BASH_ENV"
yarn test:backend:core:dbsetup
start: |
yarn dev:all-cypress
command: |
npx cypress run --spec cypress/e2e/listings-approval/**/*.{js,jsx,ts,tsx}
wait-on: "http://0.0.0.0:3001"
store_artifacts: true
- setup-backend
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
"plugin:import/typescript",
"plugin:react-hooks/recommended", // Make sure we follow https://reactjs.org/docs/hooks-rules.html
"plugin:jsx-a11y/recommended",
"prettier/@typescript-eslint", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended", // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
Expand All @@ -26,6 +25,7 @@ module.exports = {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-var-requires": "off",
"react/jsx-uses-vars": "warn",
"react/jsx-uses-react": "warn",
"@typescript-eslint/restrict-template-expressions": [
Expand All @@ -43,12 +43,14 @@ module.exports = {
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/ban-ts-comment": "off",
},
ignorePatterns: [
"node_modules",
"storybook-static",
".next",
"dist",
"api",
"migration/",
"**/*.stories.tsx",
"**/.eslintrc.js",
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/cypress_partners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ env:
EXTERNAL_API_BASE: https://api.housingbayarea.bloom.exygy.dev
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
DISABLE_CORS: "TRUE"
TWILIO_ACCOUNT_SID: 'AC.TEST'
TWILIO_AUTH_TOKEN: 'TEST'
MFA_CODE_VALID: '600000'
MFA_CODE_LENGTH: 5
AUTH_LOCK_LOGIN_COOLDOWN: '1800000'
AUTH_LOCK_LOGIN_AFTER_FAILED_ATTEMPTS: '5'


jobs:
Expand Down Expand Up @@ -57,8 +63,8 @@ jobs:
- name: yarn in root dir
run: yarn

- name: yarn in backend/core dir
working-directory: ./backend/core
- name: yarn in api dir
working-directory: ./api
run: yarn

- name: Check postgres
Expand All @@ -71,7 +77,7 @@ jobs:
PGPASSWORD: bloom

- name: Setup backend
run: yarn test:backend:core:dbsetup
run: yarn test:backend:new:dbsetup:withseed
env:
PGHOST: 127.0.0.1
PGPASSWORD: bloom
Expand All @@ -95,7 +101,7 @@ jobs:
working-directory: ./sites/partners
spec: cypress/e2e/default/*.spec.ts
build: yarn build
start: yarn dev:listings, yarn start
start: yarn dev:new-backend, yarn start
wait-on: 'http://localhost:3100/listings'
record: false # set this value to true to record videos in cypress cloud for debugging purposes - skip passing tests
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cypress_partners_la.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- name: yarn in root dir
run: yarn

- name: yarn in backend/core dir
working-directory: ./backend/core
- name: yarn in api dir
working-directory: ./api
run: yarn

- name: Check postgres
Expand All @@ -72,7 +72,7 @@ jobs:
PGPASSWORD: bloom

- name: Setup backend
run: yarn test:backend:core:dbsetup
run: yarn test:backend:new:dbsetup:withseed
env:
PGHOST: 127.0.0.1
PGPASSWORD: bloom
Expand All @@ -96,7 +96,7 @@ jobs:
working-directory: ./sites/partners
spec: cypress/e2e/listings-approval/*.spec.ts
build: yarn build
start: yarn dev:listings, yarn start
start: yarn dev:new-backend, yarn start
wait-on: 'http://localhost:3100/listings'
record: false # set this value to true to record videos in cypress cloud for debugging purposes - skip passing tests
env:
Expand Down
Loading

0 comments on commit eeb50d0

Please sign in to comment.