Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change woody.error-reason missing message to be more readable #1

Merged
merged 40 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4954bd4
change woody.error-reason missing message to be more readable
kehitt Jan 14, 2022
e372d86
switch to forked deps, employ actions for CI
kehitt Jan 14, 2022
f947d71
lint with rebar3 lint
kehitt Jan 14, 2022
6199ab4
fix elvis, update workflow
kehitt Jan 17, 2022
1a17cca
fix workflow branches
kehitt Jan 17, 2022
504951f
fix workflow step typo
kehitt Jan 17, 2022
187315d
fix workflow thrift dep
kehitt Jan 17, 2022
b43e710
once more
kehitt Jan 17, 2022
bbd4d65
fix
kehitt Jan 17, 2022
7df8f5b
test
kehitt Jan 17, 2022
f3d1008
roll back test deps, change error message again, fix workflow
kehitt Jan 17, 2022
5afa481
revert thift compiler install step
kehitt Jan 17, 2022
57f6b23
try running multi-achitecture
kehitt Jan 17, 2022
e7dc68d
fix workflow matrix
kehitt Jan 17, 2022
a2bafa3
drop container from ci
kehitt Jan 17, 2022
21c7d6f
fix cache
kehitt Jan 17, 2022
c0a686d
break ct as a test
kehitt Jan 17, 2022
46614c0
break the break
kehitt Jan 17, 2022
fcb6ac2
fix wrong plt
kehitt Jan 17, 2022
b9bb9a0
unbreak tests
kehitt Jan 17, 2022
bb55a88
experimental multi-job CI
kehitt Jan 18, 2022
8a061f0
fix
kehitt Jan 18, 2022
177336f
separate deps cache step
kehitt Jan 18, 2022
29da4da
fix skip step
kehitt Jan 18, 2022
b611a86
add try adding coverage
kehitt Jan 18, 2022
d4d034f
more universal cover filename
kehitt Jan 18, 2022
a6991b3
configure codecov limits
kehitt Jan 18, 2022
39a1e35
move config to the correct folder
kehitt Jan 18, 2022
60e9bd2
experimental cache _build
kehitt Jan 19, 2022
8d9f500
anchors away
kehitt Jan 19, 2022
5d25618
fix thrift compiler plugin to tag, lock build cache completely
kehitt Jan 19, 2022
d8a1d87
experimental reusable workflow
kehitt Jan 19, 2022
608c97b
nah
kehitt Jan 19, 2022
6c0c9e7
revert to nonreusable
kehitt Jan 19, 2022
ba7ef08
fix ct log upload
kehitt Jan 19, 2022
8a7e70b
review fixes
kehitt Jan 20, 2022
50a7000
don't cache the base plt
kehitt Jan 20, 2022
295dc0e
dont need to rerun rebar3 cover if tests are run with --cover
kehitt Jan 20, 2022
77dee60
bring back the otp version
kehitt Jan 20, 2022
e10dfdd
remove rebar.lock wildcard
kehitt Jan 21, 2022
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
51 changes: 51 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Erlang CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
keynslug marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
runs-on: ubuntu-latest

container:
image: erlang:24.1.6
keynslug marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v2

- name: Cache rebar3
if: ${{ !env.ACT }}
keynslug marked this conversation as resolved.
Show resolved Hide resolved
id: cache-rebar3
uses: actions/cache@v2
with:
path: "~/.cache/rebar3"
key: rebar-global-cache-${{ hashFiles('rebar.lock') }}
keynslug marked this conversation as resolved.
Show resolved Hide resolved

- name: Cache _build
if: ${{ !env.ACT }}
id: cache-build
uses: actions/cache@v2
with:
path: "_build/default/"
key: ${{ runner.os }}-${{ hashFiles('rebar.lock') }}-build-default

- name: Compile
run: make compile

- name: Check formatting
run: make check_format

- name: Run xref
run: make xref

- name: Run linting
run: make lint

- name: Run dialyzer
run: make dialyze

- name: Run tests
run: make test
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

42 changes: 0 additions & 42 deletions Jenkinsfile

This file was deleted.

32 changes: 3 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
SUBMODULES = build_utils
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))

UTILS_PATH := build_utils
# ToDo: remove unused TEMPLATES_PATH here, when the bug
# with handling of the varriable in build_utils is fixed
TEMPLATES_PATH := .
SERVICE_NAME := woody

BUILD_IMAGE_NAME := build-erlang
BUILD_IMAGE_TAG := c60896ef07d41e7ae2e5f9b6ce845a60ad79acc7

CALL_W_CONTAINER := all submodules compile xref lint test bench dialyze clean distclean \
check_format format

.PHONY: $(CALL_W_CONTAINER)

all: compile

-include $(UTILS_PATH)/make_lib/utils_container.mk

$(SUBTARGETS): %/.git: %
git submodule update --init $<
touch $@

submodules: $(SUBTARGETS)

compile: submodules
compile:
$(REBAR) compile

test: submodules
test:
$(REBAR) eunit
$(REBAR) ct

xref: submodules
xref:
$(REBAR) xref

lint: compile
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Woody [![Build Status](http://ci.rbkmoney.com/buildStatus/icon?job=rbkmoney_private/woody_erlang/master)](http://ci.rbkmoney.com/job/rbkmoney_private/view/Erlang/job/woody_erlang/job/master/)
Woody
======

Erlang реализация [Библиотеки RPC вызовов для общения между микросервисами](http://coredocs.rbkmoney.com/design/ms/platform/rpc-lib/)
Erlang реализация [Библиотеки RPC вызовов для общения между микросервисами](#coredocs/design/ms/platform/rpc-lib/)

версия требований: __ac4d40cc22d649d03369fcd52fb1230e51cdf52e__

Expand Down Expand Up @@ -58,7 +58,7 @@ Erlang реализация [Библиотеки RPC вызовов для об

В случае вызова _thrift_ `oneway` функции (_thrift_ реализация _cast_) `woody_client:call/3` вернет `{ok, ok}`.

Если сервер бросает `Exception`, описанный в _.thrift_ файле сервиса (т.е. _Бизнес ошибку_ в [терминологии](http://coredocs.rbkmoney.com/design/ms/platform/overview/#_7) макросервис платформы), `woody_client:call/3` вернет это исключение в виде: `{exception, Exception}`.
Если сервер бросает `Exception`, описанный в _.thrift_ файле сервиса (т.е. _Бизнес ошибку_ в [терминологии](#coredocs/design/ms/platform/overview/#_7) макросервис платформы), `woody_client:call/3` вернет это исключение в виде: `{exception, Exception}`.

В случае получения _Системной_ ошибки клиент выбрасывает _erlang:error_ типа `{woody_error, woody_error:system_error()}`.

Expand All @@ -74,7 +74,7 @@ Erlang реализация [Библиотеки RPC вызовов для об
18> {ok, Result2} = woody_client:call(Request, Opts1, Context2).
```

`Context` позволяет аннотировать RPC запросы дополнительными мета данными в виде _key-value_. `Context` передается только в запросах и изменение мета данных возможно только в режиме _append-only_ (т.е. на попытку переопределить уже существующую запись в `context meta`, библиотека вернет ошибку). Поскольку на транспортном уровне контекст передается в виде custom HTTP заголовков, синтаксис метаданных _key-value_ должен следовать ограничениям [RFC7230 ](https://tools.ietf.org/html/rfc7230#section-3.2.6). Размер ключа записи метаданных не должен превышать _53 байта_ (см. остальные требования к метаданным в [описании библиотеки](http://coredocs.rbkmoney.com/design/ms/platform/rpc-lib/#rpc_2)).
`Context` позволяет аннотировать RPC запросы дополнительными мета данными в виде _key-value_. `Context` передается только в запросах и изменение мета данных возможно только в режиме _append-only_ (т.е. на попытку переопределить уже существующую запись в `context meta`, библиотека вернет ошибку). Поскольку на транспортном уровне контекст передается в виде custom HTTP заголовков, синтаксис метаданных _key-value_ должен следовать ограничениям [RFC7230 ](https://tools.ietf.org/html/rfc7230#section-3.2.6). Размер ключа записи метаданных не должен превышать _53 байта_ (см. остальные требования к метаданным в [описании библиотеки](#coredocs/design/ms/platform/rpc-lib/#rpc_2)).

```erlang
19> Meta1 = #{<<"client1-name">> => <<"Vasya">>}.
Expand All @@ -87,7 +87,7 @@ Erlang реализация [Библиотеки RPC вызовов для об
26> FullMeta = woody_context:get_meta(Context4).
```

`Context` также позволяет задать [deadline](http://coredocs.rbkmoney.com/design/ms/platform/rpc-lib/#deadline) на исполнение запроса. Значение _deadline_ вложенных запросов можно менять произвольным образом. Также таймауты на запрос, [вычисляемые по deadline](src/woody_client_thrift_http_transport.erl), можно явно переопределить из приложения через _transport_opts_ в `woody_client:options()`. Модуль [woody_deadline](src/woody_deadline.erl) содержит API для работы с deadline.
`Context` также позволяет задать [deadline](#coredocs/design/ms/platform/rpc-lib/#deadline) на исполнение запроса. Значение _deadline_ вложенных запросов можно менять произвольным образом. Также таймауты на запрос, [вычисляемые по deadline](src/woody_client_thrift_http_transport.erl), можно явно переопределить из приложения через _transport_opts_ в `woody_client:options()`. Модуль [woody_deadline](src/woody_deadline.erl) содержит API для работы с deadline.

```erlang
27> Deadline = {{{2017, 12, 31}, {23, 59, 59}}, 350}.
Expand Down
1 change: 0 additions & 1 deletion build_utils
Submodule build_utils deleted from e13187
14 changes: 7 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
{hackney, "1.18.0"},
{gproc , "0.9.0"},
{cache , "2.3.3"},
{thrift, {git, "https://github.com/rbkmoney/thrift_erlang.git", {branch, "master"}}},
{snowflake, {git, "https://github.com/rbkmoney/snowflake.git", {branch, "master"}}},
{genlib, {git, "https://github.com/rbkmoney/genlib.git", {branch, "master"}}}
{thrift, {git, "https://github.com/valitydev/thrift_erlang.git", {branch, "master"}}},
{snowflake, {git, "https://github.com/valitydev/snowflake.git", {branch, "master"}}},
{genlib, {git, "https://github.com/valitydev/genlib.git", {branch, "master"}}}
]}.

{xref_checks, [
Expand Down Expand Up @@ -70,9 +70,9 @@
{deps, [
{cth_readable, "1.4.9"},
{proper, "1.4.0"},
{woody_api_hay,{git, "https://github.com/rbkmoney/woody_api_hay.git", {branch, "master"}}},
{damsel , {git, "https://github.com/rbkmoney/damsel.git", {ref, "8911ac3"}}},
{mg_proto , {git, "https://github.com/rbkmoney/machinegun_proto.git", {ref, "ebae56f"}}}
{woody_api_hay,{git, "https://github.com/valitydev/woody_api_hay.git", {branch, "master"}}},
{damsel , {git, "https://github.com/valitydev/damsel.git", {ref, "8911ac3"}}},
{mg_proto , {git, "https://github.com/valitydev/machinegun-proto.git", {ref, "ebae56f"}}}
]},
{dialyzer, [
{plt_extra_apps, [how_are_you, eunit, proper, common_test, cth_readable]}
Expand All @@ -81,7 +81,7 @@
]}.

{plugins, [
{rebar3_thrift_compiler, {git, "https://github.com/rbkmoney/rebar3_thrift_compiler.git", {branch, "master"}}},
{rebar3_thrift_compiler, {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {branch, "master"}}},
{erlfmt, "0.14.1"}
]}.

Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},1},
{<<"genlib">>,
{git,"https://github.com/rbkmoney/genlib.git",
{git,"https://github.com/valitydev/genlib.git",
{ref,"4565a8d73f34a0b78cca32c9cd2b97d298bdadf8"}},
0},
{<<"gproc">>,{pkg,<<"gproc">>,<<"0.9.0">>},0},
Expand All @@ -15,12 +15,12 @@
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.3.1">>},1},
{<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1},
{<<"snowflake">>,
{git,"https://github.com/rbkmoney/snowflake.git",
{git,"https://github.com/valitydev/snowflake.git",
{ref,"de159486ef40cec67074afe71882bdc7f7deab72"}},
0},
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.6">>},1},
{<<"thrift">>,
{git,"https://github.com/rbkmoney/thrift_erlang.git",
{git,"https://github.com/valitydev/thrift_erlang.git",
{ref,"c280ff266ae1c1906fb0dcee8320bb8d8a4a3c75"}},
0},
{<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.7.0">>},1}]}.
Expand Down
3 changes: 0 additions & 3 deletions src/woody.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
{enable_debug, false}
]},
{modules, []},
{maintainers, [
"Anton Belyaev <a.belyaev@rbkmoney.com>"
]},
{licenses, []},
{links, []}
]}.