You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A comment-only enabled: line in the server-wide config shadows a later enabled: false #27
An enabled: line in plugins/trace/config.yml whose value is only a comment is treated as the switch, so a later enabled: false is ignored and reporting stays on. A bare enabled: with no comment is treated differently: it is skipped, and a later line becomes the switch.
Where:src/main/java/software/stephenson/trace/TraceClient.java. ENABLED_LINE is ^\s*enabled\s*:\s*(\S+), and parseServerWideConfig keeps the first match as the switch (if (disables == null)).
enabled: followed by enabled: false: the first line does not match (\S+ needs a character), so the second line is the switch and reporting is off.
enabled: # set below followed by enabled: false: the first line matches with the capture #. isOff("#") is false, so the first line is the switch, the second is never consulted, and reporting stays on.
Unlike the tags: block and server-id:, the enabled: value is not passed through scalar(), which would strip the trailing comment and return null for a comment-only value. Issue #15 (quoted values) comes from the same missing step, so a fix for one would probably settle both.
Why it matters: this is the server-wide opt-out, and the case fails open. The Javadoc of parseServerWideConfig says "The first enabled: line outside a tags: block is the switch", but a comment-only value and a missing value behave differently today. Admittedly, two enabled: lines in one file is an unusual edit.
Options for the maintainer (this touches the opt-out contract, so it needs a human decision):
keep the behaviour and make the Javadoc say which enabled: lines count.
The current behaviour is pinned by the characterization test serverWideConfig_aValuelessEnabledLineIsSkippedButACommentOnlyOneIsTheSwitch, added in the Stage B test-expansion PR from the same session.
Activity
Reflow the #27 characterization comment to the file's width
Cover withServerWideTags directly and a valueless enabled: line (#28)