TD-312: Ensure damsel is well-behaved rebar3 dependency (#43)

Also switch to valitydev/rebar3-thrift-compiler 0.4 / valitydev/thrift 0.14.2.3
This commit is contained in:
Andrew Mayorov 2022-06-16 19:36:21 +03:00 committed by GitHub
parent d384c125d1
commit dac2cb5994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 46 additions and 119 deletions

View File

@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: valitydev/action-setup-thrift@v1 - uses: valitydev/action-setup-thrift@v1
with:
thrift-version: "0.14.2.3"
- uses: erlef/setup-beam@v1 - uses: erlef/setup-beam@v1
id: beam id: beam

View File

@ -2,7 +2,8 @@ include 'base.thrift'
include 'domain.thrift' include 'domain.thrift'
namespace java dev.vality.damsel.accounter namespace java dev.vality.damsel.accounter
namespace erlang accounter namespace erlang dmsl.accounter
typedef base.ID PlanID typedef base.ID PlanID
typedef i64 BatchID typedef i64 BatchID
typedef i64 AccountID typedef i64 AccountID
@ -126,4 +127,4 @@ service Accounter {
throws (1: AccountNotFound ex) throws (1: AccountNotFound ex)
domain.Amount GetAccountBalanceDiff(1: AccountID id, 2: base.Timestamp from_time, 3: base.Timestamp to_time) domain.Amount GetAccountBalanceDiff(1: AccountID id, 2: base.Timestamp from_time, 3: base.Timestamp to_time)
throws (1: AccountNotFound ex) throws (1: AccountNotFound ex)
} }

View File

@ -3,6 +3,7 @@
*/ */
namespace java dev.vality.damsel.base namespace java dev.vality.damsel.base
namespace erlang dmsl.base
/** Идентификатор */ /** Идентификатор */
typedef string ID typedef string ID

View File

@ -1,5 +1,5 @@
namespace java dev.vality.damsel.claim_management namespace java dev.vality.damsel.claim_management
namespace erlang claim_management namespace erlang dmsl.claimmgmt
include "base.thrift" include "base.thrift"
include "domain.thrift" include "domain.thrift"

View File

@ -2,10 +2,10 @@
* Сервис для манипуляции непрозрачным контекстом объектов. * Сервис для манипуляции непрозрачным контекстом объектов.
*/ */
include "msgpack.thrift"
namespace java dev.vality.damsel.context namespace java dev.vality.damsel.context
namespace erlang ctx namespace erlang dmsl.context
include "msgpack.thrift"
// Types // Types

View File

@ -7,7 +7,7 @@ include "msgpack.thrift"
include "json.thrift" include "json.thrift"
namespace java dev.vality.damsel.domain namespace java dev.vality.damsel.domain
namespace erlang domain namespace erlang dmsl.domain
typedef i64 DataRevision typedef i64 DataRevision
typedef i32 ObjectID typedef i32 ObjectID
@ -2641,16 +2641,6 @@ struct Terminal {
17: optional MerchantCategoryCode mcc 17: optional MerchantCategoryCode mcc
} }
union TerminalSelector {
1: list<TerminalDecision> decisions
2: set<ProviderTerminalRef> value
}
struct TerminalDecision {
1: required Predicate if_
2: required TerminalSelector then_
}
struct ProviderTerminalRef { struct ProviderTerminalRef {
1: required ObjectID id 1: required ObjectID id
2: optional i64 priority = 1000 2: optional i64 priority = 1000

View File

@ -6,7 +6,7 @@
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.domain_config namespace java dev.vality.damsel.domain_config
namespace erl domain namespace erlang dmsl.domain_conf
/** /**
* Маркер вершины истории. * Маркер вершины истории.

View File

@ -4,7 +4,7 @@ include "domain.thrift"
// moved to https://github.com/valitydev/columbus-proto // moved to https://github.com/valitydev/columbus-proto
namespace java dev.vality.damsel.columbus namespace java dev.vality.damsel.columbus
namespace erlang columbus namespace erlang dmsl.columbus
/** /**
* Идентификатор места по базе http://www.geonames.org/ * Идентификатор места по базе http://www.geonames.org/
@ -21,4 +21,4 @@ struct LocationInfo {
// Полное описание локации в json // Полное описание локации в json
// подробное описание на сайте https://www.maxmind.com/en/geoip2-city // подробное описание на сайте https://www.maxmind.com/en/geoip2-city
3: optional string raw_response; 3: optional string raw_response;
} }

View File

@ -1,7 +1,7 @@
include "base.thrift" include "base.thrift"
namespace java dev.vality.damsel.identity_document_storage namespace java dev.vality.damsel.identity_document_storage
namespace erlang ident_doc_store namespace erlang dmsl.identdoc_storage
/** /**
* Интерфейс для безопасного хранения идентификационных данных * Интерфейс для безопасного хранения идентификационных данных

View File

@ -1,4 +1,4 @@
namespace erlang json namespace erlang dmsl.json
namespace java dev.vality.damsel.json namespace java dev.vality.damsel.json
/** /**

View File

@ -7,7 +7,7 @@ include "domain.thrift"
include "geo_ip.thrift" include "geo_ip.thrift"
namespace java dev.vality.damsel.merch_stat namespace java dev.vality.damsel.merch_stat
namespace erlang merchstat namespace erlang dmsl.merchstat
/** /**
* Информация о платеже. * Информация о платеже.

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.message_sender namespace java dev.vality.damsel.message_sender
namespace erlang message_sender namespace erlang dmsl.message_sender
struct MessageAttachment{ struct MessageAttachment{
1: required string name 1: required string name

View File

@ -1,4 +1,4 @@
namespace erlang msgpack namespace erlang dmsl.msgpack
namespace java dev.vality.damsel.msgpack namespace java dev.vality.damsel.msgpack
/** /**

View File

@ -1,7 +1,7 @@
include "domain_config.thrift" include "domain_config.thrift"
namespace java dev.vality.damsel.papidmt namespace java dev.vality.damsel.papidmt
namespace erlang papidmt namespace erlang dmsl.papidmt
struct HistoryWrapper { struct HistoryWrapper {
1: required domain_config.History history 1: required domain_config.History history

View File

@ -10,7 +10,7 @@ include "repairing.thrift"
include "msgpack.thrift" include "msgpack.thrift"
namespace java dev.vality.damsel.payment_processing namespace java dev.vality.damsel.payment_processing
namespace erlang payproc namespace erlang dmsl.payproc
/* Events */ /* Events */

View File

@ -1,5 +1,5 @@
namespace java dev.vality.damsel.payment_processing.errors namespace java dev.vality.damsel.payment_processing.errors
namespace erlang payprocerr namespace erlang dmsl.payproc_error
/** /**
* TODO * TODO

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.payment_tool_provider namespace java dev.vality.damsel.payment_tool_provider
namespace erlang paytoolprv namespace erlang dmsl.paytool_provider
/** /**
Атрибуты магазина в системе упакованные в идентификатор передаваемый провайдеру. Атрибуты магазина в системе упакованные в идентификатор передаваемый провайдеру.

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.payment_tool_token namespace java dev.vality.damsel.payment_tool_token
namespace erlang ptt namespace erlang dmsl.paytool_token
/** /**
Платежный токен, который передается плательщику. Платежный токен содержит Платежный токен, который передается плательщику. Платежный токен содержит

View File

@ -3,7 +3,7 @@ include "domain.thrift"
include "msgpack.thrift" include "msgpack.thrift"
namespace java dev.vality.damsel.payout_processing namespace java dev.vality.damsel.payout_processing
namespace erlang payout_processing namespace erlang dmsl.payout_processing
typedef base.ID PayoutID typedef base.ID PayoutID
typedef list<Event> Events typedef list<Event> Events

View File

@ -1,7 +1,7 @@
include "base.thrift" include "base.thrift"
namespace java dev.vality.damsel.preauth namespace java dev.vality.damsel.preauth
namespace erlang preauth namespace erlang dmsl.preauth
union Status { union Status {
1: Granted granted 1: Granted granted

View File

@ -1,70 +0,0 @@
include "base.thrift"
include "domain.thrift"
namespace java dev.vality.damsel.proto_limiter
namespace erlang proto_limiter
/**
* Описание сущностей лимитов является частью микросервиса proto-limiter
*/
typedef base.ID LimitChangeID
typedef domain.TurnoverLimitID LimitID
struct Limit {
1: required LimitID id
2: required domain.Cash cash
3: optional base.Timestamp creation_time
4: optional base.Timestamp reload_time
5: optional string description
}
struct LimitChange {
1: required LimitID id
2: required LimitChangeID change_id
3: required domain.Cash cash
4: required base.Timestamp operation_timestamp
}
exception LimitNotFound {}
exception LimitChangeNotFound {}
exception RateCurrencyNotFound {
1: required domain.CurrencySymbolicCode limit_currency
2: required domain.CurrencySymbolicCode rate_currency
}
exception RateQuoteNotFound {}
exception ForbiddenOperationAmount {
1: required domain.Cash amount
2: required domain.CashRange allowed_range
}
service Limiter {
Limit Get(1: LimitID id, 2: base.Timestamp timestamp) throws (
1: LimitNotFound e1,
2: base.InvalidRequest e3
)
void Hold(1: LimitChange change) throws (
1: LimitNotFound e1,
2: RateCurrencyNotFound e2,
3: base.InvalidRequest e3,
4: RateQuoteNotFound e4
)
void Commit(1: LimitChange change) throws (
1: LimitNotFound e1,
2: LimitChangeNotFound e2,
3: base.InvalidRequest e3
)
void PartialCommit(1: LimitChange change) throws (
1: LimitNotFound e1,
2: LimitChangeNotFound e2,
3: ForbiddenOperationAmount e3,
4: base.InvalidRequest e4
5: RateCurrencyNotFound e5,
6: RateQuoteNotFound e6
)
void Rollback(1: LimitChange change) throws (
1: LimitNotFound e1,
2: LimitChangeNotFound e2,
3: base.InvalidRequest e3
)
}

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.proxy_inspector namespace java dev.vality.damsel.proxy_inspector
namespace erlang proxy_inspector namespace erlang dmsl.proxy_inspector
/** /**
* Набор данных для взаимодействия с инспекторским прокси. * Набор данных для взаимодействия с инспекторским прокси.

View File

@ -4,7 +4,7 @@ include "user_interaction.thrift"
include "timeout_behaviour.thrift" include "timeout_behaviour.thrift"
namespace java dev.vality.damsel.proxy_provider namespace java dev.vality.damsel.proxy_provider
namespace erlang prxprv namespace erlang dmsl.proxy_provider
/** /**
* Непрозрачное для процессинга состояние адаптера, связанное с определённой сессией взаимодействия * Непрозрачное для процессинга состояние адаптера, связанное с определённой сессией взаимодействия

View File

@ -3,7 +3,7 @@
*/ */
namespace java dev.vality.damsel.repairing namespace java dev.vality.damsel.repairing
namespace erlang repair namespace erlang dmsl.repair
include "base.thrift" include "base.thrift"

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.reports namespace java dev.vality.damsel.reports
namespace erlang reports namespace erlang dmsl.reports
typedef base.Timestamp Timestamp typedef base.Timestamp Timestamp
typedef base.InvalidRequest InvalidRequest typedef base.InvalidRequest InvalidRequest

View File

@ -5,6 +5,7 @@
include "base.thrift" include "base.thrift"
namespace java dev.vality.damsel.test namespace java dev.vality.damsel.test
namespace erlang dmsl.test
struct Shout { struct Shout {
1: required string contents 1: required string contents

View File

@ -1,5 +1,6 @@
namespace erlang tmbhv
namespace java dev.vality.damsel.timeout_behaviour namespace java dev.vality.damsel.timeout_behaviour
namespace erlang dmsl.timeout_behaviour
include "base.thrift" include "base.thrift"
include "domain.thrift" include "domain.thrift"

View File

@ -1,6 +1,8 @@
namespace java dev.vality.damsel.user_interaction
include "base.thrift" include "base.thrift"
namespace java dev.vality.damsel.user_interaction
namespace erlang dmsl.user_interaction
/** /**
* Строковый шаблон согласно [RFC6570](https://tools.ietf.org/html/rfc6570) Level 4. * Строковый шаблон согласно [RFC6570](https://tools.ietf.org/html/rfc6570) Level 4.
*/ */

View File

@ -3,7 +3,7 @@
include "payment_processing.thrift" include "payment_processing.thrift"
namespace java dev.vality.damsel.walker namespace java dev.vality.damsel.walker
namespace erlang walker namespace erlang dmsl.walker
typedef i64 ClaimID typedef i64 ClaimID
typedef domain.PartyID PartyID typedef domain.PartyID PartyID

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.webhooker namespace java dev.vality.damsel.webhooker
namespace erlang webhooker namespace erlang dmsl.webhooker
typedef string Url typedef string Url
typedef string Key typedef string Key
@ -180,4 +180,4 @@ service WebhookManager {
service WebhookMessageService { service WebhookMessageService {
void Send(1: WebhookID hook_id, 2: SourceID source_id) throws (1: WebhookNotFound ex1, 2: SourceNotFound ex2) void Send(1: WebhookID hook_id, 2: SourceID source_id) throws (1: WebhookNotFound ex1, 2: SourceNotFound ex2)
} }

View File

@ -2,7 +2,7 @@ include "base.thrift"
include "domain.thrift" include "domain.thrift"
namespace java dev.vality.damsel.withdrawals.domain namespace java dev.vality.damsel.withdrawals.domain
namespace erlang wthdm namespace erlang dmsl.wthd_domain
/// Domain /// Domain

View File

@ -1,5 +1,5 @@
namespace java dev.vality.damsel.withdrawals.errors namespace java dev.vality.damsel.withdrawals.errors
namespace erlang wtherr namespace erlang dmsl.wthd_error
union WithdrawalFailure { union WithdrawalFailure {
1: AuthorizationFailure authorization_failed 1: AuthorizationFailure authorization_failed

View File

@ -4,7 +4,7 @@ include "domain.thrift"
include "withdrawals_domain.thrift" include "withdrawals_domain.thrift"
namespace java dev.vality.damsel.withdrawals.processing namespace java dev.vality.damsel.withdrawals.processing
namespace erlang wthproc namespace erlang dmsl.wthdproc
/// Processing /// Processing

View File

@ -4,7 +4,7 @@ include "domain.thrift"
include "withdrawals_domain.thrift" include "withdrawals_domain.thrift"
namespace java dev.vality.damsel.withdrawals.provider_adapter namespace java dev.vality.damsel.withdrawals.provider_adapter
namespace erlang wthadpt namespace erlang dmsl.wthd_provider
typedef domain.Failure Failure typedef domain.Failure Failure

View File

@ -1,6 +1,5 @@
%% Common project erlang options. %% Common project erlang options.
{erl_opts, [ {erl_opts, [
% mandatory % mandatory
debug_info, debug_info,
warnings_as_errors, warnings_as_errors,
@ -49,17 +48,17 @@
{plugins, [ {plugins, [
{rebar3_thrift_compiler, {rebar3_thrift_compiler,
{git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.3.1"}}} {git, "https://github.com/valitydev/rebar3-thrift-compiler.git", {tag, "0.4"}}}
]}. ]}.
{provider_hooks, [ {provider_hooks, [
{pre, [ {pre, [
{compile, {thrift, compile}}, {compile, {thrift, compile}},
{clean , {thrift, clean }} {clean, {thrift, clean}}
]} ]}
]}. ]}.
{thrift_compiler_opts, [ {thrift_compiler_opts, [
{in_dir, "proto"}, {in_dir, "proto"},
{gen, "erlang:scoped_typenames,app_prefix=dmsl"} {gen, "erlang:app_namespaces"}
]}. ]}.