Skip to content

Commit

Permalink
Merge pull request #420 from kokonect-link/develop
Browse files Browse the repository at this point in the history
Release: 4.7.0
  • Loading branch information
noridev committed Mar 19, 2024
2 parents 801cb6c + 07c0fe0 commit c107f6e
Show file tree
Hide file tree
Showing 2,107 changed files with 49,131 additions and 11,408 deletions.
1 change: 1 addition & 0 deletions .config/docker_example.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
POSTGRES_PASSWORD=example-cherrypick-pass
POSTGRES_USER=example-cherrypick-user
POSTGRES_DB=cherrypick
DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}"
67 changes: 62 additions & 5 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@
# CherryPick configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# ┌──────────────────────────────┐
#───┘ a boring but important thing └────────────────────────────

#
# First of all, let me tell you a story that may possibly be
# boring to you and possibly important to you.
#
# CherryPick is licensed under the AGPLv3 license. This license is
# known to be often misunderstood. Please read the following
# instructions carefully and select the appropriate option so
# that you do not negligently cause a license violation.
#

# --------
# Option 1: If you host CherryPick AS-IS (without any changes to
# the source code. forks are not included).
#
# Step 1: Congratulations! You don't need to do anything.

# --------
# Option 2: If you have made changes to the source code (forks
# are included) and publish a Git repository of source
# code. There should be no access restrictions on
# this repository. Strictly speaking, it doesn't have
# to be a Git repository, but you'll probably use Git!
#
# Step 1: Build and run the CherryPick server first.
# Step 2: Open <https://your.cherrypick.example/admin/settings> in
# your browser with the administrator account.
# Step 3: Enter the URL of your Git repository in the
# "Repository URL" field.

# --------
# Option 3: If neither of the above applies to you.
# (In this case, the source code should be published
# on the CherryPick interface. IT IS NOT ENOUGH TO
# DISCLOSE THE SOURCE CODE WEHN A USER REQUESTS IT BY
# E-MAIL OR OTHER MEANS. If you are not satisfied
# with this, it is recommended that you read the
# license again carefully. Anyway, enabling this
# option will automatically generate and publish a
# tarball at build time, protecting you from
# inadvertent license violations. (There is no legal
# guarantee, of course.) The tarball will generated
# from the root directory of your codebase. So it is
# also recommended to check <built/tarball> directory
# once after building and before activating the server
# to avoid ACCIDENTAL LEAKING OF SENSITIVE INFORMATION.
# To prevent certain files from being included in the
# tarball, add a glob pattern after line 15 in
# <scripts/tarball.mjs>. DO NOT FORGET TO BUILD AFTER
# ENABLING THIS OPTION!)
#
# Step 1: Uncomment the following line.
#
# publishTarballInsteadOfProvideRepositoryUrl: true

# ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

Expand Down Expand Up @@ -118,7 +175,7 @@ redis:
# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────

# You can set scope to local (default value) or global
# You can set scope to local (default value) or global
# (include notes from remote).

#meilisearch:
Expand Down Expand Up @@ -160,14 +217,14 @@ id: 'aidx'
# Job concurrency per worker
#deliverJobConcurrency: 128
#inboxJobConcurrency: 16
#relashionshipJobConcurrency: 16
# What's relashionshipJob?:
#relationshipJobConcurrency: 16
# What's relationshipJob?:
# Follow, unfollow, block and unblock(ings) while following-imports, etc. or account migrations.

# Job rate limiter
#deliverJobPerSec: 128
#inboxJobPerSec: 32
#relashionshipJobPerSec: 64
#relationshipJobPerSec: 64

# Job attempts
#deliverJobMaxAttempts: 12
Expand Down Expand Up @@ -223,7 +280,7 @@ proxyRemoteFiles: true
signToActivityPubGet: true

# For security reasons, uploading attachments from the intranet is prohibited,
# but exceptions can be made from the following settings. Default value is "undefined".
# but exceptions can be made from the following settings. Default value is "undefined".
# Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)).
#allowedPrivateNetworks: [
# '127.0.0.1/32'
Expand Down
30 changes: 23 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,32 @@ updates:
directory: "/"
schedule:
interval: daily
# PNPM has an issue with dependabot. See:
# https://github.com/dependabot/dependabot-core/issues/7258
# https://github.com/pnpm/pnpm/issues/6530
# TODO: Restore this when the issue is solved
open-pull-requests-limit: 0
open-pull-requests-limit: 10
# List dependencies required to be updated together, sharing the same version numbers.
# Those who simply have the common owner (e.g. @fastify) don't need to be listed.
groups:
swc:
aws-sdk:
patterns:
- "@swc/*"
- "@aws-sdk/*"
bull-board:
patterns:
- "@bull-board/*"
nestjs:
patterns:
- "@nestjs/*"
slacc:
patterns:
- "slacc-*"
storybook:
patterns:
- "storybook*"
- "@storybook/*"
swc-core:
patterns:
- "@swc/core*"
typescript-eslint:
patterns:
- "@typescript-eslint/*"
tensorflow:
patterns:
- "@tensorflow/*"
10 changes: 8 additions & 2 deletions .github/workflows/api-cherrypick-js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: API report (cherrypick.js)

on: [push, pull_request]
on:
push:
paths:
- packages/cherrypick-js/**
pull_request:
paths:
- packages/cherrypick-js/**

jobs:
report:
Expand All @@ -14,7 +20,7 @@ jobs:
- run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4.0.1
uses: actions/setup-node@v4.0.2
with:
node-version-file: '.node-version'
cache: 'pnpm'
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check the description in CHANGELOG.md

on:
pull_request:
branches:
- master
- develop

jobs:
check-changelog:
runs-on: ubuntu-latest

steps:
- name: Checkout head
uses: actions/checkout@v4.1.1
- name: Setup Node.js
uses: actions/setup-node@v4.0.2
with:
node-version-file: '.node-version'

- name: Checkout base
run: |
mkdir _base
cp -r .git _base/.git
cd _base
git fetch --depth 1 origin ${{ github.base_ref }}
git checkout origin/${{ github.base_ref }} CHANGELOG.md
- name: Copy to Checker directory for CHANGELOG-base.md
run: cp _base/CHANGELOG.md scripts/changelog-checker/CHANGELOG-base.md
- name: Copy to Checker directory for CHANGELOG-head.md
run: cp CHANGELOG.md scripts/changelog-checker/CHANGELOG-head.md
- name: diff
continue-on-error: true
run: diff -u CHANGELOG-base.md CHANGELOG-head.md
working-directory: scripts/changelog-checker

- name: Setup Checker
run: npm install
working-directory: scripts/changelog-checker
- name: Run Checker
run: npm run run
working-directory: scripts/changelog-checker
134 changes: 134 additions & 0 deletions .github/workflows/check-cherrypick-js-autogen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Check CherryPick JS autogen

on:
pull_request_target:
branches:
- master
- develop
paths:
- packages/backend/**

jobs:
check-cherrypick-js-autogen:
runs-on: ubuntu-latest
permissions:
pull-requests: write

env:
api_json_name: "api-head.json"

steps:
- name: checkout
uses: actions/checkout@v4.1.1
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: setup node
id: setup-node
uses: actions/setup-node@v4.0.2
with:
node-version-file: '.node-version'
cache: pnpm

- name: install dependencies
run: pnpm i --frozen-lockfile

- name: wait get-api-diff
uses: lewagon/wait-on-check-action@v1.3.3
with:
ref: ${{ github.event.pull_request.head.sha }}
check-regexp: get-from-cherrypick .+
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30

- name: Download artifact
uses: actions/github-script@v7.0.1
with:
script: |
const fs = require('fs');
const workflows = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: `${{ github.event.pull_request.head.sha }}`
}).then(x => x.data.workflow_runs);
console.log(workflows.map(x => ({name: x.name, title: x.display_title})));
const run_id = workflows.find(x => x.name.includes("Get api.json from CherryPick")).id;
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run_id,
});
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name.startsWith("api-artifact-") || artifact.name == "api-artifact"
});
await Promise.all(matchArtifacts.map(async (artifact) => {
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data));
}));
- name: unzip artifacts
run: |-
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
ls -la
- name: get head checksum
run: |-
checksum=$(realpath head_checksum)
cd packages/cherrypick-js/src
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../..
- name: build autogen
run: |-
checksum=$(realpath ${api_json_name}_checksum)
mv $api_json_name packages/cherrypick-js/generator/api.json
cd packages/cherrypick-js/generator
pnpm run generate
cd built
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../../..
- name: check update for type definitions
run: diff head_checksum ${api_json_name}_checksum

- name: send message
if: failure()
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-cherrypick-js-autogen
message: |-
Thank you for sending us a great Pull Request! 👍
Please regenerate cherrypick-js type definitions! 🙏
example:
```sh
pnpm run build-cherrypick-js-with-types
```
- name: send message
if: success()
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-cherrypick-js-autogen
mode: delete
message: "Thank you!"
create_if_not_exists: false
28 changes: 28 additions & 0 deletions .github/workflows/check-misskey-js-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check CherryPick JS version

on:
push:
branches: [ develop ]
paths:
- packages/cherrypick-js/package.json
- package.json
pull_request:
branches: [ develop ]
paths:
- packages/cherrypick-js/package.json
- package.json

jobs:
check-version:
# ルートの package.json と packages/cherrypick-js/package.json のバージョンが一致しているかを確認する
name: Check version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Check version
run: |
if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/cherrypick-js/package.json)" ]; then
echo "Version mismatch!"
exit 1
fi

0 comments on commit c107f6e

Please sign in to comment.