Skip to content

fix(plugin-client): URL encode parameters in plugin client - #614

Merged
BrianNewsom merged 2 commits into
mainfrom
ase-90-plugin-client-path-encoding/brnewsom
Jul 8, 2026
Merged

fix(plugin-client): URL encode parameters in plugin client#614
BrianNewsom merged 2 commits into
mainfrom
ase-90-plugin-client-path-encoding/brnewsom

Conversation

@BrianNewsom

@BrianNewsom BrianNewsom commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

URL-encode path parameters when BaseNemoClient resolves endpoint
templates. This prevents spaces, slashes, and reserved characters
such as ? and # from corrupting generated request URLs.

Includes coverage for explicit path parameters and the default
workspace parameter.

Summary by CodeRabbit

  • Bug Fixes

    • Improved request handling so path values are safely encoded before being sent, preventing malformed URLs when parameters contain spaces or special characters.
    • Fixed requests that rely on a configured workspace so encoded values are used consistently in the final request URL.
  • Tests

    • Added coverage for encoded path parameters in client requests.
    • Added coverage for encoded workspace values in request paths.

Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
@BrianNewsom
BrianNewsom requested review from a team as code owners July 8, 2026 22:59
@github-actions github-actions Bot added the fix label Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 547ffdd2-16e9-4e71-b9d2-4d472a23a609

📥 Commits

Reviewing files that changed from the base of the PR and between ae7e9fb and 0778b12.

📒 Files selected for processing (2)
  • packages/nemo_platform_plugin/src/nemo_platform_plugin/client/client.py
  • packages/nemo_platform_plugin/tests/client/test_client.py

📝 Walkthrough

Walkthrough

Client's _resolve_path now percent-encodes resolved path parameter values using urllib.parse.quote before formatting the request path template. New tests verify that path parameters and workspace values are properly encoded in outgoing HTTP request URLs.

Changes

Path Parameter Encoding

Layer / File(s) Summary
Encode path params before URL formatting
packages/nemo_platform_plugin/src/nemo_platform_plugin/client/client.py
Imports quote and encodes each resolved path parameter value before substituting into path_template in _resolve_path.
Encoding tests
packages/nemo_platform_plugin/tests/client/test_client.py
Adds tests confirming percent-encoded path parameters and default workspace values appear in mocked outgoing request URLs.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: URL-encoding parameters in the plugin client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ase-90-plugin-client-path-encoding/brnewsom

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

@BrianNewsom
BrianNewsom enabled auto-merge July 8, 2026 23:08
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 23351/30531 76.5% 61.3%
Integration Tests 13618/29211 46.6% 19.8%

@BrianNewsom
BrianNewsom added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit acb05ae Jul 8, 2026
57 checks passed
@BrianNewsom
BrianNewsom deleted the ase-90-plugin-client-path-encoding/brnewsom branch July 8, 2026 23:23
arpitsardhana pushed a commit that referenced this pull request Jul 9, 2026
* fix(plugin-client): encode path and typed query parameters

Signed-off-by: Brian Newsom <brnewsom@nvidia.com>

* refactor(plugin-client): keep query transport JSON-only

Signed-off-by: Brian Newsom <brnewsom@nvidia.com>

---------

Signed-off-by: Brian Newsom <brnewsom@nvidia.com>
matthewgrossman added a commit that referenced this pull request Jul 13, 2026
…o-nemoclient-typed-http-client

Brings in the merged NemoClient migrations from main:
- #584 (Files consumers -> FilesClient)
- #609 (Secrets service + consumers -> SecretsClient)
- #614 (plugin-client URL encoding)

Resolved 4 conflicts where the Jobs consumer migration (AIRCORE-874)
overlapped the Files/Secrets migrations in multi-service files:

- services/core/entities/.../workspace_cleanup.py: combined both migrations
  (jobs via AsyncJobsClient, filesets via AsyncFilesClient); switched
  PlatformJobStatus to the plugin type and built the terminal-status set from
  enum members.
- services/core/entities/tests/.../test_workspace_cleanup.py: adopted #584's
  tuple-return _make_sdk + _MockAsyncPaginatedResponse; added a dispatching
  _patch_clients() so the combined _async_step test routes
  client_from_platform to the jobs vs files mock by client class.
- plugins/nemo-safe-synthesizer/.../api/v2/jobs/endpoints.py test: dropped the
  now-orphaned Stainless NotFoundError/PermissionDeniedError import (both uses
  migrated across the two PRs); made _patch_jobs_client dispatch jobs vs files
  clients by class.
- plugins/nemo-data-designer/.../testing/utils.py: kept both the jobs
  (CreatePlatformJobRequest) and secrets (SecretsClient) imports.

All affected suites green; jobs service unchanged (5 pre-existing env failures).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants