fix: derive User-Agent version from pom at build time#72
Open
Gabrielpanga wants to merge 1 commit into
Open
Conversation
The User-Agent header was hardcoded to "PluggyJava/0.16.2" in two places
(PluggyClient.authenticate, ApiKeyAuthInterceptor.requestWithAuth) and
had drifted from the actual pom version (1.9.0). The API logs were seeing
the wrong client version since 0.16.2.
Maven resource filtering now injects ${project.version} into
pluggy-version.properties at build time. A new ai.pluggy.utils.Version
class loads it once and composes the User-Agent as
"PluggyJava/<version> (Java <java.version>)", which also exposes the
consumer's JVM version for support visibility.
The TOOD (sic) comment flagging this exact debt has been removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PluggyJava/0.16.2in bothPluggyClient.authenticateandApiKeyAuthInterceptor.requestWithAuth, stale against the actual pom version (1.9.0). API-side logs and analytics have been seeing the wrong SDK version.${project.version}into a newpluggy-version.propertiesat build time. Aai.pluggy.utils.Versionutility loads it once and exposesVersion.USER_AGENT.PluggyJava/<version> (Java <java.version>), giving the API visibility into both SDK and consumer JVM.// TOOD: add dynamic version(sic) note inApiKeyAuthInterceptorthat flagged this exact debt.Test plan
mvn -B test— 6/6 unit tests pass (4 existing + 2 new inVersionTest)mvn -B verify— 39 integration tests pass, 0 failurestarget/classes/pluggy-version.propertiescontainsversion=1.9.0after build (Maven filtering works as expected)VersionTest.sdkVersion_isResolvedFromPom_notTheLiteralPlaceholderguards against future filtering regressions