rust-lang / docs.rs

crates.io documentation generator
https://docs.rs
MIT License
989 stars 198 forks source link

show CDN invalidation status in release-pages #1877

Closed syphar closed 1 year ago

syphar commented 2 years ago

This is a follow-up to #1552.

According to the Cloudfront documentation invalidations can take up to 15 minutes. Our tests showed around 10-13 minutes.

This can be confusing especially for crate maintainers (but also for users) since the build is finished and is shown on the release-page, while /latest/ URLs can still show the old release. URLs with the specific version in them will directly work.

So we should show an icon / a text for releases on the release-lists that tells us if there is a pending cloudfront invalidation for this crate.

A simple solution would be to just show the deploying marker when there is any finished build younger than 15 minutes for this crate. Caveat: this won't be 100% correct for yanks.

Another solution would be to use the CloudFront ListInvalidations API to get active invalidations, then parse the crate-name out of the paths in that invalidation, and mark the affected crates from these.

syphar commented 2 years ago

cc @jyn514 @jsha if you have anything to add

Nemo157 commented 2 years ago

I was wondering if this might have some overlap with UI for #826, but no I think that would just maybe add a similar icon on the queue-page showing the currently building crate and not impact the releases-page.

(Caching and invalidation as a whole probably affects it and means we wouldn't want to add any UI for it to the main crate page since it would normally not even be invalidated before the build completes and starts another invalidation).

syphar commented 2 years ago

short update:

I lean towards starting with a simple visual marker <20 minutes after the build is finished

syphar commented 2 years ago

while thinking more I'm jumping back and forth between solutions using the actual invalidation status and the workaround.

We'll probably need some more sophisticated logic when we hit quotas (#1871) , and/or some monitoring around the parallel invalidation requests.

syphar commented 1 year ago

Since #1961 we show the actual in-progress invalidations on our build-queue page.

Coming from the original motivation of this issue, I'll close it now.

If we feel like we want to show a status on other release pages we can revisit this topic.