Skip to content

Commit

Permalink
Merge pull request #31 from inkstak/upgrade_ci
Browse files Browse the repository at this point in the history
Upgrade CI
  • Loading branch information
inkstak committed Jan 12, 2024
2 parents a63b970 + b065b83 commit 575df0b
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: [ '2.7', '3.0', '3.1', '3.2', head, jruby, jruby-head, truffleruby, truffleruby-head ]
# Test only supported versions: https://endoflife.date/ruby
ruby-version: [ '3.0', '3.1', '3.2', '3.3', head, jruby, jruby-head, truffleruby, truffleruby-head ]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inherit_gem:
- config/ruby-3.0.yml

AllCops:
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
NewCops: enable
Exclude:
- '**/tmp/**/*'
Expand Down
6 changes: 3 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-12-15 09:01:40 UTC using RuboCop version 1.35.1.
# on 2024-01-12 07:13:01 UTC using RuboCop version 1.59.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 5
# Offense count: 6
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 18
Max: 24
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# frozen_string_literal: true

# Supported versions of Rails:
# https://endoflife.date/rails
#
appraise "activejob-6.0" do
gem "activejob", "~> 6.0.x"
gem "activesupport", "~> 6.0.x"
Expand All @@ -14,3 +17,8 @@ appraise "activejob-7.0" do
gem "activejob", "~> 7.0.x"
gem "activesupport", "~> 7.0.x"
end

appraise "activejob-7.1" do
gem "activejob", "~> 7.1.x"
gem "activesupport", "~> 7.1.x"
end
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ gemspec

gem "gem-release"
gem "simplecov_json_formatter"

# FIXME: mutex_m must be installed to run CI with ruby head (3.4dev)
gem "mutex_m" # , platforms: :mri_34
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023 Savater Sebastien
Copyright (c) 2016-2024 Savater Sebastien

MIT License

Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ bundle add activejob-status

## Dependencies

In future releases, `ActiveJob::Status` won't support [EOL versions](https://endoflife.date/rails) of `ActiveJob` & `ActiveSupport`.

* Version `1.x` requires `ActiveSupport >= 6.0`

If you're still using older Rails version, see [#24](https://github.com/inkstak/activejob-status/issues/24#issuecomment-1436046173).
ActiveJob::Status 1.x requires `ActiveSupport >= 6.0`

If you're still using an older version of Rails, see [v0.5.0](https://github.com/inkstak/activejob-status/releases/tag/v0.5.0).

## Configuration

Expand Down Expand Up @@ -417,6 +414,6 @@ bundle exec rake

## License & credits

Please see [LICENSE](https://github.com/inkstak/coverart/blob/main/LICENSE) for further details.
Please see [LICENSE](https://github.com/inkstak/activejob-status/blob/main/LICENSE) for further details.

Contributors: [./graphs/contributors](https://github.com/inkstak/coverart/graphs/contributors)
Contributors: [./graphs/contributors](https://github.com/inkstak/activejob-status/graphs/contributors)
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ task :default do
# something to do with the exit code.
# https://github.com/thoughtbot/appraisal/issues/144

# Otherwise it may be tainted by the rubocop task and
# Standard may be tainted by the rubocop task and
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480

fail unless system "bundle exec appraisal install"
fail unless system "bundle exec appraisal rspec"
fail unless system "bundle exec rubocop"
fail unless system "bundle exec rake standard"
Expand Down
2 changes: 1 addition & 1 deletion lib/activejob-status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def store=(store)
end

def store
@@store ||= (defined?(Rails) && Rails.cache)
@@store ||= (Rails.cache if defined?(Rails))
end

def get(id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# frozen_string_literal: true

require_relative "../spec_helper"
require_relative "../jobs/test_jobs"
require_relative "../../spec_helper"
require_relative "../../jobs/test_jobs"

RSpec.describe ActiveJob::Status do
# FIXME: weird error on JRUBY, happening randomly,
# where keyword arguments are not passed as keyword arguments but with regular
# arguments
#
if RUBY_ENGINE == "jruby" && JRUBY_VERSION == "9.4.0.0"
if RUBY_ENGINE == "jruby" && Gem::Version.new(JRUBY_VERSION) >= Gem::Version.new("9.4")
def jobs_with(*args, **kwargs)
super
rescue ArgumentError
Expand Down Expand Up @@ -202,7 +202,7 @@ def jobs_with(*args, **kwargs)
status: :queued,
serialized_job: {
"arguments" => [],
"enqueued_at" => "2022-10-31T00:00:00Z",
"enqueued_at" => "2022-10-31T00:00:00.000000000Z",
"exception_executions" => {},
"executions" => 0,
"job_class" => "BaseJob",
Expand All @@ -211,7 +211,17 @@ def jobs_with(*args, **kwargs)
"priority" => nil,
"provider_job_id" => nil,
"queue_name" => "default",
"scheduled_at" => nil,
"timezone" => nil
}.tap { |hash|
# FIXME: comparing Gem::Version with String doesn't work in ruby 3.0
# After removing support for 3.0, we could do
# ActiveJob.version < "7.1"
#
if ActiveJob.version < Gem::Version.new("7.1")
hash["enqueued_at"] = "2022-10-31T00:00:00Z"
hash.delete("scheduled_at")
end
}
)
end
Expand All @@ -224,7 +234,7 @@ def jobs_with(*args, **kwargs)
status: :completed,
serialized_job: {
"arguments" => [],
"enqueued_at" => "2022-10-31T00:00:00Z",
"enqueued_at" => "2022-10-31T00:00:00.000000000Z",
"exception_executions" => {},
"executions" => 1,
"job_class" => "BaseJob",
Expand All @@ -233,7 +243,13 @@ def jobs_with(*args, **kwargs)
"priority" => nil,
"provider_job_id" => nil,
"queue_name" => "default",
"scheduled_at" => nil,
"timezone" => nil
}.tap { |hash|
if ActiveJob.version < Gem::Version.new("7.1")
hash["enqueued_at"] = "2022-10-31T00:00:00Z"
hash.delete("scheduled_at")
end
}
)
end
Expand Down

0 comments on commit 575df0b

Please sign in to comment.