Skip to content
Open
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
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "3.2"
- name: "Test Ruby 3.1"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.1"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -126,12 +120,6 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "3.2"
- name: "Test Ruby 3.1"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.1"
yard: true
rubocop: true
build: true
Expand Down Expand Up @@ -193,12 +181,6 @@ jobs:
with:
gem: "${{ matrix.gem }}"
ruby: "3.2"
- name: "Test Ruby 3.1"
if: "${{ matrix.os == 'ubuntu-latest' }}"
uses: ./.github/actions/test_gem
with:
gem: "${{ matrix.gem }}"
ruby: "3.1"
yard: true
rubocop: true
build: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pull-requests: write # required for updating label on PR, posting comments
issues: write # required for creating new issues on failed releases
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-hook-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: write # required for pushing changes
pull-requests: write # required for updating open release PRs
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
permissions:
contents: write # required for creating releases
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
contents: write # required for pushing changes
pull-requests: write # required for creating release PRs
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
contents: write # required for pushing changes
pull-requests: write # required for creating release PRs
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-retry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
pull-requests: write # required for updating open release PRs
issues: write # required for creating new issues on failed releases
env:
ruby_version: "3.1"
ruby_version: "3.2"
runs-on: ubuntu-latest
steps:
- name: Install Ruby ${{ env.ruby_version }}
Expand Down
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,35 @@ For releases to succeed, new gems MUST include the following:
* A `CHANGELOG.md` file.
* A `yard` rake task.

## Updating Ruby version requirements

To update the minimum Ruby version requirement across all gems in the repository, use the `bin/update-ruby-version` script:

```console
# Update to Ruby 3.3 minimum
bin/update-ruby-version 3.3

# Supports patch versions and pre-releases
bin/update-ruby-version 3.2.0
bin/update-ruby-version 3.4.0.alpha
```

The script will:

1. Validate the version format
2. Update `spec.required_ruby_version` in all gemspec files
3. Show a summary of changes

After running the script:

1. Review changes with `git diff`
2. Test against the new minimum Ruby version
3. Update CI configurations in `.github/workflows`
4. Update `contrib/.rubocop.yml` to set the `TargetRubyVersion`
5. Remove any conditional logic handling Ruby versions in Appraisal files that are no longer needed
6. Remove any conditional logic in test cases that are no longer needed
7. Commit with a message like `chore: update minimum Ruby version to 3.3`

[cncf-cla]: https://identity.linuxfoundation.org/projects/cncf
[github-draft]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
[kube-github-workflow-pr]: https://github.com/kubernetes/community/blob/master/contributors/guide/github-workflow.md#7-create-a-pull-request
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for Ruby base image
ARG ALPINE_VERSION=3.21
ARG RUBY_VERSION=3.1.6
ARG RUBY_VERSION=3.2.8

FROM ruby:"${RUBY_VERSION}-alpine${ALPINE_VERSION}" as ruby

Expand All @@ -15,7 +15,7 @@ ARG APP_GROUP=app
ARG APP_DIR=/app

# Rubygems Bundler version
ARG BUNDLER_VERSION=2.0.2
ARG BUNDLER_VERSION=2.7.2

ENV SHELL /bin/bash

Expand Down
2 changes: 1 addition & 1 deletion api/opentelemetry-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'
spec.add_dependency 'logger'

spec.add_development_dependency 'benchmark-ipsa', '~> 0.2.0'
Expand Down
87 changes: 87 additions & 0 deletions bin/update-ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Script to update Ruby version requirements in all gemspecs
# Usage: bin/update-ruby-version [new_version]
# Example: bin/update-ruby-version 3.3

require 'fileutils'
require 'rubygems'

def update_gemspec_ruby_version(file_path, new_version)
content = File.read(file_path)

# Pattern to match existing inline version (supports alpha/beta/pre-release versions)
inline_pattern = /spec\.required_ruby_version = '>= [^']+'/
replacement = "spec.required_ruby_version = '>= #{new_version}'"

updated_content = content.gsub(inline_pattern, replacement)
File.write(file_path, updated_content)
end

def find_gemspecs_with_ruby_requirement
# Find all .gemspec files that contain inline Ruby version requirements
gemspec_files = Dir.glob('**/*.gemspec')

gemspec_files.select do |file|
content = File.read(file)
# Match inline version pattern (supports alpha/beta/pre-release versions)
content.match?(/spec\.required_ruby_version = '>= [^']+/)
end
end

# Main execution
def main
new_version = ARGV[0]

# Check if version parameter is provided
if new_version.nil? || new_version.empty?
puts 'Error: No Ruby version specified.'
puts
puts "Usage: #{$0} <new_ruby_version>"
puts 'Examples:'
puts " #{$0} 3.2"
puts " #{$0} 3.3"
puts " #{$0} 3.1.0"
puts
puts 'The version should be a valid Ruby version number (e.g., 3.2, 3.3, 3.4.0)'
exit 1
end

# Validate version format using Ruby's Gem::Version parser
begin
# Try to parse as a valid gem version (this will raise ArgumentError for malformed versions)
Gem::Version.new(new_version)
rescue ArgumentError => e
puts "Error: Invalid Ruby version format '#{new_version}'"
puts "Details: #{e.message}"
puts
puts 'The version must be a valid Ruby version number like:'
puts ' - 3.2'
puts ' - 3.3'
puts ' - 3.4.0.alpha'
puts ' - 3.3.0.beta1'
puts
puts "Usage: #{$0} <new_ruby_version>"
exit 1
end

puts "Updating Ruby version requirement to: >= #{new_version}"
puts 'Finding gemspec files...'

gemspec_files = find_gemspecs_with_ruby_requirement
puts "Found #{gemspec_files.length} gemspec files to update:"

gemspec_files.each do |file|
update_gemspec_ruby_version(file, new_version)
puts "Updated: #{file}"
end

puts "\nSummary:"
puts "- Total files found: #{gemspec_files.length}"
puts "- Successfully updated: #{gemspec_files.length}"

puts "\nDone! All gemspecs have been updated to require Ruby >= #{new_version}"
end

main if __FILE__ == $0
2 changes: 1 addition & 1 deletion common/opentelemetry-common.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.0'

Expand Down
2 changes: 1 addition & 1 deletion contrib/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins:
AllCops:
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: "3.1"
TargetRubyVersion: "3.2"
Exclude:
- "vendor/**/*"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'googleapis-common-protos-types', '~> 1.3'
spec.add_dependency 'google-protobuf', '~> 3.19'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'grpc'
spec.add_dependency 'opentelemetry-api', '~> 1.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.1'
spec.add_dependency 'opentelemetry-common', '~> 0.20'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'googleapis-common-protos-types', '~> 1.3'
spec.add_dependency 'google-protobuf', '>= 3.18'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'googleapis-common-protos-types', '~> 1.3'
spec.add_dependency 'google-protobuf', '>= 3.18', '< 5.0'
Expand Down
2 changes: 1 addition & 1 deletion exporter/otlp/opentelemetry-exporter-otlp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'googleapis-common-protos-types', '~> 1.3'
spec.add_dependency 'google-protobuf', '>= 3.18'
Expand Down
2 changes: 1 addition & 1 deletion exporter/zipkin/opentelemetry-exporter-zipkin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'csv', '~> 3.1'
spec.add_dependency 'opentelemetry-api', '~> 1.1'
Expand Down
2 changes: 1 addition & 1 deletion logs_api/opentelemetry-logs-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.0'

Expand Down
2 changes: 1 addition & 1 deletion logs_sdk/opentelemetry-logs-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.2'
spec.add_dependency 'opentelemetry-logs-api', '~> 0.1'
Expand Down
2 changes: 1 addition & 1 deletion metrics_api/opentelemetry-metrics-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.0'

Expand Down
2 changes: 1 addition & 1 deletion metrics_sdk/opentelemetry-metrics-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.1'
spec.add_dependency 'opentelemetry-metrics-api', '~> 0.2'
Expand Down
2 changes: 1 addition & 1 deletion propagator/b3/opentelemetry-propagator-b3.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.1'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.1'

Expand Down
2 changes: 1 addition & 1 deletion registry/opentelemetry-registry.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'opentelemetry-api', '~> 1.1'

Expand Down
2 changes: 1 addition & 1 deletion sdk/opentelemetry-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
::Dir.glob('*.md') +
['LICENSE', '.yardopts']
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 3.1'
spec.required_ruby_version = '>= 3.2'

spec.add_dependency 'logger'
spec.add_dependency 'opentelemetry-api', '~> 1.1'
Expand Down
Loading
Loading