feat(windchill): add document integration - #6577
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryHigh Risk Overview A new Ships a Windchill workflow block, Zod API contracts, WindchillIcon and catalog/docs wiring, and a large route test suite for auth, payloads, and file paths. Reviewed by Cursor Bugbot for commit 0b93551. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR adds a complete Windchill document-management integration, including workflow tools, a configurable block, secured API handling, generated registry metadata, tests, and user documentation.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/tools/windchill/route.ts | Adds authenticated dispatch for Windchill document mutations and file-transfer operations with protected outbound-request handling. |
| apps/sim/tools/windchill/utils.server.ts | Implements CSRF-aware requests and secure content transfer using validated, pinned destinations and constrained content URLs. |
| apps/sim/blocks/blocks/windchill.ts | Defines the Windchill workflow block, action forms, tool selection, and parameter mappings. |
| apps/sim/lib/api/contracts/tools/windchill.ts | Adds typed request validation for Windchill credentials, service roots, document operations, and file inputs. |
| apps/docs/content/docs/en/integrations/windchill.mdx | Documents the integration and provides populated Input and Output tables for the current action catalog. |
Sequence Diagram
sequenceDiagram
participant Workflow as Workflow executor
participant Route as Windchill API route
participant Guard as URL and DNS validation
participant Windchill as Windchill WRS
participant Storage as Sim file storage
Workflow->>Route: Invoke document operation
Route->>Route: Authenticate delegated executor
Route->>Guard: Validate service URL and resolve public address
Guard-->>Route: Return pinned destination
Route->>Windchill: Authenticate and obtain CSRF token
alt Metadata or lifecycle operation
Route->>Windchill: Send OData request
Windchill-->>Route: Return document result
else Content download
Route->>Windchill: Resolve same-origin content URL
Windchill-->>Route: Return content URL
Route->>Guard: Validate and pin content destination
Route->>Windchill: Download content
Route->>Storage: Store canonical user file
else Content upload
Route->>Storage: Read authorized user file
Route->>Windchill: Complete protected upload handshake
end
Route-->>Workflow: Return normalized tool output
Reviews (3): Last reviewed commit: "feat(windchill): add update common prope..." | Re-trigger Greptile
…leared-field handling Validated the integration end to end against PTC Windchill REST Services 2.7 documentation and fixed every divergence found. Protocol correctness: - Encode OData query spaces as %20 rather than the form-encoded `+` that URLSearchParams emits. Every multi-token $filter and $orderby reached Windchill as a literal `+` and could not match. - Download content through the documented typed navigation `<content>/PTC.ApplicationData/Content/URL`, which returns a signed vault URL, instead of a `$value` segment that WRS does not implement. The resolved URL is pinned to the configured HTTPS origin. - Terminate every Stage 2 CacheDescriptor_array entry with `;` to match the documented grammar. - Raise the $top bound to Windchill's documented 2000 maximum, keeping 200 as the default page size. Cleared-field handling: - The executor merges raw block inputs before the block's param transform, so omitting a key could not clear it. A cleared numeric or boolean field reached the URL builder as '' and threw, and cleared optional strings failed contract validation. Coercions now emit an explicit undefined, and the internal-route body strips blanks centrally. Robustness and contracts: - Bound the document-structure walk to the depth actually requested. - Loosen response schemas that re-applied request-side bounds to provider-returned values, which turned committed mutations into opaque parse failures. - Return contract-shaped bodies for oversized, malformed, and unhandled request failures. - Normalize downloaded content types and drop charset parameters. Presentation and docs: - Square the icon to a centred tile on white. - Replace WT.Document and PATCH-compatible jargon with plain language. - Fix canvas sentence noun stutters on the bulk operations. - Correct the revision skill's unverified working-copy claim to read the OID back rather than assume it, and add retirement and stale-checkout skills. - Add a manual intro section to the integration docs page.
79a871a to
77cec66
Compare
…te baseline Tool descriptions feed both the integration catalog and the generated docs page, so the plain-language pass had to reach them too: drop WT.Document and PATCH-compatible from the operation copy, and correct the $top bound the descriptions still advertised as 200. Correct the docs intro's attachment wording, gloss OData on first use, and attribute the bulk-atomicity claim to PTC's documented behavior. Raise the API route-count baseline, which staging advanced while this branch was behind.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1d51f92. Configure here.
Name, Number, and Organization are rejected by the PATCH-based update operation, and the rejection message told users to reach for Windchill's UpdateCommonProperties action that the integration did not expose. Add it. PTC documents UpdateCommonProperties as a bound DocMgmt action taking an Updates wrapper, available when hasCommonProperties is set on the Documents entity, and refused while the document is checked out. The subblock and param descriptions carry that constraint, and the rejection message now names the operation that does the job.
|
@cursor review |
…operation Validating the new operation surfaced that nothing enforced the block-to-tool alignment the review process had been checking by hand. Assert it for all 27 operations instead: every required tool param has a required, non-advanced input under that operation's condition, and no operation shows an input its tool cannot accept. Both fail on a deliberately broken condition or a dropped required flag.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d20ac2f. Configure here.
Summary
Type of Change
Testing
Checklist