open-telemetry / opentelemetry-ruby

OpenTelemetry Ruby API & SDK, and related gems
https://opentelemetry.io/
Apache License 2.0
469 stars 230 forks source link

API reference "latest" pages should yield HTTP status 301 not 404 #1435

Open chalin opened 1 year ago

chalin commented 1 year ago

Visit one of the API reference pages and you'll initially get a 404, for example opentelemetry-sdk/latest:

$ curl -I https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-sdk/latest
HTTP/2 404 

If you open the same link in a browser, then the page redirects because it contains JS code that manipulates the window location to refer to the latest version of the appropriate Gem.

Since API reference pages get redirected the proper HTTP status returned should be 301, not 404. Otherwise, that's bad for SEO and for link checkers -- e.g., see https://github.com/open-telemetry/opentelemetry.io/pull/2505/files#r1135889989.

/cc @cartermp @svrnm

arielvalentin commented 1 year ago

I am not sure why it is hosted on github.io since it is available when we publish libraries here: https://www.rubydoc.info/gems/opentelemetry-sdk

cartermp commented 1 year ago

TIL! Let's update the docs site to point there for the API link too

cartermp commented 1 year ago

Submitted https://github.com/open-telemetry/opentelemetry.io/pull/2508

cartermp commented 1 year ago

I think we can consider this closed since we'll use the rubydoc link now.

chalin commented 1 year ago

We might have more to discuss, see:

Also, having the same content in two places, isn't a good idea for SEO etc. My guess is that GH pages is used for dev versions of the API reference? If not, and it's the same as rubydoc.info, then maybe it's time to drop the GH pages?

At a minimum, the GH pages should all probably be marked noindex, nofollow, and in addition have an appropriate robots.txt file.

ahayworth commented 1 year ago

The one nice thing that the GH pages version gives us is index page with links to all the docs: https://open-telemetry.github.io/opentelemetry-ruby/

It would be kinda nice to keep that somehow. But otherwise yeah - I don't really see a huge need to keep hosting these on GH pages. Does anyone else even do that?

That said - I'm really not sure exactly how these are getting generated today. I think it's a GitHub integration but because I'm only an approver on this repo, I can't actually see that. Maybe someone like @mwear with more admin privileges can check the settings pages and see if there's a github pages integration installed?

(For what it's worth, the custom code that redirects can be found here on the gh-pages branch)

github-actions[bot] commented 3 months ago

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

svrnm commented 3 months ago

is this issue still a thing?

chalin commented 3 months ago

Yes it is. The URL in the opening comment still returns 404. I haven't investigated if the same content in two places issue is still relevant.

svrnm commented 3 months ago

Yes it is. The URL in the opening comment still returns 404. I haven't investigated if the same content in two places issue is still relevant.

https://www.rubydoc.info/gems/opentelemetry-api and https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v1.2.5/

still look very similar to me, so I guess there are still both places.

svrnm commented 3 months ago

The one nice thing that the GH pages version gives us is index page with links to all the docs

We can have some of that on opentelemetry.io I guess:

github-actions[bot] commented 2 months ago

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

chalin commented 2 months ago

This is still relevant.

github-actions[bot] commented 1 month ago

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

chalin commented 1 month ago

This is still relevant.

chalin commented 1 month ago

Can a maintainer add the keep label? /cc @svrnm

github-actions[bot] commented 9 hours ago

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.