Skip to content

Commit

Permalink
Merge staging into main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 21, 2023
2 parents 26b8c1c + e2487af commit f934590
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 298 deletions.
9 changes: 8 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>guidojw/.github"]
"extends": ["github>guidojw/.github"],
"packageRules": [
{
"matchPackageNames": "typeorm",
"enabled": false,
"description": "Disable TypeORM updates until there's a good alternative to do custom repositories."
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Delete old versions
uses: snok/container-retention-policy@f617f1ca161a52bce48417eedd76924e71d0b4d9 # v2.1.0
uses: snok/container-retention-policy@04c70fd030033036d69c0057e0d125bf25820544 # v2.1.2
with:
image-names: ${{ env.IMAGE_NAMES }}
cut-off: 2 days ago UTC
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
stage: ${{ steps.get_metadata.outputs.stage }}
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Get metadata
id: get_metadata
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Checkout code
if: fromJSON(needs.metadata.outputs.has_diff)
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Run merge
if: fromJSON(needs.metadata.outputs.has_diff)
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
fi
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.merge.outputs.sha }}

Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
done
- name: Update Continuous Delivery check run
uses: guidojw/actions/update-check-run@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
uses: guidojw/actions/update-check-run@870d7c8de5aeb08420bb88d8fbddb0222a9eac61 # v1.4.0
with:
app_id: ${{ vars.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}

Expand All @@ -27,7 +27,7 @@ jobs:
echo '::add-matcher::.github/problem-matchers/tsc.json'
- name: Build test image
uses: guidojw/actions/build-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
uses: guidojw/actions/build-docker-image@870d7c8de5aeb08420bb88d8fbddb0222a9eac61 # v1.4.0
with:
name: app

Expand All @@ -37,7 +37,7 @@ jobs:
needs: build
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}

Expand All @@ -48,10 +48,10 @@ jobs:
- name: Download actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.24
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.25
- name: Load test image
uses: guidojw/actions/load-docker-image@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
uses: guidojw/actions/load-docker-image@870d7c8de5aeb08420bb88d8fbddb0222a9eac61 # v1.4.0
with:
name: app

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ jobs:
needs: metadata
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0

- name: Login to GitHub Container Registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ${{ vars.DOCKER_REGISTRY_URL }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
id: build_push_image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
with:
push: true
context: .
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
done
- name: Update Publish Image check run
uses: guidojw/actions/update-check-run@abb0ee8d1336edf73383f2e5a09abd3a22f25b13 # v1.3.3
uses: guidojw/actions/update-check-run@870d7c8de5aeb08420bb88d8fbddb0222a9eac61 # v1.4.0
with:
app_id: ${{ vars.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.2.0
20.5.1
481 changes: 241 additions & 240 deletions .yarn/releases/yarn-3.5.1.cjs → .yarn/releases/yarn-3.6.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.5.1.cjs
yarnPath: .yarn/releases/yarn-3.6.3.cjs
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.2.0@sha256:14f0471d0478fbb9177d0f9e8c146dc872273dcdcfc7fea93a27ed81fc6b0e96
FROM node:20.5.1@sha256:8d9887b3b05d2e65598a18616c37cfc271346d12248dfcbeadd7b7bf4da1e827

ARG NODE_ENV
ENV NODE_ENV=$NODE_ENV
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-unicorn": "^48.0.0",
"reflect-metadata": "^0.1.13",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
},
"engines": {
"node": ">=14"
},
"packageManager": "yarn@3.5.1"
"packageManager": "yarn@3.6.3"
}
8 changes: 8 additions & 0 deletions src/services/training.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import cron, { type JobCallback } from 'node-schedule'
import { inject, injectable } from 'inversify'
import type { SortQuery } from '../util/request'
import UserService from './user'
import { WebSocketManager } from '../managers'

const { TYPES } = constants
const { getDate, getTime, getTimeZoneAbbreviation } = timeUtil
Expand All @@ -22,6 +23,7 @@ export default class TrainingService {

@inject(TYPES.TrainingTypeRepository) private readonly trainingTypeRepository!: Repository<TrainingType>
@inject(TYPES.UserService) private readonly userService!: UserService
@inject(TYPES.WebSocketManager) private readonly webSocketManager!: WebSocketManager

public async getTrainings (groupId: number, scopes?: string[], sort?: SortQuery): Promise<Training[]> {
if (!TrainingScopes.has(scopes)) {
Expand Down Expand Up @@ -67,6 +69,8 @@ export default class TrainingService {
}))
training.type = trainingType

this.webSocketManager.broadcast('trainingCreate', { groupId, training })

await this.announceTrainingsJob.run(groupId)
cron.scheduleJob(
`training_${training.id}`,
Expand Down Expand Up @@ -123,6 +127,8 @@ export default class TrainingService {
if (changeMessages.length > 0) {
await this.trainingRepository.save(training)

this.webSocketManager.broadcast('trainingUpdate', { groupId, training })

const editorName = await this.userService.getUsername(editorId)
await this.discordMessageJob.run(`**${editorName}**${changeMessages.length > 1 ? `\n- ${changeMessages.join('\n- ')}` : ` ${changeMessages[0]}`}`)

Expand Down Expand Up @@ -157,6 +163,8 @@ export default class TrainingService {
reason
}))

this.webSocketManager.broadcast('trainingCancel', { groupId, training })

await this.announceTrainingsJob.run(groupId)
const job = cron.scheduledJobs[`training_${cancellation.trainingId}`]
if (typeof job !== 'undefined') {
Expand Down
73 changes: 37 additions & 36 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ __metadata:
languageName: node
linkType: hard

"@babel/helper-validator-identifier@npm:^7.19.1":
version: 7.19.1
resolution: "@babel/helper-validator-identifier@npm:7.19.1"
checksum: 0eca5e86a729162af569b46c6c41a63e18b43dbe09fda1d2a3c8924f7d617116af39cac5e4cd5d431bb760b4dca3c0970e0c444789b1db42bcf1fa41fbad0a3a
"@babel/helper-validator-identifier@npm:^7.22.5":
version: 7.22.5
resolution: "@babel/helper-validator-identifier@npm:7.22.5"
checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea
languageName: node
linkType: hard

Expand Down Expand Up @@ -817,7 +817,7 @@ __metadata:
eslint-plugin-import: ^2.26.0
eslint-plugin-n: ^16.0.0
eslint-plugin-promise: ^6.0.0
eslint-plugin-unicorn: ^47.0.0
eslint-plugin-unicorn: ^48.0.0
express: ^4.18.1
express-async-errors: ^3.1.1
express-validator: ^7.0.1
Expand All @@ -833,7 +833,7 @@ __metadata:
pluralize: ^8.0.0
reflect-metadata: ^0.1.13
typeorm: ^0.2.41
typescript: ^5.0.4
typescript: ^5.2.2
ws: ^8.8.1
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -1766,11 +1766,11 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-unicorn@npm:^47.0.0":
version: 47.0.0
resolution: "eslint-plugin-unicorn@npm:47.0.0"
"eslint-plugin-unicorn@npm:^48.0.0":
version: 48.0.0
resolution: "eslint-plugin-unicorn@npm:48.0.0"
dependencies:
"@babel/helper-validator-identifier": ^7.19.1
"@babel/helper-validator-identifier": ^7.22.5
"@eslint-community/eslint-utils": ^4.4.0
ci-info: ^3.8.0
clean-regexp: ^1.0.0
Expand All @@ -1781,14 +1781,13 @@ __metadata:
lodash: ^4.17.21
pluralize: ^8.0.0
read-pkg-up: ^7.0.1
regexp-tree: ^0.1.24
regexp-tree: ^0.1.27
regjsparser: ^0.10.0
safe-regex: ^2.1.1
semver: ^7.3.8
semver: ^7.5.4
strip-indent: ^3.0.0
peerDependencies:
eslint: ">=8.38.0"
checksum: 8d93bd76d54fb44e134c6576e3bda72dbf4c9cb5bae90451ace6acf1c48e6d7329f1e36db1d19266a5da499afeff6bf0c647875d69adc92d546bcc2d8b765cca
eslint: ">=8.44.0"
checksum: fc42b6ac3018d43cd68a2d91de43a0f761824a15de5f3c201b3369e15dc3675843bae1644de65b9aa87b2cd1f79ea9188087c54477bef9deef924a1200d5219f
languageName: node
linkType: hard

Expand Down Expand Up @@ -4101,12 +4100,12 @@ __metadata:
languageName: node
linkType: hard

"regexp-tree@npm:^0.1.24, regexp-tree@npm:~0.1.1":
version: 0.1.24
resolution: "regexp-tree@npm:0.1.24"
"regexp-tree@npm:^0.1.27":
version: 0.1.27
resolution: "regexp-tree@npm:0.1.27"
bin:
regexp-tree: bin/regexp-tree
checksum: 5807013289d9205288d665e0f8d8cff94843dfd55fdedd1833eb9d9bbd07188a37dfa02942ec5cdc671180037f715148fac1ba6f18fd6be4268e5a8feb49d340
checksum: 129aebb34dae22d6694ab2ac328be3f99105143737528ab072ef624d599afecbcfae1f5c96a166fa9e5f64fa1ecf30b411c4691e7924c3e11bbaf1712c260c54
languageName: node
linkType: hard

Expand Down Expand Up @@ -4262,15 +4261,6 @@ __metadata:
languageName: node
linkType: hard

"safe-regex@npm:^2.1.1":
version: 2.1.1
resolution: "safe-regex@npm:2.1.1"
dependencies:
regexp-tree: ~0.1.1
checksum: 5d734e2193c63ef0cb00f60c0244e0f8a30ecb31923633cd34636808d6a7c4c206d650017953ae1db8bc33967c2f06af33488dea6f038f4e38212beb7bed77b4
languageName: node
linkType: hard

"safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0":
version: 2.1.2
resolution: "safer-buffer@npm:2.1.2"
Expand Down Expand Up @@ -4338,6 +4328,17 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:^7.5.4":
version: 7.5.4
resolution: "semver@npm:7.5.4"
dependencies:
lru-cache: ^6.0.0
bin:
semver: bin/semver.js
checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3
languageName: node
linkType: hard

"send@npm:0.17.1":
version: 0.17.1
resolution: "send@npm:0.17.1"
Expand Down Expand Up @@ -5000,23 +5001,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.0.4":
version: 5.0.4
resolution: "typescript@npm:5.0.4"
"typescript@npm:^5.2.2":
version: 5.2.2
resolution: "typescript@npm:5.2.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172
checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c
languageName: node
linkType: hard

"typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>":
version: 5.0.4
resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin<compat/typescript>::version=5.0.4&hash=b5f058"
"typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=f3b441"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac
checksum: 0f4da2f15e6f1245e49db15801dbee52f2bbfb267e1c39225afdab5afee1a72839cd86000e65ee9d7e4dfaff12239d28beaf5ee431357fcced15fb08583d72ca
languageName: node
linkType: hard

Expand Down

0 comments on commit f934590

Please sign in to comment.