Skip to content

feat(windchill): add document integration - #6577

Open
BillLeoutsakosvl346 wants to merge 6 commits into
stagingfrom
plan-windchill-integration
Open

feat(windchill): add document integration#6577
BillLeoutsakosvl346 wants to merge 6 commits into
stagingfrom
plan-windchill-integration

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • add 26 Windchill WT.Document tools with Basic-auth reads and CSRF-protected mutations
  • add secure content upload/download handling and the Windchill block
  • add typed contracts, tests, generated metadata, and integration documentation

Type of Change

  • New feature

Testing

  • 41 focused Windchill tests
  • monorepo type-check, lint, and format checks
  • strict API validation and all repository audits
  • live Windchill smoke test pending installation credentials

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 3:31am

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large new external integration that handles credentials, document mutations (including security labels), and file transfer. Risk is moderated by delegation-only auth, strict input contracts, HTTPS-only service roots, and upload size/ownership checks.

Overview
Adds a PTC Windchill integration for managing WT.Document objects over WRS 2.7 with Basic auth (OAuth not supported).

Covers 26 operations: list/get documents and structure, lifecycle transitions, create/update/delete, check-in/out/revise (single and bulk), security-label updates, plus primary-content and attachment upload/download.

Mutations and file transfers go through a new /api/tools/windchill route that requires executor delegation auth, validates HTTPS service roots, uses CSRF-protected Windchill sessions, and enforces file ownership plus aggregate size limits. Downloads are stored as UserFiles rather than returned inline.

Also wires the Windchill block, icons, typed contracts, registry metadata, docs, and focused route tests.

Reviewed by Cursor Bugbot for commit 79a871a. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a Windchill document integration with 26 read, mutation, lifecycle, security-label, and content-transfer operations, backed by a shared internal route and typed contracts.

  • Registers the Windchill block and tool catalog across application and documentation registries.
  • Adds Basic-auth reads, CSRF-protected mutations, and validated upload/download flows.
  • Adds focused route and utility tests plus generated metadata and integration documentation.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking documentation issue that should be corrected so users can configure the new actions.

The implementation consistently aligns block mappings, tool registrations, route contracts, authorization, SSRF protections, and content-transfer bounds; the accepted concern is limited to empty action Input tables in the new documentation.

Files Needing Attention: apps/docs/content/docs/en/integrations/windchill.mdx

Important Files Changed

Filename Overview
apps/sim/app/api/tools/windchill/route.ts Adds authenticated contract parsing, mutation dispatch, authorized file loading, and storage-backed content downloads with no accepted blocking defect.
apps/sim/tools/windchill/utils.server.ts Implements validated Windchill sessions, CSRF mutations, staged multipart uploads, and bounded binary downloads.
apps/sim/tools/windchill/utils.ts Defines aligned operation metadata, credential visibility, URL normalization, direct-read requests, and response transformations.
apps/sim/blocks/blocks/windchill.ts Exposes and maps all 26 registered Windchill operations with operation-specific fields and parameter coercion.
apps/sim/lib/api/contracts/tools/windchill.ts Adds bounded discriminated request schemas and typed responses for internal Windchill operations.
apps/docs/content/docs/en/integrations/windchill.mdx Adds documentation for every operation, but all Input tables omit the parameters users need to configure them.

Sequence Diagram

sequenceDiagram
  participant Workflow as Workflow executor
  participant Tool as Windchill tool
  participant Route as Internal Windchill route
  participant Storage as Object storage
  participant WC as Windchill

  alt Read operation
    Workflow->>Tool: Execute read with credentials
    Tool->>WC: Validated HTTPS GET + Basic auth
    WC-->>Tool: OData response
    Tool-->>Workflow: Normalized output
  else Mutation
    Workflow->>Route: Delegated internal request
    Route->>WC: Fetch CSRF nonce and session
    Route->>WC: CSRF-protected mutation
    WC-->>Route: Mutation result
    Route-->>Workflow: Typed affected-document output
  else Content upload
    Workflow->>Route: Delegated request with UserFile
    Route->>Storage: Authorize and load file
    Route->>WC: Upload stages 1, 2, and 3
    WC-->>Route: Uploaded file metadata
    Route-->>Workflow: Uploaded filenames
  else Content download
    Workflow->>Route: Delegated download request
    Route->>WC: Validated content GET
    WC-->>Route: Binary content
    Route->>Storage: Store as UserFile
    Route-->>Workflow: UserFile metadata
  end
Loading

Reviews (1): Last reviewed commit: "feat(windchill): add document integratio..." | Re-trigger Greptile

Comment on lines +20 to +23

### Windchill List Documents

#### Input

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Action inputs are undocumented

Every action's Input table contains only headings, even though the tools require connection credentials and operation-specific values. Users therefore cannot determine the required parameter names or payload shapes from this documentation.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant