mikebridge opened a new pull request, #44258:
URL: https://github.com/apache/superset/pull/44258

   ### SUMMARY
   
   The version-history panel never showed an entity's starting point 
(sc-120488, from Rebeca's QA on sc-107604): a newly created chart said "No 
history yet" until its first edit, an imported chart said "No history yet" 
despite attributed history, and after the first edit the original state was 
never a row. Dashboards only *looked* different because their creation UI flow 
issues an immediate follow-up layout save. Root cause: nothing is missing from 
the data — a fresh INSERT does create a version row — but `operation_type=0` 
transactions emit zero change records by design, and the panel renders 
exclusively from the activity stream.
   
   **Backend.** The activity orchestrator appends ONE synthetic 
starting-version record (`kind: "__creation__"`) derived from the op=0 shadow 
row and its `version_transaction` in a single inner-joined read: `issued_at`, 
`changed_by` (import attribution rides the existing user join), and the 
`version_uuid` the `/versions/` family resolves — which is what makes the row 
previewable and restorable like any other version. Placement: only for the path 
entity (inherits the activity endpoint's access gate — edit-gated once #44021 
lands), never on a truncated stream, never for `include="related"`, honoring 
`since`/`until` and `q`; appended before the total so count and pagination 
agree (+1) and the row lands on the final page as the oldest entry. If 
retention pruned the op=0 row **or** its transaction, the row is omitted 
cleanly (pinned).
   
   A machine field `creation_kind` labels the row: `pre_tracking` — the 
baseline writer now stamps `action_kind='baseline'` on the transaction it 
mints, since a retroactive baseline and a tracking-on creation are both op=0 
rows and only transaction provenance tells them apart; `imported` — INSERT 
stamped `ACTION_KIND_IMPORT`; else `created` (clones classify as created — a 
clone is a creation from the new entity's view). The stamp stays internal: the 
public `action_kind` ships null on the synthetic record (the public vocabulary 
is unchanged), and display is driven by `creation_kind` alone.
   
   **Frontend (rendering only).** The record forms its own oldest group via the 
existing announce routing (never a fake change row); `creationKind` drives the 
headline ahead of every other rule; and creation-only groups get an explicit, 
keyboard-accessible **Preview** button (they carry no change rows, so the 
per-record preview affordance never rendered for them). The three placeholder 
strings — **Original version / Created / Imported** — live in exactly one 
constant (`CREATION_LABELS`, display.ts) for the pending design copy (Figma 
2411-657); the API ships machine values only.
   
   **Known caveat**: baselines minted before this ships carry no provenance 
stamp and classify as `created`; pre-GA that is confined to staging/QA 
environments (recorded on the ticket).
   
   Review: three-lens adversarial cross-model round folded before opening 
(public-enum leak, atomic creation read, the preview affordance, gate wording).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: new/imported charts show "No history yet"; the pre-edit original is 
never a row. After: the timeline's oldest entry is Created / Original version / 
Imported, previewable and restorable. (Panel screenshots to follow from QA's TC 
re-runs.)
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/integration_tests/versioning/creation_row_tests.py` — new 
chart → one `created` row (oldest entry, count agrees, version_uuid matches the 
`/versions/` derivation); dashboard parity; re-baselined (pre-tracking) entity 
→ `pre_tracking` + the edit's own rows; `ACTION_KIND_IMPORT`-stamped INSERT → 
`imported`; pruned baseline → row omitted, count agrees; `include=related` → 
never synthesized.
   - `npm run test -- src/features/versionHistory/` — grouping (creation group 
formation, kind variants, announce routing keeps it out of the change list), 
display (labels + headline precedence), SaveGroupItem (preview action for chart 
+ dashboard starting groups by click and keyboard, current-version suppression, 
no leakage onto record-bearing groups).
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: sc-120488
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01JRLEJS4mUqKBoPjSjviKUW
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to