Skip to content

refactor: Deprecate disabled default values for query complexity limits#10207

Merged
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:deprecate/request-complexity-defaults
Mar 15, 2026
Merged

refactor: Deprecate disabled default values for query complexity limits#10207
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:deprecate/request-complexity-defaults

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 15, 2026

Issue

The requestComplexity options (includeDepth, includeCount, subqueryDepth, queryDepth, graphQLDepth, graphQLFields) currently default to -1 (disabled) to avoid a breaking change. In the next major version, these defaults will change to positive values that enforce query complexity limits. This adds deprecation warnings to inform developers to explicitly configure these options.

Tasks

  • Add changes to documentation (guides, repository pages, code comments)
  • Add tests
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

Summary by CodeRabbit

  • New Features
    • Six new request-complexity configuration options added (include depth, include count, subquery depth, query depth, GraphQL depth, GraphQL fields) with recommended defaults and guidance for tuning.
  • Documentation
    • Deprecation notice added announcing default limits for requestComplexity and timeline for change.
  • Tests
    • New tests cover deprecation logging behavior for the requestComplexity limits.

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 15, 2026

🚀 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.

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.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Mar 15, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Mar 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: 998d1eb9-a3fb-451a-95d7-cb7f6a28517e

📥 Commits

Reviewing files that changed from the base of the PR and between eb8c23b and 52dea27.

📒 Files selected for processing (2)
  • DEPRECATIONS.md
  • spec/Deprecator.spec.js

📝 Walkthrough

Walkthrough

Adds six new deprecation entries to the deprecations catalog, introducing dot-notated keys for requestComplexity (includeDepth, includeCount, subqueryDepth, queryDepth, graphQLDepth, graphQLFields) with new default values and guidance text; updates DEPRECATIONS.md and adds tests verifying logging behavior.

Changes

Cohort / File(s) Summary
Deprecation entries
src/Deprecator/Deprecations.js
Appends six new deprecation objects for requestComplexity.* keys (includeDepth, includeCount, subqueryDepth, queryDepth, graphQLDepth, graphQLFields) with changeNewDefault values and solution guidance.
Documentation
DEPRECATIONS.md
Adds a new deprecation entry DEPPS18 documenting that requestComplexity limits are enabled by default (deprecation metadata and timeline).
Tests
spec/Deprecator.spec.js
Adds two tests: one asserting deprecation logs for unset requestComplexity limits, and one asserting no logs when those limits are explicitly configured.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR 10130 — Adds the requestComplexity option implementation, validation, enforcement, and related tests (directly related to the options being deprecated here).
  • PR 10205 — Adjusts the default values for requestComplexity options that these deprecations document.
  • PR 9934 — Changes Deprecator to correctly handle nested/dot-notated option keys, impacting detection/suppression of these new deprecations.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding deprecation for disabled default values of query complexity limits.
Description check ✅ Passed The PR description addresses the Issue and includes checked Tasks, but lacks an Approach section explaining the specific technical implementation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link

@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.

🧹 Nitpick comments (1)
src/Deprecator/Deprecations.js (1)

44-73: Add table-driven tests for the six new deprecation entries.

Please cover both paths per key: warning when unset, and no warning when explicitly set (including -1). This change is config-safety critical and easy to regress without targeted assertions.

I can draft a compact parameterized test matrix for this if you want.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Deprecator/Deprecations.js` around lines 44 - 73, Add table-driven unit
tests for the six new deprecation entries in Deprecations.js to prevent
regressions: create a parameterized matrix over the optionKey values
'requestComplexity.includeDepth', 'requestComplexity.includeCount',
'requestComplexity.subqueryDepth', 'requestComplexity.queryDepth',
'requestComplexity.graphQLDepth', and 'requestComplexity.graphQLFields' and for
each assert two behaviors — that the deprecation warning is emitted when the
option is unset (or left at default) and that no warning is emitted when the
option is explicitly set (test both a positive integer and '-1' disable value).
Hook these tests into the existing deprecation-checking helper used by your test
suite (the same utility/assertions other deprecation tests use) so they exercise
the same warning capture/assert logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/Deprecator/Deprecations.js`:
- Around line 44-73: Add table-driven unit tests for the six new deprecation
entries in Deprecations.js to prevent regressions: create a parameterized matrix
over the optionKey values 'requestComplexity.includeDepth',
'requestComplexity.includeCount', 'requestComplexity.subqueryDepth',
'requestComplexity.queryDepth', 'requestComplexity.graphQLDepth', and
'requestComplexity.graphQLFields' and for each assert two behaviors — that the
deprecation warning is emitted when the option is unset (or left at default) and
that no warning is emitted when the option is explicitly set (test both a
positive integer and '-1' disable value). Hook these tests into the existing
deprecation-checking helper used by your test suite (the same utility/assertions
other deprecation tests use) so they exercise the same warning capture/assert
logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52d53765-4603-413f-9969-88f5943a0c2b

📥 Commits

Reviewing files that changed from the base of the PR and between 2b28587 and eb8c23b.

📒 Files selected for processing (1)
  • src/Deprecator/Deprecations.js

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.56%. Comparing base (ab8dd54) to head (52dea27).
⚠️ Report is 5 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10207   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files         192      192           
  Lines       16284    16284           
  Branches      199      199           
=======================================
  Hits        15073    15073           
  Misses       1194     1194           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 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.

@mtrezza mtrezza merged commit f403131 into parse-community:alpha Mar 15, 2026
22 of 24 checks passed
@mtrezza mtrezza deleted the deprecate/request-complexity-defaults branch March 15, 2026 14:58
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.23

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants