Skip to content

Conversation

@gcatanese
Copy link
Contributor

This pull request enhances the Adyen Python client library by adding support for specifying a custom application_name, which is now included in the User-Agent header for API requests.

The PR ensures that the User-Agent header is consistently set in all outgoing requests, it was actually left out. README has been updated too.

The most important changes are:

Client Initialization and User-Agent Handling:

  • Added an optional application_name parameter to the Adyen/client.py client, which, if set, is appended to the User-Agent string used in API requests. (Adyen/client.py)
  • The User-Agent header is now explicitly included in all API request headers, using the value from the HTTP client. (Adyen/client.py)

Documentation Updates:

  • Updated README.md to document the new application_name property and show its usage in various client instantiation examples.

Test Coverage:

  • New class HttpClientTest has been created to verify the behavior with and without application_name.
  • Existing tests have been updated (since User-Agent is now always included in the request).
  • test/BaseTest.py ensures the HTTP client is properly initialized in test setup.

@gcatanese gcatanese requested review from a team as code owners December 31, 2025 15:43
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gcatanese, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the Adyen Python client library by enabling developers to specify a custom application_name. This name is then incorporated into the User-Agent header of all outgoing API requests, providing enhanced visibility and traceability for applications interacting with the Adyen platform. The changes ensure consistent header usage, are well-documented, and are thoroughly tested to maintain reliability.

Highlights

  • application_name Support: Introduced an optional application_name parameter in the Adyen/client.py constructor, allowing developers to specify a custom identifier for their application.
  • Enhanced User-Agent Header: The User-Agent header in all outgoing API requests now consistently includes the library name and version, with the option to prepend the custom application_name for improved request traceability.
  • Documentation Updates: The README.md has been updated with clear examples demonstrating how to configure and utilize the new application_name property during client instantiation.
  • Comprehensive Test Coverage: New dedicated tests (test/HttpClientTest.py) have been added to verify the User-Agent header's composition, both with and without a custom application_name. Additionally, existing tests across various service modules were updated to assert the consistent User-Agent header.
  • Test Infrastructure Improvement: The test/BaseTest.py was updated to ensure the HTTP client is properly initialized before mocking in create_client_from_file, preventing potential test setup issues.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully adds support for application_name in the User-Agent header and ensures the header is consistently included in requests. The implementation is clean and the new functionality is well-tested. I've added a few suggestions to improve maintainability by reducing code duplication in the tests and removing a redundant line in the client implementation. Overall, this is a solid contribution.

@sonarqubecloud
Copy link

@gcatanese gcatanese merged commit 80cc46b into main Jan 2, 2026
7 checks passed
@gcatanese gcatanese deleted the user-agent-with-application-name branch January 2, 2026 12:31
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.

3 participants