Skip to content
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

Add User Agent info to server events #9154

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

azhavoro
Copy link
Contributor

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@azhavoro azhavoro requested a review from SpecLad as a code owner February 27, 2025 09:54
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.32%. Comparing base (0d8aaf6) to head (7ed9dc7).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9154   +/-   ##
========================================
  Coverage    73.32%   73.32%           
========================================
  Files          448      448           
  Lines        45862    45867    +5     
  Branches      3914     3914           
========================================
+ Hits         33628    33633    +5     
  Misses       12234    12234           
Components Coverage Δ
cvat-ui 77.08% <ø> (ø)
cvat-server 70.32% <100.00%> (+<0.01%) ⬆️

Comment on lines 49 to +50
request_id: Optional[str],
user_agent: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you merge these into a single parameter (taking a compound object)? Seems like it would be more robust to pass request information as a single parameter, instead of deciding for every call whether the user agent is needed or not.

**payload,
"request": {
**payload.get("request", {}),
"id": request_id,
"user-agent": user_agent,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"user-agent": user_agent,
"user_agent": user_agent,

(I'm pretty sure we're using snake_case in these fields... see working_time.)

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