• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lfit / releng-gerrit_to_platform / 25802813140

13 May 2026 01:17PM UTC coverage: 92.883% (+0.08%) from 92.806%
25802813140

push

github

ModeSevenIndustrialSolutions
Feat(logging): Add centralised logging framework

Adds gerrit_to_platform._logging, an opt-in logging framework
configured via G2P_LOG_* environment variables or a new [logging]
section in gerrit_to_platform.ini.  The framework owns every
handler, formatter and filter; modules obtain loggers through a
single get_logger() helper.

Default behaviour is unchanged (WARNING to stderr) so existing
deployments at gerrit.linuxfoundation.org continue to behave as
they do today.  Verbose diagnostics, JSON output and a secondary
file sink are purely additive and operator-controlled.

Each hook invocation carries a short URL-safe correlation id
attached to every record as cid=...; an enclosing wrapper (e.g.
the gerrit-action hook wrapper) may seed the id by exporting an
environment variable named in correlation_id_env so the same id
appears in both the wrapper log and the package log.

Hook entry-points (patchset-created, comment-added, change-merged)
now call configure() and emit a structured trace covering hook
entry, event-parse, platform detection, workflow lookup, dispatch
attempt, dispatch result and exit (with elapsed_ms).  The github
client wrapper logs every dispatch and workflows-list call with
timing and outcome.  User-facing print() calls remain in place and
run parallel to the new logging stream.

A RedactingFilter is attached to every handler installed by
configure() and scrubs GitHub token shapes (gh[posr]_...),
Authorization headers, ?token= query-string parameters and
labelled token=/secret=/password= values.  Coverage in
tests/test_logging.py asserts no synthetic token reaches a
handler verbatim, plus precedence (env over INI), idempotent
configure(), broken-file-sink fallback, JSON formatter shape and
schema_version, and per-logger overrides.

The ephemeral gerrit-action and test-deploy-gerrit container
deployments need this so operators can extract per-event traces
from short-lived Docker / GitHub-Actions sandboxes where the only
post-mortem a... (continued)

249 of 274 new or added lines in 6 files covered. (90.88%)

14 existing lines in 2 files now uncovered.

522 of 562 relevant lines covered (92.88%)

0.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/gerrit_to_platform/patchset_created.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc