Skip to content

test: read bulk import history from the shared version writer - #36763

Merged
manerow merged 1 commit into
mainfrom
fix/bulk-import-history-tests-version-writer
Oct 31, 2026
Merged

manerow merged 1 commit into
mainfrom
fix/bulk-import-history-tests-version-writer

Conversation

@manerow

@manerow manerow commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

OpenMetadata Service Unit Tests fails on main since PR #36251 merged: BulkImportChangeEventMaskingTest (1 failure) and EntityRepositoryBulkImportSecretsTest (3 errors, argument "content" is null).

PR #36251 made EntityRepository.storeVersions the only code that writes an entity version. createChangeEventForBulkOperation now stores the replaced version through it, and storeVersions writes with entityExtensionDAO().insertMany(...). Both tests were written against the previous code, which wrote that row with entityExtensionDAO().insert(...). They stub or verify insert, so they no longer see the history row.

The stored row is unchanged: same version key, same serializeForVersionHistory JSON, connection secrets still encrypted. This PR only points the two tests at insertMany and keeps every assertion on the history content.

No code outside the two tests changes.

Type of change:

  • Bug fix

High-level design:

N/A, test-only change.

Tests:

Use cases covered

  • A CSV bulk import of a database, drive or security service stores the replaced version with its connection secret still encrypted, and its change event without the secret.

Unit tests

  • BulkImportChangeEventMaskingTest: 2 passed, 0 failed.
  • EntityRepositoryBulkImportSecretsTest: 3 passed, 0 failed.
  • With VersionHistoryArchitectureTest, EntityRepositorySecretStorageTest, ChangeEventMaskingTest and the other bulk import tests: 25 passed, 0 failed.

@manerow
manerow requested a review from a team as a code owner October 31, 2026 21:21
@manerow
manerow requested a review from yan-3005 October 31, 2026 21:21
@manerow manerow added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
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 BulkImportChangeEventMaskingTest and EntityRepositoryBulkImportSecretsTest stubs and verifications at entityExtensionDAO().insertMany(...) so they match how EntityRepository.storeVersions now writes replaced versions, fixing the main-branch test failures without changing the stored row or any production code. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 370a82f into main Oct 31, 2026
88 of 89 checks passed
@manerow
manerow deleted the fix/bulk-import-history-tests-version-writer branch October 31, 2026 21:29
harshach added a commit to harshach/OpenMetadata that referenced this pull request Oct 31, 2026
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.
harshach added a commit that referenced this pull request Oct 31, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant