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

Fix error on activesupport 7 #30

Merged
merged 5 commits into from
May 21, 2024
Merged

Conversation

kenchan
Copy link
Contributor

@kenchan kenchan commented Jan 11, 2023

In activesupport 7.x there was a change in the required require as shown in rails/rails#43851 .If you require each of them, it will look like this.

require 'active_support/core_ext/hash/conversions'
require 'active_support/isolated_execution_state'
require 'active_support/xml_mini'

But, in many use cases of this gem, ActiveSupport is already loaded, so I decided to use require 'activesupport'.

@kenchan kenchan force-pushed the fix-error-on-activesupport-7 branch from 5655f87 to 4b5e4a5 Compare January 11, 2023 14:12
@kenchan kenchan force-pushed the fix-error-on-activesupport-7 branch from 4b5e4a5 to c464622 Compare January 11, 2023 14:21
@kenchan kenchan marked this pull request as ready for review January 11, 2023 14:26
@kenchan
Copy link
Contributor Author

kenchan commented Jan 11, 2023

The test also passes with activesupport 6.x.

diff --git a/global_sign.gemspec b/global_sign.gemspec
index 78555d2..96619e8 100644
--- a/global_sign.gemspec
+++ b/global_sign.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
   spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
   spec.require_paths = ['lib']
 
-  spec.add_runtime_dependency 'activesupport'
+  spec.add_runtime_dependency 'activesupport', '~> 6.0'
   spec.add_runtime_dependency 'builder'
   spec.add_runtime_dependency 'faraday'
   spec.add_runtime_dependency 'nokogiri'
Test Results

GlobalSign::Client
  #initialize
    has required object instances
    with "options" parameter
      when timeout is specified
        sets the value as a request option default
  #process
    when received wrong parameter
      raises ArgumentError
  #find_response_class_for
    when received url_verification
      returns the response class corresponding to the request class
    when received wrong parameter
      raises ArgumentError

GlobalSign::CsrDecoder::Response
  when returned success response
    succeeds
    response includes decode_csr params
  when returned error response
    fails

GlobalSign::DnsVerification::Response
  when requested a new certificate
    when returned success response
      succeeds
      returns response includes dns_verification params
    when returned error response
      fails
  when requested a renewal certificate
    when returned success response
      succeeds
      returns response includes dns_verification params
    when returned error response
      fails

GlobalSign::DnsVerificationForIssue::Response
  when returned success response
    succeeds
    returns response includes dns_verification_for_issue params
  when returned error response
    fails

GlobalSign::DVApproverList::Response
  when is a success response
    succeeds
    includes orderID and list of approvers
  when is a failure response
    fails
    includes the errors

GlobalSign::DVOrder::Response
  when requested a new certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id
  when requested a renewal certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id

GlobalSign::EVOrder::Response
  when requested a new certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id
  when requested a renewal certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id

GlobalSign::OrderGetterByOrderId::Request
  #params
    when no options
      is expected to eq {:OrderID=>"xxxx123456789"}
    when adds certificate_info option
      is expected to eq {:OrderID=>"xxxx123456789", :OrderQueryOption=>{:ReturnCertificateInfo=>true}}
    when adds fulfillment option
      is expected to eq {:OrderID=>"xxxx123456789", :OrderQueryOption=>{:ReturnFulfillment=>true}}
    when adds multiple options
      is expected to eq {:OrderID=>"xxxx123456789", :OrderQueryOption=>{:ReturnCertificateInfo=>true, :ReturnFulfillment=>true}}

GlobalSign::OrderGetterByOrderId::Response
  when returned success response
    not exists option responses
    behaves like succeeds
      is expected to be nil
      response includes order_getter_by_order_id params
      returns order_status text
  when returned success response with certificate_info option
    when order_status completed_issue
      exists certificate_info option response
      behaves like succeeds
        is expected to be nil
        response includes order_getter_by_order_id params
        returns order_status text
    when order_status initial
      exists certificate_info option response
      start_date is nil
      behaves like succeeds
        is expected to be nil
        response includes order_getter_by_order_id params
        returns order_status text
  when returned success response with fulfillment option
    exists fulfillment option response
    behaves like succeeds
      is expected to be nil
      response includes order_getter_by_order_id params
      returns order_status text
  when returned error response
    fails

GlobalSign::OVOrder::Response
  when requested a new certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id
  when requested a renewal certificate
    when returned success response
      succeeds
      returns response with order id
    when returned error response
      specifies the error
      returns empty order id

GlobalSign::Request
  #to_xml
    calls RequestXmlBuilder.build_xml
  #auth_token_params
    returns hash

GlobalSign::RequestXmlBuilder
  .build_xml
    returns xml for GlobalSign API request

GlobalSign::UrlVerification::Response
  when requested a new certificate
    when returned success response
      succeeds
      returns response includes url_verification params
    when returned error response
      fails
  when requested a renewal certificate
    when returned success response
      succeeds
      returns response includes url_verification params
    when returned error response
      fails

GlobalSign::UrlVerificationForIssue::Response
  when returned success response
    succeeds
    returns response includes url_verification_for_issue params
  when returned error response
    fails

GlobalSign
  has a version number
  .configure
    proxies to GlobalSign configuration
  .contract
    proxies to GlobalSign contract information

Finished in 0.38387 seconds (files took 0.45118 seconds to load)
82 examples, 0 failures

@kenchan
Copy link
Contributor Author

kenchan commented May 20, 2024

I set up matrix builds for each version of activesupport. Thank you sue445.

https://x.com/sue445/status/1623279954791391235

Copy link

@ikaruga777 ikaruga777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♂️

@kenchan kenchan merged commit b19eae1 into master May 21, 2024
16 checks passed
@kenchan kenchan deleted the fix-error-on-activesupport-7 branch May 21, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants