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

Include source_code_uri in gemspec, version changelog_uri #3701

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion datadog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Gem::Specification.new do |spec|

if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
spec.metadata['changelog_uri'] = 'https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md'
spec.metadata['changelog_uri'] = "https://github.com/DataDog/dd-trace-rb/blob/v#{spec.version}/CHANGELOG.md"
spec.metadata['source_code_uri'] = "https://github.com/DataDog/dd-trace-rb/tree/v#{spec.version}"
else
raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
end
Expand Down
23 changes: 23 additions & 0 deletions spec/datadog/release_gem_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,28 @@
expect(gemspec.licenses).to contain_exactly('BSD-3-Clause', 'Apache-2.0')
end
end

describe '#metadata' do
it do
{
'changelog_uri' => "https://github.com/DataDog/dd-trace-rb/blob/v#{gemspec.version}/CHANGELOG.md",
'source_code_uri' => "https://github.com/DataDog/dd-trace-rb/tree/v#{gemspec.version}"
}.each do |key, value|
expect(gemspec.metadata[key]).to eq(value)
end
end

# `allowed_push_host` is overwritten by automated scripts
# in order to publish to another destination repository.
context 'allowed_push_host' do
it { expect(gemspec.metadata).to have_key('allowed_push_host') }

it do
expect(gemspec.metadata['allowed_push_host'])
.to eq('https://rubygems.org')
.or eq('https://rubygems.pkg.github.com/DataDog')
end
end
end
end
end
Loading