-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-branch 'misskey/develop'
- Loading branch information
Showing
35 changed files
with
283 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,119 +6,33 @@ on: | |
branches: | ||
- master | ||
- develop | ||
paths: | ||
- packages/backend/** | ||
- .github/workflows/get-api-diff.yml | ||
|
||
jobs: | ||
get-base: | ||
get-from-cherrypick: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.5.1] | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: cherrypick | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_USER: example-cherrypick-user | ||
POSTGRESS_PASS: example-cherrypick-pass | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.event.pull_request.base.repo.full_name }} | ||
ref: ${{ github.base_ref }} | ||
submodules: true | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: false | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- run: corepack enable | ||
- run: pnpm i --frozen-lockfile | ||
- name: Check pnpm-lock.yaml | ||
run: git diff --exit-code pnpm-lock.yaml | ||
- name: Copy Configure | ||
run: cp .config/example.yml .config/default.yml | ||
- name: Build | ||
run: pnpm build | ||
- name : Migrate | ||
run: pnpm migrate | ||
- name: Launch cherrypick | ||
run: | | ||
screen -S cherrypick -dm pnpm run dev | ||
sleep 30s | ||
- name: Wait for CherryPick to be ready | ||
run: | | ||
MAX_RETRIES=12 | ||
RETRY_DELAY=5 | ||
count=0 | ||
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do | ||
printf '.' | ||
sleep $RETRY_DELAY | ||
count=$((count + 1)) | ||
done | ||
if [[ $count -eq $MAX_RETRIES ]]; then | ||
echo "Failed to connect to CherryPick after $MAX_RETRIES attempts." | ||
exit 1 | ||
fi | ||
- id: fetch | ||
name: Get api.json from CherryPick | ||
run: | | ||
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json) | ||
echo $RESULT > api-base.json | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: api-artifact | ||
path: api-base.json | ||
- name: Kill CherryPick Job | ||
run: screen -S cherrypick -X quit | ||
|
||
get-head: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.5.1] | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: cherrypick | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_USER: example-cherrypick-user | ||
POSTGRESS_PASS: example-cherrypick-pass | ||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
node-version: [20.10.0] | ||
api-json-name: [api-base.json, api-head.json] | ||
include: | ||
- api-json-name: api-base.json | ||
repo-name: ${{ github.event.pull_request.base.repo.full_name }} | ||
ref: ${{ github.base_ref }} | ||
- api-json-name: api-head.json | ||
repo-name: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.head_ref }} | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.head_ref }} | ||
repository: ${{ matrix.repo-name }} | ||
ref: ${{ matrix.ref }} | ||
submodules: true | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
@@ -138,39 +52,15 @@ jobs: | |
run: cp .config/example.yml .config/default.yml | ||
- name: Build | ||
run: pnpm build | ||
- name : Migrate | ||
run: pnpm migrate | ||
- name: Launch cherrypick | ||
run: | | ||
screen -S cherrypick -dm pnpm run dev | ||
sleep 30s | ||
- name: Wait for CherryPick to be ready | ||
run: | | ||
MAX_RETRIES=12 | ||
RETRY_DELAY=5 | ||
count=0 | ||
until $(curl --output /dev/null --silent --head --fail http://localhost:3000) || [[ $count -eq $MAX_RETRIES ]]; do | ||
printf '.' | ||
sleep $RETRY_DELAY | ||
count=$((count + 1)) | ||
done | ||
if [[ $count -eq $MAX_RETRIES ]]; then | ||
echo "Failed to connect to CherryPick after $MAX_RETRIES attempts." | ||
exit 1 | ||
fi | ||
- id: fetch | ||
name: Get api.json from CherryPick | ||
run: | | ||
RESULT=$(curl --retry 5 --retry-delay 5 --retry-max-time 60 http://localhost:3000/api.json) | ||
echo $RESULT > api-head.json | ||
- name: Generate API JSON | ||
run: pnpm --filter backend generate-api-json | ||
- name: Copy API.json | ||
run: cp packages/backend/built/api.json ${{ matrix.api-json-name }} | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: api-artifact | ||
path: api-head.json | ||
- name: Kill CherryPick Job | ||
run: screen -S cherrypick -X quit | ||
path: ${{ matrix.api-json-name }} | ||
|
||
save-pr-number: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
node-version: [20.5.1] | ||
node-version: [20.10.0] | ||
|
||
services: | ||
postgres: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
node-version: [20.5.1] | ||
node-version: [20.10.0] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
@@ -51,7 +51,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [20.5.1] | ||
node-version: [20.10.0] | ||
browser: [chrome] | ||
|
||
services: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
node-version: [20.5.1] | ||
node-version: [20.10.0] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.5.1 | ||
20.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export class HardMute1700383825690 { | ||
name = 'HardMute1700383825690' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "user_profile" ADD "hardMutedWords" jsonb NOT NULL DEFAULT '[]'`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "hardMutedWords"`); | ||
} | ||
} |
Oops, something went wrong.