Skip to content

Commit bed7239

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
fix(oracle-epcm): preserve transport statuses and align registrations
1 parent 6c9fa1e commit bed7239

7 files changed

Lines changed: 31 additions & 13 deletions

File tree

apps/sim/blocks/blocks/oracle_epm_enterprise_profitability.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
4848
oracle_epm_enterprise_profitability_list_job_definitions: [
4949
{
5050
text: 'List saved jobs of type',
51-
field: 'exchangeJobType',
51+
field: 'jobType',
5252
core: true,
5353
},
5454
{
@@ -491,7 +491,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
491491
placeholder: 'Enter application or a reference',
492492
},
493493
{
494-
id: 'exchangeJobType',
494+
id: 'jobType',
495495
title: 'Exchange Job Type',
496496
type: 'dropdown',
497497
options: [
@@ -530,7 +530,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
530530
serviceId: 'oracle-epm-enterprise-profitability',
531531
selectorKey: 'oracleEpm.jobDefinitions',
532532
mode: 'basic',
533-
dependsOn: ['oauthCredential', 'applicationName', 'operation', 'exchangeJobType'],
533+
dependsOn: ['oauthCredential', 'applicationName', 'operation', 'jobType'],
534534
condition: {
535535
field: 'operation',
536536
value: [
@@ -1796,7 +1796,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
17961796
jobLabel,
17971797
repositoryFileName,
17981798
outputFileName,
1799-
exchangeJobType,
1799+
jobType,
18001800
diagnosticJobType,
18011801
...rest
18021802
} = params
@@ -1819,7 +1819,7 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
18191819
: outputFileName,
18201820
jobType:
18211821
operation === 'oracle_epm_enterprise_profitability_list_job_definitions'
1822-
? exchangeJobType
1822+
? jobType
18231823
: diagnosticJobType,
18241824
}
18251825
},
@@ -1832,7 +1832,6 @@ export const OracleEpcmBlock: BlockConfig<OracleEpcmResponse> = {
18321832
description: 'Selected or manually specified ordinary repository file',
18331833
},
18341834
outputFileName: { type: 'string', description: 'Output report, export, or uploaded filename' },
1835-
exchangeJobType: { type: 'string', description: 'Saved exchange-job discovery filter' },
18361835
diagnosticJobType: { type: 'string', description: 'Supported diagnostic job family' },
18371836
operation: {
18381837
type: 'string',

apps/sim/lib/integrations/credential-display.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ const EXPECTED_COVERAGE: Record<string, string[]> = {
6868
// NetSuite remains an API-key catalog integration, like Snowflake, while its
6969
// block uses the shared reusable-credential selector.
7070
'netsuite-service-account': [],
71+
// EPCM also offers the reusable credential on its API-key-classified block.
72+
'oracle-epm-service-account': [],
7173
'pipedrive-service-account': ['pipedrive'],
7274
'salesforce-service-account': ['salesforce'],
7375
'shopify-service-account': ['shopify'],

apps/sim/lib/internal/oracle-epm-enterprise-profitability/execute-tool.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ describe('Oracle EPCM direct tool handler', () => {
8282
it.each([
8383
[new OracleEpcmOperationError('Invalid application', 400), 400, 'Invalid application'],
8484
[oracleEpmLocalError('invalid_response'), 502, 'Oracle EPM returned an invalid response'],
85+
[oracleEpmLocalError('timeout'), 408, 'The Oracle EPM request timed out'],
86+
[
87+
oracleEpmLocalError('payload_too_large'),
88+
413,
89+
'The Oracle EPM payload exceeded the allowed size',
90+
],
8591
[new Error('credential-secret-canary'), 500, 'Oracle EPCM operation failed'],
8692
])(
8793
'returns safe failures and disallows automatic resubmission',

apps/sim/lib/internal/oracle-epm-enterprise-profitability/execute-tool.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ export const executeOracleEpcmTool: InternalToolOperationHandler = async (reques
4444
: error instanceof OracleEpcmOperationError
4545
? error.status
4646
: error instanceof OracleEpmError
47-
? (error.status ?? 502)
47+
? (error.status ??
48+
(error.category === 'timeout'
49+
? 408
50+
: error.category === 'payload_too_large'
51+
? 413
52+
: 502))
4853
: timeout
4954
? 408
5055
: 500

apps/sim/lib/selectors/manifest.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ describe('selector manifest', () => {
99
const count = (classification: (typeof classifications)[number]) =>
1010
classifications.filter((value) => value === classification).length
1111

12-
expect(Object.keys(selectorManifest)).toHaveLength(94)
13-
expect(count('provider-server')).toBe(82)
12+
expect(Object.keys(selectorManifest)).toHaveLength(97)
13+
expect(count('provider-server')).toBe(85)
1414
expect(count('internal-server')).toBe(11)
1515
expect(count('local')).toBe(1)
1616
expect(classifications).not.toContain('provider-legacy')
@@ -36,7 +36,7 @@ describe('selector manifest', () => {
3636
const rawConnectionKeys = providerKeys.filter(
3737
(key) => !serverSelectorRegistry[key as keyof typeof serverSelectorRegistry].credential
3838
)
39-
expect(providerKeys).toHaveLength(82)
39+
expect(providerKeys).toHaveLength(85)
4040
expect(rawConnectionKeys.sort()).toEqual([
4141
'cloudwatch.logGroups',
4242
'cloudwatch.logStreams',
@@ -98,7 +98,7 @@ describe('selector manifest', () => {
9898
(attachment) => attachment.destination !== 'fixed'
9999
)
100100

101-
expect(preparedDestinations).toHaveLength(13)
101+
expect(preparedDestinations).toHaveLength(16)
102102
for (const attachment of preparedDestinations) {
103103
expect(attachment.destination).toEqual(
104104
expect.objectContaining({

apps/sim/lib/selectors/manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const selectorManifest = {
192192
'oracleEpm.applications': providerSelector([], { detail: true }),
193193
'oracleEpm.jobDefinitions': providerSelector(['applicationName', 'jobType'], {
194194
readiness: { all: ['oauthCredential', 'applicationName', 'jobType'] },
195-
sourceFields: { jobType: ['exchangeJobType', 'operation'] },
195+
sourceFields: { jobType: ['jobType', 'operation'] },
196196
detail: true,
197197
}),
198198
'oracleEpm.repositoryFiles': providerSelector([], { detail: true }),

apps/sim/tools/oracle_epm_enterprise_profitability/oracle_epm_enterprise_profitability.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function blockParam(operation: string, param: string): string {
2424
if (param === 'fileName')
2525
return repository.includes(action) ? 'repositoryFileName' : 'outputFileName'
2626
if (param === 'jobType')
27-
return action === 'list_job_definitions' ? 'exchangeJobType' : 'diagnosticJobType'
27+
return action === 'list_job_definitions' ? 'jobType' : 'diagnosticJobType'
2828
return param
2929
}
3030

@@ -125,6 +125,12 @@ describe('Oracle EPCM integration surface', () => {
125125
})
126126

127127
it('preserves dynamic references during selection and maps canonical fields only', () => {
128+
expect(
129+
OracleEpcmBlock.tools.config.params?.({
130+
operation: `${prefix}list_job_definitions`,
131+
jobType: '<trigger.jobType>',
132+
})
133+
).toMatchObject({ jobType: '<trigger.jobType>' })
128134
const params = {
129135
operation: `${prefix}calculate_model`,
130136
jobLabel: '<trigger.jobName>',

0 commit comments

Comments
 (0)