Hydro icon indicating copy to clipboard operation
Hydro copied to clipboard

core: add new domain join logic

Open undefined-moe opened this issue 1 year ago • 3 comments

引入 【加入域】 概念使其更符合直觉,同时提供退出域功能

  • [ ] 是否应当将未加入域的用户作为 guest 权限组管理?

undefined-moe avatar Oct 07 '24 11:10 undefined-moe

我认为应当允许用户设置为私密域/公开域(guest/default)

pandadtdyy avatar Oct 07 '24 13:10 pandadtdyy

guest: N/A default: PERM_VIEW 则普通用户访问跳转到 /domain/join,未登录用户跳转登录 guest: PERM_VIEW, default: PERM_VIEW 则普通用户和未登录用户均可直接访问

undefined-moe avatar Oct 07 '24 13:10 undefined-moe

guest: PERM_VIEW, default: PERM_VIEW, PERM_SUBMIT_PROBLEM 旧逻辑:访客 (guest) 可注册后 (default) 提交题目,成为域成员 (default) 新逻辑:访客 (guest) 可注册后 (guest) 无法提交题目 (如何引导?)

对主域的管理: 若新用户注册后自动加入 system,则域内榜单会出现大量无操作用户; 若不自动加入,则注册后用户仍需前往 /domain/join 手动完成加入域操作;

undefined-moe avatar Oct 10 '24 01:10 undefined-moe

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 & Readmes
README-EN.md, README.md
Modified workflow badge URL, removed preconfigured Gitpod link, and added major release notes with breaking API changes.
Build & Installation Scripts
build/prepare.js, build/publish.ts, flake.nix
install/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 Configs
framework/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 Enhancements
packages/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 Handlers
packages/geoip/*, packages/hydrooj/src/handler/*
Refactored constructors, error handling, event mapping, and dependency injection for domains, discussions, contests, and user registration.
Metrics & Migration
packages/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 Integration
packages/onlyoffice/**/*
Enhanced error handling and i18n support; version bumped; removed unneeded devDependencies.
Onsite Toolkit & Scoreboard
packages/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 Updates
packages/sonic/**/*
Replaced global assignment with context–based module registration for problem search functionality; minor variable name corrections.
UI Default Updates
packages/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 @coderabbitai in 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 @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

coderabbitai[bot] avatar Mar 14 '25 17:03 coderabbitai[bot]

Track in #963 instead.

undefined-moe avatar Mar 14 '25 18:03 undefined-moe