Skip to content

Commit

Permalink
Merge branch 'master' into pr/migrate
Browse files Browse the repository at this point in the history
* master: (25 commits)
  chore: cleanup tests
  chore: update snapshots
  fix: only generate .env path if present
  fix: improve warning
  fix(client): stack trace with source-map-support. Closes #3945 (#4137)
  feat(client, sdk, cli): env loading rewrite (#4142)
  ci: increase health check retries for db GH Actions
  fix(deps): update dependency undici to v2.1.1 (#4135)
  chore(deps): update devdependencies (non-major)
  fix(deps): update engines to v2.11.1-4-1d5919363a85847350c3f517da9babd9bcaca792 (#4131)
  ci: try fix for flaky client GH actions
  chore(deps): update studio to v0.307.0 (#4128)
  fix(client): remove package.json in custom output paths (#4130)
  feat: stabilize transaction & connectOrCreate (#4129)
  fix: print getConfig warnings (#4124)
  fix(cli): Ignore all errors that occur when opening Studio in a browser (#4119)
  chore: update renovate for Studio [skip ci]
  Bump Studio [skip ci]
  chore(cli): preinstall throw on node < 10 (#4118)
  chore: cleanup jest config (#4120)
  ...

# Conflicts:
#	src/packages/migrate/src/bin.ts
  • Loading branch information
Jolg42 committed Nov 4, 2020
2 parents 5cdec36 + 6d77e4a commit f17c18f
Show file tree
Hide file tree
Showing 100 changed files with 1,425 additions and 920 deletions.
36 changes: 21 additions & 15 deletions .github/renovate.json
Expand Up @@ -4,7 +4,7 @@
"schedule": ["at any time"],
"semanticCommits": "enabled",
"masterIssue": true,
"reviewers": ["@jolg42", "@timsuchanek"],
"reviewers": ["@jolg42", "@timsuchanek", "@williamluke4"],
"rebaseWhen": "conflicted",
"packageRules": [
{
Expand All @@ -26,30 +26,36 @@
"packageNames": ["@prisma/engines", "@prisma/engines-version"]
},
{
"groupName": "devDependencies (non-major)",
"groupName": "Studio",
"automerge": "true",
"depTypeList": ["devDependencies"],
"excludePackageNames": ["@prisma/engines", "@prisma/engines-version"],
"updateTypes": ["patch", "minor"]
"packageNames": ["@prisma/studio", "@prisma/studio-server"],
"updateTypes": ["patch", "minor"],
"reviewers": ["@madebysid"]
},
{
"groupName": "dependencies (non-major)",
"depTypeList": ["dependencies"],
"excludePackageNames": ["@prisma/engines", "@prisma/engines-version"],
"groupName": "checkpoint-client",
"packageNames": ["checkpoint-client"],
"updateTypes": ["patch", "minor"]
},
{
"groupName": "Studio",
"packageNames": ["@prisma/studio", "@prisma/studio-server"],
"updateTypes": ["patch", "minor"],
"groupName": "devDependencies (non-major)",
"automerge": "true",
"reviewers": ["@madebysid"]
"depTypeList": ["devDependencies"],
"excludePackageNames": [
"@prisma/engines",
"@prisma/engines-version",
"@prisma/studio",
"@prisma/studio-server"
],
"updateTypes": ["patch", "minor"],
"schedule": ["on monday and wednesday"]
},
{
"groupName": "checkpoint-client",
"packageNames": ["checkpoint-client"],
"groupName": "dependencies (non-major)",
"depTypeList": ["dependencies"],
"excludePackageNames": ["@prisma/engines", "@prisma/engines-version"],
"updateTypes": ["patch", "minor"],
"reviewers": ["@jolg42", "@timsuchanek"]
"schedule": ["on monday and wednesday"]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/setup.sh
Expand Up @@ -4,7 +4,7 @@ set -ex

cd src

npm i --silent -g pnpm@5.1.7 --unsafe-perm
npm i --silent -g pnpm@5.10.4 --unsafe-perm
pnpm i --no-prefer-frozen-lockfile

pnpm run setup
75 changes: 41 additions & 34 deletions .github/workflows/test.yml
Expand Up @@ -6,18 +6,18 @@ on:
branches:
- master
paths-ignore:
- '*.md'
- '.buildkite/**'
- 'docs/**'
- 'scripts/**'
- '.prettierrc.yml'
- '.dockerignore'
- 'LICENSE'
- "*.md"
- ".buildkite/**"
- "docs/**"
- "scripts/**"
- ".prettierrc.yml"
- ".dockerignore"
- "LICENSE"
pull_request:

env:
PRISMA_TELEMETRY_INFORMATION: 'prisma test.yml'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PRISMA_TELEMETRY_INFORMATION: "prisma test.yml"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

jobs:
# From https://github.com/marketplace/actions/workflow-run-cleanup-action
Expand All @@ -29,7 +29,7 @@ jobs:
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

#
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: 'Pr1sm4_Pr1sm4'
SA_PASSWORD: "Pr1sm4_Pr1sm4"
ports:
- 1433:1433
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
Expand Down Expand Up @@ -253,6 +253,20 @@ jobs:
node: [12]

services:
# mysql:8.0 would not work as we use `mariadb` node lib and it doesn't support the latest default password algorithm
# https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions
mysql:
image: bitnami/mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: tests
MYSQL_USER: prisma
MYSQL_PASSWORD: prisma
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10

postgres:
image: postgres:9
env:
Expand All @@ -261,7 +275,7 @@ jobs:
POSTGRES_PASSWORD: prisma
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 10

postgres_isolated:
image: postgres:10
Expand All @@ -271,30 +285,16 @@ jobs:
POSTGRES_PASSWORD: prisma
ports:
- 5432/tcp
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

# mysql:8.0 would not work as we use `mariadb` node lib and it doesn't support the latest default password algorithm
# https://stackoverflow.com/questions/60902904/how-to-pass-mysql-native-password-to-mysql-service-in-github-actions
mysql:
image: bitnami/mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: tests
MYSQL_USER: prisma
MYSQL_PASSWORD: prisma
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 10

mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: 'Pr1sm4_Pr1sm4'
SA_PASSWORD: "Pr1sm4_Pr1sm4"
ports:
- 1433:1433
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
options: --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P ${SA_PASSWORD} -Q 'SELECT 1' || exit 1" --health-interval 10s --health-timeout 5s --health-retries 10

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -322,6 +322,13 @@ jobs:
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

# MySQL tests sometimes exit with "ERROR HY000 (1449): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist"
# Maybe this can help
- name: Sleep for few seconds
uses: jakejarvis/wait-action@master
with:
time: "15s"

- run: pnpm run test
working-directory: src/packages/client
env:
Expand Down Expand Up @@ -499,7 +506,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm run test
name: 'debug'
name: "debug"
working-directory: src/packages/debug
env:
CI: true
Expand All @@ -512,7 +519,7 @@ jobs:
bash <(curl -s https://codecov.io/bash) -F debug -f ./src/__tests__/coverage/clover.xml
- run: pnpm run test
name: 'engine-core'
name: "engine-core"
working-directory: src/packages/engine-core
env:
CI: true
Expand All @@ -525,7 +532,7 @@ jobs:
bash <(curl -s https://codecov.io/bash) -F engine-core -f ./src/__tests__/coverage/clover.xml
- run: pnpm run test
name: 'fetch-engine'
name: "fetch-engine"
working-directory: src/packages/fetch-engine
env:
CI: true
Expand All @@ -538,7 +545,7 @@ jobs:
bash <(curl -s https://codecov.io/bash) -F fetch-engine -f ./src/__tests__/coverage/clover.xml
- run: pnpm run test
name: 'generator-helper'
name: "generator-helper"
working-directory: src/packages/generator-helper
env:
CI: true
Expand All @@ -551,7 +558,7 @@ jobs:
bash <(curl -s https://codecov.io/bash) -F generator-helper -f ./src/__tests__/coverage/clover.xml
- run: pnpm run test
name: 'get-platform'
name: "get-platform"
working-directory: src/packages/get-platform
env:
CI: true
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -5,7 +5,7 @@ To setup and build the packages, follow these steps:

```bash
git clone https://github.com/prisma/prisma.git
npm i -g pnpm@5.1.7 --unsafe-perm
npm i -g pnpm@5.10.4 --unsafe-perm
cd prisma/src
pnpm i
pnpm run setup
Expand All @@ -15,7 +15,7 @@ Note for Windows: Use the latest version of [Git Bash](https://gitforwindows.org

### General Prerequisites

1. Install [`pnpm@5.1.7`](https://pnpm.js.org/) (for installing npm dependencies)
1. Install [`pnpm@5.10.4`](https://pnpm.js.org/) (for installing npm dependencies)
1. Install [`docker`](https://www.docker.com/products/docker-desktop) (for managing test databases)
1. Install [`ts-node`](https://github.com/TypeStrong/ts-node) (for running Node scripts written in TypeScript)

Expand Down
2 changes: 1 addition & 1 deletion src/.buildkite/publish/run.sh
Expand Up @@ -9,7 +9,7 @@ if [ "$DEVELOPMENT_ENVIRONMENT_COMMIT" ]; then
git checkout $DEVELOPMENT_ENVIRONMENT_COMMIT
fi

npm i --silent -g pnpm@5.1.7 --unsafe-perm
npm i --silent -g pnpm@5.10.4 --unsafe-perm
npm i --silent -g yarn || echo "Ok"
yarn --version || echo "Ok"
pnpm i --no-prefer-frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion src/.buildkite/test/run.sh
Expand Up @@ -4,7 +4,7 @@ set -ex

cd src

npm i --silent -g pnpm@5.1.7 --unsafe-perm
npm i --silent -g pnpm@5.10.4 --unsafe-perm
pnpm i --no-prefer-frozen-lockfile

pnpm run setup
Expand Down
5 changes: 4 additions & 1 deletion src/docker/docker-compose.yml
Expand Up @@ -50,6 +50,9 @@ services:
- MYSQL_DATABASE=tests
- MYSQL_USER=prisma
- MYSQL_PASSWORD=prisma
# https://stackoverflow.com/questions/55559386/how-to-fix-mbind-operation-not-permitted-in-mysql-error-log
cap_add:
- SYS_NICE # CAP_SYS_NICE
volumes:
- mysql:/var/lib/mysql
ports:
Expand Down Expand Up @@ -77,7 +80,7 @@ services:
volumes:
- mssql:/var/opt/mssql
ports:
- "1433:1433"
- '1433:1433'

volumes:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Expand Up @@ -8,7 +8,7 @@
"@sindresorhus/slugify": "1.1.0",
"@types/debug": "4.1.5",
"@types/graphviz": "0.0.32",
"@types/node": "13.13.29",
"@types/node": "12.19.3",
"@types/redis": "2.8.28",
"arg": "4.1.3",
"batching-toposort": "1.2.0",
Expand Down
22 changes: 11 additions & 11 deletions src/packages/cli/package.json
@@ -1,5 +1,5 @@
{
"version": "2.9.0-dev.79",
"version": "2.11.0-dev.20",
"name": "@prisma/cli",
"description": "Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one.",
"keywords": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"node": ">=10"
},
"prisma": {
"prismaCommit": ""
"prismaCommit": "87d13fded344f1f387a8510f0fa23139444516c6"
},
"files": [
"build",
Expand Down Expand Up @@ -68,20 +68,20 @@
"@prisma/get-platform": "workspace:*",
"@prisma/migrate": "workspace:*",
"@prisma/sdk": "workspace:*",
"@prisma/studio": "0.304.0",
"@prisma/studio-server": "0.304.0",
"@prisma/studio": "0.307.0",
"@prisma/studio-server": "0.307.0",
"@prisma/tests": "workspace:^0.0.0",
"@sindresorhus/slugify": "1.1.0",
"@timsuchanek/copy": "1.4.5",
"@types/debug": "4.1.5",
"@types/jest": "26.0.15",
"@types/verror": "1.10.4",
"@types/ws": "7.2.9",
"@typescript-eslint/eslint-plugin": "4.6.0",
"@typescript-eslint/parser": "4.6.0",
"@typescript-eslint/eslint-plugin": "4.6.1",
"@typescript-eslint/parser": "4.6.1",
"checkpoint-client": "1.1.14",
"dotenv": "8.2.0",
"esbuild": "0.8.0",
"esbuild": "0.8.2",
"escape-string-regexp": "4.0.0",
"eslint": "7.12.1",
"eslint-config-prettier": "6.15.0",
Expand All @@ -96,9 +96,9 @@
"husky": "4.3.0",
"indent-string": "4.0.0",
"is-installed-globally": "0.3.2",
"jest": "26.6.1",
"jest": "26.6.2",
"line-replace": "2.0.1",
"lint-staged": "10.5.0",
"lint-staged": "10.5.1",
"log-update": "4.0.0",
"make-dir": "3.1.0",
"mz": "2.7.0",
Expand Down Expand Up @@ -151,6 +151,6 @@
},
"dependencies": {
"@prisma/bar": "^0.0.0",
"@prisma/engines": "2.11.0-8-eefa9e6e5a4d42803ffc12e2d8131858b5181f65"
"@prisma/engines": "2.11.1-4-1d5919363a85847350c3f517da9babd9bcaca792"
}
}
}
9 changes: 9 additions & 0 deletions src/packages/cli/scripts/preinstall.js
Expand Up @@ -53,6 +53,15 @@ const b = (str) => BOLD + str + RESET
const white = (str) => WHITE_BRIGHT + str + RESET

export function main() {
const nodeVersions = process.version.split('.')
const nodeMajorVersion = parseInt(nodeVersions[0].slice(1))
debug(`Node Version: ${nodeMajorVersion}`)
if (nodeMajorVersion < 10) {
console.error(
drawBox({ str: `Prisma only supports Node.js >= 10`, verticalPadding: 1, horizontalPadding: 3 }),
)
process.exit(1)
}
// When running in npx, npm puts this package into a /_npx/ folder. Tested on Win, Mac, Linux
if (__dirname.includes('_npx')) {
process.exit(0)
Expand Down

0 comments on commit f17c18f

Please sign in to comment.