Skip to content

fix(backend): write full ODM note only on first column, short marker on the rest#1264

Merged
laskevych merged 1 commit into
mainfrom
backend/gs-export-column-notes
Jun 2, 2026
Merged

fix(backend): write full ODM note only on first column, short marker on the rest#1264
laskevych merged 1 commit into
mainfrom
backend/gs-export-column-notes

Conversation

@laskevych

@laskevych laskevych commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Preview

CleanShot 2026-06-01 at 18 22 09

Summary

When a Data Mart is imported into a Google Sheet, the full "Imported via OWOX
Data Marts" provenance block (timestamp, Data Mart name, Data Mart page link)
was duplicated into the note of every column header. Combined with the
per-column description, this buried the user's own column descriptions under
repeated technical metadata.

This change keeps the ODM ownership signal on every imported column while
showing the full metadata block only once:

  • First column of the range (A1): full note — the column description, a
    blank line, then the ODM metadata block (--- Imported via OWOX Data Marts ---,
    import timestamp, Data Mart name, Data Mart page link).
  • All other columns: only the short marker --- Imported via OWOX Data Marts ---,
    enough to show the column is ODM-managed without repeating the metadata.
  • Joined / blended Data Marts: A1 references only the main (Original/Home)
    Data Mart. This already held — report.dataMart is always the main mart, and
    joinable marts only affect the column alias, never the note — and is now
    documented in the writer.

Changes

  • sheet-metadata-formatter.ts
    • Add buildImportedColumnMarker(isCommunityEdition) returning the short marker.
    • Extract private buildOdmMarker() so the full note and the short marker
      read identically.
    • Restructure buildImportedColumnNote(): the marker is now the header line
      of the metadata block (Imported at <timestamp> instead of
      Imported via OWOX Data Marts at <timestamp>), and the description is
      separated from the block by a blank line so the two never read as one
      paragraph.
  • google-sheets-report-writer.ts
    • In writeHeaders(), branch on idx === 0: the first column gets the full
      note, every other column gets the short marker.

Notes

  • The change only affects the text of the notes. ODM-owned-column
    detection and imported-range delineation rely on developer metadata
    (OWOX_COLUMNS / OWOX_REPORT_META), not on note text, so behavior is
    unaffected.
  • Existing sheets keep their old per-column notes until the next refresh, which
    rewrites all header notes — they self-heal on the next import.

Testing

  • Updated sheet-metadata-formatter.spec.ts for the new note format and added
    coverage for buildImportedColumnMarker.
  • Added a writer test asserting exactly one full note (A1) + N−1 short markers.
  • All 29 tests pass; lint clean on the changed files.

DoD

  • A1 of the Data Mart range carries the full note: column description + ODM
    metadata block (timestamp, Data Mart name, Data Mart page link)
  • Other columns of the range carry only the short marker
    (--- Imported via OWOX Data Marts ---)
  • For joined Data Marts, A1 references only the main (Original/Home) Data
    Mart, without joinable marts
  • Column description is visually separated from the ODM marker (blank line
    between them)

@laskevych laskevych self-assigned this Jun 1, 2026
@laskevych laskevych added enhancement New feature or request GoogleSheets labels Jun 1, 2026
@laskevych laskevych merged commit 0e35f84 into main Jun 2, 2026
11 of 13 checks passed
@laskevych laskevych deleted the backend/gs-export-column-notes branch June 2, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request GoogleSheets

Development

Successfully merging this pull request may close these issues.

2 participants