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

[pull] master from collectiveidea:master #1

Open
wants to merge 52 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 9, 2020

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

viraptor and others added 13 commits August 19, 2019 08:01
Add links which are exposed on rubygems and help with update automation.
This PR unifies the DelayedJob behavior of ActionMailer::Base and ActionMailer::Parameterized::Mailer

Now, the following syntax works equivalently:

```ruby
# works currently
MyMailer.delay.my_method

# this PR makes the following work
MyMailer.with(foo: 1, bar: 2).delay.my_method
```

Note that ActionMailer::Parameterized::Mailer does not inherit ActionMailer::Base (moreover, the `.with()` method returns an object instance, hence we use `include` rather than `extend`)
@pull pull bot added the ⤵️ pull label Dec 9, 2020
albus522 and others added 16 commits December 9, 2020 11:34
We can remove the rails 6.1 part when 61.0 is released
Make .delay method work with ActionMailer::Parameterized::Mailer
jruby 9.3 seems not to work with rails
```
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  * development - set it to false
  * test - set it to false (unless you use a tool that preloads your test environment)
  * production - set it to true
````
Since psych4.0, the load method has been safe_load, which causes the following error: YAML#load_dj retains the existing safeYAML support, but uses the version of psych that implements unsafe_load. In YAML#load_dj

```
  1) YAML autoloads the class of an anonymous struct
     Failure/Error:
       expect do
         yaml = "--- !ruby/struct\nn: 1\n"
         object = YAML.load(yaml)
         expect(object).to be_kind_of(Struct)
         expect(object.n).to eq(1)
       end.not_to raise_error

       expected no Exception, got #<Psych::DisallowedClass: Tried to load unspecified class: Struct> with backtrace:
         # (eval):2:in `struct'
         # ./spec/yaml_ext_spec.rb:28:in `block (3 levels) in <top (required)>'
         # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in <top (required)>'
     # ./spec/yaml_ext_spec.rb:26:in `block (2 levels) in <top (required)>'
```
net-smtp 0.3.0 dependents digest 3.0.0, but edge ruby activates 3.1.0.pre2.

The error was avoided by explicitly specifying the version in the Gemfile.

```
bundler: failed to load command: rspec (/home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.1.0/bin/rspec)
/home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:309:in `check_for_activated_spec!': You have already activated digest 3.1.0.pre2, but your Gemfile requires digest 3.0.0. Since digest is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports digest as a default gem. (Gem::LoadError)
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:25:in `block in setup'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/spec_set.rb:136:in `each'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:24:in `map'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/runtime.rb:24:in `setup'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler.rb:149:in `setup'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/setup.rb:20:in `block in <top (required)>'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/setup.rb:20:in `<top (required)>'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `require_relative'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:56:in `kernel_load'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:478:in `exec'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
	from /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-2.3.0.dev/libexec/bundle:49:in `block in <top (required)>'
	from /home/runner/.rubies/ruby-head/lib/ruby/3.1.0/bundler/friendly_errors.rb:128:in `with_friendly_errors'
	from /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-2.3.0.dev/libexec/bundle:37:in `<top (required)>'
	from /home/runner/.rubies/ruby-head/bin/bundle:23:in `load'
	from /home/runner/.rubies/ruby-head/bin/bundle:23:in `<main>'
```
willnet and others added 23 commits December 27, 2021 18:04
we don't have to add digest gem explicitly.
Rails 7.0.0 doesn't work with Ruby 3.1.

ref: rails/rails#43951
If we use Ruby 3.0 without quotations in YAML, It is interpreted as "3". If you specify 3 on GitHub Actions, it means the latest stable version of the 3 series, so 3.1 will be used.
When using Ruby 3.0 or 3.1, GitHub Actions fails likes following.

```
--- ERROR REPORT TEMPLATE -------------------------------------------------------

  ```
  NoMethodError: undefined method `metadata' for nil:NilClass
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `block in output_fund_metadata_summary'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `count'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/common.rb:22:in `output_fund_metadata_summary'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli/install.rb:85:in `run'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:253:in `block in install'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/settings.rb:131:in `temporary'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:252:in `install'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:31:in `dispatch'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/cli.rb:25:in `start'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:49:in `block in <top (required)>'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/lib/ruby/gems/3.0.0/gems/bundler-2.2.32/libexec/bundle:37:in `<top (required)>'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle:23:in `load'
    /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle:23:in `<main>'
  ```

  ## Environment

  ```
  Bundler       2.2.32
    Platforms   ruby, x86_64-linux
  Ruby          3.0.3p157 (2021-11-24 revision 3fb7d2cadc18472ec107b14234933b017a33c14d) [x86_64-linux]
    Full Path   /opt/hostedtoolcache/Ruby/3.0.3/x64/bin/ruby
    Config Dir  /opt/hostedtoolcache/Ruby/3.0.3/x64/etc
  RubyGems      3.2.32
    Gem Home    /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0
    Gem Path    /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0
    User Home   /home/runner
    User Path   /home/runner/.local/share/gem/ruby/3.0.0
    Bin Dir     /home/runner/work/delayed_job/delayed_job/vendor/bundle/ruby/3.0.0/bin
  OpenSSL
    Compiled    OpenSSL 1.1.1f  31 Mar 2020
    Loaded      OpenSSL 1.1.1f  31 Mar 2020
    Cert File   /usr/lib/ssl/cert.pem
    Cert Dir    /usr/lib/ssl/certs
  Tools
    Git         2.34.1
    RVM         not installed
    rbenv       not installed
    chruby      not installed
  ```

  ## Bundler Build Metadata

  ```
  Built At          2022-01-17
  Git SHA           unknown
  Released Version  false
  ```

  ## Bundler settings

  ```
  jobs
    Set for your local app (/home/runner/work/delayed_job/delayed_job/.bundle/config): 4
  path
    Set for your local app (/home/runner/work/delayed_job/delayed_job/.bundle/config): "/home/runner/work/delayed_job/delayed_job/vendor/bundle"
  ```

  ## Gemfile

  ### Gemfile

  ```ruby
  source 'https://rubygems.org'

  gem 'rake'

  platforms :ruby do
    # Rails 5.1 is the first to work with sqlite 1.4
    # Rails 6 now requires sqlite 1.4
    if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '5.1'
      gem 'sqlite3', '< 1.4'
    else
      gem 'sqlite3'
    end
  end

  platforms :jruby do
    if ENV['RAILS_VERSION'] == '4.2.0'
      gem 'activerecord-jdbcsqlite3-adapter', '< 50.0'
    elsif ENV['RAILS_VERSION'] == '5.0.0'
      gem 'activerecord-jdbcsqlite3-adapter', '~> 50.0'
    elsif ENV['RAILS_VERSION'] == '5.1.0'
      gem 'activerecord-jdbcsqlite3-adapter', '~> 51.0'
    elsif ENV['RAILS_VERSION'] == '5.2.0'
      gem 'activerecord-jdbcsqlite3-adapter', '~> 52.0'
    elsif ENV['RAILS_VERSION'] == '6.0.0'
      gem 'activerecord-jdbcsqlite3-adapter', '~> 60.0'
    elsif ENV['RAILS_VERSION'] == '6.1.0'
      gem 'activerecord-jdbcsqlite3-adapter', '~> 61.0'
    else
      gem 'activerecord-jdbcsqlite3-adapter'
    end
    gem 'jruby-openssl'
    gem 'mime-types', ['~> 2.6', '< 2.99']
    if ENV['RAILS_VERSION'] == 'edge'
      gem 'railties', :github => 'rails/rails'
    elsif ENV['RAILS_VERSION']
      gem 'railties', "~> #{ENV['RAILS_VERSION']}"
    else
      gem 'railties', ['>= 3.0', '< 7.1']
    end
  end

  platforms :rbx do
    gem 'psych'
  end

  group :test do
    if ENV['RAILS_VERSION'] == 'edge'
      gem 'actionmailer', :github => 'rails/rails'
      gem 'activerecord', :github => 'rails/rails'
      gem 'railties', :github => 'rails/rails'
    elsif ENV['RAILS_VERSION']
      gem 'actionmailer', "~> #{ENV['RAILS_VERSION']}"
      gem 'activerecord', "~> #{ENV['RAILS_VERSION']}"
      gem 'railties', "~> #{ENV['RAILS_VERSION']}"
    else
      gem 'actionmailer', ['>= 3.0', '< 7.1']
      gem 'activerecord', ['>= 3.0', '< 7.1']
      gem 'railties', ['>= 3.0', '< 7.1']
    end
    gem 'net-smtp' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
    gem 'rspec', '>= 3'
    gem 'simplecov', :require => false
    if /\A2.[12]/ =~ RUBY_VERSION
      # 0.8.0 doesn't work with simplecov < 0.18.0 and older ruby can't run 0.18.0
      gem 'simplecov-lcov', '< 0.8.0', :require => false
    else
      gem 'simplecov-lcov', :require => false
    end
  end

  group :rubocop do
    gem 'rubocop', '>= 0.25', '< 0.49'
  end

  gemspec
  ```

  ### Gemfile.lock

  ```
  PATH
    remote: .
    specs:
      delayed_job (4.1.9)
        activesupport (>= 3.0, < 7.1)

  GEM
    remote: https://rubygems.org/
    specs:
      actionmailer (7.0.1)
        actionpack (= 7.0.1)
        actionview (= 7.0.1)
        activejob (= 7.0.1)
        activesupport (= 7.0.1)
        mail (~> 2.5, >= 2.5.4)
        net-imap
        net-pop
        net-smtp
        rails-dom-testing (~> 2.0)
      actionpack (7.0.1)
        actionview (= 7.0.1)
        activesupport (= 7.0.1)
        rack (~> 2.0, >= 2.2.0)
        rack-test (>= 0.6.3)
        rails-dom-testing (~> 2.0)
        rails-html-sanitizer (~> 1.0, >= 1.2.0)
      actionview (7.0.1)
        activesupport (= 7.0.1)
        builder (~> 3.1)
        erubi (~> 1.4)
        rails-dom-testing (~> 2.0)
        rails-html-sanitizer (~> 1.1, >= 1.2.0)
      activejob (7.0.1)
        activesupport (= 7.0.1)
        globalid (>= 0.3.6)
      activemodel (7.0.1)
        activesupport (= 7.0.1)
      activerecord (7.0.1)
        activemodel (= 7.0.1)
        activesupport (= 7.0.1)
      activesupport (7.0.1)
        concurrent-ruby (~> 1.0, >= 1.0.2)
        i18n (>= 1.6, < 2)
        minitest (>= 5.1)
        tzinfo (~> 2.0)
      ast (2.4.2)
      builder (3.2.4)
      concurrent-ruby (1.1.9)
      crass (1.0.6)
      diff-lcs (1.5.0)
      digest (3.1.0)
      docile (1.4.0)
      erubi (1.10.0)
      globalid (1.0.0)
        activesupport (>= 5.0)
      i18n (1.8.11)
        concurrent-ruby (~> 1.0)
      io-wait (0.2.1)
      loofah (2.13.0)
        crass (~> 1.0.2)
        nokogiri (>= 1.5.9)
      mail (2.7.1)
        mini_mime (>= 0.1.1)
      mini_mime (1.1.2)
      minitest (5.15.0)
      net-imap (0.2.3)
        digest
        net-protocol
        strscan
      net-pop (0.1.1)
        digest
        net-protocol
        timeout
      net-protocol (0.1.2)
        io-wait
        timeout
      net-smtp (0.3.1)
        digest
        net-protocol
        timeout
      nokogiri (1.13.1-x86_64-linux)
        racc (~> 1.4)
      parser (2.7.2.0)
        ast (~> 2.4.1)
      powerpack (0.1.3)
      psych (4.0.3)
        stringio
      racc (1.6.0)
      rack (2.2.3)
      rack-test (1.1.0)
        rack (>= 1.0, < 3)
      rails-dom-testing (2.0.3)
        activesupport (>= 4.2.0)
        nokogiri (>= 1.6)
      rails-html-sanitizer (1.4.2)
        loofah (~> 2.3)
      rainbow (2.2.2)
        rake
      rake (13.0.6)
      rspec (3.10.0)
        rspec-core (~> 3.10.0)
        rspec-expectations (~> 3.10.0)
        rspec-mocks (~> 3.10.0)
      rspec-core (3.10.1)
        rspec-support (~> 3.10.0)
      rspec-expectations (3.10.2)
        diff-lcs (>= 1.2.0, < 2.0)
        rspec-support (~> 3.10.0)
      rspec-mocks (3.10.2)
        diff-lcs (>= 1.2.0, < 2.0)
        rspec-support (~> 3.10.0)
      rspec-support (3.10.3)
      rubocop (0.48.1)
        parser (>= 2.3.3.1, < 3.0)
        powerpack (~> 0.1)
        rainbow (>= 1.99.1, < 3.0)
        ruby-progressbar (~> 1.7)
        unicode-display_width (~> 1.0, >= 1.0.1)
      ruby-progressbar (1.11.0)
      simplecov (0.21.2)
        docile (~> 1.1)
        simplecov-html (~> 0.11)
        simplecov_json_formatter (~> 0.1)
      simplecov-html (0.12.3)
      simplecov-lcov (0.8.0)
      simplecov_json_formatter (0.1.3)
      sqlite3 (1.4.2)
      stringio (3.0.1)
      strscan (3.0.1)
      timeout (0.2.0)
      tzinfo (2.0.4)
        concurrent-ruby (~> 1.0)
      unicode-display_width (1.8.0)

  PLATFORMS
    x86_64-linux

  DEPENDENCIES
    actionmailer (~> 7.0.1)
    activerecord (~> 7.0.1)
    activerecord-jdbcsqlite3-adapter
    delayed_job!
    jruby-openssl
    mime-types (~> 2.6, < 2.99)
    psych
    railties (~> 7.0.1)
    rake
    rspec (>= 3)
    rubocop (>= 0.25, < 0.49)
    simplecov
    simplecov-lcov
    sqlite3

  BUNDLED WITH
     2.2.32
  ```

  ## Gemspecs

  ### delayed_job.gemspec

  ```ruby
  # -*- encoding: utf-8 -*-

  Gem::Specification.new do |spec|
    spec.add_dependency 'activesupport', ['>= 3.0', '< 7.1']
    spec.authors        = ['Brandon Keepers', 'Brian Ryckbost', 'Chris Gaffney', 'David Genord II', 'Erik Michaels-Ober', 'Matt Griffin', 'Steve Richert', 'Tobias Lütke']
    spec.description    = 'Delayed_job (or DJ) encapsulates the common pattern of asynchronously executing longer tasks in the background. It is a direct extraction from Shopify where the job table is responsible for a multitude of core tasks.'
    spec.email          = ['[email protected]']
    spec.files          = %w[CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md Rakefile delayed_job.gemspec]
    spec.files          += Dir.glob('{contrib,lib,recipes,spec}/**/*') # rubocop:disable SpaceAroundOperators
    spec.homepage       = 'http:https://github.com/collectiveidea/delayed_job'
    spec.licenses       = ['MIT']
    spec.name           = 'delayed_job'
    spec.require_paths  = ['lib']
    spec.summary        = 'Database-backed asynchronous priority queue system -- Extracted from Shopify'
    spec.test_files     = Dir.glob('spec/**/*')
    spec.version        = '4.1.9'
    spec.metadata       = {
      'changelog_uri'   => 'https://github.com/collectiveidea/delayed_job/blob/master/CHANGELOG.md',
      'bug_tracker_uri' => 'https://github.com/collectiveidea/delayed_job/issues',
      'source_code_uri' => 'https://github.com/collectiveidea/delayed_job'
    }
  end
  ```

  --- TEMPLATE END ----------------------------------------------------------------

  Unfortunately, an unexpected error occurred, and Bundler cannot continue.

  First, try this link to see if there are any existing issue reports for this error:
  https://github.com/rubygems/rubygems/search?q=undefined+method+%60metadata%27+for+nil+NilClass&type=Issues

  If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there.
  Took  13.62 seconds
Error: The process '/opt/hostedtoolcache/Ruby/3.0.3/x64/bin/bundle' failed with exit code 1
```
This reverts commit 069b642.

Delayed Job does not require Rails so the specs should not require it.

# Conflicts:
#	Gemfile
#	spec/helper.rb
Rails should not break anything in 7.x releases.
ActiveSupport 7 drops classic dependency autoloading. This does a basic zeitwerk setup to test the newer Rails autoloading system
fix: ActiveSupport 7.0.3 Compatibility
Rails 7 and above requires Ruby 2.7 compatibility, however JRuby 9.3.x
provides only Ruby 2.6 compatibility.
CI: add Ruby 3.2 to the test matrix
Ensure `Array` has been decorated with `#extract_options`
This was probably the only way to do it 10 years ago when it was added.
Use a block for expect to raise_exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants