Skip to content

v0.63.1.x

@github-automation-metabase github-automation-metabase tagged this 29 Jul 01:11
Audit log statements (#78841)

* Audit log statements: no stack traces, no queries/user input, no pretty-printing

- Replace throwable args to log macros with (ex-message e) so ex-data and
  stack traces never reach the logs (~450 sites)
- Remove SQL/MBQL queries, prepared-statement params, HTTP request/response
  bodies, PII, and user-authored names from log output (IDs kept)
- Replace u/pprint-to-str in log calls with pr-str, or drop the value
- Silence sqlglot parser warnings in the GraalPy bootstrap (they quote raw
  chunks of customer SQL to stderr)
- Rewrite leftover functional colors (hsl/hsla/rgb/rgba) to hex in static-viz
  SVG output so Batik never errors (and stack-dumps) on them



* Use logf variants for exception messages; restore serdes --full-stacktrace

- Convert print-style `(log/warn "msg:" (ex-message e))` calls to
  `(log/warnf "msg: %s" (ex-message e))`
- Serdes import/export logs the full stack trace again when the
  --full-stacktrace CLI option / full_stacktrace API param is passed



* Update swap-clauses tests for clause-free warning messages



* Update log-content test assertions for the new logging policy

Log calls no longer attach throwables (entries have :e nil) and append
ex-message text to the message instead; body/secret leak tests now assert
the payload never appears in log output.



* Address review comments

- rethrow-api-error!: update docstrings — response body is never logged,
  it travels on the thrown ex-data
- expand-macros: log the segment filter-clause count once instead of an
  identical trace line per clause
- settings cache: log the whole SQLException message chain (the old
  print-sql-exception-chain walked .getNextException; ex-message alone
  dropped the chained causes)



---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Assets 2
Loading