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

Append "cwltool" to HTTP User-Agent string #1977

Merged
merged 15 commits into from
Feb 28, 2024

Conversation

svonworl
Copy link
Contributor

Hi, my name is Steve, and I'm an engineer on the Dockstore team. This PR appends the string "cwltool" to the User-Agent string of all cwltool HTTP requests issued via the requests package, so it looks like:

python-requests/2.31.0 cwltool

This PR would allow us to differentiate cwltool traffic from other Dockstore traffic that originates from the requests package. After this change, we'd be able to track cwltool usage and handle its requests more appropriately. For example, it'd be more feasible for us to filter a DOS attack and not affect cwltool traffic, or to tweak our webservice with a cwltool-specific accommodation.

@mr-c
Copy link
Member

mr-c commented Feb 22, 2024

Thanks for your PR @svonworl . There are several other CWL runners that reuse this code. Would you prefer they use their own program name, or should we stick to cwltool only, or also append their name?

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 83.80%. Comparing base (814d6d1) to head (7bbace0).

Files Patch % Lines
cwltool/main.py 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1977   +/-   ##
=======================================
  Coverage   83.80%   83.80%           
=======================================
  Files          46       46           
  Lines        8235     8245   +10     
  Branches     2187     2190    +3     
=======================================
+ Hits         6901     6910    +9     
  Misses        858      858           
- Partials      476      477    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@svonworl
Copy link
Contributor Author

Thanks for your PR @svonworl . There are several other CWL runners that reuse this code. Would you prefer they use their own program name, or should we stick to cwltool only, or also append their name?

Hi @mr-c, it'd be great if cwltool was always in the string, after which the other CWL runners could append their name (ex: python-requests/2.31 cwltool other-runner. That way, it'd be apparent that the queries are cwltool-based and we'd also be able to differentiate the various runners.

@mr-c mr-c enabled auto-merge (squash) February 26, 2024 18:03
auto-merge was automatically disabled February 27, 2024 19:11

Head branch was pushed to by a user without write access

@svonworl
Copy link
Contributor Author

Looks like one of the checks failed, could it be a test flake? I can't see anything in the PR that would've broken it...

Should work for calrissian, reana-cwl-runner, and arvados-cwl-runner, but not
toil-cwl-runner which doesn't call the cwltool.main.main() function.

Probably works for streamflow, but I haven't tested that.
@mr-c mr-c enabled auto-merge (squash) February 28, 2024 11:23
@mr-c mr-c merged commit ca16314 into common-workflow-language:main Feb 28, 2024
45 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.

2 participants