From 58a64173e5954b86bb49c51d4f8bae6769908158 Mon Sep 17 00:00:00 2001 From: Rustem Shaydullin Date: Fri, 27 Feb 2026 04:33:21 +0300 Subject: [PATCH 1/3] Enable Erlang support --- .github/workflows/erlang-pr.yml | 21 +++++++++++++ rebar.config | 53 +++++++++++++++++++++++++++++++++ src/fraudbusters_proto.app.src | 10 +++++++ 3 files changed, 84 insertions(+) create mode 100644 .github/workflows/erlang-pr.yml create mode 100644 rebar.config create mode 100644 src/fraudbusters_proto.app.src diff --git a/.github/workflows/erlang-pr.yml b/.github/workflows/erlang-pr.yml new file mode 100644 index 0000000..32cd36a --- /dev/null +++ b/.github/workflows/erlang-pr.yml @@ -0,0 +1,21 @@ +name: Erlang CI Checks + +on: + push: + branches: + - 'master' + - 'epic/**' + pull_request: + branches: ['**'] + +jobs: + run: + name: Run checks + uses: valitydev/erlang-workflows/.github/workflows/erlang-simple-build.yml@v1 + with: + otp-version: 24 + rebar-version: 3.18 + thrift-version: 0.14.2.3 + use-thrift: true + run-eunit: false + run-common-test: false diff --git a/rebar.config b/rebar.config new file mode 100644 index 0000000..9f043d1 --- /dev/null +++ b/rebar.config @@ -0,0 +1,53 @@ +%% Common project erlang options. +{erl_opts, [ + debug_info, + warnings_as_errors, + warn_export_all, + warn_missing_spec, + warn_untyped_record, + warn_export_vars, + + % by default + warn_unused_record, + warn_bif_clash, + warn_obsolete_guard, + warn_unused_vars, + warn_shadow_vars, + warn_unused_import, + warn_unused_function, + warn_deprecated_function, + warn_missing_spec_all +]}. + +{deps, [ + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}} +]}. + +{xref_checks, [ + undefined_function_calls, + undefined_functions, + deprecated_functions_calls, + deprecated_functions +]}. + +{dialyzer, [ + {warnings, [unmatched_returns, error_handling, unknown]}, + {plt_apps, all_deps} +]}. + +{plugins, [ + {rebar3_thrift_compiler, + {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.4"}}} +]}. + +{provider_hooks, [ + {pre, [ + {compile, {thrift, compile}}, + {clean, {thrift, clean}} + ]} +]}. + +{thrift_compiler_opts, [ + {in_dir, "proto"}, + {gen, "erlang:app_namespaces"} +]}. diff --git a/src/fraudbusters_proto.app.src b/src/fraudbusters_proto.app.src new file mode 100644 index 0000000..725761d --- /dev/null +++ b/src/fraudbusters_proto.app.src @@ -0,0 +1,10 @@ +{application, fraudbusters_proto, [ + {description, "Fraudbusters thrift protocol"}, + {vsn, "0.1.0"}, + {registered, []}, + {applications, [ + kernel, + stdlib + ]}, + {env, []} +]}. From 9416b9fd1eb0862c5887c9434a97625439fdb973 Mon Sep 17 00:00:00 2001 From: Rustem Shaydullin Date: Fri, 27 Feb 2026 12:50:55 +0300 Subject: [PATCH 2/3] Fix --- proto/fraudbusters.thrift | 2 +- rebar.config | 1 + rebar.lock | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 rebar.lock diff --git a/proto/fraudbusters.thrift b/proto/fraudbusters.thrift index 816ddb2..034641b 100644 --- a/proto/fraudbusters.thrift +++ b/proto/fraudbusters.thrift @@ -6,7 +6,7 @@ include 'domain.thrift' */ namespace java dev.vality.damsel.fraudbusters -namespace erlang fraudbusters +namespace erlang fb_proto.fraudbusters typedef string ID typedef ID AccountID diff --git a/rebar.config b/rebar.config index 9f043d1..531bfc8 100644 --- a/rebar.config +++ b/rebar.config @@ -49,5 +49,6 @@ {thrift_compiler_opts, [ {in_dir, "proto"}, + {include_dirs, ["_build/default/lib/damsel/proto"]}, {gen, "erlang:app_namespaces"} ]}. diff --git a/rebar.lock b/rebar.lock new file mode 100644 index 0000000..ed13784 --- /dev/null +++ b/rebar.lock @@ -0,0 +1,4 @@ +[{<<"damsel">>, + {git,"https://github.com/valitydev/damsel.git", + {ref,"5c25c2e8f27366ca591fc50787dedabe8448945c"}}, + 0}]. From 1c6e72546bc8b59e59d73260ba2c73ad812c3b00 Mon Sep 17 00:00:00 2001 From: Rustem Shaydullin Date: Fri, 27 Feb 2026 12:53:03 +0300 Subject: [PATCH 3/3] Fix dialyzer --- src/fraudbusters_proto.app.src | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fraudbusters_proto.app.src b/src/fraudbusters_proto.app.src index 725761d..1ddc531 100644 --- a/src/fraudbusters_proto.app.src +++ b/src/fraudbusters_proto.app.src @@ -4,7 +4,8 @@ {registered, []}, {applications, [ kernel, - stdlib + stdlib, + damsel ]}, {env, []} ]}.