Repository navigation
refactor: V7 — new stack, monorepo structure, and tooling modernization - #208
Conversation
|
Important Review skippedToo many files! This PR contains 299 files, which is 149 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (299)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
◈ PR LensNote This drawing shows
Architecture 32 components touched across 6 lanes. Play the interactive walkthrough Inside the changed components — 3 viewsComponent view — Gateway service Internal WebSocket dispatch routing, entity managers, and Redis integration in wolfstar-gateway Component view — Shared cache & serialization Binary encoding and HashScopedCache models in the wolfstar-shared library Component view — Database package Prisma 8 contracts and PostgreSQL runtime client in wolfstar-database Data flow
Follow each request, response and payload View
Tip Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one 🪧 More tips
Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This is a 2,155-file V7 migration that replaces the runtime layout with new bot, gateway, shared-cache/broker, and database components while also changing persistence, Docker images, and production CI/CD. The resulting runtime and deployment blast radius is substantially broader than a mechanical refactor or minor tooling change. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
@copilot please fix the merge conflicts in this pull request. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
# Conflicts: # .github/workflows/tolgee-sync.yml
… work The join guard switches, the auto-moderation menu and /automod edit, and the import confirmation now defer before the lock, the Discord reads or the access check.
…gacy removal A form opened before the member select menus would clear the saved roles and users.
A failed alert no longer deletes the newer claim of the next alert.
GatewayClient.user is only set on a shard's READY, so a broker worker has none and every listener that wrote settings as the bot threw. The avatar reads use optional chaining.
|
@lorypelli The conflicts with |
@lorypelli You're right, and it was worse than a typing issue: |
…ave (#392) Co-authored-by: lorypelli <[email protected]>
… from workers (#395) Co-authored-by: lorypelli <[email protected]>
A broker worker has no gateway user, so the footer of a case log lost its icon and moderationEntryEdit no longer recognized the log, posting a second one on edit.
…sses With the broker, a command runs on the gateway and the events it causes run on a worker. The lock and the case cache lived in the memory of each process, so a worker labelled a kick or a softban as a plain leave, kept the roles of a ban and made a second case for a ban the gateway had made. The lock of a moderation action is now also kept in Redis, which waitLock waits on, and the latest case of a user, and the check for a similar case, fall back to the database when this process has not cached the case.
The test of the help texts reads the commands from the generated types, which have had /info since they were regenerated, and found it the only command without a commands/help entry. Its i18n types are regenerated with the new key.
A punishment menu sent before the merge still submits Timeout, and the handler dropped it. All three readers now share parseAutoModerationHardAction. The mute-timeout setting text now says that /mute and /timeout do not follow it.
With moderation.mute-timeout on, a mute that Discord can take as a timeout is one. It then needs no muted role, and its case is a Timeout, as for the automod.
| const action = ModerationActions.timeout; | ||
| if (await action.isActive(context.guild, context.target.id)) throw context.t('moderation:actionIsActive'); | ||
|
|
||
| const data = await this.getActionData(interaction, context); | ||
| const entry = await action.apply( |
There was a problem hiding this comment.
/mute add now creates a Discord timeout for eligible durations, but /mute remove still checks for and removes only the muted role. After a one-hour mute, removal reports no active role mute—or asks to set up a role when none exists—and leaves the member timed out. Moderators must use /timeout remove instead.
Update /mute remove to recognize and undo timeout-backed mutes without requiring a muted role.
Prompt To Fix With AI
This is a comment left during a code review.
Path: projects/bot/src/commands/Moderation/mute/add.ts
Line: 43-47
Comment:
**Mute removal misses timeouts**
`/mute add` now creates a Discord timeout for eligible durations, but `/mute remove` still checks for and removes only the muted role. After a one-hour mute, removal reports no active role mute—or asks to set up a role when none exists—and leaves the member timed out. Moderators must use `/timeout remove` instead.
Update `/mute remove` to recognize and undo timeout-backed mutes without requiring a muted role.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Migrates
wolfstar-botoff Sapphire Framework onto@wolfstar/http-frameworkand the Stars CLI, and cuts the database over to Prisma ORM 8. The monorepo now has two workspaces,projects/botandprojects/database; the two extra workspaces this PR briefly introduced,projects/gatewayandprojects/shared, were folded back into the bot and removed (see below).@wolfstar/http-framework,@wolfstar/cli(stars) as the build tool (tsdown-based), Yarn → pnpm,tsc/eslint→ oxlint + oxfmt,lint-staged→ nano-staged. Plugins (plugin-api,plugin-i18next,plugin-subcommands-advanced,plugin-logger,plugin-gateway,plugin-cache,plugin-sharder) are declared as dependencies and auto-registered by the Stars CLI (<name>/registerinjected at build time) — no manual/registerimports.projects/botnow mirrors staryl's layout:src/lib/utilities,#common/#typesaliases in one map (scripts/aliases.ts),tests/setup.ts, filename-routedsrc/routes/*.get.ts. i18next types are generated withstars codegenfromsrc/locales/en-USinstead of hand-maintained.projects/databaseis Prisma ORM 8 only (@prisma/orm-postgres), with a normalized contract (Guild,Modules,GuildRoles,GuildLogs,GuildAutoModeration*, …) replacing the old flatguildstable; Prisma 7 and the dual-generation setup are gone.projects/bot/src/lib/database— never ported when the monorepo was restructured — is rebuilt on top of it:GuildDatastays a flat settings object for the rest of the bot,src/lib/database/settings/storage.tsmaps every key to its table/column and reads/writes the normalized tables in one transaction, andAuditLogManager,PermissionNodeManager,AdderManager,SchemaKey/SchemaGroup, and the serializer store are ported onto the v8 client and@wolfstar/http-framework's container.projects/gatewayprocess and itswolfstar-sharedcache/broker package are removed. The bot now runs the Discord gateway in-process with@wolfstar/plugin-gateway, backed by a@wolfstar/plugin-cacheRedis entity cache and a Redis session store (shards resume across restarts instead of re-identifying).container.clientstays the baseClienttype, so gateway-aware code reaches the managers throughcontainer.gatewayClientinstead (56 call sites renamed).@wolfstar/*package bumped to latest (plugin-gateway0.6.0 → 0.8.0 bringsGuildResolvableand the rest of discord.js's*Resolvabletypes, used to rewriteresolveGuild); apnpm-workspace.yamloverride dedupesplugin-i18nextonto one version, sinceshared-http-piecespinned an older one with an incompatible peer range.projects/gateway/projects/sharedstages).Upstream follow-ups filed
Gaps found while integrating
@wolfstar/plugin-gateway/plugin-cacheand retiringwolfstar-sharedwere filed againstwolfstar-project/pluginsrather than worked around locally where upstream was the better fix: #121 (register entrypoint crash, member requests, session resume — resolved onmain), #136 (@wolfstar/plugin-broker, replacingwolfstar-shared's Redis-stream broker), #137 (pluggable codec / opt-in projection forplugin-cache's Redis store, replacingwolfstar-shared's hand-rolled binary cache format).Test plan
pnpm installcompletes without errorspnpm --filter wolfstar-database prisma:generate && pnpm --filter wolfstar-database buildpnpm --filter wolfstar-bot buildpnpm testpnpm lint(oxlint + oxfmt)docker build .)Fix
/mute removebefore merging so moderators can undo the mutes that/mute addcreates.Reviews (171) · Last reviewed commit: "fix(moderation): make /mute add a timeou..." · Reviewed by Greptile