Skip to content

Commit

Permalink
Deprecate gamesparks (again - new approach)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Oct 17, 2023
1 parent 86c691f commit 816a0aa
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Service
# @option options [Hash<gem,version>] :gem_dependencies ({})
# @option options [Hash] :add_plugins ({})
# @option options [Hash] :remove_plugins ([])
# @option options [Boolean] :deprecated (false)
def initialize(options)
@name = options.fetch(:name)
@identifier = name.downcase
Expand Down Expand Up @@ -57,6 +58,7 @@ def initialize(options)
@require_endpoint_discovery = api.fetch('operations', []).any? do |_, o|
o['endpointdiscovery'] && o['endpointdiscovery']['required']
end
@deprecated = options[:deprecated] || false
end

# @return [String] The service name, e.g. "S3"
Expand Down Expand Up @@ -146,6 +148,11 @@ def included_in_core?
# @return [Boolean] true if any operation requires endpoint_discovery
attr_reader :require_endpoint_discovery

# @return [Boolean] true if the service is deprecated
def deprecated?
@deprecated
end

# @api private
def inspect
"#<#{self.class.name}>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def description
if @service.short_name != @service.full_name
abbreviation = " (#{@service.short_name})"
end
desc = "Official AWS Ruby gem for #{@service.full_name}#{abbreviation}. "
desc = ''
desc += '[DEPRECATED] ' if @service.deprecated?
desc += "Official AWS Ruby gem for #{@service.full_name}#{abbreviation}. "
desc += 'This gem is part of the AWS SDK for Ruby.'
end
desc
Expand All @@ -72,6 +74,10 @@ def dependencies
end
end

def deprecated?
@service.deprecated?
end

Dependency = Struct.new(:gem, :version)

end
Expand Down
4 changes: 4 additions & 0 deletions build_tools/aws-sdk-code-generator/templates/gemspec.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ Gem::Specification.new do |spec|
{{/dependencies}}

spec.required_ruby_version = '>= 2.3'

{{#deprecated?}}
spec.post_install_message = '{{gem_name}} is deprecated'
{{/deprecated?}}
end
5 changes: 2 additions & 3 deletions build_tools/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def services
# WARNING: not thread-safe
@services ||= begin
manifest.inject({}) do |hash, (name, config)|
next hash if config['deprecated']

service = build_service(name, config)
hash[service.identifier] = service
hash
Expand Down Expand Up @@ -74,7 +72,8 @@ def build_service(svc_name, config)
endpoint_tests: model_path('endpoint-tests-1.json', config['models']),
gem_dependencies: gem_dependencies(api, config['dependencies'] || {}),
add_plugins: add_plugins(api, config['addPlugins'] || []),
remove_plugins: config['removePlugins'] || []
remove_plugins: config['removePlugins'] || [],
deprecated: config['deprecated']
)
end

Expand Down
4 changes: 2 additions & 2 deletions gems/aws-sdk-gamesparks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Unreleased Changes
------------------

* Feature - Deprecated this service.

1.12.0 (2023-10-17)
------------------

* Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.

* Feature - Deprecated this service.

1.11.0 (2023-09-27)
------------------

Expand Down
4 changes: 3 additions & 1 deletion gems/aws-sdk-gamesparks/aws-sdk-gamesparks.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.name = 'aws-sdk-gamesparks'
spec.version = File.read(File.expand_path('../VERSION', __FILE__)).strip
spec.summary = 'AWS SDK for Ruby - GameSparks'
spec.description = 'Official AWS Ruby gem for GameSparks. This gem is part of the AWS SDK for Ruby.'
spec.description = '[DEPRECATED] Official AWS Ruby gem for GameSparks. This gem is part of the AWS SDK for Ruby.'
spec.author = 'Amazon Web Services'
spec.homepage = 'https://github.com/aws/aws-sdk-ruby'
spec.license = 'Apache-2.0'
Expand All @@ -29,4 +29,6 @@ Gem::Specification.new do |spec|
spec.add_dependency('aws-sigv4', '~> 1.1')

spec.required_ruby_version = '>= 2.3'

spec.post_install_message = 'aws-sdk-gamesparks is deprecated'
end
3 changes: 2 additions & 1 deletion services.json
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@
"models": "gamelift/2015-10-01"
},
"GameSparks": {
"models": "gamesparks/2021-08-17"
"models": "gamesparks/2021-08-17",
"deprecated": true
},
"Glacier": {
"models": "glacier/2012-06-01",
Expand Down

0 comments on commit 816a0aa

Please sign in to comment.