Skip to content

A comment-only enabled: line in the server-wide config shadows a later enabled: false #27

Open

Description

@dmccoystephenson

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):

The current behaviour is pinned by the characterization test serverWideConfig_aValuelessEnabledLineIsSkippedButACommentOnlyOneIsTheSwitch, added in the Stage B test-expansion PR from the same session.

This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Activity

  1. added 2 commits that reference this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions