Skip to content

Cover withServerWideTags directly and a valueless enabled: line - #28

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/server-wide-tag-merge-tests
Oct 23, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
feature/server-wide-tag-merge-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Stage B — unit-test expansion (the server-wide tag merge and the enabled: line reader). Test code only; no production change.

Summary

  • withServerWideTags_dropsNullTagsLetsTheEventWinAndNeverModifiesTheCallersMap: the helper's own Javadoc promises (null key/value counts as absent, the event's tag wins, the caller's map is untouched) were asserted only end to end, and its null-dropping cannot be reached through report() at all, because withVersion drops nulls first. The key order (event tags first, then server-wide) and an event with null tags are now pinned too.
  • withServerWideTags_addsNoneToAnEventAlreadyAtOrOverMaxTags: the cap was covered only for an event below MAX_TAGS. This pins that an event at the limit gains nothing, that one already over it (as withVersion produces today, see withVersion pushes an event already at MAX_TAGS over the server's tag limit #13) is neither trimmed nor grown, and that one short of it takes exactly the first server-wide tag.
  • serverWideConfig_aValuelessEnabledLineIsSkippedButACommentOnlyOneIsTheSwitch: a characterization test. A bare enabled: is passed over and a later enabled: false disables, but enabled: # ... captures #, becomes the switch, and a later enabled: false is ignored (fail-open). Filed as A comment-only enabled: line in the server-wide config shadows a later enabled: false #27 for a maintainer decision rather than changed here. The test pins the current behaviour and should be updated by whichever PR settles A comment-only enabled: line in the server-wide config shadows a later enabled: false #27.

Test plan

  • mvn -B verify locally on JDK 21: Tests run: 84, Failures: 0, Errors: 0, Skipped: 0 (81 before, 3 new)
  • CI matrix build (8), build (17), build (21) green on the PR head (only java.util.ArrayList is added, which is available on Java 8)

Deferred issues

No tracking issue for the coverage work. The gap was found during triage.

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

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

dmccoystephenson and others added 2 commits October 23, 2026 07:15
withServerWideTags drops null tags, lets the event's own tag win, keeps
event tags first, and never modifies the caller's map; none of that was
asserted on the helper itself, and its null-dropping cannot be reached
through report(). The cap is now also pinned for an event already at or
over MAX_TAGS. A bare "enabled:" is skipped while a comment-only one is
taken as the switch; the test pins that, and #27 asks whether it should.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (head bcc67be):

Finding fixed during review: TraceClientTest.java:400 had a characterization comment line that ran well past the file's usual comment width. It was reflowed in bcc67be.

Judgment call for the maintainer: TraceClientTest.java:407, the assertFalse(... "enabled: # set below", "enabled: false" ...) assertion, pins a fail-open behaviour on purpose. Whichever PR settles #27 (or #15, if the scalar() route is taken) is expected to flip it.

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


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 7d9f1ef into main Oct 23, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the feature/server-wide-tag-merge-tests branch October 23, 2026 13:18
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