Skip to content

fix: NumberOrBoolean config option (cluster) value not coerced from env/CLI#10531

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/cluster-option-parser-definition
Open

fix: NumberOrBoolean config option (cluster) value not coerced from env/CLI#10531
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/cluster-option-parser-definition

Conversation

@dblythy

@dblythy dblythy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #9643

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of the cluster option so numeric strings and boolean-like values are interpreted correctly.
    • Fixed definition validation to more reliably detect options that include an action handler.
  • Tests
    • Added coverage for numeric and boolean coercion behavior.
    • Updated existing validation tests to match the new option handling behavior.

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

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: 5ccbc14b-49ab-4c85-895e-a931b5390a7f

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9d53a and dab15c1.

📒 Files selected for processing (4)
  • resources/buildConfigDefinitions.js
  • spec/CLI.spec.js
  • spec/buildConfigDefinitions.spec.js
  • src/Options/Definitions.js

📝 Walkthrough

Walkthrough

This PR fixes an incorrect parser reference for the NumberOrBoolean generic type. resources/buildConfigDefinitions.js and src/Options/Definitions.js now reference the existing numberOrBoolParser (passing an option name) instead of the nonexistent numberOrBooleanParser. Related tests were updated and a new coercion test was added.

Changes

NumberOrBoolean parser fix

Layer / File(s) Summary
Generator fix for NumberOrBoolean mapper
resources/buildConfigDefinitions.js, spec/buildConfigDefinitions.spec.js
mapperFor now generates a call expression to numberOrBoolParser(elt.name) instead of returning a wrapped numberOrBooleanParser reference; the spec asserts a CallExpression with the mock element's name argument ('cluster').
Cluster option wiring and behavior tests
src/Options/Definitions.js, spec/CLI.spec.js
ParseServerOptions.cluster.action uses parsers.numberOrBoolParser('cluster'); CLI spec adds a coercion test ('2'2, 'true'/'false'→booleans) and switches action presence checks to 'action' in definition.

Estimated code review effort: 2 (Simple) | ~10 minutes

Related issues: #9643 (incorrect NumberOrBoolean parser reference caused a runtime error since numberOrBooleanParser did not exist).

Suggested labels: bug, tests

Suggested reviewers: mtrezza

🐰

A parser mixed up, boolean or number confused,
Now numberOrBoolParser is properly used,
With cluster's name passed as a key,
Tests confirm coercion works happily,
A tiny fix, bugs defused.
🚥 Pre-merge checks | ✅ 6 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says Closes #9643`` and omits the required Issue, Approach, and Tasks sections. Add the template sections with a brief issue summary, the implementation approach, and the relevant task checklist.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the PR change and uses the required fix: prefix.
Linked Issues check ✅ Passed The parser fix and tests match issue #9643's requirement to use numberOrBoolParser for cluster coercion.
Out of Scope Changes check ✅ Passed All listed edits stay focused on the NumberOrBoolean cluster parsing fix and its tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Only parser wiring and tests changed; no eval, deserialization, path, or command-execution paths were introduced.
Engage In Review Feedback ✅ Passed PASS: The provided context shows only automated/non-substantive review activity, so there was no actionable feedback to ignore or resolve without discussion.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (cce91e5) to head (dab15c1).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10531   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         193      193           
  Lines       16981    16981           
  Branches      248      248           
=======================================
  Hits        15736    15736           
  Misses       1224     1224           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy dblythy requested a review from a team July 5, 2026 02:41
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.

Incorrect definition for NumberOrBoolean check in resources/buildConfigDefinition.js

2 participants