Skip to content

Survive TML spec drift in deploy and flag unparseable checkpoint exports - #338

Merged
jp-spotter merged 2 commits into
thoughtspot:devfrom
jp-spotter:fix/tml-drift-resilience
Aug 5, 2026
Merged

Survive TML spec drift in deploy and flag unparseable checkpoint exports#338
jp-spotter merged 2 commits into
thoughtspot:devfrom
jp-spotter:fix/tml-drift-resilience

Conversation

@jp-spotter

@jp-spotter jp-spotter commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

TS Cloud 26.7 added viz_style to the TML spec; no released thoughtspot_tml parses it (thoughtspot/thoughtspot_tml#40, same drift class as #29). Export writes raw edoc text and succeeds, so checkpoints from 26.5+ clusters produce files that crash every subsequent deploy with an unhandled TMLDecodeError before anything is sent.

Deploy now survives spec drift

  • Per-file parse failures are collected instead of raised. ALL_OR_NONE refuses up front (a partial set violates the policy; exit 1). PARTIAL / VALIDATE_ONLY proceed with the parseable set, report the skips, and exit 1.
  • When drift is the cause, the failure reason names the real fix: uses TML attributes newer than the installed thoughtspot_tml <version> (unrecognized attribute: 'viz_style').

Checkpoint flags the landmines at export time

  • Exports stay raw-text (never parse-then-dump — unknown attributes are never stripped). After writing, each edoc is parse-checked; unparseable files get a WARN naming object + attribute, plus a count summary. Files are kept and the exit code is unchanged.

Reporting is capped — first 5 failures in detail, then ..and N more, full list in the logfile. Live verification against a 26.7 cluster surfaced 223 drifted Liveboards out of 2,341.

Also: python -m cs_tools now exits with the command's return code__main__.py called run() without sys.exit(), so module-mode invocations always exited 0 regardless of failure. The console-script exe was never affected. Adds the suite's first process-level exit-code test (verified red before the fix).

Verified live against 26.7: landmine detection on genuine drift, VALIDATE_ONLY partial deploy + skip reporting (exit 1), ALL_OR_NONE pre-flight refusal before any API call (exit 1).


Side note: a fix in thoughtspot_tml itself is also in motion (spec regen against 26.7.x, tracked upstream in thoughtspot/thoughtspot_tml#40). Once a fixed release ships we'll bump the pyproject.toml floor in a follow-up — the hardening here covers the drift class regardless, including the next attribute the server adds.

@jp-spotter
jp-spotter requested a review from a team as a code owner August 5, 2026 19:45
@jp-spotter
jp-spotter merged commit 83ac048 into thoughtspot:dev Aug 5, 2026
3 checks passed
@jp-spotter
jp-spotter deleted the fix/tml-drift-resilience branch August 6, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant