Aws-sdk-ruby: Lots of warnings generated by this gem

Created on 7 May 2018  路  9Comments  路  Source: aws/aws-sdk-ruby

When running Ruby with warnings enabled, the aws-sdk-core gem generates a lot of warnings. These warnings should be fixed and may represent bugs or unexpected collisions. You should add --warnings to your .rspec and ensure that no warnings are generated during testing.

/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/plugin.rb:125: warning: method redefined; discarding old doc_default
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:55: warning: assigned but unused variable - expiredIdentityTokenMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:58: warning: assigned but unused variable - idpCommunicationErrorMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:59: warning: assigned but unused variable - idpRejectedClaimMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:60: warning: assigned but unused variable - invalidAuthorizationMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:61: warning: assigned but unused variable - invalidIdentityTokenMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:62: warning: assigned but unused variable - malformedPolicyDocumentMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:64: warning: assigned but unused variable - packedPolicyTooLargeMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client_api.rb:65: warning: assigned but unused variable - regionDisabledMessage
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sigv4-1.0.2/lib/aws-sigv4/signer.rb:441: warning: shadowing outer local variable - headers
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:453: warning: method redefined; discarding old assume_role
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of assume_role was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:673: warning: method redefined; discarding old assume_role_with_saml
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of assume_role_with_saml was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:958: warning: method redefined; discarding old assume_role_with_web_identity
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of assume_role_with_web_identity was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:1037: warning: method redefined; discarding old decode_authorization_message
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of decode_authorization_message was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:1107: warning: method redefined; discarding old get_caller_identity
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_caller_identity was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:1320: warning: method redefined; discarding old get_federation_token
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_federation_token was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/aws-sdk-sts/client.rb:1460: warning: method redefined; discarding old get_session_token
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_session_token was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:182: warning: method redefined; discarding old add_permission
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of add_permission was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:215: warning: method redefined; discarding old check_if_phone_number_is_opted_out
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of check_if_phone_number_is_opted_out was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:259: warning: method redefined; discarding old confirm_subscription
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of confirm_subscription was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:342: warning: method redefined; discarding old create_platform_application
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of create_platform_application was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:415: warning: method redefined; discarding old create_platform_endpoint
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of create_platform_endpoint was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:455: warning: method redefined; discarding old create_topic
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of create_topic was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:486: warning: method redefined; discarding old delete_endpoint
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of delete_endpoint was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:514: warning: method redefined; discarding old delete_platform_application
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of delete_platform_application was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:539: warning: method redefined; discarding old delete_topic
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of delete_topic was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:574: warning: method redefined; discarding old get_endpoint_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_endpoint_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:609: warning: method redefined; discarding old get_platform_application_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_platform_application_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:650: warning: method redefined; discarding old get_sms_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_sms_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:679: warning: method redefined; discarding old get_subscription_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_subscription_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:709: warning: method redefined; discarding old get_topic_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of get_topic_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:762: warning: method redefined; discarding old list_endpoints_by_platform_application
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_endpoints_by_platform_application was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:804: warning: method redefined; discarding old list_phone_numbers_opted_out
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_phone_numbers_opted_out was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:851: warning: method redefined; discarding old list_platform_applications
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_platform_applications was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:889: warning: method redefined; discarding old list_subscriptions
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_subscriptions was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:932: warning: method redefined; discarding old list_subscriptions_by_topic
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_subscriptions_by_topic was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:966: warning: method redefined; discarding old list_topics
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of list_topics was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:991: warning: method redefined; discarding old opt_in_phone_number
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of opt_in_phone_number was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1142: warning: method redefined; discarding old publish
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of publish was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1168: warning: method redefined; discarding old remove_permission
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of remove_permission was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1217: warning: method redefined; discarding old set_endpoint_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of set_endpoint_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1288: warning: method redefined; discarding old set_platform_application_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of set_platform_application_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1401: warning: method redefined; discarding old set_sms_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of set_sms_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1435: warning: method redefined; discarding old set_subscription_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of set_subscription_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1468: warning: method redefined; discarding old set_topic_attributes
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of set_topic_attributes was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1549: warning: method redefined; discarding old subscribe
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of subscribe was here
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-sns-1.1.0/lib/aws-sdk-sns/client.rb:1577: warning: method redefined; discarding old unsubscribe
/home/samuel/.rvm/gems/ruby-2.5.0/gems/aws-sdk-core-3.20.2/lib/seahorse/client/base.rb:198: warning: previous definition of unsubscribe was here

Most helpful comment

@awood45 Any update to this?

All 9 comments

For example, if you DID intend to redefine a method, use undef. As an example for why this is a problem, I've seen situations where methods were clobbered by accident.

@awood45 I don't believe this should be targeted at a major version, since no actual API changes would need to occur, this is purely "patch level" changes. I've made some PRs which incrementally improve the situation.

I will supply some more PRs to improve the situation. You should be able to merge them with no concern as to functionality/changes.

I made a PR to fix warnings in https://github.com/mustache/mustache/pull/241

This will require an on-going commitment, but I hope I've sowed the first seeds.

Definitely taking a look at this - it may require some careful looks at our generators as well.

@awood45 Thanks so much for spending time on this issue. Let me know if there is anything I can do to help. Once you merge the existing PRs, I will be happy to find more. I'll also try to apply some pressure to mustache to get those warnings fixed too.

@awood45 Any update to this?

What was the outcome? Did we manage to get everything merged in the end? Can I help by making other PRs to reduce warnings?

I've got a pending work item being tracked to add the warnings flag without breaking our test suite (it looks like just a few tests that are checking output in a way that doesn't play well with warnings), but the rest has been merged. I would happily take other warning-reducing PRs.

@awood45 it seems like this repo is still missing .rspec with --warnings. Do you think you will be able to add that?

Was this page helpful?
0 / 5 - 0 ratings