core: add new domain join logic
引入 【加入域】 概念使其更符合直觉,同时提供退出域功能
- [ ] 是否应当将未加入域的用户作为 guest 权限组管理?
我认为应当允许用户设置为私密域/公开域(guest/default)
guest: N/A default: PERM_VIEW 则普通用户访问跳转到 /domain/join,未登录用户跳转登录 guest: PERM_VIEW, default: PERM_VIEW 则普通用户和未登录用户均可直接访问
guest: PERM_VIEW, default: PERM_VIEW, PERM_SUBMIT_PROBLEM 旧逻辑:访客 (guest) 可注册后 (default) 提交题目,成为域成员 (default) 新逻辑:访客 (guest) 可注册后 (guest) 无法提交题目 (如何引导?)
对主域的管理: 若新用户注册后自动加入 system,则域内榜单会出现大量无操作用户; 若不自动加入,则注册后用户仍需前往 /domain/join 手动完成加入域操作;
Walkthrough
The pull request introduces a wide range of configuration, dependency, and API improvements across many modules. Changes include new configuration files and updated ignore rules, updated build and installation scripts with modern TypeScript and Yarn settings, significant refactors in the judge‐ and UI–related modules, new ESLint and schema configurations, and migration enhancements enforcing lock checks and BigInt pagination. Several global assignments have been removed in favor of context–based injections, and new features (e.g. Kattis checker support, OnlyOffice i18n messages, resolver pages for onsite toolkits) have been added across both backend and frontend code.
Changes
| File(s)/Component(s) | Change Summary |
|---|---|
Configuration Files.gitattributes, .gitignore, .gitpod.yml, .yarnrc.yml |
New/updated configuration for line ending normalization, ignore rules, and Yarn settings. |
Documentation & ReadmesREADME-EN.md, README.md |
Modified workflow badge URL, removed preconfigured Gitpod link, and added major release notes with breaking API changes. |
Build & Installation Scriptsbuild/prepare.js, build/publish.ts, flake.nixinstall/install.sh, install/install.ts, root package.json |
Upgraded TypeScript compiler options, Yarn version, publish tag and versioning logic; added a new Nix flake for development; improved install scripts with decompression, crypto, and enhanced warning checks; dependency updates. |
ESLint & Framework Configsframework/eslint-config/*, framework/framework/* |
Added new ESLint plugins and extensions; enhanced handler, decorators, interface, and serializer functions with better type safety and context–injection. |
Judge Module Enhancementspackages/hydrojudge/**/* |
Major refactors with breaking API changes: new checker methods (including Kattis and communication), improved file handling, refined versioning logic, and extensive TypeScript generics updates. |
Domain, GeoIP & Registration Handlerspackages/geoip/*, packages/hydrooj/src/handler/* |
Refactored constructors, error handling, event mapping, and dependency injection for domains, discussions, contests, and user registration. |
Metrics & Migrationpackages/prom-client/**/*, packages/migrate/**/* |
Integrated Schema-based settings for metrics; migration scripts now enforce lock mechanisms and use BigInt for pagination; version and dependency updates. |
OnlyOffice Integrationpackages/onlyoffice/**/* |
Enhanced error handling and i18n support; version bumped; removed unneeded devDependencies. |
Onsite Toolkit & Scoreboardpackages/onsite-toolkit/**/*, packages/scoreboard-xcpcio/**/* |
Introduced new React components for a resolver page and XCPCIO scoreboard with dynamic ranking, real–time updates, and asset copying. |
Sonic Service Updatespackages/sonic/**/* |
Replaced global assignment with context–based module registration for problem search functionality; minor variable name corrections. |
UI Default Updatespackages/ui-default/**/* |
Extensive user interface improvements: new components, refined template services, updated markdown editors, enhanced i18n/language support, and various dependency/version bumps. |
| Miscellaneous UI & Utility Changes (e.g. Monaco, Markdown, Scratchpad, Editor, etc.) |
Adjusted import paths, removed redundant global assignments, improved styling, and introduced new utility methods (e.g. for rendering Markdown and handling retries). |
Sequence Diagram(s)
sequenceDiagram
participant User
participant MigrationService
participant checkLock
participant Database
User->>MigrationService: Trigger migration script
MigrationService->>checkLock: Invoke checkLock(callback)
checkLock->>Database: Query for migrate.lock
alt Lock exists
Database-->>checkLock: Lock found
checkLock-->>MigrationService: Return error (migration busy)
else No lock exists
checkLock->>MigrationService: Proceed & set lock
MigrationService->>Database: Process migration tasks (update, paginate with BigInt, etc.)
MigrationService->>Database: Release lock (set migrate.lock to 0)
MigrationService-->>User: Migration completed successfully
end
Poem
I’m a bunny hopping through the code fields,
Digging deep in configs and builds with zeal.
I nibble on changes—new checkers and locks,
Fancy UI and API upgrades in lots.
With ears perked high and a joyful heart,
I celebrate each update with a happy little start!
Keep on hopping, dear coder, for the changes are art!
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ERR_PNPM_OPTIONAL_DEPS_REQUIRE_PROD_DEPS Optional dependencies cannot be installed without production dependencies
[!TIP]
⚡🧪 Multi-step agentic review comment chat (experimental)
- We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments. - To enable this feature, set early_access to true under in the settings.
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Generate unit testing code for this file. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and generate unit testing code. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
Track in #963 instead.