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

Remove builds.json API endpoint #2198

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

Conversation

Nemo157
Copy link
Member

@Nemo157 Nemo157 commented Aug 26, 2023

I would have exact stats, but grafana is currently down 🙃. IIRC we went from ~100 req/min to somewhere around 1 req/hour. The major consumers crates.io and shields.io have definitely migrated, lib.rs is the other known consumer and @kornelski 👍'd my comment about migrating so I hope it has updated by now.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Aug 26, 2023
@syphar
Copy link
Member

syphar commented Sep 6, 2023

So, while it's true that we now get much less traffic on this endpoint, it's not zero.

grafik

I'm not sure if we now still should remove this endpoint, where it doesn't hurt (much) apart from the maintenance effort.

We could try to get access logs from CloudFront to get more information about the user agents on the remaining calls.

From what I understand the builds.json endpoint counts as a public API of docs.rs, so just removing it would break tooling?

What do you think @rust-lang/docs-rs ? Did we have breaking API changes like this in the past?

@syphar syphar added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Sep 6, 2023
@GuillaumeGomez
Copy link
Member

We did quite a few times, but it was years ago when it wasn't already part of rust-lang, so not sure it counts. It would be interesting to check the actual "users" of this endpoint before taking a decision I think.

@Nemo157
Copy link
Member Author

Nemo157 commented Sep 6, 2023

I'm not sure if we now still should remove this endpoint, where it doesn't hurt (much) apart from the maintenance effort.

I have future changes that would require breaking this endpoint, or making what it says about the crate not really match what we're storing about it.

@Nemo157
Copy link
Member Author

Nemo157 commented Sep 6, 2023

From what I understand the builds.json endpoint counts as a public API of docs.rs, so just removing it would break tooling?

I'm not sure if it is really a public API, I don't believe there's any documentation about it, we've just used it for integrations we at least partially manage like crates.io or shields.io.

@Nemo157
Copy link
Member Author

Nemo157 commented Sep 8, 2023

https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-cloudfront-announces-cache-and-origin-request-policies/ seems like it should support us forwarding the user-agent to the service, I'll see if I can figure out how this looks in terraform and open a PR.

@syphar syphar removed the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. label Oct 14, 2023
@Nemo157
Copy link
Member Author

Nemo157 commented Oct 16, 2023

We've had 20 requests so far since simpleinfra#344 was deployed, they appear to be a variety of desktop/mobile browser user-agents, so my best guess is there is some website/browser plugin that is doing the request client-side.

user agents
      3 Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0.1 Mobile/15E148 Safari/604.1
      1 Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/118.0.5993.69 Mobile/15E148 Safari/604.1
      1 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
      2 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
      7 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
      1 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
      2 Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0
      4 Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0

@Nemo157
Copy link
Member Author

Nemo157 commented Oct 16, 2023

I tried a github code search too, and didn't find anything relevant, just a bunch of docs.rs, crates.io and shields forks.

@syphar
Copy link
Member

syphar commented Oct 19, 2023

I had a chat with Tobias (crates.io) who in the end have a similar issue (private APIs that are publicly used).

To get more info I created rust-lang/simpleinfra#354 to be able to look into the Referer header for more information,

but currently I lean towards keeping the API alive it's not too much effort. From what I remember it would need generating the build_status boolean attribute based on our new status-enum, which is probably fine.
( I'm also happy to invest the work if needed).

@syphar syphar mentioned this pull request Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants