Skip to content

Commit 9cac2fe

Browse files
committed
Remove unnecessary provider normalisation in benchmark endpoints
1 parent e10c2ea commit 9cac2fe

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

packages/server/api/src/app/benchmark/catalog-resolver.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ import { throwValidationError } from './errors';
99
const WORKFLOWS_CATALOG_DIR = 'workflows-catalog';
1010

1111
function getCatalogDir(provider: string): string {
12-
return path.join(__dirname, WORKFLOWS_CATALOG_DIR, provider.toLowerCase());
12+
return path.join(__dirname, WORKFLOWS_CATALOG_DIR, provider);
1313
}
1414

1515
function getLifecycleWorkflow(provider: string): LifecycleWorkflow {
16-
const normalized = provider.toLowerCase();
17-
const lifecycleWorkflow = PROVIDER_LIFECYCLE_WORKFLOWS[normalized];
16+
const lifecycleWorkflow = PROVIDER_LIFECYCLE_WORKFLOWS[provider];
1817
if (!lifecycleWorkflow) {
1918
throwValidationError(`Unsupported benchmark provider: ${provider}`);
2019
}

packages/server/api/src/app/benchmark/create-benchmark.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ async function deleteFlowsByIds(params: {
7070
}
7171

7272
function getBenchmarkFolderDisplayName(provider: string): string {
73-
const normalizedProvider = provider.toLowerCase();
74-
switch (normalizedProvider) {
73+
switch (provider) {
7574
case BenchmarkProviders.AWS:
7675
return 'AWS Benchmark';
7776
default:

packages/server/api/src/app/benchmark/provider-adapter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ export function registerProvider(
6161
provider: string,
6262
adapter: ProviderAdapter,
6363
): void {
64-
providers.set(provider.toLowerCase(), adapter);
64+
providers.set(provider, adapter);
6565
}
6666

6767
export function getProvider(provider: string): ProviderAdapter {
68-
const normalized = provider.toLowerCase();
69-
const adapter = providers.get(normalized);
68+
const adapter = providers.get(provider);
7069
if (!adapter) {
7170
throwValidationError(`Provider not found: ${provider}`);
7271
}

packages/server/api/src/app/benchmark/wizard.service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,13 @@ export async function resolveWizardNavigation(
134134
request: BenchmarkWizardRequest,
135135
projectId: string,
136136
): Promise<BenchmarkWizardStepResponse> {
137-
const normalizedProvider = provider.toLowerCase();
138-
const providerAdapter = getProvider(normalizedProvider);
137+
const providerAdapter = getProvider(provider);
139138
const config = providerAdapter.config;
140139

141140
const context: WizardContext = {
142141
benchmarkConfiguration: request.benchmarkConfiguration,
143142
projectId,
144-
provider: normalizedProvider,
143+
provider,
145144
};
146145

147146
const { stepToShow, nextStep } = await computeWizardStepResponse(

0 commit comments

Comments
 (0)