Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into migrate/log-from-en…
Browse files Browse the repository at this point in the history
…gines
  • Loading branch information
tomhoule committed Jul 15, 2021
2 parents 6c38d7c + 137a400 commit 7154b78
Show file tree
Hide file tree
Showing 139 changed files with 3,036 additions and 4,360 deletions.
11 changes: 10 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"excludePackageNames": [
"@prisma/engines",
"@prisma/engines-version",
"@prisma/fetch-engine",
"@prisma/get-platform",
"@prisma/studio-server",
"checkpoint-client"
],
Expand All @@ -28,6 +30,8 @@
"excludePackageNames": [
"@prisma/engines",
"@prisma/engines-version",
"@prisma/fetch-engine",
"@prisma/get-platform",
"checkpoint-client"
],
"schedule": ["before 8am on Wednesday"]
Expand All @@ -44,7 +48,12 @@
"ignoreUnstable": false,
"followTag": "latest",
"reviewers": ["@jolg42", "@williamluke4", "millsp"],
"packageNames": ["@prisma/engines", "@prisma/engines-version"]
"packageNames": [
"@prisma/engines",
"@prisma/engines-version",
"@prisma/fetch-engine",
"@prisma/get-platform"
]
},
{
"groupName": "Studio",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/label-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "DUMMY, FOR ENABLING"
days-before-stale: 60
days-before-stale: 90
days-before-close: -1
exempt-issue-labels: "kind/discussion,kind/docs,kind/feature,kind/improvement,kind/question"
exempt-issue-labels: "kind/discussion,kind/docs,kind/feature,kind/improvement,kind/question,kind/epic,kind/subtask"
stale-issue-label: "status/needs-action"
skip-stale-issue-message: true
skip-stale-pr-message: true
Expand Down
30 changes: 1 addition & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- run: pnpm run jest integration/${{ matrix.database }} -- --forceExit --maxConcurrency=8
- run: pnpm run jest integration/${{ matrix.database }} -- --maxConcurrency=8
working-directory: src/packages/integration-tests
env:
CI: true
Expand Down Expand Up @@ -528,20 +528,6 @@ jobs:
flags: engine-core,${{ matrix.os }}
name: engine-core-${{ matrix.os }}

- run: pnpm run test
name: 'fetch-engine'
working-directory: src/packages/fetch-engine
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v1
with:
files: ./src/packages/fetch-engine/src/__tests__/coverage/clover.xml
flags: fetch-engine,${{ matrix.os }}
name: fetch-engine-${{ matrix.os }}

- run: pnpm run test
name: 'generator-helper'
working-directory: src/packages/generator-helper
Expand All @@ -555,17 +541,3 @@ jobs:
files: ./src/packages/generator-helper/src/__tests__/coverage/clover.xml
flags: generator-helper,${{ matrix.os }}
name: generator-helper-${{ matrix.os }}

- run: pnpm run test
name: 'get-platform'
working-directory: src/packages/get-platform
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v1
with:
files: ./src/packages/get-platform/src/__tests__/coverage/clover.xml
flags: get-platform,${{ matrix.os }}
name: get-platform-${{ matrix.os }}
74 changes: 74 additions & 0 deletions .github/workflows/update-engines-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Update Engines Version
on:
workflow_dispatch:
inputs:
version:
description: "Version to check and update the engines version"
required: true

jobs:
update_engines:
name: "Check and update @prisma/engines@${{ github.event.inputs.version }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.9.1

# This step uses `@prisma/ensure-npm-release` (abbv. `enr`) https://github.com/prisma/ensure-npm-release
- name: Check if version is available on npm
run: |
echo 'Checking that all packages [@prisma/engines, @prisma/engines-version, @prisma/fetch-engine, @prisma/get-platform] have the published version @${{ github.event.inputs.version }}'
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/engines -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/engines-version -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/fetch-engine -u ${{ github.event.inputs.version }}
pnpx -y -p @prisma/ensure-npm-release enr update -p @prisma/get-platform -u ${{ github.event.inputs.version }}
echo 'Awesome - proceeding to make the PR'
- name: Update the engines dependencies
run: |
echo 'Updating @prisma/engines, @prisma/engines-version, @prisma/fetch-engine and @prisma/get-platform to ${{ github.event.inputs.version }} using pnpm'
cd src
pnpm update -r @prisma/engines@${{ github.event.inputs.version }} @prisma/engines-version@${{ github.event.inputs.version }} @prisma/fetch-engine@${{ github.event.inputs.version }} @prisma/get-platform@${{ github.event.inputs.version }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BOT_TOKEN }}
commit-message: "fix(deps): update engines to ${{ github.event.inputs.version }}"
committer: "Prismo <prismabots@gmail.com>"
author: "Prismo <prismabots@gmail.com>"
branch: deps/engines-${{ github.event.inputs.version }}
delete-branch: true
labels: automerge
title: "fix(deps): update engines to ${{ github.event.inputs.version }}"
body: |
This automatic PR updates the engines to version `${{ github.event.inputs.version }}`. This will get automatically merged if all the tests pass.
## Packages:
| Package | NPM URL |
|---------|---------|
|`@prisma/engines`| https://npmjs.com/package/@prisma/engines/v/${{ github.event.inputs.version }}|
|`@prisma/engines-version`| https://npmjs.com/package/@prisma/engines-version/v/${{ github.event.inputs.version }}|
|`@prisma/fetch-engine`| https://npmjs.com/package/@prisma/fetch-engine/v/${{ github.event.inputs.version }}|
|`@prisma/get-platform`| https://npmjs.com/package/@prisma/get-platform/v/${{ github.event.inputs.version }}|
- name: PR url
run: |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Sleep for 5 seconds
run: sleep 5s
shell: bash

- name: Auto approve Pull Request (to trigger automerge if tests passing)
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.cpr.outputs.pull-request-number }}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

ts-node scripts/lint.ts --staged
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ List of packages:
- client
- debug
- engine-core
- fetch-engine
- generator-helper
- get-platform
- migrate
- react-prisma
- sdk
Expand Down
4 changes: 0 additions & 4 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ In the `prisma/prisma` repository we have a few places where you can write tests
- Unit tests for `debug` package
- **`engine-core`**
- Unit tests for `engine-core` package
- **`fetch-engine`**
- Integration tests for downloading binaries
- **`generator-helper`**
- Integration tests for generator interface implementation
- **`get-platform`**
- Unit tests for `get-platform` package
- **`migrate`**
- Unit and integration tests for `migrate` and `db` commands
- **`react-prisma`**
Expand Down
8 changes: 0 additions & 8 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
comment: false

flags:
get-platform:
carryforward: true
paths:
- src/packages/get-platform/
fetch-engine:
carryforward: true
paths:
- src/packages/fetch-engine/
client:
carryforward: true
paths:
Expand Down
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,30 @@
"lint": "ts-node scripts/lint.ts",
"bench": "ts-node scripts/bench.ts | tee output.txt",
"precommit-all": "ts-node scripts/lint.ts --staged",
"eslint": "eslint"
"eslint": "eslint",
"prepare": "is-ci || husky install"
},
"devDependencies": {
"@types/benchmark": "2.1.0",
"@types/node": "14.17.3",
"@typescript-eslint/eslint-plugin": "4.28.0",
"@typescript-eslint/parser": "4.28.0",
"@types/benchmark": "2.1.1",
"@types/node": "14.17.5",
"@typescript-eslint/eslint-plugin": "4.28.3",
"@typescript-eslint/parser": "4.28.3",
"arg": "5.0.0",
"benchmark": "2.1.4",
"chalk": "4.1.1",
"eslint": "7.29.0",
"eslint": "7.30.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-jest": "24.3.6",
"eslint-plugin-prettier": "3.4.0",
"execa": "5.1.1",
"globby": "11.0.4",
"husky": "4.3.8",
"husky": "7.0.1",
"is-ci": "3.0.0",
"p-map": "4.0.0",
"prettier": "2.3.1",
"prettier": "2.3.2",
"staged-git-files": "1.2.0",
"ts-node": "10.0.0",
"typescript": "4.3.4"
},
"husky": {
"hooks": {
"pre-commit": "ts-node scripts/lint.ts --staged"
}
"ts-node": "10.1.0",
"typescript": "4.3.5"
}
}

0 comments on commit 7154b78

Please sign in to comment.