fix: set User-Agent header to qase-api-client-python/<version>#472
Merged
fix: set User-Agent header to qase-api-client-python/<version>#472
Conversation
The Qase backend uses /qase-api-client[\w-]*/i regex to classify SDK requests by source. The auto-generated API clients defaulted to 'OpenAPI-Generator/1.0.0/python' which does not match. Update both qase-api-client (V1) and qase-api-v2-client (V2) to set User-Agent to 'qase-api-client-python/<version>' where version is resolved dynamically via importlib.metadata.
51f584c to
b8a94c8
Compare
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
User-Agentheader toqase-api-client-python/<version>on both V1 and V2 API clients so the Qase backend can correctly classify Python SDK requests via its/qase-api-client[\w-]*/iregexhost_data['commons']withimportlib.metadatafallbackChanged files
qase-python-commons/src/qase/commons/client/api_v2_client.py— added_get_commons_version()helper and User-Agent assignment in_add_client_headers()qase-python-commons/tests/tests_qase_commons/test_user_agent.py— new test fileTest plan