Skip to content

Remove builds.json API endpoint #2198

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

Merged
merged 1 commit into from
May 16, 2025
Merged

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
@syphar syphar added S-waiting-on-author Status: This PR is incomplete or needs to address review comments and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Nov 6, 2024
@syphar syphar removed their request for review November 6, 2024 05:45
@syphar
Copy link
Member

syphar commented Nov 6, 2024

This is blocked on

  • rebase
  • checking who still requests the old API based on the referrer

@syphar
Copy link
Member

syphar commented May 16, 2025

we just checked the access logs for referrers.

example line:

"GET /crate/bitfun_plugin_api/0.37.4/builds.json HTTP/1.1" 
404 
5166 
"https://rust.inhuawei.com/" 
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"

So the only service requesting this endpoint is https://rust.inhuawei.com/, some internal Huawei service (?), and it's only requesting crates / versions docs.rs doesn't have (all are 404s). cc @GuillaumeGomez ? ;)

So we will drop the endpoint.

@Nemo157 Nemo157 force-pushed the remove-build-api branch from b6eb25f to 5c95717 Compare May 16, 2025 09:14
@Nemo157 Nemo157 requested a review from a team as a code owner May 16, 2025 09:14
@github-actions github-actions bot added S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels May 16, 2025
@Nemo157 Nemo157 force-pushed the remove-build-api branch from 5c95717 to 289033d Compare May 16, 2025 09:26
@syphar syphar merged commit 7ba7591 into rust-lang:master May 16, 2025
9 checks passed
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels May 16, 2025
@GuillaumeGomez
Copy link
Member

Yep it's fine. Never heard about it so I guess it's fine.

@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label May 22, 2025
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