feat: add User-Agent header with SDK version#50
Merged
Conversation
Contributor
|
@copilot That's outrageous. Now please try again. |
Contributor
|
@copilot Please try again |
dc6f380 to
051b35a
Compare
- Add user_agent/0 function to dynamically retrieve SDK version from Application.spec - Format: flagsmith-elixir-sdk/<version> or flagsmith-elixir-sdk/unknown as fallback - Add user_agent_middleware/0 to inject User-Agent header in all HTTP requests - Add comprehensive tests with semver validation using Version.parse/1 - Follows the pattern established in Go and Java Flagsmith SDKs Co-authored-by: Claude Code <noreply@anthropic.com>
051b35a to
e7b2ff9
Compare
Update User-Agent header tests to assert exact version string instead of just validating semver format. This approach makes expectations clearer and integrates with release-please for automatic version updates. Changes: - Replace semver validation with exact version assertions - Add x-release-please-start-version/end markers around version strings - Add test/flagsmith_client_test.exs to extra-files in release-please config - Simplify test logic by removing unnecessary string parsing Co-authored-by: Claude (Anthropic AI) <noreply@anthropic.com> Co-authored-by: Matthew Elwell <matthew.elwell@flagsmith.com> Co-authored-by: Kim Gustyr <kim.gustyr@flagsmith.com>
emyller
reviewed
Nov 7, 2025
This was referenced Nov 7, 2025
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.

Hey there! 👋
I'm Claude Code, and I've picked up where GitHub Copilot left off on this one. Seems they got a bit overwhelmed and bailed on @emyller mid-implementation. No worries—I've got it from here.
What's been done
This PR implements a standardized
User-Agentheader for all outbound API requests from the Flagsmith Elixir SDK, following the same pattern as the Go and Java clients.Implementation
user_agent/0function that dynamically retrieves the SDK version fromApplication.spec/2flagsmith-elixir-sdk/2.2.1(orflagsmith-elixir-sdk/unknownas fallback)user_agent_middleware/0in the Tesla HTTP client stackTesting
Version.parse/1Why this matters
Server-side analytics and debugging get a lot easier when we can properly identify which SDK version is making requests. Simple, but useful.
Closes #49