Skip to content

[Evals]: Create evaluation #3844

Open
priyanshu6238 wants to merge 19 commits intomasterfrom
feat/fix_create_evalution_page
Open

[Evals]: Create evaluation #3844
priyanshu6238 wants to merge 19 commits intomasterfrom
feat/fix_create_evalution_page

Conversation

@priyanshu6238
Copy link
Copy Markdown
Collaborator

@priyanshu6238 priyanshu6238 commented Mar 16, 2026

Summary

  • Adds GET_ASSISTANT_CONFIG_VERSIONS query to fetch all assistant versions for the dropdown.
  • Adds CREATE_GOLDEN_QA and CREATE_EVALUATION mutations with correct GraphQL input/response shapes.
  • Adds LIST_AI_EVALUATIONS query to src/graphql/queries/AIEvaluations.ts.
  • Adds/fix test coverage

backend pr -glific/glific#4905

Summary by CodeRabbit

  • New Features

    • Assistant selector now shows assistant versions and lets you pick a specific config.
    • Evaluation creation is connected to backend and navigates to chat on start.
    • Golden QA uploads now produce and return dataset identifiers.
  • Improvements

    • Form layout spacing and alignment refined; Golden QA field shows helper text.
    • Placeholders and assistant dropdown loading/empty states clarified; upload flow updated to include datasetId.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR replaces dummy GraphQL documents with real operations: adds GET_ASSISTANT_CONFIG_VERSIONS, CREATE_EVALUATION, and LIST_AI_EVALUATIONS. AIEvaluationCreate now queries assistant config versions to populate the assistant dropdown, uses a CREATE_EVALUATION mutation with success/error handlers and navigation, updates form payload construction to derive configId from selected assistant version, and changes Golden QA state to include datasetId and name (goldenQaId becomes numeric). UploadGoldenQaDialog.onProceed, tests, and mocks were updated to include datasetId. CSS tweaks adjust form layout alignment and Golden QA button styling. Several mocks were added/updated to reflect new queries/mutation shapes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

status: ready for review

Suggested reviewers

  • mdshamoon

Poem

🐇 I hopped through queries, found versions two,
I nudged a button’s curve and lined things true,
Dataset IDs tucked in names, neat and small,
Dropdowns sing their options, answering the call,
🥕— a rabbit’s wiggle for changes all.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[Evals]: Create evaluation' is directly related to the main objective of this PR, which implements the create evaluation feature by adding GraphQL queries and mutations, updating components, and integrating real Apollo operations.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fix_create_evalution_page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 16, 2026

@github-actions github-actions bot temporarily deployed to pull request March 16, 2026 11:30 Inactive
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx (1)

195-197: Avoid passing getAssistantConfigVersionsMock twice in this test setup.

defaultMocks already includes this mock via getAIEvaluationCreateMocks, so appending it again is redundant and can make mock resolution less deterministic.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx` around
lines 195 - 197, The test 'shows assistant options from query using
assistantName and versionNumber' is passing getAssistantConfigVersionsMock twice
by appending it to defaultMocks; remove the duplicate so mocks aren’t
duplicated. Update the render call in the test to use only defaultMocks (which
already includes getAssistantConfigVersionsMock via getAIEvaluationCreateMocks)
instead of [...defaultMocks, getAssistantConfigVersionsMock], ensuring the test
uses the single canonical mock instance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx`:
- Around line 161-166: In the SectionDivider field config for
__evaluationDetailsDivider, fix the misspelled key "placedolder" to
"placeholder" so the placeholder behavior is applied; update the object property
name in the AIEvaluationCreate component where SectionDivider is defined (look
for the __evaluationDetailsDivider config) to use "placeholder" with the
intended string value.
- Around line 41-42: The new UI strings in AIEvaluationCreate.tsx are
hard-coded; import and use the i18next hook (useTranslation) and replace each
literal (the paragraph around "Select The Golden QA Dataset..." plus the other
literals at the noted locations 46-50, 68, 172) with t('your.namespace.key')
calls (e.g., t('aiEvaluation.selectGoldenDataset')) and add corresponding keys
to the locale files so they are picked up by yarn extract-translations; update
the AIEvaluationCreate component to call const { t } = useTranslation() and use
t(...) for all visible strings so localization coverage is preserved.

In `@src/mocks/AIEvaluations.ts`:
- Around line 14-42: The mock getAssistantConfigVersionsMock is missing the
kaapiUuid field which GET_ASSISTANT_CONFIG_VERSIONS queries; update each
assistantConfigVersions item in getAssistantConfigVersionsMock to include a
kaapiUuid value (e.g., a unique string) so the mock shape matches the GraphQL
selection set and prevents missing-field cache warnings.

---

Nitpick comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx`:
- Around line 195-197: The test 'shows assistant options from query using
assistantName and versionNumber' is passing getAssistantConfigVersionsMock twice
by appending it to defaultMocks; remove the duplicate so mocks aren’t
duplicated. Update the render call in the test to use only defaultMocks (which
already includes getAssistantConfigVersionsMock via getAIEvaluationCreateMocks)
instead of [...defaultMocks, getAssistantConfigVersionsMock], ensuring the test
uses the single canonical mock instance.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2469974e-ccb4-4210-9b57-7f6627e7573c

📥 Commits

Reviewing files that changed from the base of the PR and between 131af00 and 6dc7f96.

📒 Files selected for processing (6)
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.module.css
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx
  • src/graphql/mutations/AIEvaluations.ts
  • src/graphql/queries/Assistant.ts
  • src/mocks/AIEvaluations.ts

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.91%. Comparing base (c56b13f) to head (fce4269).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3844      +/-   ##
==========================================
+ Coverage   81.88%   81.91%   +0.02%     
==========================================
  Files         308      309       +1     
  Lines       12940    12953      +13     
  Branches     2978     2982       +4     
==========================================
+ Hits        10596    10610      +14     
  Misses       1409     1409              
+ Partials      935      934       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link
Copy Markdown

cypress bot commented Mar 16, 2026

Glific    Run #8076

Run Properties:  status check passed Passed #8076  •  git commit bbd78ac65d ℹ️: Merge fce42690a1796886ea24221544006125e6df519e into c56b13f7ed7fa1dbac09a9b51dc9...
Project Glific
Branch Review feat/fix_create_evalution_page
Run status status check passed Passed #8076
Run duration 08m 36s
Commit git commit bbd78ac65d ℹ️: Merge fce42690a1796886ea24221544006125e6df519e into c56b13f7ed7fa1dbac09a9b51dc9...
Committer Priyanshu singh
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 62
View all changes introduced in this branch ↗︎

@priyanshu6238 priyanshu6238 marked this pull request as draft March 16, 2026 17:19
@rvignesh89 rvignesh89 changed the title Feat/fix create evalution page [Evals]: Create evaluation Mar 17, 2026
@priyanshu6238 priyanshu6238 self-assigned this Mar 17, 2026
@github-actions github-actions bot temporarily deployed to pull request March 18, 2026 03:07 Inactive
@priyanshu6238 priyanshu6238 marked this pull request as ready for review March 18, 2026 03:22
@github-actions github-actions bot temporarily deployed to pull request March 18, 2026 03:26 Inactive
@priyanshu6238 priyanshu6238 linked an issue Mar 18, 2026 that may be closed by this pull request
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/containers/AIEvals/AIEvaluationCreate/UploadGoldenQaDialog.tsx (1)

90-100: ⚠️ Potential issue | 🟠 Major

Validate parsed datasetId before calling onProceed.

The backend returns datasetId as a string, and parseInt() at line 97 can return NaN if the value is invalid or non-numeric. The current guard at line 90 only checks for goldenQa and goldenQa.name existence, allowing invalid datasetId values to propagate to the callback, which expects a number type.

Suggested patch
-      if (!goldenQa || !goldenQa.name) {
+      const parsedDatasetId = Number(goldenQa?.datasetId);
+      if (!goldenQa || !goldenQa.name || !Number.isInteger(parsedDatasetId)) {
         setNotification('Failed to upload Golden QA', 'error');
         return;
       }

       setNotification('Golden QA uploaded successfully', 'success');
       onProceed({
-        datasetId: parseInt(goldenQa.datasetId, 10),
+        datasetId: parsedDatasetId,
         name: goldenQa.name,
         duplicationFactor: goldenQa.duplication_factor,
       });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/UploadGoldenQaDialog.tsx` around
lines 90 - 100, The parsed datasetId from goldenQa.datasetId must be validated
before calling onProceed: in UploadGoldenQaDialog, parse goldenQa.datasetId with
parseInt into a variable (e.g., parsedDatasetId), check
Number.isFinite(parsedDatasetId) or !Number.isNaN(parsedDatasetId) and that it
is > 0 (or meets your domain rules); if invalid, call setNotification('Invalid
dataset ID in uploaded Golden QA', 'error') and return instead of invoking
onProceed; only call onProceed({ datasetId: parsedDatasetId, name:
goldenQa.name, duplicationFactor: goldenQa.duplication_factor }) when the parsed
value is valid.
♻️ Duplicate comments (2)
src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx (2)

139-144: ⚠️ Potential issue | 🟡 Minor

Fix typo in field config key (placedolderplaceholder).

Line 143 uses a misspelled key, so the config entry is ignored.

Suggested patch
     {
       component: SectionDivider,
       name: '__evaluationDetailsDivider',
       label: 'Evaluation Details',
-      placedolder: '',
+      placeholder: '',
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx` around
lines 139 - 144, The field config for the SectionDivider entry named
'__evaluationDetailsDivider' has a typo in its key ('placedolder') so the
placeholder is ignored; update the config by renaming the key from 'placedolder'
to 'placeholder' on the object with component SectionDivider and name
'__evaluationDetailsDivider' so the placeholder value is applied correctly.

20-29: ⚠️ Potential issue | 🟠 Major

Use i18next keys instead of hard-coded UI strings.

New/updated user-facing literals here should be wrapped with t(...) to keep localization coverage intact.

As per coding guidelines, "Use i18next for internationalization with string extraction to Lokalise via yarn extract-translations".

Also applies to: 67-68, 133-159, 198-200, 213-213

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx` around
lines 20 - 29, In AIEvaluationCreate, replace all hard-coded UI strings (e.g.,
"Expected CSV Format:", "Question, Answer", '{"What Is X"},{"Answer"}', "Click
Here For The Template Csv" and other literals at the referenced ranges) with
i18next calls using the useTranslation hook (e.g., const { t } =
useTranslation()) and t('your.key.here') keys, add appropriate translation keys
(camel/snake as project convention) and update JSX to use t(...) for labels and
link text; after changes run the translation extraction step (yarn
extract-translations) to ensure keys are picked up and include keys for the
other mentioned sections (lines ~67-68, 133-159, 198-200, 213) as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx`:
- Around line 75-78: goldenQaOptions uses mixed id types causing goldenQaId
(typed number) to accept the placeholder; make ids consistent and validate as a
number: change the placeholder option id from '0' to '' in goldenQaOptions (so
the select shows no valid id), update the validation schema that checks
goldenQaId to require a number with min(1) (or equivalent numeric minimum)
instead of a string check, and when building the submission payload convert the
selected id to a numeric datasetId (e.g., Number(goldenQaId)) or handle the
empty string as absent; update references to goldenQADatasets.map,
goldenQaOptions, goldenQaId state, and the form validation schema accordingly.

In `@src/graphql/mutations/AIEvaluations.ts`:
- Around line 13-17: The CREATE_GOLDEN_QA GraphQL mutation's selection set is
missing the duplication_factor field, so goldenQa.duplication_factor is
undefined when UploadGoldenQaDialog reads it; update the createGoldenQa
selection (the goldenQa { ... } block in the CREATE_GOLDEN_QA mutation) to
include duplication_factor so Apollo fetches that value for
UploadGoldenQaDialog.

---

Outside diff comments:
In `@src/containers/AIEvals/AIEvaluationCreate/UploadGoldenQaDialog.tsx`:
- Around line 90-100: The parsed datasetId from goldenQa.datasetId must be
validated before calling onProceed: in UploadGoldenQaDialog, parse
goldenQa.datasetId with parseInt into a variable (e.g., parsedDatasetId), check
Number.isFinite(parsedDatasetId) or !Number.isNaN(parsedDatasetId) and that it
is > 0 (or meets your domain rules); if invalid, call setNotification('Invalid
dataset ID in uploaded Golden QA', 'error') and return instead of invoking
onProceed; only call onProceed({ datasetId: parsedDatasetId, name:
goldenQa.name, duplicationFactor: goldenQa.duplication_factor }) when the parsed
value is valid.

---

Duplicate comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx`:
- Around line 139-144: The field config for the SectionDivider entry named
'__evaluationDetailsDivider' has a typo in its key ('placedolder') so the
placeholder is ignored; update the config by renaming the key from 'placedolder'
to 'placeholder' on the object with component SectionDivider and name
'__evaluationDetailsDivider' so the placeholder value is applied correctly.
- Around line 20-29: In AIEvaluationCreate, replace all hard-coded UI strings
(e.g., "Expected CSV Format:", "Question, Answer", '{"What Is X"},{"Answer"}',
"Click Here For The Template Csv" and other literals at the referenced ranges)
with i18next calls using the useTranslation hook (e.g., const { t } =
useTranslation()) and t('your.key.here') keys, add appropriate translation keys
(camel/snake as project convention) and update JSX to use t(...) for labels and
link text; after changes run the translation extraction step (yarn
extract-translations) to ensure keys are picked up and include keys for the
other mentioned sections (lines ~67-68, 133-159, 198-200, 213) as well.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ec368d63-aa4b-46f6-854b-30200aa44783

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc7f96 and 521ba67.

📒 Files selected for processing (8)
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.module.css
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx
  • src/containers/AIEvals/AIEvaluationCreate/UploadGoldenQaDialog.test.tsx
  • src/containers/AIEvals/AIEvaluationCreate/UploadGoldenQaDialog.tsx
  • src/graphql/mutations/AIEvaluations.ts
  • src/graphql/queries/AIEvaluations.ts
  • src/mocks/AIEvaluations.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.module.css

@priyanshu6238
Copy link
Copy Markdown
Collaborator Author

priyanshu6238 commented Mar 18, 2026

Note: Code coverage may fail since the UI is not fully ready yet. Hence, I’m not adding test cases for the create evaluation feature at this stage. I will include them in my test PR.

@github-actions github-actions bot temporarily deployed to pull request March 18, 2026 04:04 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 18, 2026 09:29 Inactive
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx (2)

79-81: Remove unnecessary variables from query that accepts no arguments.

The GET_ASSISTANT_CONFIG_VERSIONS query definition (in src/graphql/queries/Assistant.ts) takes no variables, but this call passes { filter: {} }. While Apollo may ignore extraneous variables, this creates misleading code and could fail if the server enforces strict variable validation.

Suggested fix
-  const { data: versionsData } = useQuery(GET_ASSISTANT_CONFIG_VERSIONS, {
-    variables: { filter: {} },
-  });
+  const { data: versionsData, loading: assistantsLoading } = useQuery(GET_ASSISTANT_CONFIG_VERSIONS);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx` around
lines 79 - 81, The useQuery call passing unnecessary variables should be
simplified: remove the variables object from the useQuery invocation that
queries GET_ASSISTANT_CONFIG_VERSIONS in AIEvaluationCreate (the
useQuery(GET_ASSISTANT_CONFIG_VERSIONS, { variables: { filter: {} } }) call)
because the GraphQL operation accepts no variables; update the call to just
useQuery(GET_ASSISTANT_CONFIG_VERSIONS) so extraneous variables aren’t sent and
to avoid misleading future readers.

187-190: FormLayout query props are placeholders that could cause confusing behavior.

getItemQuery is set to GET_ASSISTANT_CONFIG_VERSIONS (fetches assistants, not evaluations), and all three mutation props use CREATE_EVALUATION. Since handleSetPayload triggers the actual mutation, these props act as placeholders—but if FormLayout attempts to use them (e.g., for edit mode or delete), the behavior will be incorrect. Consider using null or creating proper no-op queries to avoid accidental misuse.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx` around
lines 187 - 190, FormLayout's GraphQL props are using incorrect placeholders
(getItemQuery=GET_ASSISTANT_CONFIG_VERSIONS and
create/update/deleteItemQuery=CREATE_EVALUATION) which can cause wrong behavior
if FormLayout ever invokes them; change those props to explicit null (or a
dedicated no-op query/mutation) so they cannot be accidentally used, and leave
actual mutation handling to handleSetPayload; update the JSX where FormLayout is
instantiated (look for the AIEvaluationCreate component and the FormLayout prop
assignments) to pass null or proper no-op operations for getItemQuery,
createItemQuery, updateItemQuery, and deleteItemQuery.
src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx (1)

287-294: Mock uses variableMatcher: () => true, which won't catch incorrect mutation variables.

The createGoldenQaCustomSuccessMock (per src/mocks/AIEvaluations.ts) uses a catch-all variable matcher, so tests will pass even if the component sends incorrect or missing fields in the mutation. Consider adding a stricter mock for critical mutation tests to validate the exact payload structure.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx` around
lines 287 - 294, The test relies on createGoldenQaCustomSuccessMock which
currently uses variableMatcher: () => true, so update the mock in the test to
use a stricter variable matcher that asserts the exact mutation payload (e.g.,
match the expected input fields like question, answer, metadata/id) or replace
the catch-all mock with a new mock variant that validates variables;
specifically modify createGoldenQaCustomSuccessMock (or add
createGoldenQaStrictSuccessMock) to compare incoming variables to the expected
GraphQL input shape and only return the success response when they match, then
use that stricter mock in the failing test to ensure the component sends the
correct mutation variables.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx`:
- Around line 166-177: The test 'accepts valid evaluation name with
alphanumeric, underscore and hyphen' asserts pattern acceptance but the
component's validation schema uses Yup.string().required() (no matches pattern),
so the test is misleading; either restore the pattern check in the component's
validation schema by adding .matches(/^[a-zA-Z0-9_-]+$/) to the field validation
in the AIEvaluationCreate form schema (the Yup validation used to validate the
name) OR rename/update the test to assert only that a non-empty name is accepted
(change the test title and expectations to reflect required-only validation),
and ensure any references to the name input (placeholder 'Give a unique name for
the evaluation experiment') remain correct.
- Line 14: The test creates duplicate Apollo mocks by appending
getAssistantConfigVersionsMock to the array returned by
getAIEvaluationCreateMocks(); update the test to stop adding
getAssistantConfigVersionsMock twice—use the defaultMocks array directly (e.g.,
use [...defaultMocks] or defaultMocks) instead of [...defaultMocks,
getAssistantConfigVersionsMock], removing the extra
getAssistantConfigVersionsMock to avoid duplicate mock entries (refer to
getAIEvaluationCreateMocks, getAssistantConfigVersionsMock, and defaultMocks).

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx`:
- Around line 120-124: The handler handleUploadGoldenQaProceed currently accepts
{ datasetId, name } but UploadGoldenQaDialogProps.onProceed requires {
datasetId, name, duplicationFactor }; update handleUploadGoldenQaProceed to
accept duplicationFactor as well and include it where appropriate (e.g., add
duplicationFactor to the new item pushed into setGoldenQADatasets and/or include
it in setStates if golden QA state needs it), then keep closing behavior
setShowUploadGoldenQaDialog(false); ensuring the parameter shape matches the
onProceed type so TypeScript no longer errors.
- Around line 161-174: The payload builder in handleSetPayload is incorrectly
passing payload.assistantId as configVersion; change it to use the selected
version's versionNumber by setting configVersion to
selectedVersion?.versionNumber (from versionsData.assistantConfigVersions) when
calling createEvaluation in handleSetPayload so the backend receives the actual
versionNumber instead of the DB id.

---

Nitpick comments:
In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx`:
- Around line 287-294: The test relies on createGoldenQaCustomSuccessMock which
currently uses variableMatcher: () => true, so update the mock in the test to
use a stricter variable matcher that asserts the exact mutation payload (e.g.,
match the expected input fields like question, answer, metadata/id) or replace
the catch-all mock with a new mock variant that validates variables;
specifically modify createGoldenQaCustomSuccessMock (or add
createGoldenQaStrictSuccessMock) to compare incoming variables to the expected
GraphQL input shape and only return the success response when they match, then
use that stricter mock in the failing test to ensure the component sends the
correct mutation variables.

In `@src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx`:
- Around line 79-81: The useQuery call passing unnecessary variables should be
simplified: remove the variables object from the useQuery invocation that
queries GET_ASSISTANT_CONFIG_VERSIONS in AIEvaluationCreate (the
useQuery(GET_ASSISTANT_CONFIG_VERSIONS, { variables: { filter: {} } }) call)
because the GraphQL operation accepts no variables; update the call to just
useQuery(GET_ASSISTANT_CONFIG_VERSIONS) so extraneous variables aren’t sent and
to avoid misleading future readers.
- Around line 187-190: FormLayout's GraphQL props are using incorrect
placeholders (getItemQuery=GET_ASSISTANT_CONFIG_VERSIONS and
create/update/deleteItemQuery=CREATE_EVALUATION) which can cause wrong behavior
if FormLayout ever invokes them; change those props to explicit null (or a
dedicated no-op query/mutation) so they cannot be accidentally used, and leave
actual mutation handling to handleSetPayload; update the JSX where FormLayout is
instantiated (look for the AIEvaluationCreate component and the FormLayout prop
assignments) to pass null or proper no-op operations for getItemQuery,
createItemQuery, updateItemQuery, and deleteItemQuery.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c3462292-f4d5-43de-b5d9-e14b8fe17eae

📥 Commits

Reviewing files that changed from the base of the PR and between 521ba67 and 31b45ba.

📒 Files selected for processing (3)
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.test.tsx
  • src/containers/AIEvals/AIEvaluationCreate/AIEvaluationCreate.tsx
  • src/mocks/AIEvaluations.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/mocks/AIEvaluations.ts

@github-actions github-actions bot temporarily deployed to pull request March 19, 2026 06:20 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 19, 2026 11:42 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 20, 2026 07:15 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 20, 2026 08:47 Inactive
@priyanshu6238 priyanshu6238 marked this pull request as draft March 21, 2026 05:01
@github-actions github-actions bot temporarily deployed to pull request March 28, 2026 17:25 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 29, 2026 17:11 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 29, 2026 17:40 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 30, 2026 02:51 Inactive
@priyanshu6238 priyanshu6238 marked this pull request as ready for review March 30, 2026 05:03
@rvignesh89 rvignesh89 self-requested a review March 30, 2026 11:28
Copy link
Copy Markdown
Contributor

@rvignesh89 rvignesh89 left a comment

Choose a reason for hiding this comment

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

Please address comments before merging.

Apart from the comments please also fix the following UX.

Current: When I enter evaluation name and select a version, and then go to upload golden qa, the selected fields are reset.
Expected: Selected field values should remain.

expect(screen.getByText('Click here for the template CSV')).toBeInTheDocument();
expect(screen.getByText('Question, Answer')).toBeInTheDocument();
expect(screen.getByText('{"What Is X"},{"Answer"}')).toBeInTheDocument();
expect(screen.getByText('Click Here For The Template Csv')).toBeInTheDocument();
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.

@priyanshu6238 why do these values keep changing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i change it according to the noopur design


useEffect(() => {
if (versionsError) {
setNotification(versionsError.message, 'warning');
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.

This message should be prepended to say failed to fetch assistant versions. Otherwise user has no idea where the failure occurred.

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This needs to be handled on the backend. I will include a general message for this in my next backend PR.

@github-actions github-actions bot temporarily deployed to pull request March 31, 2026 10:08 Inactive
@priyanshu6238
Copy link
Copy Markdown
Collaborator Author

Making it draft will pick it again in next iteration. when we again start the evals work

@priyanshu6238 priyanshu6238 marked this pull request as draft March 31, 2026 14:29
@priyanshu6238 priyanshu6238 linked an issue Apr 1, 2026 that may be closed by this pull request
@priyanshu6238 priyanshu6238 marked this pull request as ready for review April 1, 2026 15:46
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.

2 participants