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

Fix 2638: Use absolute URL for LICENSE/CHANGELOG in README #2682

Merged
merged 3 commits into from
Feb 19, 2025

Conversation

Shunpoco
Copy link
Contributor

Fixes #2638

Changes

Use absolute URL (for example, https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-proto/CHANGELOG.md) instead of a relative URL (./CHANGELOG.md).

I found that cargo.io treats a relative URL like <repository URL>/<commit and path in .cargo_vcs_info.json>/<the relative path>. So the relative path is converted like https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/blob/HEAD/opentelemetry-otlp/CHANGELOG.md. This causes 404 errors.

To solve this, we have two options:

  1. Use an absolute URL instead of a relative URL (this PR takes this option)
  2. Change repository URL to the root in each Cargo.toml (https://github.com/open-telemetry/opentelemetry-rust)
    • cargo.io treats the relative path like https://github.com/open-telemetry/opentelemetry-rust/blob/HEAD/opentelemetry-otlp/CHANGELOG.md, it is a valid URL
    • Because ./opentelemetry and ./opentelemetry-sdk do so, their crate page doesn't have 404s.

At first I thought to take the option 2, but I found this issue: rust-lang/crates.io#9939.
The issue is not the exact same as our pattern, but they also suffer that cargo.io doesn't treat a relative path as they expected. And the cargo.io maintainer says that developer should use an absolute URL. If we take the option 2, for now it fixes the problem but in the future if cargo.io team does some breaking changes, our URL may be broken again. So I took the first option.

NOTE: In my second commit, I changed homepage/repository URL on opentelemetry/opentelemetry-http/opentelemetry-sdk's Cargo.toml since they are inconsistent against other sub-dir. But technically this change is not related to #2638 .

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@Shunpoco Shunpoco requested a review from a team as a code owner February 18, 2025 23:47
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.1%. Comparing base (58c7644) to head (6974a0b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2682   +/-   ##
=====================================
  Coverage   79.1%   79.1%           
=====================================
  Files        122     122           
  Lines      22546   22546           
=====================================
+ Hits       17849   17853    +4     
+ Misses      4697    4693    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cijothomas cijothomas merged commit b5c9fdc into open-telemetry:main Feb 19, 2025
21 checks passed
@Shunpoco Shunpoco deleted the issue-2638-fix-404-links branch February 19, 2025 07:29
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.

Changelog in crates.io points to 404
2 participants