Kaynağa Gözat

Merge pull request #13404 from thalesmg/20240703-r57-refactor-mix-common-deps

ci(mix): refactor to avoid conflicts
Thales Macedo Garitezi 1 yıl önce
ebeveyn
işleme
ae24b7a37b

+ 13 - 8
apps/emqx/mix.exs

@@ -28,7 +28,7 @@ defmodule EMQX.MixProject do
   def application do
     [
       ## FIXME!!! go though emqx.app.src and add missing stuff...
-      extra_applications: [:public_key, :ssl, :os_mon, :logger, :mnesia] ++ UMP.extra_applications(),
+      extra_applications: [:public_key, :ssl, :os_mon, :logger, :mnesia, :sasl] ++ UMP.extra_applications(),
       mod: {:emqx_app, []}
     ]
   end
@@ -37,14 +37,19 @@ defmodule EMQX.MixProject do
     ## FIXME!!! go though emqx.app.src and add missing stuff...
     [
       {:emqx_utils, in_umbrella: true},
-      {:emqx_ds_backends, in_umbrella: true},
+      # {:emqx_ds_backends, in_umbrella: true},
 
-      {:ekka, github: "emqx/ekka", tag: "0.19.3", override: true},
-      {:esockd, github: "emqx/esockd", tag: "5.11.2"},
-      {:gproc, github: "emqx/gproc", tag: "0.9.0.1", override: true},
-      {:hocon, github: "emqx/hocon", tag: "0.42.2", override: true},
-      {:lc, github: "emqx/lc", tag: "0.3.2", override: true},
-      {:ranch, github: "emqx/ranch", tag: "1.8.1-emqx", override: true},
+      UMP.common_dep(:gproc),
+      UMP.common_dep(:gen_rpc),
+      UMP.common_dep(:ekka),
+      UMP.common_dep(:esockd),
+      UMP.common_dep(:cowboy),
+      UMP.common_dep(:lc),
+      UMP.common_dep(:hocon),
+      UMP.common_dep(:ranch),
+      UMP.common_dep(:bcrypt),
+      UMP.common_dep(:pbkdf2),
+      UMP.common_dep(:emqx_http_lib),
     ] ++ UMP.quicer_dep()
   end
 

+ 1 - 1
apps/emqx_auth_http/mix.exs

@@ -29,7 +29,7 @@ defmodule EMQXAuthHTTP.MixProject do
       {:emqx_auth, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
       {:emqx_connector, in_umbrella: true},
-      {:hocon, github: "emqx/hocon", tag: "0.42.2", override: true}
+      UMP.common_dep(:hocon)
     ]
   end
 end

+ 1 - 1
apps/emqx_auth_jwt/mix.exs

@@ -28,7 +28,7 @@ defmodule EMQXAuthJWT.MixProject do
       {:emqx, in_umbrella: true},
       {:emqx_auth, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
-      {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"}
+      UMP.common_dep(:jose),
     ]
   end
 end

+ 5 - 1
apps/emqx_auth_mnesia/mix.exs

@@ -24,6 +24,10 @@ defmodule EMQXAuthMnesia.MixProject do
   end
 
   def deps() do
-    [{:emqx, in_umbrella: true}, {:emqx_auth, in_umbrella: true}]
+    [
+      {:emqx, in_umbrella: true},
+      {:emqx_auth, in_umbrella: true},
+      UMP.common_dep(:esasl),
+    ]
   end
 end

+ 1 - 1
apps/emqx_bridge_http/mix.exs

@@ -27,7 +27,7 @@ defmodule EMQXBridgeHTTP.MixProject do
     [
       {:emqx, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
-      {:ehttpc, github: "emqx/ehttpc", tag: "0.4.13"}
+      UMP.common_dep(:ehttpc),
     ]
   end
 end

+ 1 - 1
apps/emqx_bridge_mqtt/mix.exs

@@ -27,7 +27,7 @@ defmodule EMQXBridgeMQTT.MixProject do
     [
       {:emqx, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
-      {:emqtt, github: "emqx/emqtt", tag: "1.10.1", system_env: UMP.maybe_no_quic_env()}
+      UMP.common_dep(:emqtt),
     ]
   end
 end

+ 4 - 4
apps/emqx_connector/mix.exs

@@ -33,11 +33,11 @@ defmodule EMQXConnector.MixProject do
     [
       {:emqx, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
-      {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"},
-      {:ecpool, github: "emqx/ecpool", tag: "0.5.7"},
+      UMP.common_dep(:jose),
+      UMP.common_dep(:ecpool),
       {:eredis_cluster, github: "emqx/eredis_cluster", tag: "0.8.4"},
-      {:ehttpc, github: "emqx/ehttpc", tag: "0.4.13"},
-      {:emqtt, github: "emqx/emqtt", tag: "1.10.1", system_env: UMP.maybe_no_quic_env()}
+      UMP.common_dep(:ehttpc),
+      UMP.common_dep(:emqtt),
     ]
   end
 end

+ 2 - 2
apps/emqx_durable_storage/mix.exs

@@ -29,8 +29,8 @@ defmodule EMQXDurableStorage.MixProject do
   def deps() do
     [
       {:emqx_utils, in_umbrella: true},
-      {:gproc, github: "emqx/gproc", tag: "0.9.0.1"},
-      {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-5"},
+      UMP.common_dep(:rocksdb),
+      UMP.common_dep(:gproc),
       {:ra, "2.7.3"},
     ]
   end

+ 3 - 3
apps/emqx_enterprise/mix.exs

@@ -23,9 +23,9 @@ defmodule EMQXEnterprise.MixProject do
 
   def deps() do
     [
-      {:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.10"},
-      {:typerefl, github: "ieQu1/typerefl", tag: "0.9.1"},
-      {:hocon, github: "emqx/hocon", tag: "0.42.2"}
+      UMP.common_dep(:snabbkaffe),
+      UMP.common_dep(:typerefl),
+      UMP.common_dep(:hocon),
     ]
   end
 end

+ 1 - 1
apps/emqx_exhook/mix.exs

@@ -38,7 +38,7 @@ defmodule EMQXExhook.MixProject do
     [
       {:emqx, in_umbrella: true},
       {:emqx_utils, in_umbrella: true},
-      {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true}
+      UMP.common_dep(:grpc)
     ]
   end
 

+ 1 - 1
apps/emqx_gateway_exproto/mix.exs

@@ -37,7 +37,7 @@ defmodule EMQXGatewayExproto.MixProject do
       {:emqx, in_umbrella: true},
       {:emqx_utils, in_umbrella: true},
       {:emqx_gateway, in_umbrella: true},
-      {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true}
+      UMP.common_dep(:grpc)
     ]
   end
 end

+ 1 - 1
apps/emqx_gcp_device/mix.exs

@@ -29,7 +29,7 @@ defmodule EMQXGCPDevice.MixProject do
     [
       {:emqx, in_umbrella: true},
       {:emqx_auth, in_umbrella: true},
-      {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"}
+      UMP.common_dep(:jose),
     ]
   end
 

+ 1 - 1
apps/emqx_machine/mix.exs

@@ -29,7 +29,7 @@ defmodule EMQXMachine.MixProject do
       {:emqx_conf, in_umbrella: true, runtime: false},
       {:emqx_dashboard, in_umbrella: true, runtime: false},
       {:emqx_management, in_umbrella: true, runtime: false},
-      {:covertool, github: "zmstone/covertool", tag: "2.0.4.1"}
+      UMP.common_dep(:covertool),
     ]
   end
 end

+ 1 - 1
apps/emqx_postgresql/mix.exs

@@ -23,7 +23,7 @@ defmodule EMQXPostgresql.MixProject do
 
   def deps() do
     [
-      {:epgsql, github: "emqx/epgsql", tag: "4.7.1.2"},
+      UMP.common_dep(:epgsql),
       {:emqx_connector, in_umbrella: true, runtime: false},
       {:emqx_resource, in_umbrella: true}
     ]

+ 4 - 4
apps/emqx_resource/mix.exs

@@ -26,10 +26,10 @@ defmodule EMQXResource.MixProject do
   def deps() do
     [
       {:emqx, in_umbrella: true},
-      {:ecpool, github: "emqx/ecpool", tag: "0.5.7"},
-      {:gproc, github: "emqx/gproc", tag: "0.9.0.1"},
-      {:jsx, github: "talentdeficit/jsx", tag: "v3.1.0"},
-      {:telemetry, "1.1.0"}
+      UMP.common_dep(:ecpool),
+      UMP.common_dep(:gproc),
+      UMP.common_dep(:jsx),
+      UMP.common_dep(:telemetry),
     ]
   end
 end

+ 2 - 6
apps/emqx_rule_engine/mix.exs

@@ -29,12 +29,8 @@ defmodule EMQXRuleEngine.MixProject do
       {:emqx_modules, in_umbrella: true},
       {:emqx_resource, in_umbrella: true},
       {:emqx_bridge, in_umbrella: true},
-      {:emqtt,
-       github: "emqx/emqtt", tag: "1.10.1", override: true, system_env: maybe_no_quic_env()}
+      UMP.common_dep(:rulesql),
+      UMP.common_dep(:emqtt),
     ]
   end
-
-  defp maybe_no_quic_env() do
-    UMP.maybe_no_quic_env()
-  end
 end

+ 2 - 2
apps/emqx_s3/mix.exs

@@ -27,8 +27,8 @@ defmodule EMQXS3.MixProject do
   def deps() do
     [
       {:emqx, in_umbrella: true},
-      {:gproc, github: "emqx/gproc", tag: "0.9.0.1"},
-      {:ehttpc, github: "emqx/ehttpc", tag: "0.4.13"},
+      UMP.common_dep(:gproc),
+      UMP.common_dep(:ehttpc),
       {:erlcloud, github: "emqx/erlcloud", tag: "3.7.0.3"},
       {:emqx_bridge_http, in_umbrella: true, runtime: false}
     ]

+ 1 - 1
apps/emqx_schema_registry/mix.exs

@@ -28,7 +28,7 @@ defmodule EMQXSchemaRegistry.MixProject do
       {:emqx_rule_engine, in_umbrella: true},
       {:erlavro, github: "emqx/erlavro", tag: "2.10.0"},
       {:jesse, github: "emqx/jesse", tag: "1.8.0"},
-      {:gpb, "4.19.9"}
+      UMP.common_dep(:gpb),
     ]
   end
 end

+ 3 - 3
apps/emqx_utils/mix.exs

@@ -26,9 +26,9 @@ defmodule EMQXUtils.MixProject do
 
   def deps() do
     [
-      {:jiffy, github: "emqx/jiffy", tag: "1.0.6"},
-      {:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.3"},
-      {:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.10", override: true},
+      UMP.common_dep(:jiffy),
+      UMP.common_dep(:emqx_http_lib),
+      UMP.common_dep(:snabbkaffe),
     ]
   end
 end

+ 208 - 85
mix.exs

@@ -29,107 +29,230 @@ defmodule EMQXUmbrella.MixProject do
       tarball along with the release.
   """
 
+  # TODO: remove once we switch to the new mix build
+  def new_mix_build?() do
+    System.get_env("NEW_MIX_BUILD") == "1"
+  end
+
   def project() do
     profile_info = check_profile!()
     version = pkg_vsn()
 
-    [
-      # TODO: these lines will be uncommented when we switch to using mix as the manager
-      # for all umbrella apps.
-      # apps_path: "apps",
-      # apps: applications(profile_info.release_type, profile_info.edition_type) |> Keyword.keys(),
-
-      app: :emqx_mix,
-      erlc_options: erlc_options(profile_info, version),
-      version: version,
-      deps: deps(profile_info, version),
-      releases: releases(),
-      aliases: aliases()
-    ]
+    if new_mix_build?() do
+      [
+        # TODO: these lines will be uncommented when we switch to using mix as the manager
+        # for all umbrella apps.
+        apps_path: "apps",
+        apps:
+          applications(profile_info.release_type, profile_info.edition_type) |> Keyword.keys(),
+        erlc_options: erlc_options(profile_info, version),
+        version: version,
+        deps: deps(profile_info, version),
+        releases: releases(),
+        aliases: aliases()
+      ]
+    else
+      # TODO: this check and clause will be removed when we switch to using mix as the
+      # manager for all umbrella apps.
+      [
+        app: :emqx_mix,
+        erlc_options: erlc_options(profile_info, version),
+        version: version,
+        deps: deps(profile_info, version),
+        releases: releases(),
+        aliases: aliases()
+      ]
+    end
   end
 
-  defp deps(profile_info, version) do
+  @doc """
+  Please try to add dependencies that used by a single umbrella application in the
+  application's own `mix.exs` file, if possible.  If it's shared by more than one
+  application, or if the dependency requires an `override: true` option, add a new clause
+  to `common_dep/1` so that we centralize versions in this root `mix.exs` file as much as
+  possible.
+
+  Here, transitive dependencies from our app dependencies should be placed when there's a
+  need to override them.  For example, since `jsone` is a dependency to `rocketmq` and to
+  `erlavro`, which are both dependencies and not umbrella apps, we need to add the
+  override here.  Also, there are cases where adding `override: true` to the umbrella
+  application dependency simply won't satisfy mix.  In such cases, it's fine to add it
+  here.
+  """
+  def deps(profile_info, version) do
     # we need several overrides here because dependencies specify
     # other exact versions, and not ranges.
 
-    ## TODO: this should be removed once we migrate the release build to mix
+    if new_mix_build?() do
+      new_deps()
+    else
+      old_deps(profile_info, version)
+    end
+  end
+
+  def new_deps() do
+    quicer_dep() ++
+      jq_dep() ++
+      extra_release_apps() ++
+      overridden_deps()
+  end
+
+  ## TODO: this should be removed once we migrate the release build to mix
+  defp old_deps(profile_info, version) do
     rebar3_umbrella_apps = emqx_apps(profile_info, version) ++ enterprise_deps(profile_info)
 
     common_deps() ++
-      [
-        {:lc, github: "emqx/lc", tag: "0.3.2", override: true},
-        {:redbug, github: "emqx/redbug", tag: "2.0.10"},
-        {:covertool, github: "zmstone/covertool", tag: "2.0.4.1", override: true},
-        {:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true},
-        {:ehttpc, github: "emqx/ehttpc", tag: "0.4.14", override: true},
-        {:gproc, github: "emqx/gproc", tag: "0.9.0.1", override: true},
-        {:jiffy, github: "emqx/jiffy", tag: "1.0.6", override: true},
-        {:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true},
-        {:esockd, github: "emqx/esockd", tag: "5.11.2", override: true},
-        {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-5", override: true},
-        {:ekka, github: "emqx/ekka", tag: "0.19.5", override: true},
-        {:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.1", override: true},
-        {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true},
-        {:minirest, github: "emqx/minirest", tag: "1.4.3", override: true},
-        {:ecpool, github: "emqx/ecpool", tag: "0.5.7", override: true},
-        {:replayq, github: "emqx/replayq", tag: "0.3.8", override: true},
-        {:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true},
-        # maybe forbid to fetch quicer
-        {:emqtt,
-         github: "emqx/emqtt", tag: "1.10.1", override: true, system_env: maybe_no_quic_env()},
-        {:rulesql, github: "emqx/rulesql", tag: "0.2.1"},
-        {:observer_cli, "1.7.1"},
-        {:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.5"},
-        {:telemetry, "1.1.0", override: true},
-        # in conflict by emqtt and hocon
-        {:getopt, "1.0.2", override: true},
-        {
-          :snabbkaffe,
-          ## without this, snabbkaffe is compiled with `-define(snk_kind, '$kind')`, which
-          ## will basically make events in tests never match any predicates.
-          github: "kafka4beam/snabbkaffe",
-          tag: "1.0.10",
-          override: true,
-          system_env: emqx_app_system_env(profile_info, version)
-        },
-        {:hocon, github: "emqx/hocon", tag: "0.42.2", override: true},
-        {:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.3", override: true},
-        {:esasl, github: "emqx/esasl", tag: "0.2.1"},
-        {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2", override: true},
-        # in conflict by ehttpc and emqtt
-        {:gun, github: "emqx/gun", tag: "1.3.11", override: true},
-        # in conflict by emqx_connector and system_monitor
-        {:epgsql, github: "emqx/epgsql", tag: "4.7.1.2", override: true},
-        # in conflict by emqx and observer_cli
-        {:recon, github: "ferd/recon", tag: "2.5.1", override: true},
-        {:jsx, github: "talentdeficit/jsx", tag: "v3.1.0", override: true},
-        # in conflict by erlavro and rocketmq
-        {:jsone, github: "emqx/jsone", tag: "1.7.1", override: true},
-        # dependencies of dependencies; we choose specific refs to match
-        # what rebar3 chooses.
-        # in conflict by gun and emqtt
-        {:cowlib,
-         github: "ninenines/cowlib",
-         ref: "c6553f8308a2ca5dcd69d845f0a7d098c40c3363",
-         override: true},
-        # in conflict by cowboy_swagger and cowboy
-        {:ranch, github: "emqx/ranch", tag: "1.8.1-emqx", override: true},
-        # in conflict by grpc and eetcd
-        {:gpb, "4.19.9", override: true, runtime: false},
-        {:hackney, github: "emqx/hackney", tag: "1.18.1-1", override: true},
-        # set by hackney (dependency)
-        {:ssl_verify_fun, "1.1.7", override: true},
-        {:rfc3339, github: "emqx/rfc3339", tag: "0.2.3", override: true},
-        {:bcrypt, github: "emqx/erlang-bcrypt", tag: "0.6.2", override: true},
-        {:uuid, github: "okeuday/uuid", tag: "v2.0.6", override: true},
-        {:quickrand, github: "okeuday/quickrand", tag: "v2.0.6", override: true},
-        {:ra, "2.7.3", override: true},
-        {:mimerl, "1.2.0", override: true}
-      ] ++
+      extra_release_apps() ++
+      overridden_deps() ++
       jq_dep() ++
       quicer_dep() ++ rebar3_umbrella_apps
   end
 
+  def overridden_deps() do
+    [
+      common_dep(:lc),
+      common_dep(:covertool),
+      common_dep(:typerefl),
+      common_dep(:ehttpc),
+      common_dep(:gproc),
+      common_dep(:jiffy),
+      common_dep(:cowboy),
+      common_dep(:esockd),
+      common_dep(:rocksdb),
+      common_dep(:ekka),
+      common_dep(:gen_rpc),
+      common_dep(:grpc),
+      common_dep(:minirest),
+      common_dep(:ecpool),
+      common_dep(:replayq),
+      common_dep(:pbkdf2),
+      # maybe forbid to fetch quicer
+      common_dep(:emqtt),
+      common_dep(:rulesql),
+      common_dep(:telemetry),
+      # in conflict by emqtt and hocon
+      common_dep(:getopt),
+      common_dep(:snabbkaffe),
+      common_dep(:hocon),
+      common_dep(:emqx_http_lib),
+      common_dep(:esasl),
+      common_dep(:jose),
+      # in conflict by ehttpc and emqtt
+      common_dep(:gun),
+      # in conflict by emqx_connector and system_monitor
+      common_dep(:epgsql),
+      # in conflict by emqx and observer_cli
+      {:recon, github: "ferd/recon", tag: "2.5.1", override: true},
+      common_dep(:jsx),
+      # in conflict by erlavro and rocketmq
+      common_dep(:jsone),
+      # dependencies of dependencies; we choose specific refs to match
+      # what rebar3 chooses.
+      # in conflict by gun and emqtt
+      common_dep(:cowlib),
+      # in conflict by cowboy_swagger and cowboy
+      common_dep(:ranch),
+      # in conflict by grpc and eetcd
+      common_dep(:gpb),
+      {:hackney, github: "emqx/hackney", tag: "1.18.1-1", override: true},
+      # set by hackney (dependency)
+      {:ssl_verify_fun, "1.1.7", override: true},
+      common_dep(:rfc3339),
+      common_dep(:bcrypt),
+      {:uuid, github: "okeuday/uuid", tag: "v2.0.6", override: true},
+      {:quickrand, github: "okeuday/quickrand", tag: "v2.0.6", override: true},
+      {:ra, "2.7.3", override: true},
+      {:mimerl, "1.2.0", override: true}
+    ]
+  end
+
+  def extra_release_apps() do
+    [
+      {:redbug, github: "emqx/redbug", tag: "2.0.10"},
+      {:observer_cli, "1.7.1"},
+      {:system_monitor, github: "ieQu1/system_monitor", tag: "3.0.5"}
+    ]
+  end
+
+  def common_dep(:ekka), do: {:ekka, github: "emqx/ekka", tag: "0.19.5", override: true}
+  def common_dep(:esockd), do: {:esockd, github: "emqx/esockd", tag: "5.11.2", override: true}
+  def common_dep(:gproc), do: {:gproc, github: "emqx/gproc", tag: "0.9.0.1", override: true}
+  def common_dep(:hocon), do: {:hocon, github: "emqx/hocon", tag: "0.42.2", override: true}
+  def common_dep(:lc), do: {:lc, github: "emqx/lc", tag: "0.3.2", override: true}
+  # in conflict by ehttpc and emqtt
+  def common_dep(:gun), do: {:gun, github: "emqx/gun", tag: "1.3.11", override: true}
+  # in conflict by cowboy_swagger and cowboy
+  def common_dep(:ranch), do: {:ranch, github: "emqx/ranch", tag: "1.8.1-emqx", override: true}
+  def common_dep(:ehttpc), do: {:ehttpc, github: "emqx/ehttpc", tag: "0.4.14", override: true}
+  def common_dep(:jiffy), do: {:jiffy, github: "emqx/jiffy", tag: "1.0.6", override: true}
+  def common_dep(:grpc), do: {:grpc, github: "emqx/grpc-erl", tag: "0.6.12", override: true}
+  def common_dep(:cowboy), do: {:cowboy, github: "emqx/cowboy", tag: "2.9.2", override: true}
+  def common_dep(:jsone), do: {:jsone, github: "emqx/jsone", tag: "1.7.1", override: true}
+  def common_dep(:ecpool), do: {:ecpool, github: "emqx/ecpool", tag: "0.5.7", override: true}
+  def common_dep(:replayq), do: {:replayq, github: "emqx/replayq", tag: "0.3.8", override: true}
+  def common_dep(:jsx), do: {:jsx, github: "talentdeficit/jsx", tag: "v3.1.0", override: true}
+  # in conflict by emqtt and hocon
+  def common_dep(:getopt), do: {:getopt, "1.0.2", override: true}
+  def common_dep(:telemetry), do: {:telemetry, "1.1.0", override: true}
+  # in conflict by grpc and eetcd
+  def common_dep(:gpb), do: {:gpb, "4.19.9", override: true, runtime: false}
+
+  def common_dep(:covertool),
+    do: {:covertool, github: "zmstone/covertool", tag: "2.0.4.1", override: true}
+
+  # in conflict by emqx_connector and system_monitor
+  def common_dep(:epgsql), do: {:epgsql, github: "emqx/epgsql", tag: "4.7.1.2", override: true}
+  def common_dep(:esasl), do: {:esasl, github: "emqx/esasl", tag: "0.2.1"}
+  def common_dep(:gen_rpc), do: {:gen_rpc, github: "emqx/gen_rpc", tag: "3.3.1", override: true}
+
+  def common_dep(:jose),
+    do: {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2", override: true}
+
+  def common_dep(:rulesql), do: {:rulesql, github: "emqx/rulesql", tag: "0.2.1"}
+
+  def common_dep(:pbkdf2),
+    do: {:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4", override: true}
+
+  def common_dep(:bcrypt),
+    do: {:bcrypt, github: "emqx/erlang-bcrypt", tag: "0.6.2", override: true}
+
+  # hex version 0.2.2 used by `jesse` has buggy mix.exs
+  def common_dep(:rfc3339), do: {:rfc3339, github: "emqx/rfc3339", tag: "0.2.3", override: true}
+
+  def common_dep(:minirest),
+    do: {:minirest, github: "emqx/minirest", tag: "1.4.3", override: true}
+
+  # maybe forbid to fetch quicer
+  def common_dep(:emqtt),
+    do:
+      {:emqtt,
+       github: "emqx/emqtt", tag: "1.10.1", override: true, system_env: maybe_no_quic_env()}
+
+  def common_dep(:typerefl),
+    do: {:typerefl, github: "ieQu1/typerefl", tag: "0.9.1", override: true}
+
+  def common_dep(:rocksdb),
+    do: {:rocksdb, github: "emqx/erlang-rocksdb", tag: "1.8.0-emqx-5", override: true}
+
+  def common_dep(:emqx_http_lib),
+    do: {:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.3", override: true}
+
+  def common_dep(:cowlib),
+    do:
+      {:cowlib,
+       github: "ninenines/cowlib", ref: "c6553f8308a2ca5dcd69d845f0a7d098c40c3363", override: true}
+
+  def common_dep(:snabbkaffe),
+    do: {
+      :snabbkaffe,
+      ## without this, snabbkaffe is compiled with `-define(snk_kind, '$kind')`, which
+      ## will basically make events in tests never match any predicates.
+      github: "kafka4beam/snabbkaffe",
+      tag: "1.0.10",
+      override: true,
+      system_env: emqx_app_system_env(profile_info(), pkg_vsn())
+    }
+
   ###############################################################################################
   # BEGIN DEPRECATED FOR MIX BLOCK
   # These should be removed once we fully migrate to mix