fix(internals): add url length validation for url generation#169
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds playground URL length enforcement and chunked serialization in playground utilities, extends oversize-path tests, and updates the Pages artifact upload to include hidden files. ChangesPlayground URL length limit enforcement
Pages artifact upload
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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 `@projects/internals/tools/src/playground/utils.ts`:
- Around line 153-163: Return early in the playground URL builder when
ELEMENTS_PLAYGROUND_BASE_URL is unset so the empty-string fallback is preserved;
move the guard ahead of the url construction and MAX_PLAYGROUND_URL_LENGTH
validation in utils.ts, before encodeURI(...) and the ToolError check inside the
playground URL generation logic.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 36e5c4ad-5862-42d2-9902-47438694ec89
📒 Files selected for processing (3)
projects/internals/tools/src/playground/service.test.tsprojects/internals/tools/src/playground/utils.test.tsprojects/internals/tools/src/playground/utils.ts
b68f580 to
02eff2a
Compare
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 `@projects/internals/tools/src/playground/utils.test.ts`:
- Around line 576-577: The comment in the playground URL length test is
describing the wrong constraint; update the wording near the Uint8Array setup in
utils.test.ts to reflect the real intent. In the test around serialize and
MAX_PLAYGROUND_URL_LENGTH, rephrase it to say the data is high-entropy and
resists gzip so the generated playground URL exceeds the length limit, rather
than mentioning V8’s argument-count limit.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 3430600c-95dd-4764-86c5-554822b8e768
📒 Files selected for processing (3)
projects/internals/tools/src/playground/service.test.tsprojects/internals/tools/src/playground/utils.test.tsprojects/internals/tools/src/playground/utils.ts
c4d85dc to
b7e16c3
Compare
b7e16c3 to
8c79be4
Compare
8c79be4 to
4659162
Compare
- Introduced a maximum URL length constant and validation in the createPlaygroundURL function to ensure URLs do not exceed 32,768 characters. - Added tests to verify that errors are thrown when the URL length limit is exceeded, ensuring robust error handling in service and utils. Signed-off-by: Cory Rylan <crylan@nvidia.com>
4659162 to
4c72b8c
Compare
Summary by CodeRabbit