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

Bringing changes from sidekiq-alive-next #72

Merged
merged 59 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
1e48fcf
Create dependabot.yml
andrcuns Oct 14, 2022
ee8d1f6
Remove deprecated options call on config
andrcuns Oct 2, 2022
6620cca
Clean up logging and add ability to set custom logger
andrcuns Oct 14, 2022
16a4312
Clean up code and add shutdown callback
andrcuns Oct 14, 2022
14e478c
Regenerate gemfile
andrcuns Oct 14, 2022
39a5c71
Correctly set sidekiq queues
andrcuns Oct 14, 2022
2bea4c3
Update workflow
andrcuns Oct 14, 2022
200e463
Add github-actions to dep updates
andrcuns Oct 14, 2022
022ec32
Add lockfile platforms
andrcuns Oct 14, 2022
3312edb
Update version to 2.2.0
andrcuns Oct 14, 2022
e074009
Bump actions/checkout from 2 to 3 (#7)
dependabot[bot] Oct 14, 2022
5bf81c5
Rename gem to sidekiq-alive (#8)
andrcuns Oct 14, 2022
833ebbe
Add release and changelog workflow (#10)
andrcuns Oct 15, 2022
4440510
Fix setting custom sidekiq queue (#9)
andrcuns Oct 15, 2022
dd8113d
Set git identity for release workflow
andrcuns Oct 15, 2022
7f0287e
Rename gem to sidekiq-alive-next
andrcuns Oct 15, 2022
371d939
Update README.md
andrcuns Oct 15, 2022
66c95cd
Create github release in the same job
andrcuns Oct 15, 2022
0e8ef78
Update gemspec metadata (#11)
andrcuns Oct 15, 2022
5ca2f3a
Add static rubocop checks (#12)
andrcuns Oct 15, 2022
b84024f
Automate release (#13)
andrcuns Oct 15, 2022
9a0fef1
Unset deployment mode for release
andrcuns Oct 15, 2022
c147e91
Add release ssh key for release workflow
andrcuns Oct 15, 2022
a942099
Checkout tag in release
andrcuns Oct 15, 2022
142c085
Add additional details to startup info (#14)
andrcuns Oct 15, 2022
be88c86
Use scan for finding and purging jobs (#15)
andrcuns Oct 15, 2022
28cfe8e
Add changelog workflow (#16)
andrcuns Oct 15, 2022
78342dc
Bump rspec from 3.11.0 to 3.12.0 (#17)
dependabot[bot] Oct 27, 2022
866a1b3
Sidekiq 7 support (#19)
andrcuns Oct 28, 2022
3e5885f
Update README.md
andrcuns Oct 29, 2022
92e53f7
Update changelog.yml
andrcuns Oct 29, 2022
4680aa5
Use ruby 3.1.2 for development
andrcuns Nov 2, 2022
c187f52
Replace pry with debug gem
andrcuns Nov 2, 2022
1fb4851
Update rack requirement from >= 2.2.4, < 3 to >= 3, < 4 (#20)
dependabot[bot] Nov 2, 2022
c45c3b5
Update nokogiri and workflow ruby setup
andrcuns Nov 2, 2022
6465336
Bump sidekiq from 7.0.0 to 7.0.1 (#21)
dependabot[bot] Nov 8, 2022
3ddedc8
Bump rackup from 0.2.2 to 0.2.3 (#22)
dependabot[bot] Nov 14, 2022
cc47f66
Bump rack from 3.0.0 to 3.0.1 (#23)
dependabot[bot] Nov 22, 2022
ce191b4
Bump sidekiq from 7.0.1 to 7.0.2 (#24)
dependabot[bot] Dec 1, 2022
f17e088
Loosen rackup requirement (#25)
andrcuns Dec 2, 2022
9dc21b3
Bump rack from 3.0.1 to 3.0.2 (#27)
dependabot[bot] Dec 6, 2022
a917e5d
Bump debug from 1.6.3 to 1.7.0 (#26)
dependabot[bot] Dec 6, 2022
063fcd4
renaming back and apply changes
arturictus Dec 7, 2022
d265f72
rubocop fix
arturictus Dec 7, 2022
d6e9050
rubocop fix (for real)
arturictus Dec 7, 2022
e8a7796
add comment to why different ways to access to queues
arturictus Dec 7, 2022
172fc71
use badges from this repo
arturictus Dec 7, 2022
bf354b2
Remove breaking version restrictions
andrcuns Dec 20, 2022
5d91e0e
Enable new cops by default
andrcuns Dec 20, 2022
8fdac34
Ignore load error for sidekiq/capsule
andrcuns Dec 20, 2022
b5f2458
Move dynamic sidekiq version definition to Gemfile
andrcuns Dec 21, 2022
d55bd1b
Improve sidekiq version detection
andrcuns Dec 21, 2022
9b265b6
Add redis client wrappers
andrcuns Dec 21, 2022
3074e46
Remove redundant module function
andrcuns Dec 21, 2022
a0e3043
Fix sq_config mocking
andrcuns Dec 21, 2022
f65ab7a
fix sidekiq 5
arturictus Dec 21, 2022
fbb71b4
Update release actions
andrcuns Dec 21, 2022
faa1cc1
improve Helpers version
arturictus Dec 21, 2022
eb4250c
Update release.yml for default project labels
andrcuns Dec 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "daily"
reviewers:
- "andrcuns"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "daily"
reviewers:
- andrcuns
labels:
- "ci"
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
changelog:
andrcuns marked this conversation as resolved.
Show resolved Hide resolved
categories:
- title: '🚀 New feature or request'
labels:
- 'enhancement'
- title: '🐞 Bug Fixes'
labels:
- 'bug'
- title: '📦 Dependency updates'
labels:
- 'dependencies'
20 changes: 20 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Changelog

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: Release version
required: true
type: string

jobs:
release:
name: Ruby gem
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_SSH_KEY }}
arturictus marked this conversation as resolved.
Show resolved Hide resolved
-
name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
-
name: Update version
run: |
git config user.name github-actions
git config user.email github-actions@github.com
bundle config unset deployment
bundle exec rake "version[${{ inputs.version }}]" && git push
-
name: Create tag and push to rubygems
run: bundle exec rake release
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
48 changes: 36 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
name: Ruby CI
name: Test

on:
push:
branches: [main, master]
branches:
- master
pull_request:
branches: [main, master]
branches:
- master

jobs:
test:
rubocop:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 1
-
name: Run lint
run: bundle exec rubocop --color

test:
runs-on: ubuntu-latest
needs: rubocop
strategy:
fail-fast: false
matrix:
ruby-version: ["3.1", "3.0", "2.7", "2.6", "2.5"]
# Service containers to run with `runner-job`
ruby-version: ["3.1", "3.0", "2.7"]
sidekiq-version: ["~> 5.2", "~> 6.5", "~> 7"]
arturictus marked this conversation as resolved.
Show resolved Hide resolved
# Service containers to run with `runner-job`
services:
# Label used to access the service container
redis:
Expand All @@ -30,12 +49,17 @@ jobs:
- 6379:6379

steps:
- uses: actions/checkout@v2
- name: Set up Ruby ${{ matrix.ruby-version }}
-
uses: actions/checkout@v3
-
name: Set up Ruby ${{ matrix.ruby-version }} with Sidekiq ${{ matrix.sidekiq-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rspec
bundler-cache: true
cache-version: 1
env:
SIDEKIQ_VERSION_RANGE: ${{ matrix.sidekiq-version }}
-
name: Run tests
run: bundle exec rspec --force-color
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/pkg/
/spec/reports/
/tmp/
Gemfile.lock

# rspec failure tracking
.rspec_status
Expand Down
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--format documentation
--color
--require spec_helper
--order random
11 changes: 11 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
inherit_gem:
rubocop-shopify: rubocop.yml

AllCops:
TargetRubyVersion: 2.7
SuggestExtensions: false
NewCops: enable

Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_first_argument
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.2
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
source 'https://rubygems.org'
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in sidekiq_alive.gemspec
gemspec

gem 'pry'
gem "sidekiq", ENV["SIDEKIQ_VERSION_RANGE"] || "< 8"
60 changes: 0 additions & 60 deletions Gemfile.lock

This file was deleted.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,19 @@ SidekiqAlive.setup do |config|
# require 'net/http'
# config.callback = proc { Net::HTTP.get("https://status.com/ping") }

# ==> Shutdown callback
# When sidekiq process is shutting down, you can perform some action, like cleaning up created queue
# default: proc {}
#
# config.shutdown_callback = proc do
# Sidekiq::Queue.all.find { |q| q.name == "#{queue_prefix}-#{SidekiqAlive.hostname}" }&.clear
# end

# ==> Queue Prefix
# SidekiqAlive will run in a independent queue for each instance/replica
# This queue name will be generated with: "#{queue_prefix}-#{hostname}.
# You can customize the prefix here.
# default: :sidekiq_alive
# default: :sidekiq-alive
#
# config.queue_prefix = :other

Expand Down
21 changes: 19 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task default: :spec

desc "Update version"
task :version, :new_version do |_, args|
version_path = "lib/sidekiq_alive/version.rb"
new_version = args[:new_version]
version_file = File.read(version_path)

version_file.match(/VERSION = "(.*)"/)[1].then do |version|
File.write(version_path, version_file.gsub(version, new_version))
end

sh("bundle install")
sh("git add #{version_path} Gemfile.lock")
sh("git commit -m 'Update version to #{new_version}'")
end
7 changes: 4 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'bundler/setup'
require 'sidekiq_alive'
require "bundler/setup"
require "sidekiq_alive"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand All @@ -10,5 +11,5 @@ require 'sidekiq_alive'
# require "pry"
# Pry.start

require 'irb'
require "irb"
IRB.start(__FILE__)