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

Use pants as the user-agent instead of the default (python-requests). #8077

Merged
merged 1 commit into from Jul 20, 2019

Conversation

@asherf
Copy link
Contributor

commented Jul 19, 2019

Problem

When calling the report server, pants leveraging the python requests is using the default user agent (for example: "python-requests/2.22.0")
This is not optimal, the user-agent should more actuarially reflect the software making the HTTP call

Solution

Use pants as the user-agent, adding the pants version as part of the user-agent header.

Result

"Pants/v1.18.0rc0"

@asherf asherf force-pushed the asherf:user-agent branch from 7da7a23 to 218adbb Jul 19, 2019

@Eric-Arellano
Copy link
Contributor

left a comment

Sounds reasonable! Thank you for contributing to Pants :)

Once you make the changes, we'll guide it through CI. We unfortunately have a few flaky tests so it's likely that some shards will fail unrelated to this change. If we don't get to restarting those, please feel free to comment on this to remind us.

src/python/pants/goal/run_tracker.py Outdated Show resolved Hide resolved
src/python/pants/goal/run_tracker.py Outdated Show resolved Hide resolved
tests/python/pants_test/goal/test_run_tracker.py Outdated Show resolved Hide resolved
tests/python/pants_test/goal/test_run_tracker.py Outdated Show resolved Hide resolved
src/python/pants/goal/run_tracker.py Outdated Show resolved Hide resolved
src/python/pants/goal/run_tracker.py Outdated Show resolved Hide resolved

@asherf asherf force-pushed the asherf:user-agent branch from 84ab388 to e07d2c7 Jul 20, 2019

@asherf asherf referenced this pull request Jul 20, 2019
@Eric-Arellano
Copy link
Contributor

left a comment

Looks good! Thank you!

This will fail the lint check though, due to import ordering. Run build-support/bin/isort.sh -f to fix it, followed by build-support/githooks/pre-commit to ensure this passes the linter and all.

@codealchemy
Copy link
Contributor

left a comment

👍

@asherf asherf force-pushed the asherf:user-agent branch from e07d2c7 to 7487bb4 Jul 20, 2019

Eric-Arellano added a commit that referenced this pull request Jul 20, 2019

@Eric-Arellano Eric-Arellano merged commit 929474c into pantsbuild:master Jul 20, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

Eric-Arellano added a commit that referenced this pull request Jul 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.