From a32b8d8071cec0b8757bb62e5a76958d76461153 Mon Sep 17 00:00:00 2001 From: Juan Francisco Huete Verdejo Date: Mon, 9 Mar 2026 12:41:17 +0100 Subject: [PATCH 1/5] chore: TD-7718 Set graph dependency as optional (to avoid conflict in td-ai) --- CHANGELOG.md | 4 ++++ mix.exs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 367cc3d..4e8ce76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased] + +- [TD-7718] Set graph dependency as optional (to avoid conflict in td-ai) + [7.12.0] 2025-10-28 ### Added diff --git a/mix.exs b/mix.exs index 24b01b6..09568b9 100644 --- a/mix.exs +++ b/mix.exs @@ -32,7 +32,7 @@ defmodule TdCache.MixProject do {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: :dev, runtime: false}, {:ex_machina, "~> 2.8", only: :test}, - {:graph, git: "https://github.com/Bluetab/graph.git", tag: "1.4.0"}, + {:graph, git: "https://github.com/Bluetab/graph.git", tag: "1.4.0", optional: true}, {:jason, "~> 1.4"}, {:redix, "~> 1.5"} ] From 76becd3cdf0045a733df321f0be645c32b6c03cf Mon Sep 17 00:00:00 2001 From: "saul.isern" Date: Tue, 10 Mar 2026 16:43:45 +0100 Subject: [PATCH 2/5] refactor: rename Graph to Bluetab.Graph --- lib/td_cache/domain_cache.ex | 10 +++++----- lib/td_cache/taxonomy_cache.ex | 8 ++++---- mix.exs | 2 +- mix.lock | 2 +- test/td_cache/domain_cache_test.exs | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/td_cache/domain_cache.ex b/lib/td_cache/domain_cache.ex index 19c7a70..3471d48 100644 --- a/lib/td_cache/domain_cache.ex +++ b/lib/td_cache/domain_cache.ex @@ -229,22 +229,22 @@ defmodule TdCache.DomainCache do defp to_id(id) when is_binary(id), do: String.to_integer(id) defp create_graph(entries) do - create_graph(Graph.new([], acyclic: true), entries) + create_graph(Bluetab.Graph.new([], acyclic: true), entries) end defp create_graph(graph, []), do: graph defp create_graph(graph, [child_id, child_id | entries]) do graph - |> Graph.add_vertex(child_id) + |> Bluetab.Graph.add_vertex(child_id) |> create_graph(entries) end defp create_graph(graph, [child_id, parent_id | entries]) do graph - |> Graph.add_vertex(child_id) - |> Graph.add_vertex(parent_id) - |> Graph.add_edge(parent_id, child_id) + |> Bluetab.Graph.add_vertex(child_id) + |> Bluetab.Graph.add_vertex(parent_id) + |> Bluetab.Graph.add_edge(parent_id, child_id) |> create_graph(entries) end diff --git a/lib/td_cache/taxonomy_cache.ex b/lib/td_cache/taxonomy_cache.ex index e2f94b2..0bbb3b1 100644 --- a/lib/td_cache/taxonomy_cache.ex +++ b/lib/td_cache/taxonomy_cache.ex @@ -109,8 +109,8 @@ defmodule TdCache.TaxonomyCache do defp do_get_reaching_ids(domain_id, tree) do domain_id |> List.wrap() - |> Enum.filter(&Graph.has_vertex?(tree, &1)) - |> Graph.Traversal.reaching(tree) + |> Enum.filter(&Bluetab.Graph.has_vertex?(tree, &1)) + |> Bluetab.Graph.Traversal.reaching(tree) |> Enum.reject(&(&1 == 0)) |> Enum.reverse() end @@ -118,8 +118,8 @@ defmodule TdCache.TaxonomyCache do defp do_get_reachable_ids(domain_id, tree) do domain_id |> List.wrap() - |> Enum.filter(&Graph.has_vertex?(tree, &1)) - |> Graph.Traversal.reachable(tree) + |> Enum.filter(&Bluetab.Graph.has_vertex?(tree, &1)) + |> Bluetab.Graph.Traversal.reachable(tree) end defp to_integer(id) when is_integer(id), do: id diff --git a/mix.exs b/mix.exs index 09568b9..9a647c9 100644 --- a/mix.exs +++ b/mix.exs @@ -32,7 +32,7 @@ defmodule TdCache.MixProject do {:credo, "~> 1.7.11", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: :dev, runtime: false}, {:ex_machina, "~> 2.8", only: :test}, - {:graph, git: "https://github.com/Bluetab/graph.git", tag: "1.4.0", optional: true}, + {:graph, git: "https://github.com/Bluetab/graph.git", tag: "8.3.0"}, {:jason, "~> 1.4"}, {:redix, "~> 1.5"} ] diff --git a/mix.lock b/mix.lock index f735735..600fe86 100644 --- a/mix.lock +++ b/mix.lock @@ -8,7 +8,7 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_machina": {:hex, :ex_machina, "2.8.0", "a0e847b5712065055ec3255840e2c78ef9366634d62390839d4880483be38abe", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm", "79fe1a9c64c0c1c1fab6c4fa5d871682cb90de5885320c187d117004627a7729"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, - "graph": {:git, "https://github.com/Bluetab/graph.git", "9e0897eabbf3c0f598e937c060b6700368ab9563", [tag: "1.4.0"]}, + "graph": {:git, "https://github.com/Bluetab/graph.git", "b71054befe048625aeff0b3e964567d1611c96fd", [tag: "8.3.0"]}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "redix": {:hex, :redix, "1.5.2", "ab854435a663f01ce7b7847f42f5da067eea7a3a10c0a9d560fa52038fd7ab48", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:nimble_options, "~> 0.5.0 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "78538d184231a5d6912f20567d76a49d1be7d3fca0e1aaaa20f4df8e1142dcb8"}, diff --git a/test/td_cache/domain_cache_test.exs b/test/td_cache/domain_cache_test.exs index 81c2680..7315cc8 100644 --- a/test/td_cache/domain_cache_test.exs +++ b/test/td_cache/domain_cache_test.exs @@ -108,14 +108,14 @@ defmodule TdCache.DomainCacheTest do domains: domains, children: children } do - assert %Graph{} = tree = DomainCache.tree() - ids = Graph.out_neighbours(tree, 0) + assert %Bluetab.Graph{} = tree = DomainCache.tree() + ids = Bluetab.Graph.out_neighbours(tree, 0) assert_lists_equal(ids, parents, &(&1 == &2.id)) - ids = Enum.flat_map(ids, &Graph.out_neighbours(tree, &1)) + ids = Enum.flat_map(ids, &Bluetab.Graph.out_neighbours(tree, &1)) assert_lists_equal(ids, domains, &(&1 == &2.id)) - ids = Enum.flat_map(ids, &Graph.out_neighbours(tree, &1)) + ids = Enum.flat_map(ids, &Bluetab.Graph.out_neighbours(tree, &1)) assert_lists_equal(ids, children, &(&1 == &2.id)) - ids = Enum.flat_map(ids, &Graph.out_neighbours(tree, &1)) + ids = Enum.flat_map(ids, &Bluetab.Graph.out_neighbours(tree, &1)) assert ids == [] end end From 912a80682761d862598a70ef8799f8e0804c84f4 Mon Sep 17 00:00:00 2001 From: "saul.isern" Date: Tue, 10 Mar 2026 16:44:51 +0100 Subject: [PATCH 3/5] doc: CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8ce76..25f2654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ ## [Unreleased] -- [TD-7718] Set graph dependency as optional (to avoid conflict in td-ai) +### Changed + +- [TD-7718] Rename `Graph` module to `Bluetab.Graph` [7.12.0] 2025-10-28 From 46df57c4f3c7b0aa55b998378e4339747542f4a2 Mon Sep 17 00:00:00 2001 From: "saul.isern" Date: Tue, 10 Mar 2026 16:47:17 +0100 Subject: [PATCH 4/5] chore: credo issues --- lib/td_cache/taxonomy_cache.ex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/td_cache/taxonomy_cache.ex b/lib/td_cache/taxonomy_cache.ex index 0bbb3b1..1a134ad 100644 --- a/lib/td_cache/taxonomy_cache.ex +++ b/lib/td_cache/taxonomy_cache.ex @@ -4,6 +4,7 @@ defmodule TdCache.TaxonomyCache do """ use GenServer + alias Bluetab.Graph alias TdCache.AclCache alias TdCache.DomainCache @@ -109,8 +110,8 @@ defmodule TdCache.TaxonomyCache do defp do_get_reaching_ids(domain_id, tree) do domain_id |> List.wrap() - |> Enum.filter(&Bluetab.Graph.has_vertex?(tree, &1)) - |> Bluetab.Graph.Traversal.reaching(tree) + |> Enum.filter(&Graph.has_vertex?(tree, &1)) + |> Graph.Traversal.reaching(tree) |> Enum.reject(&(&1 == 0)) |> Enum.reverse() end @@ -118,8 +119,8 @@ defmodule TdCache.TaxonomyCache do defp do_get_reachable_ids(domain_id, tree) do domain_id |> List.wrap() - |> Enum.filter(&Bluetab.Graph.has_vertex?(tree, &1)) - |> Bluetab.Graph.Traversal.reachable(tree) + |> Enum.filter(&Graph.has_vertex?(tree, &1)) + |> Graph.Traversal.reachable(tree) end defp to_integer(id) when is_integer(id), do: id From 51a3ec547bc4903023a64d3fe914613a4c3fa981 Mon Sep 17 00:00:00 2001 From: "saul.isern" Date: Thu, 12 Mar 2026 15:35:04 +0100 Subject: [PATCH 5/5] chore: bump versions --- CHANGELOG.md | 2 +- mix.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25f2654..290db4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [8.3.0] 2026-03-12 ### Changed diff --git a/mix.exs b/mix.exs index 9a647c9..799057b 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule TdCache.MixProject do def project do [ app: :td_cache, - version: "7.12.0", + version: "8.3.0", elixir: "~> 1.18", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod,