feat: Add commit id into source code url of gem metadata#1984
feat: Add commit id into source code url of gem metadata#1984thompson-tomo wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
|
Would using tags instead of SHA be a better user experience? |
|
Both achieve the same result and experience, tags are nicer for users using github but we would need to extend the CI to be adding tags and using them. The nice thing about commits is that they are always available to both ci/users and can not be tampered with. |
45fe33e to
b9cca80
Compare
|
We talked about this in the SIG this week, and there seemed to be a preference to use the release tags. The reasons, besides the fact that URLs are more comprehensible as being tied to a specific release version, are:
The downsides of using a tag are:
In my judgment, those are less compelling concerns. The release tag name is straightforward to compute: |
|
The problem you run into with using spec to compute the tag is local development would be generating invalid/untestable urls.
It should be pointing to the sha of the commit used in the release hence shouldn't be different.
If you want This can be addressed by setting an environment variable as part of the rake task and then using this variable.
|
b9cca80 to
804fc04
Compare
804fc04 to
ba9252b
Compare
True. However, we're already generating invalid/untestable URLs in two other 🤔 Until we've got link-liveness-checking of these package metadata URLs included in our test suite—which, again, won't work for docs links until after a version is released—I'm in favor of interpolating the tag name: - …/opentelemetry-ruby-contrib/tree/main/instrumentation/<cool-gem-name>'
+ …/opentelemetry-ruby-contrib/tree/#{spec.name}/v#{spec.version}/instrumentation/<cool-gem-name>' |
Closes #1961
This tweaks the gemspec files so that the source code url now contains the commit which generated the gem. By including this commit id, we can as part of deprecation work remove the source files while having atleast the latest published version of gem pointing to the code used and a readme containing the deprecation
Note the only other change was to update
resources/aws/opentelemetry-resource-detector-aws.gemspecso that it was the same metadata as the other gems.