feat(oracle-fusion): add SCM integration - #7439
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
Greptile SummaryThe PR adds a read-only Oracle Fusion Cloud SCM integration spanning workflow tools, selectors, service-account configuration, generated catalog surfaces, and documentation.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up-review scope. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/internal/oracle-fusion-scm/operations.ts | Defines the bounded list/detail execution model, resource routing, opaque-key handling, and response projection for all SCM resources. |
| apps/sim/lib/internal/oracle-fusion-scm/schema.ts | Adds normalized input and provider-response schemas with nullable projected fields and validation for authentication, pagination, and opaque keys. |
| apps/sim/tools/oracle_fusion_scm/shared.ts | Provides shared tool factories, protected authentication parameters, input filtering, and common list/detail contracts. |
| apps/sim/blocks/blocks/oracle_fusion_scm.ts | Adds the workflow-facing block with 20 operations, service-account configuration, selectors, outputs, templates, and skills. |
| apps/sim/lib/selectors/server/providers/oracle-fusion-scm.ts | Implements six bounded service-account-backed selectors whose opaque values align with the corresponding detail tools. |
| apps/sim/lib/internal/oracle-fusion-scm/oracle-fusion-scm.test.ts | Exercises all resource families, nested paths, page bounds, parsing, opaque-key validation, and list/detail behavior. |
| apps/docs/content/docs/integrations/oracle_fusion_scm.mdx | Documents prerequisites, tenant-validation constraints, tool inputs, and projected outputs for the new integration. |
Sequence Diagram
sequenceDiagram
participant User as Workflow user
participant Block as Oracle SCM block
participant Exec as Tool executor
participant Auth as Service-account resolver
participant Oracle as Oracle Fusion SCM
User->>Block: Configure operation and credential
Block->>Exec: Invoke registered SCM tool
Exec->>Auth: Resolve access token and instance URL
Auth-->>Exec: Inject protected authentication fields
Exec->>Oracle: Send bounded list or detail request
Oracle-->>Exec: Return projected resource payload
Exec-->>Block: Return stable tool result
Block-->>User: Expose workflow outputs
Reviews (3): Last reviewed commit: "fix(oracle-fusion): harden SCM integrati..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
4 issues found across 72 files
Confidence score: 3/5
integration-search-items.tscan emitconnect=oauthbefore availability hydrates for service-account-only integrations such as Oracle Fusion, causing the detail page to reject the search result — align the fallback with the eventual supported authentication type.get-blocks-metadata-tool.tsreturns Oracle SCM metadata outside the declared type, whiletransformBlockMetadatalacks a service-account branch; consumers can receive misleadingauthTypemetadata — add the service-account case and update the metadata type.schema.tstrims opaque Oracle keys before encoding requests, so keys with surrounding spaces resolve to a different resource and can break detail or child calls — preserve the original key while validating or rejecting whitespace.page.tsxtells users that direct-configuredauthType: 'none'integrations require no authentication, which misdescribes how those integrations are set up — explain that configuration happens directly in the block and clarify the remaining connection requirements.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/integration-search-items.ts">
<violation number="1" location="apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/integration-search-items.ts:18">
P2: When availability has not hydrated yet, this fallback emits `connect=oauth` for service-account-only entries such as Oracle Fusion. The detail page later rejects OAuth when availability arrives, so the search click does not open the service-account picker; derive the fallback from the entry’s auth type or defer adding the query parameter until availability is known.</violation>
</file>
<file name="apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-tool.ts">
<violation number="1" location="apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-tool.ts:632">
P2: When `get_blocks_metadata` processes Oracle SCM, this branch returns a value outside the declared metadata type, and `transformBlockMetadata` has no service-account branch. The result reports `authType: "Service Account"` without `requiredCredentials`, so Copilot receives no service-account credential descriptor; add the union member and corresponding transformation.</violation>
</file>
<file name="apps/sim/app/(landing)/integrations/(shell)/page.tsx">
<violation number="1" location="apps/sim/app/(landing)/integrations/(shell)/page.tsx:35">
P2: When the catalog includes direct-configured `authType: 'none'` integrations, this FAQ still tells users they need no authentication. Describe the remaining integrations as configured directly in the block, with connection details or no credentials as applicable.</violation>
</file>
<file name="apps/sim/lib/internal/oracle-fusion-scm/schema.ts">
<violation number="1" location="apps/sim/lib/internal/oracle-fusion-scm/schema.ts:680">
P2: When an Oracle-derived opaque key has leading or trailing spaces, this schema trims it before the request is encoded, so detail and child calls address a different resource. Preserve the key exactly while rejecting only blank values.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
4 issues found across 78 files
Confidence score: 3/5
apps/sim/blocks/blocks/oracle_fusion_scm.tscan forward a key from a previous SCM operation into the newly selected tool, where strict parsing may reject it and fail workflow switching; filter inactive operation-specific keys before forwarding.apps/sim/lib/internal/oracle-fusion-scm/operations.tsmay emit a whitespace-only self-link segment as a synthetic key that the detail schema rejects, making affected list results unusable; suppress or normalize blank synthetic keys.apps/sim/lib/internal/oracle-fusion-scm/schema.tscan alter unsafe integral Oracle IDs written in exponent or zero-fraction notation, diverging from the exact token preserved by the shared client; retain the raw token through SCM projection while validating it.apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-projection.test.tshas an inaccurate module comment after registering and reading the Oracle SCM block; update the comment to match the test setup.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/blocks/blocks/oracle_fusion_scm.ts">
<violation number="1" location="apps/sim/blocks/blocks/oracle_fusion_scm.ts:487">
P2: When a workflow retains a key from a previous SCM operation, this mapper forwards it to the newly selected tool. The strict SCM parsers reject that inactive key, so switching operations can make the block fail; filter the mapped values to the selected operation's parameters before validation.</violation>
</file>
<file name="apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-projection.test.ts">
<violation number="1" location="apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-projection.test.ts:22">
P3: The module comment says 'Only the Slack block is read, so only it is registered,' but the mock now registers both the Slack and oracle_fusion_scm blocks and the new test reads oracle_fusion_scm. Update the comment to name both blocks so it does not mislead future maintainers about the mock's contents.</violation>
</file>
<file name="apps/sim/lib/internal/oracle-fusion-scm/operations.ts">
<violation number="1" location="apps/sim/lib/internal/oracle-fusion-scm/operations.ts:191">
P2: When an Oracle self link ends in a whitespace-only segment such as `%20%20`, this projection emits that segment as the synthetic key. The detail input schema rejects the same key as blank, so list results cannot be used for a follow-up get; reject trim-only derived keys while preserving surrounding whitespace on nonblank keys.
(Based on your team's feedback about Oracle opaque-key blank-value handling.)</violation>
</file>
<file name="apps/sim/lib/internal/oracle-fusion-scm/schema.ts">
<violation number="1" location="apps/sim/lib/internal/oracle-fusion-scm/schema.ts:357">
P2: When an unsafe integral Oracle ID arrives in exponent or zero-fraction notation, this preprocessor changes the exact token preserved by the shared client. Preserve the raw token through SCM projection while still validating that it is an integral identifier.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| ...rest | ||
| } = params | ||
| return { | ||
| ...rest, |
There was a problem hiding this comment.
P2: When a workflow retains a key from a previous SCM operation, this mapper forwards it to the newly selected tool. The strict SCM parsers reject that inactive key, so switching operations can make the block fail; filter the mapped values to the selected operation's parameters before validation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/blocks/blocks/oracle_fusion_scm.ts, line 487:
<comment>When a workflow retains a key from a previous SCM operation, this mapper forwards it to the newly selected tool. The strict SCM parsers reject that inactive key, so switching operations can make the block fail; filter the mapped values to the selected operation's parameters before validation.</comment>
<file context>
@@ -0,0 +1,760 @@
+ ...rest
+ } = params
+ return {
+ ...rest,
+ q: optionalString(q, 'Filter'),
+ finder: optionalString(finder, 'Finder'),
</file context>
| const parsed = parseOracleFusionScmResource(resource, value) | ||
| const definition = RESOURCE_DEFINITIONS[resource] | ||
| return { | ||
| [definition.keyField]: extractOracleFusionOpaqueKey( |
There was a problem hiding this comment.
P2: When an Oracle self link ends in a whitespace-only segment such as %20%20, this projection emits that segment as the synthetic key. The detail input schema rejects the same key as blank, so list results cannot be used for a follow-up get; reject trim-only derived keys while preserving surrounding whitespace on nonblank keys.
(Based on your team's feedback about Oracle opaque-key blank-value handling.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/internal/oracle-fusion-scm/operations.ts, line 191:
<comment>When an Oracle self link ends in a whitespace-only segment such as `%20%20`, this projection emits that segment as the synthetic key. The detail input schema rejects the same key as blank, so list results cannot be used for a follow-up get; reject trim-only derived keys while preserving surrounding whitespace on nonblank keys.
(Based on your team's feedback about Oracle opaque-key blank-value handling.) </comment>
<file context>
@@ -0,0 +1,393 @@
+ const parsed = parseOracleFusionScmResource(resource, value)
+ const definition = RESOURCE_DEFINITIONS[resource]
+ return {
+ [definition.keyField]: extractOracleFusionOpaqueKey(
+ parsed,
+ instanceUrl,
</file context>
|
|
||
| const oracleIdentifier = z.preprocess((value) => { | ||
| if (value === undefined || value === null) return value | ||
| return normalizeOracleFusionScmIdentifier(value) ?? value |
There was a problem hiding this comment.
P2: When an unsafe integral Oracle ID arrives in exponent or zero-fraction notation, this preprocessor changes the exact token preserved by the shared client. Preserve the raw token through SCM projection while still validating that it is an integral identifier.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/internal/oracle-fusion-scm/schema.ts, line 357:
<comment>When an unsafe integral Oracle ID arrives in exponent or zero-fraction notation, this preprocessor changes the exact token preserved by the shared client. Preserve the raw token through SCM projection while still validating that it is an integral identifier.</comment>
<file context>
@@ -0,0 +1,833 @@
+
+const oracleIdentifier = z.preprocess((value) => {
+ if (value === undefined || value === null) return value
+ return normalizeOracleFusionScmIdentifier(value) ?? value
+}, z.string().regex(/^\d+$/).max(MAX_IDENTIFIER_DIGITS).nullable().optional())
+
</file context>
| return partialBlockRegistry(await import('@/blocks/blocks/slack')) | ||
| return partialBlockRegistry( | ||
| await import('@/blocks/blocks/slack'), | ||
| await import('@/blocks/blocks/oracle_fusion_scm') |
There was a problem hiding this comment.
P3: The module comment says 'Only the Slack block is read, so only it is registered,' but the mock now registers both the Slack and oracle_fusion_scm blocks and the new test reads oracle_fusion_scm. Update the comment to name both blocks so it does not mislead future maintainers about the mock's contents.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-projection.test.ts, line 22:
<comment>The module comment says 'Only the Slack block is read, so only it is registered,' but the mock now registers both the Slack and oracle_fusion_scm blocks and the new test reads oracle_fusion_scm. Update the comment to name both blocks so it does not mislead future maintainers about the mock's contents.</comment>
<file context>
@@ -17,7 +17,10 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
- return partialBlockRegistry(await import('@/blocks/blocks/slack'))
+ return partialBlockRegistry(
+ await import('@/blocks/blocks/slack'),
+ await import('@/blocks/blocks/oracle_fusion_scm')
+ )
})
</file context>
Summary
Depends on #7427
Type of Change
Testing
feat/oracle-fusion-foundationNo live Oracle tenant was available; required permissions, feature opt-ins, and the
MaintenanceFlagquarterly-release compatibility check are documented for tenant validation.Checklist
Screenshots/Videos
Not applicable; this adds integration/tool surfaces without a custom visual UI.