Skip to content

Commit 72f960a

Browse files
GSMLG-BOTclaude
andcommitted
fix: resolve GitHub Actions CI failures
- Add missing dialyxir dependency for static analysis - Add missing credo dependency for code quality checks - Fix code formatting issues in test helper and main module - Ensure all Elixir files conform to standard formatting Fixes CI run: 18615706375 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ec12446 commit 72f960a

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

lib/concord.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ defmodule Concord do
7373
case query({:get, key}, timeout) do
7474
{:ok, {{_index, _term}, query_result}, _} ->
7575
query_result
76+
7677
{:timeout, _} ->
7778
{:error, :timeout}
79+
7880
{:error, :noproc} ->
7981
{:error, :cluster_not_ready}
82+
8083
{:error, reason} ->
8184
{:error, reason}
8285
end

mix.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ defmodule Concord.MixProject do
3232
{:telemetry_poller, "~> 1.0"},
3333
{:jason, "~> 1.4"},
3434
{:plug_crypto, "~> 1.2"},
35+
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
36+
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
3537
{:ex_doc, "~> 0.29", only: :dev, runtime: false}
3638
]
3739
end

mix.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
%{
22
"aten": {:hex, :aten, "0.6.0", "7a57b275a6daf515ac3683fb9853e280b4d0dcdd74292fd66ac4a01c8694f8c7", [:rebar3], [], "hexpm", "5f39a164206ae3f211ef5880b1f7819415686436e3229d30b6a058564fbaa168"},
3+
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
4+
"credo": {:hex, :credo, "1.7.13", "126a0697df6b7b71cd18c81bc92335297839a806b6f62b61d417500d1070ff4e", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "47641e6d2bbff1e241e87695b29f617f1a8f912adea34296fb10ecc3d7e9e84f"},
5+
"dialyxir": {:hex, :dialyxir, "1.4.6", "7cca478334bf8307e968664343cbdb432ee95b4b68a9cba95bdabb0ad5bdfd9a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "8cf5615c5cd4c2da6c501faae642839c8405b49f8aa057ad4ae401cb808ef64d"},
36
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
7+
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
48
"ex_doc": {:hex, :ex_doc, "0.38.4", "ab48dff7a8af84226bf23baddcdda329f467255d924380a0cf0cee97bb9a9ede", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "f7b62346408a83911c2580154e35613eb314e0278aeea72ed7fedef9c1f165b2"},
9+
"file_system": {:hex, :file_system, "1.1.1", "31864f4685b0148f25bd3fbef2b1228457c0c89024ad67f7a81a3ffbc0bbad3a", [:mix], [], "hexpm", "7a15ff97dfe526aeefb090a7a9d3d03aa907e100e262a0f8f7746b78f8f87a5d"},
510
"gen_batch_server": {:hex, :gen_batch_server, "0.8.9", "1c6bc0f530bf8c17e8b4acc20c2cc369ffa5bee2b46de01e21410745f24b1bc9", [:rebar3], [], "hexpm", "c8581fe4a4b6bccf91e53ce6a8c7e6c27c8c591bab5408b160166463f5579c22"},
611
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
712
"libcluster": {:hex, :libcluster, "3.5.0", "5ee4cfde4bdf32b2fef271e33ce3241e89509f4344f6c6a8d4069937484866ba", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebf6561fcedd765a4cd43b4b8c04b1c87f4177b5fb3cbdfe40a780499d72f743"},

test/support/concord_test_helper.ex

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ defmodule Concord.TestHelper do
2222
rescue
2323
_ -> :ok
2424
end
25-
Process.sleep(200) # Increased sleep time
25+
26+
# Increased sleep time
27+
Process.sleep(200)
2628
:ra_system.start_default()
2729

2830
# Wait for RA system to be fully ready
@@ -59,10 +61,13 @@ defmodule Concord.TestHelper do
5961
:ok ->
6062
:ra.trigger_election(node_id)
6163
wait_for_cluster_ready()
64+
6265
{:ok, _} ->
6366
wait_for_cluster_ready()
67+
6468
{:error, {:already_started, _}} ->
6569
wait_for_cluster_ready()
70+
6671
{:error, :not_new} ->
6772
# Server already exists, try to get it running properly
6873
# First stop any existing server, then restart it
@@ -85,6 +90,7 @@ defmodule Concord.TestHelper do
8590
rescue
8691
_ -> :ok
8792
end
93+
8894
Process.sleep(200)
8995
:ra_system.start_default()
9096
Process.sleep(100)
@@ -94,12 +100,15 @@ defmodule Concord.TestHelper do
94100
:ok ->
95101
:ra.trigger_election(node_id)
96102
wait_for_cluster_ready()
103+
97104
{:ok, _} ->
98105
wait_for_cluster_ready()
106+
99107
{:error, reason} ->
100108
IO.inspect(reason, label: "Failed to restart server after full cleanup")
101109
{:error, reason}
102110
end
111+
103112
{:error, reason} ->
104113
IO.inspect(reason, label: "Failed to start server")
105114
{:error, reason}
@@ -155,29 +164,34 @@ defmodule Concord.TestHelper do
155164
node_id = {:concord_cluster, node()}
156165

157166
case loop(until, fn ->
158-
case :ra.members(node_id) do
159-
{:ok, members, leader} when is_list(members) ->
160-
# Found members and leader, cluster is ready
161-
IO.inspect({:ready, length(members), leader}, label: "Cluster ready")
162-
:ready
163-
{:error, :noproc} ->
164-
:not_ready
165-
{:error, reason} ->
166-
IO.inspect({:error, reason}, label: "RA error")
167-
:not_ready
168-
result ->
169-
IO.inspect(result, label: "RA members result")
170-
:not_ready
171-
end
172-
end) do
167+
case :ra.members(node_id) do
168+
{:ok, members, leader} when is_list(members) ->
169+
# Found members and leader, cluster is ready
170+
IO.inspect({:ready, length(members), leader}, label: "Cluster ready")
171+
:ready
172+
173+
{:error, :noproc} ->
174+
:not_ready
175+
176+
{:error, reason} ->
177+
IO.inspect({:error, reason}, label: "RA error")
178+
:not_ready
179+
180+
result ->
181+
IO.inspect(result, label: "RA members result")
182+
:not_ready
183+
end
184+
end) do
173185
:ok -> :ok
174186
:timeout -> {:error, :timeout}
175187
end
176188
end
177189

178190
defp loop(until, fun) do
179191
case fun.() do
180-
:ready -> :ok
192+
:ready ->
193+
:ok
194+
181195
:not_ready ->
182196
if System.monotonic_time(:millisecond) < until do
183197
Process.sleep(100)
@@ -187,4 +201,4 @@ defmodule Concord.TestHelper do
187201
end
188202
end
189203
end
190-
end
204+
end

0 commit comments

Comments
 (0)