cyclone_lariat 1.0.0.rc7 → 1.0.0.rc9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +8 -8
- data/README.md +2 -1
- data/lib/cyclone_lariat/middleware.rb +11 -4
- data/lib/cyclone_lariat/services/migrate.rb +2 -1
- data/lib/cyclone_lariat/services/rollback.rb +2 -0
- data/lib/cyclone_lariat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49347a3eb8840d9a9acb582bb5fd2eae61a91966
|
4
|
+
data.tar.gz: 2862a28254fa6283248f512defc4d8b24751c537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2db83d6daf2ddc9827747158561434af508ec56aa9f1d030b83e5a5f5b0343f50b6a3427ef86f956d6cb5b9e85fa775140c4a9a93dc07808cb54eb22832d010
|
7
|
+
data.tar.gz: b472263e1fc18f710916179280d8764c23cb9228f08998aecefae6180e8c742284df7234c5120d9fcc47003253975bb1115e57e7869bb118ddf620f9a2950b75
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [1.0.0.rc9]
|
8
|
+
Changed
|
9
|
+
- Added message if migration does not exist
|
10
|
+
|
11
|
+
## [1.0.0.rc8]
|
12
|
+
Changed
|
13
|
+
- Added `before_save` hook to middleware
|
14
|
+
|
7
15
|
## [1.0.0.rc7]
|
8
16
|
Changed
|
9
17
|
- Fixed `CycloneLariat::Messages::Builder`
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cyclone_lariat (1.0.0.
|
4
|
+
cyclone_lariat (1.0.0.rc9)
|
5
5
|
aws-sdk-sns
|
6
6
|
aws-sdk-sqs
|
7
7
|
dry-cli (~> 0.6)
|
@@ -28,19 +28,19 @@ GEM
|
|
28
28
|
arel (9.0.0)
|
29
29
|
ast (2.4.2)
|
30
30
|
aws-eventstream (1.2.0)
|
31
|
-
aws-partitions (1.
|
32
|
-
aws-sdk-core (3.
|
31
|
+
aws-partitions (1.790.0)
|
32
|
+
aws-sdk-core (3.178.0)
|
33
33
|
aws-eventstream (~> 1, >= 1.0.2)
|
34
34
|
aws-partitions (~> 1, >= 1.651.0)
|
35
35
|
aws-sigv4 (~> 1.5)
|
36
36
|
jmespath (~> 1, >= 1.6.1)
|
37
|
-
aws-sdk-sns (1.
|
38
|
-
aws-sdk-core (~> 3, >= 3.
|
37
|
+
aws-sdk-sns (1.65.0)
|
38
|
+
aws-sdk-core (~> 3, >= 3.177.0)
|
39
39
|
aws-sigv4 (~> 1.1)
|
40
|
-
aws-sdk-sqs (1.
|
41
|
-
aws-sdk-core (~> 3, >= 3.
|
40
|
+
aws-sdk-sqs (1.61.0)
|
41
|
+
aws-sdk-core (~> 3, >= 3.177.0)
|
42
42
|
aws-sigv4 (~> 1.1)
|
43
|
-
aws-sigv4 (1.
|
43
|
+
aws-sigv4 (1.6.0)
|
44
44
|
aws-eventstream (~> 1, >= 1.0.2)
|
45
45
|
byebug (11.1.3)
|
46
46
|
coderay (1.1.3)
|
data/README.md
CHANGED
@@ -786,7 +786,8 @@ class Receiver
|
|
786
786
|
chain.add CycloneLariat::Middleware,
|
787
787
|
dataset: DB[:events],
|
788
788
|
errors_notifier: LunaPark::Notifiers::Sentry.new,
|
789
|
-
message_notifier: LunaPark::Notifiers::Log.new(min_lvl: :debug, format: :pretty_json)
|
789
|
+
message_notifier: LunaPark::Notifiers::Log.new(min_lvl: :debug, format: :pretty_json),
|
790
|
+
before_save: -> { |message| message.data[:password] = nil }
|
790
791
|
end
|
791
792
|
|
792
793
|
class UserIsNotRegistered < LunaPark::Errors::Business
|
@@ -10,11 +10,12 @@ module CycloneLariat
|
|
10
10
|
class Middleware
|
11
11
|
attr_reader :config
|
12
12
|
|
13
|
-
def initialize(errors_notifier: nil, message_notifier: nil, repo: Repo::InboxMessages, **options)
|
13
|
+
def initialize(errors_notifier: nil, message_notifier: nil, before_save: nil, repo: Repo::InboxMessages, **options)
|
14
14
|
@config = CycloneLariat::Options.wrap(options).merge!(CycloneLariat.config)
|
15
15
|
@events_repo = repo.new(**@config.to_h)
|
16
16
|
@message_notifier = message_notifier
|
17
17
|
@errors_notifier = errors_notifier
|
18
|
+
@before_save = before_save
|
18
19
|
end
|
19
20
|
|
20
21
|
def call(_worker_instance, queue, _sqs_msg, body, &block)
|
@@ -34,7 +35,7 @@ module CycloneLariat
|
|
34
35
|
|
35
36
|
private
|
36
37
|
|
37
|
-
attr_reader :errors_notifier, :message_notifier, :events_repo
|
38
|
+
attr_reader :errors_notifier, :message_notifier, :events_repo, :before_save
|
38
39
|
|
39
40
|
def receive_message!(body)
|
40
41
|
body[:Message] ? JSON.parse(body[:Message], symbolize_names: true) : body
|
@@ -48,10 +49,16 @@ module CycloneLariat
|
|
48
49
|
|
49
50
|
existed = events_repo.find(uuid: event.uuid)
|
50
51
|
return true if existed&.processed?
|
52
|
+
return yield if existed
|
53
|
+
|
54
|
+
event.clone.tap do |e|
|
55
|
+
before_save.call(e) if before_save
|
56
|
+
events_repo.create(e)
|
57
|
+
end
|
51
58
|
|
52
|
-
events_repo.create(event) unless existed
|
53
59
|
yield
|
54
|
-
|
60
|
+
|
61
|
+
events_repo.processed!(uuid: event.uuid, error: event.client_error)
|
55
62
|
end
|
56
63
|
|
57
64
|
def catch_business_error(event)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyclone_lariat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kudrin
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-
|
14
|
+
date: 2023-07-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: aws-sdk-sns
|