Skip to content

Keep the install ID in a file for programs that are not plugins (0.6.0) - #10

Merged
dmccoystephenson merged 1 commit into
mainfrom
install-id-file
Oct 3, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
install-id-file

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Parity with trace-client-python/-js/-csharp/-cpp for programs that are not Spigot plugins: the per-installation ID can now be kept in a file the program names, resolved by the client after its opt-outs.

  • Builder.installIdFile(File) — resolved in build() only when the client is enabled, after the environment, server-wide, config and key checks. The first line matching [A-Za-z0-9_.-]{1,255} (whitespace trimmed) is used. A missing file, or one with no such line, gets a new random UUID written to it (parent directories created). A file that exists but cannot be read yields an in-memory ID and is left untouched; a failed write yields an in-memory ID; build() never throws. Fallbacks are logged at FINE.
  • Precedence (documented in the Javadoc and README): explicit installId(...) > installIdFile(...) > the server-wide server-id:. When a file is given alongside serverWideConfig(...), the server-wide file still supplies enabled: and tags: but gains no server-id: line.
  • TraceClient.installIdFromFile(File) — the same load-or-create step as a static helper, with the README/Javadoc warning the other clients carry: called directly, it writes whatever the opt-outs say.
  • 0.6.0: VERSION, file header, pom.xml, README dependency snippet.
  • Tests (mirroring the python/js suites): created once with parent dirs and reused; first valid line read and file never rewritten; file with no valid line replaced; unwritable path → in-memory ID, logged, nothing created; unreadable file (a directory) left alone; bad paths (null, blank, NUL) never throw; every opt-out leaves the directory empty; precedence explicit > file > server-wide. mvn -B verify passed locally on JDK 17 (62 tests, release 8).

🤖 Generated with Claude Code

https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL


drafted by Claude on behalf of Daniel Stephenson

Builder.installIdFile(File) resolves the installation's ID in build(),
after every opt-out, the same way the python/js/csharp/cpp clients do:
the first line matching [A-Za-z0-9_.-]{1,255} is used; a missing file or
one with no such line gets a fresh UUID (parent directories created); an
unreadable file or a failed write yields an in-memory ID and the file is
left untouched; build() never throws. Precedence: installId(...) >
installIdFile(...) > the server-wide server-id:. The static
installIdFromFile(File) exposes the same step, with the README warning
that it writes even when reporting is off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
@dmccoystephenson
dmccoystephenson merged commit ee16438 into main Oct 3, 2026
3 checks passed
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