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

Update solidus4 compatibility #92

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,73 @@
version: 2.1

orbs:
# Required for feature specs.
browser-tools: circleci/[email protected]

# Always take the latest version of the orb, this allows us to
# 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@volatile

jobs:
run-specs-with-postgres:
executor: solidusio_extensions/postgres
run-specs:
parameters:
solidus:
type: string
default: main
db:
type: string
default: "postgres"
ruby:
type: string
default: "3.2"
executor:
name: solidusio_extensions/<< parameters.db >>
ruby_version: << parameters.ruby >>
steps:
- solidusio_extensions/run-tests
run-specs-with-mysql:
executor: solidusio_extensions/mysql
- checkout
- browser-tools/install-chrome
- solidusio_extensions/run-tests-solidus-<< parameters.solidus >>

lint-code:
executor:
name: solidusio_extensions/sqlite
ruby_version: "3.1"
steps:
- solidusio_extensions/run-tests
- solidusio_extensions/lint-code

workflows:
"Run specs on supported Solidus versions":
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
"Weekly run specs against master":
- run-specs:
name: &name "run-specs-solidus-<< matrix.solidus >>-ruby-<< matrix.ruby >>-db-<< matrix.db >>"
matrix:
parameters: { solidus: ["main"], ruby: ["3.2"], db: ["postgres"] }
- run-specs:
name: *name
matrix:
parameters: { solidus: ["current"], ruby: ["3.1"], db: ["mysql"] }
- run-specs:
name: *name
matrix:
parameters: { solidus: ["older"], ruby: ["3.0"], db: ["sqlite"] }
- lint-code

"Weekly run specs against main":
triggers:
- schedule:
cron: "0 0 * * 4" # every Thursday
filters:
branches:
only:
- master
- main
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
- run-specs:
name: *name
matrix:
parameters: { solidus: ["main"], ruby: ["3.2"], db: ["postgres"] }
- run-specs:
name: *name
matrix:
parameters: { solidus: ["current"], ruby: ["3.1"], db: ["mysql"] }
18 changes: 1 addition & 17 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
_extends: .github
2 changes: 2 additions & 0 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
issues=false
exclude-labels=infrastructure
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
.sass-cache
coverage
Gemfile.lock
Gemfile-local
tmp
nbproject
pkg
*.swp
spec/dummy
spec/examples.txt
/sandbox
.rvmrc
.ruby-version
.ruby-gemset
99 changes: 67 additions & 32 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-01-21 11:29:49 +0100 using RuboCop version 0.76.0.
# on 2025-01-11 17:52:21 UTC using RuboCop version 1.70.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: 3
# Cop supports --auto-correct.
# Offense count: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation
Layout/AlignArguments:
Layout/ArgumentAlignment:
Exclude:
- 'config/initializers/ransack.rb'
- 'spec/features/admin/gift_cards_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleAlignWith, Severity.
# SupportedStylesAlignWith: start_of_line, def
Layout/DefEndAlignment:
Exclude:
- 'app/controllers/spree/api/gift_cards_controller.rb'

# Offense count: 4
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/models/spree/order_contents_spec.rb'
- 'spec/models/spree/virtual_gift_card_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperator:
Exclude:
- 'lib/solidus_virtual_gift_card/engine.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect.
Lint/UselessAssignment:
Exclude:
- 'spec/models/spree/order_contents_spec.rb'

# Offense count: 3
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
# SupportedStyles: snake_case, normalcase, non_integer
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
Naming/VariableNumber:
Exclude:
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/order_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect.
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/TimesMap:
Exclude:
- 'app/models/spree/redemption_code_generator.rb'
Expand All @@ -54,7 +66,7 @@ RSpec/AnyInstance:
- 'spec/features/admin/products_card_spec.rb'

# Offense count: 45
# Configuration parameters: Prefixes.
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
Expand All @@ -67,6 +79,7 @@ RSpec/ContextWording:
- 'spec/models/spree/virtual_gift_card_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/lib/tasks/send_gift_card_emails_spec.rb'
Expand Down Expand Up @@ -98,12 +111,17 @@ RSpec/MessageSpies:
EnforcedStyle: receive

# Offense count: 17
# Configuration parameters: AggregateFailuresByDefault.
RSpec/MultipleExpectations:
Max: 6

# Offense count: 42
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 14

# Offense count: 100
# Configuration parameters: IgnoreSharedExamples.
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/controllers/spree/admin/gift_cards_controller_spec.rb'
Expand All @@ -118,14 +136,30 @@ RSpec/NamedSubject:
- 'spec/models/spree/virtual_gift_card_spec.rb'

# Offense count: 31
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 6

# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/models/spree/virtual_gift_card_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect.
RSpec/ScatteredLet:
Exclude:
- 'spec/controllers/spree/api/gift_cards_controller_spec.rb'

# Offense count: 12
RSpec/StubbedMock:
Exclude:
- 'spec/controllers/spree/admin/gift_cards_controller_spec.rb'
- 'spec/lib/tasks/send_gift_card_emails_spec.rb'
- 'spec/models/spree/order_spec.rb'
- 'spec/models/spree/virtual_gift_card_spec.rb'

# Offense count: 6
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Expand All @@ -136,13 +170,14 @@ RSpec/VerifiedDoubles:

# Offense count: 1
# Configuration parameters: Include.
# Include: db/migrate/*.rb
# Include: db/**/*.rb
Rails/CreateTableWithTimestamps:
Exclude:
- 'db/migrate/20140623152903_create_virtual_gift_card.rb'

# Offense count: 6
# Configuration parameters: EnforcedStyle.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowToTime.
# SupportedStyles: strict, flexible
Rails/Date:
Exclude:
Expand All @@ -152,32 +187,31 @@ Rails/Date:
- 'spec/models/spree/order_contents_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/FindBy:
Exclude:
- 'app/models/spree/virtual_gift_card.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Rails/Output:
Exclude:
- 'lib/generators/solidus_virtual_gift_card/install/install_generator.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ReflectionClassName:
Exclude:
- 'app/models/spree/virtual_gift_card.rb'

# Offense count: 3
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/20151111211220_backfill_inventory_units_on_gift_card.rb'
- 'spec/controllers/spree/admin/gift_cards_controller_spec.rb'
- 'spec/features/admin/gift_cards_spec.rb'

# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
Expand All @@ -188,15 +222,16 @@ Style/ClassAndModuleChildren:
- 'app/models/spree/virtual_gift_card.rb'

# Offense count: 4
# Configuration parameters: MinBodyLength.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/controllers/spree/admin/gift_cards_controller.rb'
- 'app/decorators/models/solidus_virtual_gift_card/spree/order_contents_decorator.rb'

# Offense count: 41
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 24
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 170
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

See https://github.com/solidusio-contrib/solidus_virtual_gift_card/releases or OLD_CHANGELOG.md for older versions.
Loading