Repository navigation
test: read bulk import history from the shared version writer - #36763
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟢 Low risk · Updating two bulk-import tests to use the shared batch writer changes verification only; no production behavior or interfaces are changed. Points the 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 |
open-metadata#36763 moved the bulk-import history mocks onto insertMany; this keeps the two checks it did not carry over: the explicit single-row assertion on the captured version batch, and the unchecked-warning suppression on the raw ArgumentCaptor.
…36758) * fix: check pipeline status task names against a set (CWE-407) PUT /pipelines/{fqn}/status validated every taskStatus entry with a linear scan over the pipeline's tasks, so one request cost tasks x entries comparisons; /status/bulk cost tasks^2/2 for a status naming every task. Neither list has a size limit, and a pipeline owner sending large repeated bodies could occupy every QoS request slot and deny service to all other API clients. Collect the pipeline's task names into a HashSet once per request and check each entry against the set, making both endpoints linear in tasks + entries. A status carrying task entries for a pipeline without tasks now gets the same 400 (Invalid task name) instead of a 500 (NullPointerException). * test: assert one stored version row in bulk-import masking check #36763 moved the bulk-import history mocks onto insertMany; this keeps the two checks it did not carry over: the explicit single-row assertion on the captured version batch, and the unchecked-warning suppression on the raw ArgumentCaptor.
Describe your changes:
OpenMetadata Service Unit Testsfails on main since PR #36251 merged:BulkImportChangeEventMaskingTest(1 failure) andEntityRepositoryBulkImportSecretsTest(3 errors,argument "content" is null).PR #36251 made
EntityRepository.storeVersionsthe only code that writes an entity version.createChangeEventForBulkOperationnow stores the replaced version through it, andstoreVersionswrites withentityExtensionDAO().insertMany(...). Both tests were written against the previous code, which wrote that row withentityExtensionDAO().insert(...). They stub or verifyinsert, so they no longer see the history row.The stored row is unchanged: same version key, same
serializeForVersionHistoryJSON, connection secrets still encrypted. This PR only points the two tests atinsertManyand keeps every assertion on the history content.No code outside the two tests changes.
Type of change:
High-level design:
N/A, test-only change.
Tests:
Use cases covered
Unit tests
BulkImportChangeEventMaskingTest: 2 passed, 0 failed.EntityRepositoryBulkImportSecretsTest: 3 passed, 0 failed.VersionHistoryArchitectureTest,EntityRepositorySecretStorageTest,ChangeEventMaskingTestand the other bulk import tests: 25 passed, 0 failed.