Skip to content
Closed
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
3 changes: 3 additions & 0 deletions apps/engine/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Config

config :logger, level: :none

config :forge,
document_store_clustering: :global

config :engine,
edit_window_millis: 10,
modules_cache_expiry: {50, :millisecond},
Expand Down
61 changes: 59 additions & 2 deletions apps/engine/deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ let

gen_lsp =
let
version = "0.11.0";
version = "0.11.1";
drv = buildMix {
inherit version;
name = "gen_lsp";
Expand All @@ -174,7 +174,7 @@ let
src = fetchHex {
inherit version;
pkg = "gen_lsp";
sha256 = "d67c20650a5290a02f7bac53083ac4487d3c6b461f35a8b14c5d2d7638c20d26";
sha256 = "78cd7994c0e46399c71e727fe29cfb8ff41e32711c1a30ad4b92203ee0d7920d";
};

beamDeps = [
Expand All @@ -187,6 +187,23 @@ let
in
drv;

gen_state_machine =
let
version = "2.1.0";
drv = buildMix {
inherit version;
name = "gen_state_machine";
appConfigPath = ./config;

src = fetchHex {
inherit version;
pkg = "gen_state_machine";
sha256 = "ae367038808db25cee2f2c4b8d0531522ea587c4995eb6f96ee73410a60fa06b";
};
};
in
drv;

jason =
let
version = "1.4.4";
Expand All @@ -204,6 +221,23 @@ let
in
drv;

libring =
let
version = "1.7.0";
drv = buildMix {
inherit version;
name = "libring";
appConfigPath = ./config;

src = fetchHex {
inherit version;
pkg = "libring";
sha256 = "070e3593cb572e04f2c8470dd0c119bc1817a7a0a7f88229f43cf0345268ec42";
};
};
in
drv;

nimble_options =
let
version = "1.1.1";
Expand Down Expand Up @@ -335,6 +369,29 @@ let
in
drv;

swarm =
let
version = "0fff93ab51d28783b8eab22f2a2bff859c7e0b69";
drv = buildMix {
inherit version;
name = "swarm";
appConfigPath = ./config;

src = pkgs.fetchFromGitHub {
owner = "doorgan";
repo = "swarm";
rev = "0fff93ab51d28783b8eab22f2a2bff859c7e0b69";
hash = "sha256-GpgapXxf0LTTD0PqrACBhX42dtQqRxZiOV43iuXzjqo=";
};

beamDeps = [
libring
gen_state_machine
];
};
in
drv;

telemetry =
let
version = "1.3.0";
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/lib/engine/search/store/backends/ets.ex
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ defmodule Engine.Search.Store.Backends.Ets do
end

defp genserver_name(%Project{} = project) do
{:global, leader_name(project)}
{:via, :global, leader_name(project)}
end

defp become_leader(%Project{} = project) do
Expand Down Expand Up @@ -235,7 +235,7 @@ defmodule Engine.Search.Store.Backends.Ets do
for {node_name_charlist, _port} <- node_and_port_list,
node_name_string = List.to_string(node_name_charlist),
String.contains?(node_name_string, project_substring) do
:"#{node_name_string}@127.0.0.1"
:"#{node_name_string}"
end
end

Expand Down
1 change: 1 addition & 0 deletions apps/engine/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ defmodule Engine.MixProject do
{:path_glob, "~> 0.2"},
{:phoenix_live_view, "~> 1.0", only: [:test], runtime: false},
{:sourceror, "~> 1.9"},
{:swarm, github: "doorgan/swarm", ref: "0fff93ab51d28783b8eab22f2a2bff859c7e0b69"},
{:stream_data, "~> 1.1", only: [:test], runtime: false},
{:refactorex, "~> 0.1.52"}
]
Expand Down
3 changes: 3 additions & 0 deletions apps/engine/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
"file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"},
"gen_lsp": {:hex, :gen_lsp, "0.11.1", "395034f8d0f33cc76cbae85f480c827ae7bafa6b2436445501aaa582ba3195ff", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "78cd7994c0e46399c71e727fe29cfb8ff41e32711c1a30ad4b92203ee0d7920d"},
"gen_state_machine": {:hex, :gen_state_machine, "2.1.0", "a38b0e53fad812d29ec149f0d354da5d1bc0d7222c3711f3a0bd5aa608b42992", [:mix], [], "hexpm", "ae367038808db25cee2f2c4b8d0531522ea587c4995eb6f96ee73410a60fa06b"},
"hpax": {:hex, :hpax, "1.0.3", "ed67ef51ad4df91e75cc6a1494f851850c0bd98ebc0be6e81b026e765ee535aa", [:mix], [], "hexpm", "8eab6e1cfa8d5918c2ce4ba43588e894af35dbd8e91e6e55c817bca5847df34a"},
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"libring": {:hex, :libring, "1.7.0", "4f245d2f1476cd7ed8f03740f6431acba815401e40299208c7f5c640e1883bda", [:mix], [], "hexpm", "070e3593cb572e04f2c8470dd0c119bc1817a7a0a7f88229f43cf0345268ec42"},
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
"mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"},
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
Expand All @@ -31,6 +33,7 @@
"sourceror": {:hex, :sourceror, "1.10.0", "38397dedbbc286966ec48c7af13e228b171332be1ad731974438c77791945ce9", [:mix], [], "hexpm", "29dbdfc92e04569c9d8e6efdc422fc1d815f4bd0055dc7c51b8800fb75c4b3f1"},
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},
"stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"},
"swarm": {:git, "https://github.com/doorgan/swarm.git", "0fff93ab51d28783b8eab22f2a2bff859c7e0b69", [ref: "0fff93ab51d28783b8eab22f2a2bff859c7e0b69"]},
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
"typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"},
"websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"},
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/test/engine/build/error_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ defmodule Engine.Build.ErrorTest do

# used a regex here because the error changed in elixir 1.18
assert diagnostic.message =~
~r[protocol Enumerable not implemented for( 1 of)? type Integer]
~r[protocol Enumerable not implemented for( 1 of)?( type)? Integer]

assert decorate(document_text, diagnostic.position) =~ "«for i <- 1, do: i\n»"
end
Expand All @@ -468,7 +468,7 @@ defmodule Engine.Build.ErrorTest do

# used a regex here because the error changed in elixir 1.18
assert diagnostic.message =~
~r[protocol Enumerable not implemented for( 1 of)? type Integer]
~r[protocol Enumerable not implemented for( 1 of)?( type)? Integer]

assert decorate(document_text, diagnostic.position) =~ "«for i <- 1, do: i\n»"
end
Expand Down
4 changes: 2 additions & 2 deletions apps/engine/test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Application.ensure_all_started(:snowflake)
Application.ensure_all_started(:refactorex)
{"", 0} = System.cmd("epmd", ~w(-daemon))
Application.ensure_all_started(:swarm)
random_number = :rand.uniform(500)

with :nonode@nohost <- Node.self() do
{:ok, _pid} =
:net_kernel.start(:"testing-#{random_number}@127.0.0.1", %{name_domain: :longnames})
Node.start(:"testing-#{random_number}", :shortnames)
end

Engine.Module.Loader.start_link(nil)
Expand Down
2 changes: 1 addition & 1 deletion apps/expert/bin/debug_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
project_name=$1
node_name=$(epmd -names | grep manager-"$project_name" | awk '{print $2}')

iex --name "shell@127.0.0.1" \
iex --sname "shell" \
--remsh "${node_name}" \
--cookie expert
6 changes: 6 additions & 0 deletions apps/expert/config/test.exs
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
import Config

config :forge,
# Expert does need proper clustering even in tests,
# since a lot of tests actually rely on actual nodes
# being started and needing proper distribution.
document_store_clustering: :swarm
65 changes: 61 additions & 4 deletions apps/expert/deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ let

burrito =
let
version = "1.4.0";
version = "1.5.0";
drv = buildMix {
inherit version;
name = "burrito";
Expand All @@ -156,7 +156,7 @@ let
src = fetchHex {
inherit version;
pkg = "burrito";
sha256 = "0fa052e6f446cd3e5ff7e00813452b09eeadeddb5ec5174c2976eb0e4ad88765";
sha256 = "3861abda7bffa733862b48da3e03df0b4cd41abf6fd24b91745f5c16d971e5fa";
};

beamDeps = [
Expand Down Expand Up @@ -195,7 +195,7 @@ let

gen_lsp =
let
version = "0.11.0";
version = "0.11.1";
drv = buildMix {
inherit version;
name = "gen_lsp";
Expand All @@ -204,7 +204,7 @@ let
src = fetchHex {
inherit version;
pkg = "gen_lsp";
sha256 = "d67c20650a5290a02f7bac53083ac4487d3c6b461f35a8b14c5d2d7638c20d26";
sha256 = "78cd7994c0e46399c71e727fe29cfb8ff41e32711c1a30ad4b92203ee0d7920d";
};

beamDeps = [
Expand All @@ -217,6 +217,23 @@ let
in
drv;

gen_state_machine =
let
version = "2.1.0";
drv = buildMix {
inherit version;
name = "gen_state_machine";
appConfigPath = ./config;

src = fetchHex {
inherit version;
pkg = "gen_state_machine";
sha256 = "ae367038808db25cee2f2c4b8d0531522ea587c4995eb6f96ee73410a60fa06b";
};
};
in
drv;

hpax =
let
version = "1.0.3";
Expand Down Expand Up @@ -251,6 +268,23 @@ let
in
drv;

libring =
let
version = "1.7.0";
drv = buildMix {
inherit version;
name = "libring";
appConfigPath = ./config;

src = fetchHex {
inherit version;
pkg = "libring";
sha256 = "070e3593cb572e04f2c8470dd0c119bc1817a7a0a7f88229f43cf0345268ec42";
};
};
in
drv;

logger_file_backend =
let
version = "0.0.14";
Expand Down Expand Up @@ -456,6 +490,29 @@ let
in
drv;

swarm =
let
version = "0fff93ab51d28783b8eab22f2a2bff859c7e0b69";
drv = buildMix {
inherit version;
name = "swarm";
appConfigPath = ./config;

src = pkgs.fetchFromGitHub {
owner = "doorgan";
repo = "swarm";
rev = "0fff93ab51d28783b8eab22f2a2bff859c7e0b69";
hash = "sha256-GpgapXxf0LTTD0PqrACBhX42dtQqRxZiOV43iuXzjqo=";
};

beamDeps = [
libring
gen_state_machine
];
};
in
drv;

telemetry =
let
version = "1.3.0";
Expand Down
2 changes: 1 addition & 1 deletion apps/expert/lib/expert/engine_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Expert.EngineApi do

def call(%Project{} = project, m, f, a \\ []) do
project
|> Project.node_name()
|> Project.node()
|> :erpc.call(m, f, a)
end

Expand Down
Loading
Loading