Repository navigation
Preserve Context Center file content during metadata edits - #36662
Conversation
|
Local Java test run: FAILED — details
Failed: Selected but produced no report: Tests run locally
Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts. integration · mysql-elasticsearch · parallel: 55 classes
Why these tests
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=ContextFileIndexTest,ContextFileProcessingServiceTest,ContextFileRepositoryTest,DefaultContextEntityPromptLoaderTest,DriveMapperTest,EntityRepositoryBulkFieldsTest,FileContextProcessingEngineTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<55 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=ContextMemoryDerivationIT,ContextMemoryExtractionIT,ConversationSchemaMigrationIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=AgentSparqlResourceIT,RdfMcpKnowledgeGraphIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ Approved🔴 High risk · ContextFile metadata edits now reject supplied asset IDs and retain existing content references, so stale content could remain when a replacement was intended. Preserves Context Center file content during metadata edits by rejecting POST/PUT requests that supply content references with a 400 and keeping stored content references intact on PUT and PATCH. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Preserve Context Center file content during metadata edits. Content assignment stays with uploads; metadata POST/PUT requests supplying an asset reference return 400. Add mapper, repository, and storage-backed API regressions, and align the extraction fixtures with creation-time content assignment.
Type of change:
High-level design:
The mapper validates metadata requests, and the shared updater keeps both stored content references for PUT and PATCH. Uploads continue assigning the references during creation. The schema and generated TypeScript document the request behavior; no stored format or database migration changes.
Decision: Context file metadata edits preserve content.
Tests:
Use cases covered
Unit tests
DriveMapperTestandContextFileRepositoryTestadd seven regression cases, confirmed failing before the implementation. The affected Java run includes all 10 selected unit test classes: 60 passed, 1 skipped, no failures or errors.JaCoCo line coverage measured on the original regression implementation (unchanged by the conflict resolution): mapper 100%, updater 100%, full repository 70.5%. All 6 added executable lines are covered. Generated the report with
mvn -B jacoco:report -pl openmetadata-service -Djacoco.dataFile=/tmp/context-file-coverage-final.exec.Backend integration tests
Updated
ContextFileIT,DriveFileUploadIT, andContextMemoryExtractionIT. The affected plan covers the upload and metadata flows plus their surrounding integration suites on MySQL/Elasticsearch. The conflict resolution preserves both the uploaded content references and the timestamp protection for concurrent processing writes frommain.Local Java test run: PASSED
5c689df4ba4f(baseorigin/main)All 62 selected integration classes produced reports. The parallel, isolated, and RDF lanes passed: 3,424 integration tests passed, 329 skipped, no failures or errors.
TableResourceIT#test_columnLineageRenameran without the previous Elasticsearch error, andMcpServiceResourceITnow contains tests and produced a passing report. The unit step also passed its real MySQL and PostgreSQL conditional-write checks.Local Java test details for 5c689df
Local Java test run: PASSED — details
5c689df4ba4f(baseorigin/main)Tests run locally
ContextFileIndexTest(3 passed),ContextFileProcessingServiceTest(21 passed),ContextFileRepositoryTest(6 passed),ContextProcessingConditionalWriteSqlTest(2 passed),ContextProcessingRepositoryTest(9 passed),ContextProcessingUpdatesTest(5 passed),DefaultContextEntityPromptLoaderTest(1 passed, 1 skipped),DriveMapperTest(3 passed),EntityRepositoryBulkFieldsTest(8 passed),FileContextProcessingEngineTest(2 passed)ContextMemoryDerivationIT(5 passed),ContextMemoryExtractionIT(7 passed),ConversationSchemaMigrationIT(2 passed)AgentSparqlResourceIT(22 passed),RdfMcpKnowledgeGraphIT(21 passed)Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts.
integration · mysql-elasticsearch · parallel: 58 classes
AIApplicationResourceIT(35 passed, 3 skipped),AIContextKnowledgeAuthorizationIT(29 passed, 2 skipped),AIContextMcpIT(48 passed, 5 skipped),AIContextRestIT(10 passed, 2 skipped),AIFrameworkControlResourceIT(12 passed, 2 skipped),AIGovernancePolicyResourceIT(53 passed, 3 skipped),AgentExecutionResourceIT(4 passed, 5 skipped),AttachmentListIT(27 passed, 8 skipped),BaseEntityIT$ListEntityHistoryByTimestampPaginationTest(43 passed),ConceptContextIT(6 passed),ConfigResourceIT(25 passed, 3 skipped),ContextFileIT(4 passed),ContextMemoryAnchorIT(164 passed, 14 skipped),ContextMemoryConflictReviewIT(4 passed),ContextMemoryCreateGrantIT(4 passed),ContextMemoryIT(113 passed, 7 skipped),ContextMemoryLifecycleIT(86 passed, 7 skipped),ContextMemoryQueryEvidenceIT(28 passed, 5 skipped),ContextMemoryRelatedEntitiesReconcileIT(1 passed),ContextMemorySearchMatrixIT(39 passed, 5 skipped),ContextMemorySourceEntityTiebreakIT(35 passed),ContextMemoryStatusMigrationIT(1 passed),ContextMemoryWriteAccessIT(24 passed, 2 skipped),ConversationResourceIT(41 passed, 4 skipped),CredentialMcpRevocationIT(6 passed, 1 skipped),DatabaseSmokeIT(59 passed, 9 skipped),DirectoryResourceIT(261 passed, 17 skipped),DriveFileUploadIT(47 passed, 5 skipped),DriveServiceResourceIT(45 passed, 8 skipped),FileResourceIT(20 passed, 5 skipped),FolderIT(14 passed),FolderResourceIT(43 passed, 8 skipped),GlossaryTermResourceIT(252 passed, 8 skipped),IngestionPipelineAgentTypeIT(16 passed, 1 skipped),LLMModelResourceIT(634 passed, 83 skipped),LLMServiceResourceIT(26 passed, 2 skipped),McpContextMemoryPrincipalIdentityIT(71 passed, 10 skipped),McpContextMemoryVisibilityIT(5 passed),McpExecutionResourceIT(28 passed, 1 skipped),McpGrantMigrationIT(1 passed),McpIntegrationIT(43 passed, 5 skipped),McpOAuthIT(26 passed, 1 skipped),McpPermissionIT(59 passed, 5 skipped),McpRdfNotEnabledIT(55 passed, 6 skipped),McpSearchIT(10 passed),McpServerResourceIT(3 passed),McpServiceResourceIT(28 passed, 1 skipped),McpToolsValidationIT(2 passed),McpUserContextIT(42 passed, 1 skipped),MetricAssetsIT(44 passed, 1 skipped),OntologyAiResourceIT(18 passed, 4 skipped),PersonaAIContextIT(91 passed, 15 skipped),PromptTemplateResourceIT(213 passed, 27 skipped),SeedDataPresenceIT(34 passed, 2 skipped),SpreadsheetResourceIT(31 passed, 2 skipped),TableResourceIT(2 passed),UserResourceIT(41 passed),WorksheetResourceIT(39 passed, 1 skipped)Why these tests
added by author: Retain the concurrent processing write protection from main while preserving uploaded content references←ContextProcessingConditionalWriteSqlTest,ContextProcessingRepositoryTestarea ai-mcp-context←openmetadata-spec/src/main/resources/json/schema/api/data/createContextFile.jsonarea drives-attachments←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextFileRepository.java,openmetadata-service/src/main/java/org/openmetadata/service/resources/drive/ContextFileMapper.javacalled from entity ContextFile←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextFileRepository.java,openmetadata-service/src/main/java/org/openmetadata/service/resources/drive/ContextFileMapper.javacalled from entity Folder←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextFileRepository.javachanged test←openmetadata-integration-tests/src/test/java/org/openmetadata/it/drive/ContextFileIT.java,openmetadata-integration-tests/src/test/java/org/openmetadata/it/drive/DriveFileUploadIT.java,openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ContextMemoryExtractionIT.java,openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/ContextFileRepositoryTest.java,openmetadata-service/src/test/java/org/openmetadata/service/resources/drive/DriveMapperTest.javaentity ContextFile←openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/ContextFileRepository.java,openmetadata-service/src/main/java/org/openmetadata/service/resources/drive/ContextFileMapper.java,openmetadata-spec/src/main/resources/json/schema/api/data/createContextFile.jsonsmoke←code other than a test class changedCommands
mvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=ContextFileIndexTest,ContextFileProcessingServiceTest,ContextFileRepositoryTest,ContextProcessingConditionalWriteSqlTest,ContextProcessingRepositoryTest,ContextProcessingUpdatesTest,DefaultContextEntityPromptLoaderTest,DriveMapperTest,EntityRepositoryBulkFieldsTest,FileContextProcessingEngineTest -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<57 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=ContextMemoryDerivationIT,ContextMemoryExtractionIT,ConversationSchemaMigrationIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=AgentSparqlResourceIT,RdfMcpKnowledgeGraphIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=falseIngestion integration tests
Not applicable: no ingestion behavior changed.
make generate ARGS=--python-only, TypeScript regeneration, and generated-model freshness checks passed.Playwright (UI) tests
Browser tests were not run in this validation. The UI diff contains generated type documentation only; the affected metadata, upload, download, permissions, extraction, and cleanup flows passed the REST/S3 integration suites.
Manual testing performed
No manual UI checks. The automated REST/S3 tests exercise upload, metadata edits, download, sharing checks, and cleanup with isolated test infrastructure.
UI screen recording:
Not applicable: backend behavior and generated type documentation only.
Checklist:
mvn -B spotless:apply -pl openmetadata-service,openmetadata-integration-tests, decision-record checks, andgit diff --checkpassed.5c689df4ba4f5f9295118bc411f1ca73f1cd9840againstREVIEW.md: no findings; content preservation and concurrent processing protection both retained.