pub_sub_model_sync 1.0.beta2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +43 -0
- data/CHANGELOG.md +18 -4
- data/Gemfile.lock +2 -6
- data/README.md +198 -122
- data/docs/notifications-diagram.png +0 -0
- data/lib/pub_sub_model_sync/base.rb +0 -20
- data/lib/pub_sub_model_sync/config.rb +2 -3
- data/lib/pub_sub_model_sync/message_processor.rb +32 -9
- data/lib/pub_sub_model_sync/message_publisher.rb +18 -14
- data/lib/pub_sub_model_sync/payload.rb +15 -12
- data/lib/pub_sub_model_sync/{publisher.rb → payload_builder.rb} +16 -11
- data/lib/pub_sub_model_sync/publisher_concern.rb +29 -27
- data/lib/pub_sub_model_sync/railtie.rb +0 -1
- data/lib/pub_sub_model_sync/run_subscriber.rb +17 -13
- data/lib/pub_sub_model_sync/runner.rb +3 -5
- data/lib/pub_sub_model_sync/service_base.rb +6 -33
- data/lib/pub_sub_model_sync/service_google.rb +2 -2
- data/lib/pub_sub_model_sync/service_kafka.rb +2 -2
- data/lib/pub_sub_model_sync/subscriber_concern.rb +11 -9
- data/lib/pub_sub_model_sync/transaction.rb +7 -3
- data/lib/pub_sub_model_sync/version.rb +1 -1
- data/lib/pub_sub_model_sync.rb +1 -1
- data/samples/README.md +50 -0
- data/samples/app1/Dockerfile +13 -0
- data/samples/app1/Gemfile +37 -0
- data/samples/app1/Gemfile.lock +171 -0
- data/samples/app1/README.md +24 -0
- data/samples/app1/Rakefile +6 -0
- data/samples/app1/app/models/application_record.rb +3 -0
- data/samples/app1/app/models/concerns/.keep +0 -0
- data/samples/app1/app/models/post.rb +19 -0
- data/samples/app1/app/models/user.rb +29 -0
- data/samples/app1/bin/bundle +114 -0
- data/samples/app1/bin/rails +5 -0
- data/samples/app1/bin/rake +5 -0
- data/samples/app1/bin/setup +33 -0
- data/samples/app1/bin/spring +14 -0
- data/samples/app1/config/application.rb +40 -0
- data/samples/app1/config/boot.rb +4 -0
- data/samples/app1/config/credentials.yml.enc +1 -0
- data/samples/app1/config/database.yml +25 -0
- data/samples/app1/config/environment.rb +5 -0
- data/samples/app1/config/environments/development.rb +63 -0
- data/samples/app1/config/environments/production.rb +105 -0
- data/samples/app1/config/environments/test.rb +57 -0
- data/samples/app1/config/initializers/application_controller_renderer.rb +8 -0
- data/samples/app1/config/initializers/backtrace_silencers.rb +8 -0
- data/samples/app1/config/initializers/cors.rb +16 -0
- data/samples/app1/config/initializers/filter_parameter_logging.rb +6 -0
- data/samples/app1/config/initializers/inflections.rb +16 -0
- data/samples/app1/config/initializers/mime_types.rb +4 -0
- data/samples/app1/config/initializers/pubsub.rb +4 -0
- data/samples/app1/config/initializers/wrap_parameters.rb +14 -0
- data/samples/app1/config/locales/en.yml +33 -0
- data/samples/app1/config/master.key +1 -0
- data/samples/app1/config/puma.rb +43 -0
- data/samples/app1/config/routes.rb +3 -0
- data/samples/app1/config/spring.rb +6 -0
- data/samples/app1/config.ru +6 -0
- data/samples/app1/db/migrate/20210513080700_create_users.rb +12 -0
- data/samples/app1/db/migrate/20210513134332_create_posts.rb +11 -0
- data/samples/app1/db/schema.rb +34 -0
- data/samples/app1/db/seeds.rb +7 -0
- data/samples/app1/docker-compose.yml +32 -0
- data/samples/app1/log/.keep +0 -0
- data/samples/app2/Dockerfile +13 -0
- data/samples/app2/Gemfile +37 -0
- data/samples/app2/Gemfile.lock +171 -0
- data/samples/app2/README.md +24 -0
- data/samples/app2/Rakefile +6 -0
- data/samples/app2/app/models/application_record.rb +9 -0
- data/samples/app2/app/models/concerns/.keep +0 -0
- data/samples/app2/app/models/customer.rb +28 -0
- data/samples/app2/app/models/post.rb +10 -0
- data/samples/app2/bin/bundle +114 -0
- data/samples/app2/bin/rails +5 -0
- data/samples/app2/bin/rake +5 -0
- data/samples/app2/bin/setup +33 -0
- data/samples/app2/bin/spring +14 -0
- data/samples/app2/config/application.rb +40 -0
- data/samples/app2/config/boot.rb +4 -0
- data/samples/app2/config/credentials.yml.enc +1 -0
- data/samples/app2/config/database.yml +25 -0
- data/samples/app2/config/environment.rb +5 -0
- data/samples/app2/config/environments/development.rb +63 -0
- data/samples/app2/config/environments/production.rb +105 -0
- data/samples/app2/config/environments/test.rb +57 -0
- data/samples/app2/config/initializers/application_controller_renderer.rb +8 -0
- data/samples/app2/config/initializers/backtrace_silencers.rb +8 -0
- data/samples/app2/config/initializers/cors.rb +16 -0
- data/samples/app2/config/initializers/filter_parameter_logging.rb +6 -0
- data/samples/app2/config/initializers/inflections.rb +16 -0
- data/samples/app2/config/initializers/mime_types.rb +4 -0
- data/samples/app2/config/initializers/pubsub.rb +4 -0
- data/samples/app2/config/initializers/wrap_parameters.rb +14 -0
- data/samples/app2/config/locales/en.yml +33 -0
- data/samples/app2/config/master.key +1 -0
- data/samples/app2/config/puma.rb +43 -0
- data/samples/app2/config/routes.rb +3 -0
- data/samples/app2/config/spring.rb +6 -0
- data/samples/app2/config.ru +6 -0
- data/samples/app2/db/development.sqlite3 +0 -0
- data/samples/app2/db/migrate/20210513080956_create_customers.rb +10 -0
- data/samples/app2/db/migrate/20210513135203_create_posts.rb +10 -0
- data/samples/app2/db/schema.rb +31 -0
- data/samples/app2/db/seeds.rb +7 -0
- data/samples/app2/docker-compose.yml +20 -0
- data/samples/app2/log/.keep +0 -0
- metadata +92 -6
- data/lib/pub_sub_model_sync/initializers/before_commit.rb +0 -23
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84f478587ccd28d92b653744e72d338cf53818e5286544ff2c6e1e982a5a12a7
|
|
4
|
+
data.tar.gz: 32266d8a3ba69cad2e716c4861914b62e87ee96cf226ecf8f67dab3f909d9856
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 02a727027a13d0b55f330395c95f9077568efb74fae3927c941211a4d849910fd6c071dae5fdd9386b3bb34c5257389cd74e4fcf5979e29f665a9b8e9e93aa95
|
|
7
|
+
data.tar.gz: 896f7430fbc83640ef3141a9e24413de69034ebc2d9e6a66987d734e25e9c41e52f03aa23faa494d9f05d0e4628acd058082e729a1de00c513fb0fb1c2cca70e
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
tags: # triggered once a git tag is published
|
|
4
|
+
- '*'
|
|
5
|
+
|
|
6
|
+
name: Create Release
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Create Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
# Changelog action adaptations
|
|
19
|
+
- name: Create required package.json
|
|
20
|
+
run: test -f package.json || echo '{}' >package.json
|
|
21
|
+
- name: Detect Previous Tag (action not detecting very well)
|
|
22
|
+
run: echo "::set-output name=previous_tag::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
|
|
23
|
+
id: tag_checker
|
|
24
|
+
|
|
25
|
+
- name: Generate Changelog
|
|
26
|
+
uses: scottbrenner/generate-changelog-action@master
|
|
27
|
+
id: Changelog
|
|
28
|
+
with:
|
|
29
|
+
from-tag: ${{steps.tag_checker.outputs.previous_tag}}
|
|
30
|
+
to-tag: HEAD
|
|
31
|
+
|
|
32
|
+
- name: Create Release
|
|
33
|
+
id: create_release
|
|
34
|
+
uses: actions/create-release@latest
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
|
37
|
+
with:
|
|
38
|
+
tag_name: ${{ github.ref }}
|
|
39
|
+
release_name: Release ${{ github.ref }}
|
|
40
|
+
body: |
|
|
41
|
+
${{ steps.Changelog.outputs.changelog }}
|
|
42
|
+
draft: false
|
|
43
|
+
prerelease: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
# 1.
|
|
3
|
+
# 1.1.1 (October 25, 2021)
|
|
4
|
+
- feat: include `ordering_key topic_name` when delivering a notification for debugging purposes
|
|
5
|
+
- doc: improve docs
|
|
6
|
+
|
|
7
|
+
# 1.1.0 (October 25, 2021)
|
|
8
|
+
- feat: change `transactions_max_buffer` default value to 1 to deliver notifications once they were called
|
|
9
|
+
- feat: use `after_commit` instead of `before_commit` callback and remove the horrible AR patch for rails 4
|
|
10
|
+
|
|
11
|
+
# 1.0.1 (August 20, 2021)
|
|
12
|
+
- refactor: improve service exit when running in k8s
|
|
13
|
+
|
|
14
|
+
# 1.0 (June 13, 2021)
|
|
15
|
+
This version includes many changes that was refactored from previous version, and thus it needs manual changes to migrate into this version.
|
|
4
16
|
- Refactor: Subscribers param renamed `from_action` into `to_action` and added support for block or lambda
|
|
5
17
|
- Feat: Improved `ps_subscribe` to accept new arguments and support for property mappings
|
|
6
18
|
- Refactor: Refactored `ps_publish` to be called manually (removes notification assumptions) and accept for new arguments
|
|
7
|
-
- Feat: Added `
|
|
19
|
+
- Feat: Added `ps_after_action` to listen CRUD events to send notifications in the expected order
|
|
8
20
|
- Feat: Added `config.default_topic_name` to define default topic name whe publishing (by default `config.topic_name`)
|
|
9
21
|
- Refactor: Refactored PubSub Transactions to support rollbacks (any exception inside transactions can automatically cancel all pending notifications: configurable through `config.transactions_use_buffer`)
|
|
10
22
|
- Feat: Improved CRUD transactions to deliver inner notifications in the expected order to keep data consistency
|
|
11
23
|
- System refactor: Added subscriber runner
|
|
12
24
|
- Fix: Class notifications can only be listened by class subscriptions
|
|
13
25
|
- Refactor: Removed `publish_model_data` to have a unique model publisher `ps_publish`
|
|
14
|
-
- Refactor: Renamed `ps_before_sync` into `ps_before_publish`, `
|
|
26
|
+
- Refactor: Renamed `ps_before_sync` into `ps_before_publish`, `ps_after_sync` into `ps_after_publish`
|
|
15
27
|
- Refactor: Renamed `payload.attributes` into `payload.info`
|
|
16
28
|
- Feat: Support for plain Ruby Objects (Non ActiveRecord models)
|
|
17
29
|
- Fix: Retry errors for 5 times before exiting notifications listener
|
|
18
|
-
- Feat: Added transactions max_buffer
|
|
30
|
+
- Feat: Added transactions max_buffer
|
|
31
|
+
- Feat: add `ps_perform_publish` to perform the callback for a specific action
|
|
32
|
+
- Feat: Removed `ps_skip_sync` callback
|
|
19
33
|
|
|
20
34
|
# 0.6.0 (March 03, 2021)
|
|
21
35
|
- feat: add support to include custom payload headers
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pub_sub_model_sync (1.
|
|
4
|
+
pub_sub_model_sync (1.1.1)
|
|
5
5
|
rails
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -116,7 +116,6 @@ GEM
|
|
|
116
116
|
google-cloud-errors (~> 1.0)
|
|
117
117
|
grpc-google-iam-v1 (>= 0.6.10, < 2.0)
|
|
118
118
|
google-protobuf (3.17.0)
|
|
119
|
-
google-protobuf (3.17.0-x86_64-linux)
|
|
120
119
|
googleapis-common-protos (1.3.11)
|
|
121
120
|
google-protobuf (~> 3.14)
|
|
122
121
|
googleapis-common-protos-types (>= 1.0.6, < 2.0)
|
|
@@ -133,9 +132,6 @@ GEM
|
|
|
133
132
|
grpc (1.37.1)
|
|
134
133
|
google-protobuf (~> 3.15)
|
|
135
134
|
googleapis-common-protos-types (~> 1.0)
|
|
136
|
-
grpc (1.37.1-x86_64-linux)
|
|
137
|
-
google-protobuf (~> 3.15)
|
|
138
|
-
googleapis-common-protos-types (~> 1.0)
|
|
139
135
|
grpc-google-iam-v1 (0.6.11)
|
|
140
136
|
google-protobuf (~> 3.14)
|
|
141
137
|
googleapis-common-protos (>= 1.3.11, < 2.0)
|
|
@@ -264,4 +260,4 @@ DEPENDENCIES
|
|
|
264
260
|
sqlite3
|
|
265
261
|
|
|
266
262
|
BUNDLED WITH
|
|
267
|
-
2.2.
|
|
263
|
+
2.2.29
|