Repository navigation
[2.1] Fixes #36457, #36458, #36459: keep CSV import rows and versions; drop the year-0001 life cycle placeholder - #36830
Merged
Merged
Conversation
… the year-0001 life cycle placeholder (#36562) * Fixes #36457: normalize CSV line endings before parsing an import Both import screens rewrite CRLF and lone CR to LF before handing the file to papaparse, which infers one line separator per file, so a file that mixes line endings parses into one row per line. * Fixes #36458: store the previous version when a CSV import updates an entity updateManyEntitiesForImport stores each replaced entity, with the relationships a PUT or PATCH records, as a history row in the same transaction and before the row update. The imported entity's change description starts from the stored version, so the importer's own edit within the session consolidates against it, and it keeps the per-field change summary. * Fixes #36459: drop life cycle timestamps before the Unix epoch on write prepareInternal, which runs for create, PUT, PATCH and bulk create, drops any created, updated or accessed aspect timestamped before 1970, the year-0001 placeholder older ingestion clients send for a source that reported no time, and drops the life cycle when no aspect remains. A PATCH whose life cycle carries nothing but placeholders keeps the stored life cycle, since those clients replace the whole field. The write still succeeds. The table header hides a pre-epoch creation time stored before this rule. Decision: ADR:2026-10-29-lifecycle-timestamps-before-the-epoch-are-dropped-on-write * Open a quoted CSV cell only at the start of a cell normalizeCsvLineBreaks treats a quote as opening a quoted cell only at the start of the text, after a comma or after a line break, as papaparse does, so a quote inside an unquoted cell such as 12" pipe stays text. The cell boundary is matched with a capture group because the build targets Safari 16.0. * Apply ui-checkstyle to the CSV import tests * Hydrate import originals in place and serialize history before the transaction (cherry picked from commit 8791c16)
gh-bot-collate
Bot
requested review from
IceS2
and removed request for
a team
November 2, 2026 09:41
gh-bot-collate
Bot
requested review from
shah-harshit
and removed request for
a team
November 2, 2026 09:41
Author
|
🤖 This backport will not merge itself: |
14 tasks done
Contributor
|
4 tasks done
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.



Automated backport of #36562 to
2.1.8791c16aa7afbd3a51e0165a32f0c78f9212c762Resolution notes
Backport notes: PR #36562 → 2.1
Conflict
openmetadata-service/.../jdbi3/EntityRepository.javaconflicted aroundserializeForVersionHistory/
storeVersions.The PR's own hunk here just splits the pre-existing
storeVersions(List<T>)helper into aserialization step (
versionRows) and a write step (storeVersions(VersionRows)), soupdateManyEntitiesForImportcan serialize each original's version row before the writetransaction instead of inside it.
The conflict wasn't caused by this change, though.
mainhad already grown, independently of thisPR, a field-masking layer around version history (
getFieldsHiddenFromHistory,MaskedFields.wholeFieldsOf,prepareForVersionHistory,fieldsHiddenFromHistory,withoutFieldsHiddenFromHistory,withHiddenFieldsOf) that2.1does not have —MaskedFieldsdoesn't exist anywhere on this branch, and
serializeForVersionHistoryon2.1is still the plainJsonUtils.pojoToJson(entity). Because the PR's hunk sits right next to that masking code, gitpulled the whole unrelated block into the conflict.
Resolution: kept
2.1's plainserializeForVersionHistoryand the rest of its shape as-is, andadded only the PR's actual change on top of it — the
VersionRowsrecord,versionRows(...), andstoreVersions(VersionRows). The masking layer was left out entirely since it isn't part of this PRand doesn't exist on
2.1.One simplification versus
main:2.1never had a publicstoreVersions(List<T> originals)wrapper (every other call site on this branch builds the version-extension name and calls
entityExtensionDAO().insert(...)directly, inline). Since nothing on2.1needs that wrapper, itwas not added — only the private
versionRows/storeVersions(VersionRows)pair thatupdateManyEntitiesForImportactually calls.The rest of the merge commit (CRLF normalization for CSV import, the
updateManyEntitiesForImportchanges that store the previous version and set
importChangeDescription, the life-cycleplaceholder drop in
prepareInternal/preparePatchedvia the newLifeCyclesutil, and the UI/testchanges) applied cleanly with no conflicts.
What to check by hand
EntityRepository.javahas no remaining reference to the masking helpers(
MaskedFields,getFieldsHiddenFromHistory,prepareForVersionHistory,withHiddenFieldsOf) — there should be none; they were not ported.versionRows/storeVersions(VersionRows)are only called fromupdateManyEntitiesForImport(the single call site on this branch), and that every otherversion-insert call site on
2.1is untouched.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #36562 is asked to look.
resolver run