Skip to content

Replace mocked benchmarkApi.createBenchmark with real API call#2044

Merged
cezudas merged 4 commits intomainfrom
cezudas/OPS-3822
Mar 3, 2026
Merged

Replace mocked benchmarkApi.createBenchmark with real API call#2044
cezudas merged 4 commits intomainfrom
cezudas/OPS-3822

Conversation

@cezudas
Copy link
Contributor

@cezudas cezudas commented Mar 3, 2026

Copilot AI review requested due to automatic review settings March 3, 2026 09:16
@linear
Copy link

linear bot commented Mar 3, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the mocked benchmark creation behavior with a real backend API call and attempts to refresh relevant cached data after a benchmark is created (OPS-3822).

Changes:

  • Replace benchmarkApi.createBenchmark mock implementation with a real POST /v1/benchmarks/:provider request.
  • Invalidate React Query caches after successful benchmark creation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/react-ui/src/app/features/benchmark/benchmark-api.ts Removes the mocked createBenchmark and calls the real API endpoint.
packages/react-ui/src/app/features/benchmark/use-benchmark-wizard-navigation.ts Adds React Query cache invalidation after benchmark creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +86 to +87
queryKey: [QueryKeys.foldersFlows, QueryKeys.flows],
});
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

invalidateQueries is being called with queryKey: [QueryKeys.foldersFlows, QueryKeys.flows], which will only match queries whose key starts with that two-element prefix. In this codebase, folder tree uses [QueryKeys.foldersFlows] and flows list uses [QueryKeys.flows, ...], so this call likely won't invalidate anything. Invalidate each key separately (or use the existing useRefetchFolderTree helper for folders, and a separate invalidation for [QueryKeys.flows]).

Suggested change
queryKey: [QueryKeys.foldersFlows, QueryKeys.flows],
});
queryKey: [QueryKeys.foldersFlows],
});
queryClient.invalidateQueries({
queryKey: [QueryKeys.flows],
});

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@cezudas cezudas merged commit 8a238f8 into main Mar 3, 2026
21 checks passed
@cezudas cezudas deleted the cezudas/OPS-3822 branch March 3, 2026 11:25
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.

3 participants