Skip to content

Add user agent config bit and set it for GH actions #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 10, 2025

Conversation

jeandet
Copy link
Member

@jeandet jeandet commented Jun 10, 2025

This pull request introduces a new configuration option for setting a custom HTTP user agent in the speasy package. The changes ensure that the user agent can be customized for HTTP requests, improving identification and compatibility for specific use cases. Updates were made across configuration files and core functionality.

Configuration Updates:

  • .github/workflows/PRs.yml and .github/workflows/tests.yml: Added the SPEASY_CORE_HTTP_USER_AGENT environment variable to define a custom user agent for GitHub Actions workflows. [1] [2]
  • speasy/config/__init__.py: Introduced a new configuration entry http_user_agent with a default value and description, allowing users to set a custom user agent for HTTP requests.

Core Functionality Updates:

  • speasy/core/http.py: Updated the USER_AGENT variable to use the custom value from core_config.http_user_agent if set; otherwise, it defaults to the existing user agent format.

jeandet added 2 commits June 10, 2025 09:49
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
@jeandet jeandet requested review from brenard-irap and Copilot June 10, 2025 07:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new configuration option for setting a custom HTTP user agent in the speasy package to improve identification and compatibility in HTTP requests. It updates core HTTP functionality, configuration definitions, and GitHub Actions workflows to support the new environment variable.

  • Introduces a new configuration entry, http_user_agent, in speasy/config/init.py
  • Updates USER_AGENT initialization in speasy/core/http.py to use the custom configuration if provided
  • Adds SPEASY_CORE_HTTP_USER_AGENT environment variable in GitHub Actions workflows for tests and PRs

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
speasy/core/http.py Updates the USER_AGENT variable to use the optional http_user_agent
speasy/config/init.py Adds a new config entry for the HTTP user agent with default and description
.github/workflows/tests.yml Introduces SPEASY_CORE_HTTP_USER_AGENT environment variable
.github/workflows/PRs.yml Introduces SPEASY_CORE_HTTP_USER_AGENT environment variable

Copy link

@jeandet
Copy link
Member Author

jeandet commented Jun 10, 2025

Works as expected:
image

Copy link
Collaborator

@brenard-irap brenard-irap left a comment

Choose a reason for hiding this comment

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

image

@jeandet jeandet merged commit dfebdc3 into SciQLop:main Jun 10, 2025
19 of 23 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.

None yet

2 participants