[WIP] feat(platform): IXP designtime base service [ACTV-89364]#1812
Open
cezara98t wants to merge 4 commits into
Open
[WIP] feat(platform): IXP designtime base service [ACTV-89364]#1812cezara98t wants to merge 4 commits into
cezara98t wants to merge 4 commits into
Conversation
First increment of the IXP design-time Python SDK (epic ACTV-89216, spike
ACTV-89217): the shared transport base every IXP service will build on.
Adds platform/ixp/IxpDesigntimeService(BaseService) encoding the
du_/api/designtimeapi conventions:
- du_/api/designtimeapi base path, org/tenant scoped, mandatory
api-version=1.0 on every call
- strict path-segment percent-encoding (quote(safe="")) so reserved chars
survive (/ -> %2F, space -> %20)
- NO retry on non-idempotent writes (POST/PUT/PATCH/upload) or DELETE, matching
the CLI SDK's zero-retry contract to avoid double-create/confirm on transient
5xx; idempotent GETs keep the platform retry policy
- empty write body sent as {}; multipart `file` upload; binary download
- sync + async twins; errors via EnrichedException; no FolderContext (IXP is
org/tenant scoped only)
Additive only: a new platform/ixp/ subpackage nothing else imports yet.
13 pytest-httpx tests; ruff + mypy clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the initial IXP design-time transport foundation (platform/ixp/) for the du_/api/designtimeapi gateway, intended to be the shared base used by future IXP design-time services.
Changes:
- Introduces
IxpDesigntimeServicewith endpoint construction (strict segment encoding), mandatoryapi-version=1.0parameter handling, and sync/async request helpers. - Implements IXP-specific transport behavior: retry only for idempotent GETs, no retries for writes/deletes, plus upload/download helpers.
- Adds pytest-httpx coverage for URL construction, encoding, retry policy, empty write bodies, multipart upload, binary download, and async parity.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/uipath-platform/src/uipath/platform/ixp/_transport.py | New IXP design-time transport base service (sync/async helpers, encoding, api-version, retry policy, upload/download). |
| packages/uipath-platform/src/uipath/platform/ixp/init.py | Exposes the new transport base and constants as the uipath.platform.ixp public surface. |
| packages/uipath-platform/tests/services/test_ixp_transport.py | Adds transport-level tests validating URL/query conventions, encoding, retry behavior, and upload/download helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @staticmethod | ||
| def _params(params: Optional[dict[str, Any]]) -> dict[str, Any]: | ||
| """Merge the mandatory ``api-version`` into a request's query params.""" | ||
| return {"api-version": DESIGNTIME_API_VERSION, **(params or {})} |
Comment on lines
+122
to
+131
| scoped_url = self._url.scope_url(str(endpoint), "tenant") | ||
| response = self._client.request( | ||
| method, | ||
| scoped_url, | ||
| params=self._params(params), | ||
| json=json, | ||
| files=files, | ||
| headers=self._headers(), | ||
| ) | ||
| return self._raise_for_status(response) |
Comment on lines
+142
to
+152
| scoped_url = self._url.scope_url(str(endpoint), "tenant") | ||
| response = await self._client_async.request( | ||
| method, | ||
| scoped_url, | ||
| params=self._params(params), | ||
| json=json, | ||
| files=files, | ||
| headers=self._headers(), | ||
| ) | ||
| return self._raise_for_status(response) | ||
|
|
Name the design-time service folder after its domain entity rather than the product acronym, matching the entity-based convention used elsewhere in platform/ (connections, entities, documents, ...). Pairs cleanly with the runtime sibling: documents/ (du_/api/framework) is DU runtime, document_projects/ (du_/api/designtimeapi) is DU design-time. The IxpDesigntimeService class name is unchanged (it names the API, not the folder). Only the directory, the import path, and doc references move. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The IXP design-time SDK is an independent client of du_/api/designtimeapi; its implementation should not reference the CLI. Reword the no-retry-on-writes rationale to stand on its own (a transient 5xx must not double-create/confirm a design-time mutation) and drop the "matching the CLI SDK" asides from the transport docstrings and the test docstring. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Match the platform's file-naming convention: every service module is `_<name>_service.py`, and the shared HTTP base is `common/_base_service.py` (class BaseService). This module plays the same role one level down — the base service every IXP design-time service extends — so name it `_base_service.py` (class IxpDesigntimeService is unchanged). Renames the matching test file and drops the "transport" framing from the docstrings. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Context
Part of building the Document Understanding design-time surface in the UiPath Python SDK.
This PR delivers ACTV-89364 — the shared design-time base service (first step).
It's the base service every IXP design-time service (projects, taxonomy, labellings, documents, models) will build on. No service surface yet — base only; an additive
platform/document_projects/subpackage nothing else imports.What's here
platform/document_projects/IxpDesigntimeService(BaseService)— thedu_/api/designtimeapibase service (_base_service.py):du_/api/designtimeapi, org/tenant-scoped,api-version=1.0auto-appended.quote(safe="")(/→%2F, space→%20).{}; multipartfileupload; binary download(bytes, content_type).EnrichedException; noFolderContext(IXP is org/tenant-scoped only).Why a new folder (not
documents/)This adds a new
platform/document_projects/subpackage rather than extending the existingplatform/documents/. The two talk to different backend services and share no endpoints, so they're kept as separate service layers:documents/— DU runtime (du_/api/framework): extraction/classification at execution time.document_projects/— DU design-time (du_/api/designtimeapi): authoring projects, taxonomy, models.The folder name mirrors that design-time ↔ runtime split and avoids conflating two unrelated services. The
IxpDesigntimeServiceclass name is unchanged — it names the API, not the folder.Verification
13 pytest-httpx tests pass (url/api-version, encoding, no-retry-on-write, GET retry, multipart, binary, async);
ruff+mypyclean.🤖 Generated with Claude Code