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

Resolve CI failures: Tackle dependency, linting, environment, and build config issues #155

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
39 changes: 31 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,50 @@ orbs:
# run specs against Solidus supported versions only without the need
# to change this configuration every time a Solidus version is released
# or goes EOL.
solidusio_extensions: solidusio/extensions@0.2.27
solidusio_extensions: solidusio/extensions@volatile

jobs:
run-specs-with-postgres:
executor: solidusio_extensions/postgres
parameters:
ruby_version:
type: string
default: "3.2"
executor:
name: solidusio_extensions/postgres
ruby_version: << parameters.ruby_version >>
steps:
- solidusio_extensions/run-tests
run-specs-with-mysql:
executor: solidusio_extensions/mysql
parameters:
ruby_version:
type: string
default: "3.2"
executor:
name: solidusio_extensions/mysql
ruby_version: << parameters.ruby_version >>
steps:
- solidusio_extensions/run-tests
lint-code:
executor: solidusio_extensions/sqlite-memory
parameters:
ruby_version:
type: string
default: "3.2"
executor:
name: solidusio_extensions/sqlite-memory
ruby_version: << parameters.ruby_version >>
steps:
- solidusio_extensions/lint-code

workflows:
"Run specs on supported Solidus versions":
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
- lint-code

- run-specs-with-mysql:
name: "Run specs with MySQL and Ruby 3.1"
ruby_version: "3.1"
- lint-code:
name: "Lint code with Ruby 3.0"
ruby_version: "3.0"
"Weekly run specs against main":
triggers:
- schedule:
Expand All @@ -38,4 +59,6 @@ workflows:
- main
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
- run-specs-with-mysql:
name: "Run specs with MySQL and Ruby 3.1 on main"
ruby_version: "3.1"
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require:
- solidus_dev_support/rubocop

Gemspec/RequiredRubyVersion:
Enabled: false

AllCops:
NewCops: disable

Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ else
gem 'sqlite3'
end

gem 'solidus_social', github: 'solidusio-contrib/solidus_social', ref: 'eb542f3052430c208089366fc9ae458a9fe2d9a1'

gemspec

# Use a local Gemfile to include development dependencies that might not be
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/solidus_bolt/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def verify_bolt_request
signing_secret = SolidusBolt::BoltConfiguration.fetch&.signing_secret || ''
computed_hmac = Base64.encode64(OpenSSL::HMAC.digest("SHA256", signing_secret, permitted_params.to_json)).strip

return render json: { error: 'Unauthorized request' }, status: :unauthorized unless hmac_header == computed_hmac
render json: { error: 'Unauthorized request' }, status: :unauthorized unless hmac_header == computed_hmac
end
end
end
2 changes: 1 addition & 1 deletion bin/sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ unbundled bundle exec rails generate solidus:install \
$@

unbundled bundle exec rails generate solidus:auth:install
unbundled bundle exec rails generate ${extension_name}:install
unbundled bundle exec rails generate ${extension_name}:install --auto_run_migrations=true

echo
echo "🚀 Sandbox app successfully created for $extension_name!"
Expand Down
4 changes: 2 additions & 2 deletions solidus_bolt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.metadata['source_code_uri'] = 'https://github.com/solidusio/solidus_bolt'
spec.metadata['changelog_uri'] = 'https://github.com/solidusio/solidus_bolt/blob/main/CHANGELOG.md'

spec.required_ruby_version = Gem::Requirement.new('>= 2.5')
spec.required_ruby_version = Gem::Requirement.new('>= 3.0')

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand All @@ -41,7 +41,7 @@ Gem::Specification.new do |spec|

spec.add_development_dependency 'net-smtp'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'solidus_dev_support', '~> 2.5'
spec.add_development_dependency 'solidus_dev_support', '~> 2.7'
spec.add_development_dependency 'vcr'
spec.add_development_dependency 'webmock'
end
2 changes: 1 addition & 1 deletion spec/requests/spree/admin/bolt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
end

it 'creates a new SolidusBolt::BoltConfiguration record if no records are present' do
expect { get '/admin/bolt' }.to change { SolidusBolt::BoltConfiguration.count }.by(1)
expect { get '/admin/bolt' }.to change(SolidusBolt::BoltConfiguration, :count).by(1)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
before { bolt_payment_method }

it 'creates a new payment source with card ID' do
expect { sync_payment_sources }.to change { SolidusBolt::PaymentSource.count }.by(1)
expect { sync_payment_sources }.to change(SolidusBolt::PaymentSource, :count).by(1)
bolt_payment_source = SolidusBolt::PaymentSource.last
expect(bolt_payment_source.card_id).to be_present
expect(bolt_payment_source.card_expiration).to be_present
Expand Down