Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump @cloudamqp/amqp-client from 2.1.1 to 3.1.1 #32

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
272ac80
Add extra_hosts host.docker.internal:host-gateway for worker to conne…
tzushimelon Sep 16, 2023
7cd9432
Re-add key-db dev container ports
tzushimelon Sep 16, 2023
7660d57
Catch errors in component collectors
tzushimelon Sep 16, 2023
274c66f
Add configurable tracing url
tzushimelon Sep 16, 2023
6daae6d
Set tracing url to host
tzushimelon Sep 16, 2023
8912a9e
Catch uncaught errors in handlers, fix mod log extra } char, prevent …
tzushimelon Oct 5, 2023
dab43b5
Add logging labels to worker
tzushimelon Oct 9, 2023
7a9b4aa
Add lookup groups
tzushimelon Oct 10, 2023
2700bf2
Add vitest
tzushimelon Oct 11, 2023
2e542f8
Refactor to use ban pools
tzushimelon Oct 11, 2023
43f65e4
Allow bun support
tzushimelon Oct 11, 2023
06a2e89
Update settings formatting
tzushimelon Oct 11, 2023
40ae6de
Separate ban pools to repository, table types
tzushimelon Oct 12, 2023
799f0a6
Use bun for commands and install
tzushimelon Oct 12, 2023
37cd22c
Use separate service for invites
tzushimelon Oct 12, 2023
b5ef059
Add tx support
tzushimelon Oct 13, 2023
700042b
Add autocomplete handler
tzushimelon Oct 13, 2023
19893ab
Move tx support by passing in db
tzushimelon Oct 13, 2023
1ab6cb6
Add owned pools to show autocomplete
tzushimelon Oct 13, 2023
84f36a7
Run prettier
tzushimelon Oct 13, 2023
ac7e267
Show components and embeds
tzushimelon Oct 13, 2023
2c9cc0b
Settings page and handlers
tzushimelon Oct 15, 2023
7745a73
Add pool settings command
tzushimelon Oct 16, 2023
a420008
Disable import/prefer-default-export rule
tzushimelon Oct 16, 2023
bc6c0d5
Bump @cloudamqp/amqp-client from 2.1.1 to 3.1.1
dependabot[bot] Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ services:
shlink:
ports:
- "8080:8080"
keydb:
ports:
- "6379:6379"
37 changes: 5 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
version: "3.8"
services:
sushii_interactions:
build:
dockerfile: ./dockerfiles/sushii-worker/Dockerfile
context: .
logging:
options:
max-size: "10m"
max-file: "3"
depends_on:
- sushii_data
restart: unless-stopped
environment:
- LOG_LEVEL=debug
- NODE_ENV=production
- DISCORD_TOKEN=$DISCORD_TOKEN
- APPLICATION_ID=193163942502072320
- DATABASE_URL=$DATABASE_URL
- SUSHII_GRAPHQL_WS_URL=ws://sushii_data:8080/graphql
- SUSHII_GRAPHQL_TOKEN=$SUSHII_GRAPHQL_TOKEN
- SENTRY_DSN=$SENTRY_DSN
- TWILIGHT_PROXY_URL=http://twilight-http-proxy:80/api
- SUSHII_IMAGE_SERVER_URL=http://sushii-image-server:3000
# Notifications
- NOTIFY_WEBHOOK_URL=$NOTIFY_WEBHOOK_URL
- NOTIFY_WEBHOOK_USERNAME=$NOTIFY_WEBHOOK_USERNAME
# Increase max memory usage - should use approx 1100 MB on start
- NODE_OPTIONS=--max-old-space-size=4096
networks:
- sushii_net
labels:
- "traefik.enable=false"
# Secondary new service for testing before deleting sushii_interactions
sushii_worker:
build:
dockerfile: ./dockerfiles/sushii-worker/Dockerfile
Expand All @@ -56,15 +24,20 @@ services:
- SENTRY_DSN=$SENTRY_DSN
- TWILIGHT_PROXY_URL=http://twilight-http-proxy:80/api
- SUSHII_IMAGE_SERVER_URL=http://sushii-image-server:3000
- TRACING_EXPORTER_URL=http://host.docker.internal:4318/v1/traces
# Notifications
- NOTIFY_WEBHOOK_URL=$NOTIFY_WEBHOOK_URL
- NOTIFY_WEBHOOK_USERNAME=$NOTIFY_WEBHOOK_USERNAME
# Increase max memory usage - should use approx 1100 MB on start
- NODE_OPTIONS=--max-old-space-size=4096
networks:
- sushii_net
extra_hosts:
- "host.docker.internal:host-gateway"
labels:
- "traefik.enable=false"
- "logging=promtail"
- "logging_jobname=sushii_worker"
sushii_data:
build:
dockerfile: ./dockerfiles/sushii-data/Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion packages/sushii-worker/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = {
"checkLoops": false
},
],
"no-multi-str": "off"
"no-multi-str": "off",
"import/prefer-default-export": "off",
},
settings: {
"import/resolver": {
Expand Down
13 changes: 8 additions & 5 deletions packages/sushii-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"main": "index.js",
"license": "AGPL-3.0-or-later",
"scripts": {
"test": "jest",
"test": "vitest",
"build": "tsc --skipLibCheck",
"start": "node dist/index.js",
"start": "bun run ./src/index.ts",
"build:graphql": "graphql-codegen --config codegen.yml",
"codegen:pg": "kysely-codegen --out-file ./src/model/dbTypes.ts",
"dev": "ts-node src/index.ts | pino-pretty -c -t"
"dev": "bun src/index.ts | pino-pretty -c -t"
},
"dependencies": {
"@cloudamqp/amqp-client": "^2.1.0",
"@cloudamqp/amqp-client": "^3.1.1",
"@godaddy/terminus": "^4.12.1",
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/auto-instrumentations-node": "^0.39.2",
Expand All @@ -35,6 +35,7 @@
"graphql-request": "5.1.0",
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.11.2",
"hi-base32": "^0.5.1",
"i18next": "^21.6.13",
"i18next-fs-backend": "^1.1.4",
"kysely": "^0.26.3",
Expand Down Expand Up @@ -68,6 +69,7 @@
"@types/pg-cursor": "^2.7.0",
"@typescript-eslint/eslint-plugin": "^5.12.0",
"@typescript-eslint/parser": "^5.12.0",
"bun-types": "^1.0.5",
"eslint": "^8.45.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^16.1.0",
Expand All @@ -78,6 +80,7 @@
"prettier": "^3.0.0",
"ts-jest": "^27.1.4",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
14 changes: 7 additions & 7 deletions packages/sushii-worker/src/builders/buildModLogEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function buildModLogEmbed(
actionType: ActionType,
targetUser: User,
modCase: ModCase,
timeoutChange?: TimeoutChange
timeoutChange?: TimeoutChange,
): Promise<EmbedBuilder> {
let executorUser;
if (modCase.executor_id) {
Expand All @@ -42,7 +42,7 @@ export default async function buildModLogEmbed(

fields.push({
name: `User ${ActionType.toString(actionType)}`,
value: `<@${targetUser.id}> ${targetUser.displayName} (\`@${targetUser.tag}}\`) | \`${targetUser.id}\``,
value: `<@${targetUser.id}> ${targetUser.displayName} (\`@${targetUser.tag}\`) | \`${targetUser.id}\``,
inline: false,
});

Expand All @@ -56,7 +56,7 @@ export default async function buildModLogEmbed(
if (timeoutChange.actionType === ActionType.Timeout) {
const newTsR = toTimestamp(
timeoutChange.new,
TimestampStyles.RelativeTime
TimestampStyles.RelativeTime,
);
const dur = timeoutChange.duration.humanize();

Expand All @@ -70,13 +70,13 @@ export default async function buildModLogEmbed(
if (timeoutChange.actionType === ActionType.TimeoutAdjust) {
const newTsR = toTimestamp(
timeoutChange.new,
TimestampStyles.RelativeTime
TimestampStyles.RelativeTime,
);
const dur = timeoutChange.duration.humanize();

const oldTsR = toTimestamp(
timeoutChange.old,
TimestampStyles.RelativeTime
TimestampStyles.RelativeTime,
);

fields.push(
Expand All @@ -89,14 +89,14 @@ export default async function buildModLogEmbed(
name: "Previous Timeout",
value: `Would have expired ${oldTsR}`,
inline: false,
}
},
);
}

if (timeoutChange.actionType === ActionType.TimeoutRemove) {
const oldTsR = toTimestamp(
timeoutChange.old,
TimestampStyles.RelativeTime
TimestampStyles.RelativeTime,
);

fields.push({
Expand Down
Loading
Loading