Skip to content

judge: enhance validation for communication type config#1163

Merged
undefined-moe merged 1 commit into
hydro-dev:masterfrom
HeRaNO:master
May 15, 2026
Merged

judge: enhance validation for communication type config#1163
undefined-moe merged 1 commit into
hydro-dev:masterfrom
HeRaNO:master

Conversation

@HeRaNO
Copy link
Copy Markdown
Contributor

@HeRaNO HeRaNO commented May 15, 2026

num_processes should be greater than 0. So let's enhance the validation.

Summary by CodeRabbit

  • Bug Fixes
    • Validation now requires the number of processes to be explicitly provided and positive, with clearer errors for missing or invalid values.
    • Configurations that exceed the allowed process limit are now rejected to prevent runtime issues.

Review Change Stack

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 85943777-ae5d-4168-a57a-925457369395

📥 Commits

Reviewing files that changed from the base of the PR and between 2372e55 and f78c1a1.

📒 Files selected for processing (1)
  • packages/hydrojudge/src/cases.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/hydrojudge/src/cases.ts

Walkthrough

The isValidConfig function in packages/hydrojudge/src/cases.ts was updated to tighten validation of communication-type configurations. The function now explicitly requires config.num_processes to be set and greater than zero, validates that it does not exceed processLimit, and throws FormatError with specific messages for violations. The previous logic that used a fallback default of 2 processes has been removed, making num_processes mandatory rather than optional for communication configs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Enhance validation for communication type config' accurately describes the main change: stricter validation for communication type configuration, specifically requiring num_processes to be a positive integer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

packages/hydrojudge/src/cases.ts

Oops! Something went wrong! :(

ESLint: 9.39.4

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint-plugin-react-hooks' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:301:9)
at packageResolve (node:internal/modules/esm/resolve:764:81)
at moduleResolve (node:internal/modules/esm/resolve:855:18)
at defaultResolve (node:internal/modules/esm/resolve:988:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:697:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:714:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:746:52)
at #resolve (node:internal/modules/esm/loader:679:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:599:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:162:33)

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HeRaNO
Copy link
Copy Markdown
Contributor Author

HeRaNO commented May 15, 2026

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/hydrojudge/src/cases.ts`:
- Around line 19-21: The check for config.num_processes currently only rejects
null/zero but allows negative values; update the validation in the code that
throws FormatError so it requires a strictly positive integer (e.g., change the
condition to if (config.num_processes == null || config.num_processes <= 0) and
keep/adjust the error message to "Number of processes must be > 0 for
communication type."); ensure this validation is applied where
config.num_processes is read (the block containing the existing FormatError) so
downstream logic using config.num_processes cannot receive negative values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fbe1b743-3683-4125-a2ac-ea0080b1831b

📥 Commits

Reviewing files that changed from the base of the PR and between d7772f2 and 7313fee.

📒 Files selected for processing (1)
  • packages/hydrojudge/src/cases.ts

Comment thread packages/hydrojudge/src/cases.ts Outdated
@undefined-moe undefined-moe changed the title Enhance validation for communication type config judge: enhance validation for communication type config May 15, 2026
@undefined-moe undefined-moe merged commit c5fed86 into hydro-dev:master May 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants