oban-bg/oban

Upgrading to Oban 2.17.4 from 2.17.3 fails compilation step with `no function clause matching in Ecto.Query.with_cte/3 `

Closed this issue · 1 comments

Precheck

  • Do a quick search and make sure the bug has not yet been reported
  • For support, favor using the Elixir Forum, Slack, IRC, etc.
  • Be friendly and polite!

Environment

  • Oban Version: 2.17.4
  • PostgreSQL Version: 12.3
  • Elixir & Erlang/OTP Versions (elixir --version): elixir 1.16.1-otp-26, erlang 26.2.1

Current Behavior

Upgrading to Oban 2.17.4 from 2.17.3 fails compilation step. To add, we are using Ecto 3.9.6.

==> oban
Compiling 56 files (.ex)

== Compilation error in file lib/oban/engines/basic.ex ==
** (FunctionClauseError) no function clause matching in Ecto.Query.with_cte/3    
    (ecto 3.9.6) expanding macro: Ecto.Query.with_cte/3
    lib/oban/engines/basic.ex:107: Oban.Engines.Basic.fetch_jobs/3
    (elixir 1.16.1) expanding macro: Kernel.|>/2
    lib/oban/engines/basic.ex:107: Oban.Engines.Basic.fetch_jobs/3
    (ecto 3.9.6) expanding macro: Ecto.Query.select/3
    lib/oban/engines/basic.ex:111: Oban.Engines.Basic.fetch_jobs/3
    (elixir 1.16.1) expanding macro: Kernel.|>/2
    lib/oban/engines/basic.ex:111: Oban.Engines.Basic.fetch_jobs/3
could not compile dependency :oban, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile oban --force", update it with "mix deps.update oban" or clean it with "mix deps.clean oban"

I looked into it and Ecto.Query.with_cte/3 actually exists in Ecto 3.9.6. The with_cte function was also recently changed in 2.17.4: 02541e8

I admittedly have a limited knowledge of this specific command and function so I cannot debug further. Let me know if you need more info!

Expected Behavior

It should compile.

The materialized option used in Oban v2.17.4 wasn’t released until Ecto 3.10. Bumping up Ecto will fix the problem, and we’ll update Oban’s requirement.