generated from idrinth-api-bench/project-defaults
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* copy over code for microservice fixes #1018 * add relevant .github files fixes #1018
- Loading branch information
Showing
68 changed files
with
6,189 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FASTIFY_PORT=3003 | ||
FASTIFY_HOST=127.0.0.1 | ||
FASTIFY_MYSQL_CONNECTION=mysql://root@localhost/idrinth-api-bench | ||
FASTIFY_ORIGIN=* | ||
FASTIFY_COMPRESS_MIN_SIZE=1024 | ||
JWT_SECRET=SOMEsecretTObeReplaced | ||
FASTIFY_RATE_LIMIT=120 |
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,16 @@ | ||
module.exports = { | ||
env: { | ||
node: true, | ||
es2020: true | ||
}, | ||
ignorePatterns: [ | ||
'.eslintrc.cjs', | ||
'node_modules', | ||
], | ||
plugins: [ | ||
"fastify-security-rules", | ||
], | ||
rules: { | ||
"fastify-security-rules/detect-bind-on-all-ifaces": 2, | ||
}, | ||
}; |
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,3 @@ | ||
github: | ||
- idrinth | ||
ko_fi: idrinth |
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,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 100 |
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,9 @@ | ||
version: 1 | ||
body: | ||
patterns: | ||
- '#\d+' | ||
error: The body has to include an issue reference like `#0` | ||
branch: | ||
patterns: | ||
- 'issue-\d{1,}-[a-z0-9-]+' | ||
error: Branch must be called `issue-{id}-{short description}` |
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,28 @@ | ||
# The Pull Request is ready | ||
|
||
- [ ] fixes #<!-- YOUR ISSUE ID HERE --> | ||
- [ ] all actions are passing | ||
- [ ] only fixes a single issue | ||
|
||
## Overview | ||
|
||
<!-- Provide a brief description of the changes introduced by this | ||
Pull Request. --> | ||
|
||
## Review points | ||
|
||
<!-- List the points to be reviewed in detail | ||
and the points you are not confident about. --> | ||
<!-- Delete this section if not needed --> | ||
|
||
## History-Microservice | ||
|
||
- [ ] no breaking changes have been added to the api | ||
- [ ] changes have been documented in the open-api.yml | ||
- [ ] tests have been written(if necessary) | ||
- [ ] shared code has been extracted in a different file | ||
|
||
## Notes | ||
|
||
<!-- Write any note or comment. You can share your thoughts or ideas. --> | ||
<!-- Delete this section if not needed --> |
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,5 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
- renovate |
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,29 @@ | ||
name: Commit Message Lint | ||
on: | ||
push: | ||
branches: | ||
- the-one | ||
pull_request: | ||
branches: | ||
- the-one | ||
env: | ||
CURRENT_NODE_VERSION: ${{ vars.CURRENT_NODE_VERSION || 'latest' }} | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.CURRENT_NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.CURRENT_NODE_VERSION }} | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
framework/package-lock.json | ||
documentation-website/package-lock.json | ||
history-microservice/package-lock.json | ||
history-website/package-lock.json | ||
cli/package-lock.json | ||
package-lock.json | ||
- run: npm ci | ||
- run: npm run commitlint-ci |
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,17 @@ | ||
name: conflibot | ||
on: | ||
pull_request: | ||
branches: | ||
- the-one | ||
|
||
jobs: | ||
conflibot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Warn potential conflicts | ||
uses: idrinth/conflibot@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
exclude: | | ||
**/package-lock.json |
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,52 @@ | ||
name: Docker | ||
on: | ||
push: | ||
branches: | ||
- the-one | ||
paths: | ||
- 'containers/*/Dockerfile' | ||
- '.github/workflows/docker.yml' | ||
pull_request: | ||
branches: | ||
- the-one | ||
paths: | ||
- 'containers/*/Dockerfile' | ||
- '.github/workflows/docker.yml' | ||
jobs: | ||
builder: | ||
name: Builder | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- run: git fetch --tags | ||
- name: Cache Docker images. | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('containers/api-bench-build/Dockerfile') }} | ||
- run: docker build --build-arg="BUILD_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)" -t "idrinth/api-bench-build:$(git describe --tags `git rev-list --tags --max-count=1`)" --build-arg="BUILD_TIME=now" containers/api-bench-build | ||
build: | ||
needs: | ||
- builder | ||
strategy: | ||
matrix: | ||
folder: | ||
- 'api-bench-gitlab-runner' | ||
- 'api-bench' | ||
- 'api-bench-gitea-action' | ||
- 'api-bench-history-website' | ||
- 'api-bench-history-microservice' | ||
name: Build ${{ matrix.folder }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- run: git fetch --tags | ||
- name: Cache Docker images. | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('containers/api-bench-build/Dockerfile') }} | ||
read-only: true | ||
- run: docker build --build-arg="BUILD_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)" --build-arg="BUILD_TIME=now" containers/${{ matrix.folder }} |
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,18 @@ | ||
name: Editor Config Lint | ||
on: | ||
push: | ||
branches: | ||
- the-one | ||
pull_request: | ||
branches: | ||
- the-one | ||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
- run: go install github.com/editorconfig-checker/editorconfig-checker/v2/cmd/editorconfig-checker@latest | ||
- run: ~/go/bin/editorconfig-checker |
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,18 @@ | ||
name: Greetings | ||
|
||
on: | ||
- pull_request_target | ||
- issues | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: "Welcome in and thank you for your contribution.\nUsually issues are responded to within 48 hours, but depending on the current workload that may be slightly longer.\n\nYou can also find us on slack at [idrinth-api-bench](https://join.slack.com/t/idrinth-api-bench/shared_invite/zt-2f4zmw2sz-c3etHzCFq3LtZpkR15xXMA)." | ||
pr-message: "Thank you for contributing!\nPlease make sure the actions pass. Once your pull request has been merged, you will automatically be added to the contributor's list on the website.\nIf you want to be shouted out on Linkedin, have a look for the [shoutout issue](https://github.com/Idrinth/api-bench/labels/shoutout) of the specific version.\n\nYou can also find us on slack at [idrinth-api-bench](https://join.slack.com/t/idrinth-api-bench/shared_invite/zt-2f4zmw2sz-c3etHzCFq3LtZpkR15xXMA)." |
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,13 @@ | ||
name: Labeler | ||
on: | ||
- pull_request_target | ||
jobs: | ||
label: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- uses: actions/labeler@v5 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" |
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,15 @@ | ||
name: Update Milestone | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
name: update-milestone | ||
if: ${{github.event.pull_request.merged == true}} | ||
steps: | ||
- uses: idrinth/milestone-set-action@patch-1 | ||
name: milestone set | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} |
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,19 @@ | ||
name: Prace.js | ||
on: | ||
pull_request: | ||
branches: | ||
- the-one | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: innerspacetrainings/Prace.js@master | ||
with: | ||
configuration-path: .github/prace.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,34 @@ | ||
name: pull request size | ||
on: | ||
pull_request: | ||
branches: | ||
- the-one | ||
env: | ||
CURRENT_NODE_VERSION: ${{ vars.CURRENT_NODE_VERSION || 'latest' }} | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.CURRENT_NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.CURRENT_NODE_VERSION }} | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
framework/package-lock.json | ||
documentation-website/package-lock.json | ||
history-microservice/package-lock.json | ||
history-website/package-lock.json | ||
cli/package-lock.json | ||
package-lock.json | ||
- run: npm install -g "https://github.com/Idrinth/check-pr-length.git#patch-1" | ||
- run: git remote add base https://github.com/idrinth/api-bench.git | ||
- run: git config --global user.email "[email protected]" | ||
- run: git config --global user.name "PRS" | ||
- run: git fetch base the-one | ||
- run: git switch the-one | ||
- run: git remote add pullrequest "https://github.com/${{github.event.pull_request.head.repo.full_name}}" | ||
- run: git fetch pullrequest "${GITHUB_HEAD_REF}" | ||
- run: git switch $GITHUB_HEAD_REF | ||
- run: check-pr-length --max=350 --total=500 --base=the-one --silent=false --exclude="package-lock.json;*/package-lock.json" |
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,27 @@ | ||
name: Release | ||
on: | ||
milestone: | ||
types: | ||
- closed | ||
env: | ||
CURRENT_NODE_VERSION: ${{ vars.CURRENT_NODE_VERSION || 'latest' }} | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.CURRENT_NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.CURRENT_NODE_VERSION }} | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
framework/package-lock.json | ||
documentation-website/package-lock.json | ||
history-microservice/package-lock.json | ||
history-website/package-lock.json | ||
cli/package-lock.json | ||
package-lock.json | ||
- run: echo "VERSION_TO_PUBLISH=$(jq --raw-output .milestone.title $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
- run: npm run setup | ||
- run: npm run publish |
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,41 @@ | ||
name: Spellcheck | ||
on: | ||
push: | ||
branches: | ||
- the-one | ||
paths: | ||
- '**.md' | ||
- 'package-lock.json' | ||
- '.github/workflows/spellcheck.yml' | ||
pull_request: | ||
branches: | ||
- the-one | ||
paths: | ||
- '**.md' | ||
- 'package-lock.json' | ||
- '.github/workflows/spellcheck.yml' | ||
env: | ||
CURRENT_NODE_VERSION: ${{ vars.CURRENT_NODE_VERSION || 'latest' }} | ||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Node.js environment ${{ env.CURRENT_NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.CURRENT_NODE_VERSION }} | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
framework/package-lock.json | ||
documentation-website/package-lock.json | ||
history-microservice/package-lock.json | ||
history-website/package-lock.json | ||
cli/package-lock.json | ||
package-lock.json | ||
- name: Build root | ||
run: npm ci | ||
- name: spellcheck | ||
run: npm run spellcheck |
Oops, something went wrong.