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

publish-toolstate: show more context on HTTP error #75844

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Aug 23, 2020

The default display for HTTPError in Python does not include the request body. For GitHub API, the body includes more details about the error (like rate limiting). This could help diagnosing errors like this: #75815 (comment)

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2020
@Mark-Simulacrum
Copy link
Member

Can you confirm this doesn't leak the GitHub token or anything else like that? I suspect no, because it seems to just log the response which IIRC shouldn't contain anything - but would be good to confirm (just looking at what it typically prints is enough IMO).

r=me if so

@ehuss
Copy link
Contributor Author

ehuss commented Aug 23, 2020

Yea, the output is just the JSON object, which looks something like this:

HTTPError: HTTP Error 401: Unauthorized
b'{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}'

Another example (from the docs) would be:

HTTP/1.1 403 Forbidden
{
  "message": "Maximum number of login attempts exceeded. Please try again later.",
  "documentation_url": "https://developer.github.com/v3"
}

It does not include any http headers. I'm pretty sure the API never echoes any secrets. Additionally, I believe GitHub Actions (and Azure) have secret scrubbers in the log output which prevents things like GitHub tokens from being exposed.

@bors r=Mark-Simulacrum rollup

@bors
Copy link
Contributor

bors commented Aug 23, 2020

📌 Commit 2e6f2e8 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 23, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 24, 2020
…r=Mark-Simulacrum

publish-toolstate: show more context on HTTP error

The default display for HTTPError in Python does not include the request body. For GitHub API, the body includes more details about the error (like rate limiting). This could help diagnosing errors like this: rust-lang#75815 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 24, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#75819 (Use intra-doc-links in `core::{char, macros, fmt}`)
 - rust-lang#75821 (Switch to intra-doc links in `std::macros`)
 - rust-lang#75825 (Fix typo in documentation of i32 wrapping_abs())
 - rust-lang#75826 (Corrected Misleading documentation for derived Ord/PartialOrd implementation )
 - rust-lang#75831 (doc: Prefer https link for wikipedia URLs)
 - rust-lang#75844 (publish-toolstate: show more context on HTTP error)
 - rust-lang#75847 (Switch to intra-doc links in `std::collections`)
 - rust-lang#75851 (Switch to intra-doc links in `core::array`)
 - rust-lang#75856 (more tool clippy fixes)
 - rust-lang#75859 (doc: Fix typo in std::process::Child documentation)

Failed merges:

r? @ghost
@bors bors merged commit d6de961 into rust-lang:master Aug 24, 2020
@cuviper cuviper added this to the 1.47.0 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants