Skip to content

[2.1] Fixes #36457, #36458, #36459: keep CSV import rows and versions; drop the year-0001 life cycle placeholder - #36830

Merged
mohityadav766 merged 1 commit into
2.1from
backport/2.1/pr-36562
Nov 3, 2026
Merged

mohityadav766 merged 1 commit into
2.1from
backport/2.1/pr-36562

Conversation

@gh-bot-collate

@gh-bot-collate gh-bot-collate Bot commented Nov 2, 2026

Copy link
Copy Markdown

Automated backport of #36562 to 2.1.

Source PR #36562
Author @yan-3005
Merge commit 8791c16aa7afbd3a51e0165a32f0c78f9212c762
Method Conflicts resolved by Claude — worth a read of the diff.

Resolution notes

Backport notes: PR #36562 → 2.1

Conflict

openmetadata-service/.../jdbi3/EntityRepository.java conflicted around serializeForVersionHistory
/ storeVersions.

The PR's own hunk here just splits the pre-existing storeVersions(List<T>) helper into a
serialization step (versionRows) and a write step (storeVersions(VersionRows)), so
updateManyEntitiesForImport can serialize each original's version row before the write
transaction instead of inside it.

The conflict wasn't caused by this change, though. main had already grown, independently of this
PR, a field-masking layer around version history (getFieldsHiddenFromHistory,
MaskedFields.wholeFieldsOf, prepareForVersionHistory, fieldsHiddenFromHistory,
withoutFieldsHiddenFromHistory, withHiddenFieldsOf) that 2.1 does not have — MaskedFields
doesn't exist anywhere on this branch, and serializeForVersionHistory on 2.1 is still the plain
JsonUtils.pojoToJson(entity). Because the PR's hunk sits right next to that masking code, git
pulled the whole unrelated block into the conflict.

Resolution: kept 2.1's plain serializeForVersionHistory and the rest of its shape as-is, and
added only the PR's actual change on top of it — the VersionRows record, versionRows(...), and
storeVersions(VersionRows). The masking layer was left out entirely since it isn't part of this PR
and doesn't exist on 2.1.

One simplification versus main: 2.1 never had a public storeVersions(List<T> originals)
wrapper (every other call site on this branch builds the version-extension name and calls
entityExtensionDAO().insert(...) directly, inline). Since nothing on 2.1 needs that wrapper, it
was not added — only the private versionRows/storeVersions(VersionRows) pair that
updateManyEntitiesForImport actually calls.

The rest of the merge commit (CRLF normalization for CSV import, the updateManyEntitiesForImport
changes that store the previous version and set importChangeDescription, the life-cycle
placeholder drop in prepareInternal/preparePatched via the new LifeCycles util, and the UI/test
changes) applied cleanly with no conflicts.

What to check by hand

  • Confirm EntityRepository.java has no remaining reference to the masking helpers
    (MaskedFields, getFieldsHiddenFromHistory, prepareForVersionHistory,
    withHiddenFieldsOf) — there should be none; they were not ported.
  • Confirm versionRows/storeVersions(VersionRows) are only called from
    updateManyEntitiesForImport (the single call site on this branch), and that every other
    version-insert call site on 2.1 is 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

… 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
gh-bot-collate Bot requested review from a team as code owners November 2, 2026 09:41
@gh-bot-collate
gh-bot-collate Bot requested review from IceS2 and removed request for a team November 2, 2026 09:41
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 2, 2026
@gh-bot-collate
gh-bot-collate Bot requested review from shah-harshit and removed request for a team November 2, 2026 09:41
@gh-bot-collate

gh-bot-collate Bot commented Nov 2, 2026

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 80%
80.2% (132628/165360) 66.83% (47037/70381) 69.87% (26653/38145)

@sonarqubecloud

sonarqubecloud Bot commented Nov 2, 2026

Copy link
Copy Markdown

@mohityadav766
mohityadav766 merged commit 1c7560f into 2.1 Nov 3, 2026
102 checks passed
@mohityadav766
mohityadav766 deleted the backport/2.1/pr-36562 branch November 3, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants