ATLAS-5322: Fix glossary bulk import relation parsing and error reporting. - #712
Open
UmeshPatil-1 wants to merge 1 commit into
Open
ATLAS-5322: Fix glossary bulk import relation parsing and error reporting.#712UmeshPatil-1 wants to merge 1 commit into
UmeshPatil-1 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Problem
GlossaryName:TermName,TermName@GlossaryName, and same-glossaryTermNameshorthand), but parsing/lookup was inconsistent.BulkImportResponse.Backend changes (repository)
GlossaryTermUtils.javaresolveRelatedTermReference()to normalize and validate three relation formats:TermName@GlossaryName(qualified name)GlossaryName:TermName(legacy colon format — backward compatible)TermName(same-glossary shorthand — best-effort, not a hard failure if unresolved)lookupGlossaryTermGuid()to resolve related terms from graph or in-import GUID cache.cacheImportedTermGuid()so terms created/seen during import are available for relation linking in pass 2.GlossaryService.javareconcileBulkImportResponse()after relation pass:successImportInfoListif they appear infailedImportInfoList(prevents misleading partial-success reporting)GlossaryServiceTest.javaglossary_healthcare_filled.csv— expects 20 successes, 0 failures.UI changes
React dashboard (
dashboard/)glossaryImportUtils.tswith:formatGlossaryImportFailure()→ e.g.Patient@Healthcare Glossary: Reference not foundbuildGlossaryImportFailureSummary()→ e.g.Glossary import completed with 1 failure(s) out of 2 term(s). See error details.ImportDialog.tsxandAddUpdateGlossaryForm.tsxto use formatted toast + Error Details list.glossaryImportUtils.test.tsLegacy dashboard (
dashboardv2/)ImportLayoutView.jsto show summary notification and formatted per-term errors in Error Details modal (always shown when failures exist).How was this patch tested?
Unit tests
GlossaryServiceTest— existing bulk import tests pass with updated invalid-relation expectationGlossaryServiceTest— new test withglossary_healthcare_filled.csv: 20 success, 0 failedglossaryImportUtils.test.ts— failure formatting and summary messageManual REST tests
Tested using glossary_healthcare_filled.csv (20 data rows + 1 header = 20 terms) and curl commands.
Health check — GET /api/atlas/v2/glossary?limit=1
Result: HTTP 200
Import healthcare CSV — POST /api/atlas/v2/glossary/import
Result: Success: 20, Failed: 0
Verify term count — GET /api/atlas/v2/glossary/{guid}
Result: Term count: 20
Patient term seeAlso relation — GET /api/atlas/v2/glossary/term/{patientTermGuid}
Result: seeAlso count: 1, linked to Provider
Provider preferredTerms — GET /api/atlas/v2/glossary/term/{providerTermGuid}
Result: 2 terms — Physician, Nurse
Colon format backward compatibility — import CSV with GlossaryName:TermName references
Result: Success: 2, Failed: 0
Negative test — invalid explicit @ reference — MissingTerm@BadRelGlossary
Result: Entry in failedImportInfoList with clear error (not silent drop)
Re-import same CSV (idempotency) — POST /api/atlas/v2/glossary/import
Result: Success: 20, Failed: 0
Automated verification script — scripts/atlas5322_verify.sh
Result: ALL CHECKS PASSED
Example import verification:
curl -s -u admin:admin -X POST
-F "file=@glossary_healthcare_filled.csv"
"http://localhost:21000/api/atlas/v2/glossary/import"
Expected: successImportInfoList size = 20, failedImportInfoList empty.
Example relation verification:
GET /api/atlas/v2/glossary/term/{patientTermGuid}
Expected: "seeAlso" contains Provider; Provider has 2 preferredTerms.
UI manual test