Does anyone here happen to know who maintains `sol...
# support
t
Does anyone here happen to know who maintains
solidus-contrib/solidus_product_assembly
? I've been trying to make that gem support Solidus 4, but my latest attempt is failing in the Circle specs in ways that don't seem to be related to the code itself, but rather some configuration. (Either that I don't have access to actually trigger the builds correctly, or else there's some Circle configuration that needs to be tweaked)
d
Hi Tom, I had the same problem today with another extension. I have updated the .circleci/config.yml file in the following way and everything has worked as expected.
Copy code
version: 2.1

orbs:
  # 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:
    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:
      - checkout
      - solidusio_extensions/run-tests-solidus-<< parameters.solidus >>

workflows:
  "Run specs on supported Solidus versions":
    jobs:
      - 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"] }

  "Weekly run specs against main":
    triggers:
      - schedule:
          cron: "0 0 * * 4" # every Thursday
          filters:
            branches:
              only:
                - main
    jobs:
      - 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"] }
t
Ooh, interesting - do you happen to have a link to the PR? The syntax used in the circle config for the Product Assembly gem looks a little different than what you have here, so I'd like to make sure I understand the diff a bit better.
d
sure! This is the PR
t
Perfect - thanks! That's really helpful.
🎉 1
That got me further, but it seems like there's something deeper unhappy in the spec setup or the library. Specifically, it seems like something is likely unhappy with Ruby 3+ and keyword args.
Copy code
/home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/activerecord-7.0.5/lib/active_record/associations.rb:1469:in `has_many': wrong number of arguments (given 3, expected 1..2) (ArgumentError)
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:73:in `block in included'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in `class_eval'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-globalize-1.0.0.alpha3/lib/friendly_id/history.rb:72:in `included'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-5.5.0/lib/friendly_id/configuration.rb:56:in `include'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-5.5.0/lib/friendly_id/configuration.rb:56:in `block in use'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-5.5.0/lib/friendly_id/configuration.rb:53:in `map'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-5.5.0/lib/friendly_id/configuration.rb:53:in `use'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/friendly_id-5.5.0/lib/friendly_id/base.rb:207:in `friendly_id'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/app/models/spree/product.rb:10:in `<class:Product>'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/app/models/spree/product.rb:8:in `<module:Spree>'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/app/models/spree/product.rb:3:in `<top (required)>'
	from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/gems/zeitwerk-2.6.8/lib/zeitwerk/kernel.rb:30:in `require'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/lib/spree/core/product_filters.rb:57:in `<module:ProductFilters>'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/lib/spree/core/product_filters.rb:47:in `<module:Core>'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/lib/spree/core/product_filters.rb:4:in `<module:Spree>'
	from /home/circleci/project/vendor/bundle/main/ruby/3.2.0/bundler/gems/solidus-a03f44349c9d/core/lib/spree/core/product_filters.rb:3:in `<top (required)>'
I'll have to see if I can debug this further, but if that rings a bell for anyone, I'm all ears! 🙂