chore: align with upstream changes from Node qs v6.15.2#10
Conversation
📝 WalkthroughWalkthroughUpdates baseline to Node qs 6.15.2 and pnpm bootstrap docs; refactors decode key segmentation to normalize dots before depth=0 and removes bracket-recovery helper; refines comma-array null handling and charset-sentinel delimiter; expands parity tests for these behaviors. ChangesBaseline upgrade and behavior alignment
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -24 |
| Duplication | 0 |
🟢 Coverage 85.29% diff coverage · -0.04% coverage variation
Metric Results Coverage variation ✅ -0.04% coverage variation (-1.00%) Diff coverage ✅ 85.29% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (d09b12f) 5048 4940 97.86% Head commit (9342b4d) 4997 (-51) 4888 (-52) 97.82% (-0.04%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#10) 34 29 85.29% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
- Coverage 97.86% 97.81% -0.05%
==========================================
Files 37 37
Lines 5048 4997 -51
==========================================
- Hits 4940 4888 -52
- Misses 108 109 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 `@tests/comparison/js/README.md`:
- Around line 1-4: The README currently instructs "npm ci" but the fixture uses
pnpm (pnpm-lock.yaml and package.json), so update the bootstrap instruction by
replacing the "npm ci" command with the pnpm equivalent (e.g., "pnpm install
--frozen-lockfile" or "pnpm i --frozen-lockfile") so the locked pnpm
dependencies are installed deterministically; update the line containing the
"npm ci" command in the tests/comparison/js README (the sentence referencing
bootstrapping the Node comparison tests) to use the chosen pnpm command.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6ae8de3c-764d-4b3b-b70a-dd92d76147db
⛔ Files ignored due to path filters (1)
tests/comparison/js/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
README.mddocs/divergences.mdsrc/decode.rssrc/decode/keys.rssrc/decode/tests/keys.rssrc/decode/tests/mod.rssrc/decode/tests/scanner.rssrc/encode.rssrc/encode/comma.rssrc/encode/scalar.rssrc/encode/tests/helpers.rstests/comparison/js/README.mdtests/comparison/js/package.jsontests/divergences.rstests/porting_ledger.mdtests/support/cases/csharp_encode.rstests/support/cases/dart_encode.rstests/support/cases/node_parse.rstests/support/cases/node_stringify.rs
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s Node qs semantic baseline to 6.15.2 and aligns Rust encode/decode edge-case behavior (notably structured key parsing and comma-array null handling) to match upstream semantics more closely.
Changes:
- Bumped Node comparison fixture from
qs@6.15.1toqs@6.15.2and updated baseline references in docs/tests. - Refined decode key segmentation to better handle dotted keys at
depth=0and treat unterminated/nested bracket groups as literal segments (matching upstream behavior). - Reworked comma list encoding around null-like values to match Node’s “empty slot” joining behavior, and fixed charset-sentinel delimiter handling.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/support/cases/node_stringify.rs | Adds new Node parity encode cases for strict-null RFC1738 key formatting, comma-array null slot behavior, and delimiter-aware charset sentinels. |
| tests/support/cases/node_parse.rs | Adds Node parity decode cases for dot normalization with depth=0 and bracket edge cases (literal empty brackets, unterminated groups, trailing text). |
| tests/support/cases/dart_encode.rs | Updates test case description to reflect RFC1738 key-only formatting behavior. |
| tests/support/cases/csharp_encode.rs | Updates test case description to reflect delimiter-aware charset sentinel behavior. |
| tests/porting_ledger.md | Updates ledger entries to reflect new Node-consistent behavior for dotted keys at depth=0 and related C# divergence notes. |
| tests/divergences.rs | Updates divergence test name/expectations for dot normalization before depth=0 preservation. |
| tests/comparison/js/README.md | Updates stated pinned qs version (but still incorrectly instructs npm ci). |
| tests/comparison/js/pnpm-lock.yaml | Updates Node fixture lockfile to qs@6.15.2. |
| tests/comparison/js/package.json | Updates dependency constraint to ^6.15.2. |
| src/encode/tests/helpers.rs | Updates/extends unit tests for comma-null joining and RFC1738 key-only formatting. |
| src/encode/scalar.rs | Simplifies encode_key_only_fragment to use the same formatter logic (fixing RFC1738 space handling in key-only output). |
| src/encode/comma.rs | Adjusts comma-array encoding to preserve null “slots” (empty strings) vs compacting, and updates strict/skip-null edge handling. |
| src/encode.rs | Ensures charset sentinel separator uses the configured delimiter instead of hardcoding &. |
| src/decode/tests/scanner.rs | Updates tests for new split-key behavior (balanced bracket scanning, dotted keys at depth=0). |
| src/decode/tests/mod.rs | Removes re-exports of deleted key-recovery helper. |
| src/decode/tests/keys.rs | Updates structured-key helper tests to new literal-bracket/trailing-text behavior. |
| src/decode/keys.rs | Reworks split_key_into_segments to scan balanced brackets, normalize dots before depth=0, and handle unterminated bracket groups as a single literal segment. |
| src/decode.rs | Removes references to deleted key-recovery helper. |
| README.md | Updates Node fixture bootstrap instructions (pnpm) and baseline version reference to 6.15.2. |
| docs/divergences.md | Updates divergence matrix baseline/version and the dotted-key depth=0 entry to match new behavior. |
Files not reviewed (1)
- tests/comparison/js/pnpm-lock.yaml: Language not supported
…a_array_controlled
…empty string values
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
This pull request updates the Node
qssemantic baseline from version6.15.1to6.15.2and refines the handling of key parsing and comma array encoding for improved standards compliance and bug fixes. The most important changes are as follows:Semantic Baseline Update:
qsversion6.15.2as the new semantic baseline, replacing6.15.1. This affectsREADME.mdanddocs/divergences.md. [1] [2] [3] [4]Key Parsing and Divergence Handling:
depth = 0preservation whenallow_dots = true, and updated the divergence matrix and related documentation to reflect this behavior.split_key_into_segmentsto simplify and improve handling of unterminated bracket groups, removing thefind_recoverable_balanced_openrecovery logic and updating tests accordingly. [1] [2] [3] [4] [5] [6]Comma Array Encoding Fixes:
skip_nulls,strict_null_handling, and related options, and fixing edge cases for empty arrays and nulls. [1] [2] [3] [4] [5] [6] [7]Test and Code Cleanup:
find_recoverable_balanced_openand related test cases, to streamline the codebase. [1] [2] [3] [4]Other Bug Fixes:
encode_key_only_fragmentto avoid unnecessary replacements.Summary by CodeRabbit
Bug Fixes
&.allow_dotsis enabled.+instead of%20.Documentation
pnpm install --frozen-lockfile.