dapr 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb950146d2c73109f4c62d4c698ca7c949ae1ec17c87a0b0acffde6fbff6fd5a
4
- data.tar.gz: 0b22b033b5f96dc35411159ec1b48984accd79f5682c3eaca57f19b9948433e4
3
+ metadata.gz: 333d5818807b0f936fb7ece35380b3ab2ba83875dd0e39efa28ca0b369c92a25
4
+ data.tar.gz: 859ba4dcadb9f7b98c50b8d91226949e1e429466c1c779305bf7a505f968274b
5
5
  SHA512:
6
- metadata.gz: 402fea67d0ae37a5c5a99e36fe7af50b2eb7717f48bb3b89cbed3c1f6d62d52f97624d2125ea4cd3a7f5916a9f7d416aee05765d5344446e82a10bb17c2c4fb7
7
- data.tar.gz: 14d2b26b6ccb5e5d16a7e8d5cd577457918f147a56f79f581a5d6f6f47ce73a438b042ce68c0f5e1c778f3285688208f43c059e0d350ba833852faef54d1abd5
6
+ metadata.gz: b852cc847ff3645c78f48411ff57a39431fed239bd4760e10275411d650516f8dc509a6e7874726d35d9dfd0de9f730650811de0c74acf272604664021c885e9
7
+ data.tar.gz: f787940e3cdeecb504c861f9927fd60b8377045cc8edadef080f040c56bfcc09ae0f0662b303ae18ac375f3180d7fd8c270cde32c252aa313c3e0270f26fb22f
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.3.1"
2
+ ".": "0.3.3"
3
3
  }
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ require:
4
4
  - rubocop-minitest
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 3.2.0
7
+ TargetRubyVersion: 3.3.0
8
8
  NewCops: enable
9
9
 
10
10
 
data/.version.txt CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.3](https://github.com/rubyists/dapr-ruby-client/compare/v0.3.2...v0.3.3) (2024-10-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * **grpc:** Update grpc to 1.66 in container ([#71](https://github.com/rubyists/dapr-ruby-client/issues/71)) ([da78331](https://github.com/rubyists/dapr-ruby-client/commit/da783315276b27c4a1b37996198021f415adf4cf))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **lock:** Updates lock/unlock to append _alpha1 ([#72](https://github.com/rubyists/dapr-ruby-client/issues/72)) ([847d091](https://github.com/rubyists/dapr-ruby-client/commit/847d0910265df8c37edf5d2af4eed0c0f6d4feb0))
14
+
15
+ ## [0.3.2](https://github.com/rubyists/dapr-ruby-client/compare/v0.3.1...v0.3.2) (2024-07-19)
16
+
17
+
18
+ ### Features
19
+
20
+ * **grpc:** Update grpc to 1.65.1 ([#69](https://github.com/rubyists/dapr-ruby-client/issues/69)) ([536dec9](https://github.com/rubyists/dapr-ruby-client/commit/536dec92730f3578de368d19c8150d701a6aac1b))
21
+
3
22
  ## [0.3.1](https://github.com/rubyists/dapr-ruby-client/compare/v0.3.0...v0.3.1) (2024-06-03)
4
23
 
5
24
 
data/ci/build_image.sh CHANGED
@@ -30,7 +30,8 @@ base_dir=$(basename "$(pwd)")
30
30
  : "${IMAGE_NAME:=$base_dir}"
31
31
  : "${LICENSE:=MIT}"
32
32
  : "${REGISTRY:=ghcr.io}"
33
- : "${RUBY_VERSION:=3.3.2}"
33
+ : "${RUBY_VERSION:=3.3.4}"
34
+ : "${REGISTRY_TOKEN:=$GITHUB_TOKEN}"
34
35
 
35
36
  base_image_tag="$RUBY_VERSION-alpine$ALPINE_VERSION"
36
37
  base_exists=$(skopeo list-tags docker://docker.io/ruby |jq -r "any(.Tags[] == \"$base_image_tag\"; .)")
@@ -155,7 +156,6 @@ if [ $# -gt 0 ]; then
155
156
  shift
156
157
  fi
157
158
 
158
-
159
159
  if [ -z "$CONTAINERFILE" ]; then
160
160
  printf "No containerfile specified, looking for default locations\n"
161
161
  for containerfile in Containerfile Dockerfile
@@ -218,8 +218,8 @@ $runtime build --tag "$full_tag" "$@" \
218
218
  --label org.opencontainers.image.revision="$revision" \
219
219
  --label org.opencontainers.image.url="$repo_url" \
220
220
  --label org.opencontainers.image.title="$IMAGE_NAME" \
221
- --label org.opencontainers.image.source="Generated by gitops_tools/bin/build_image ($USER@$HOSTNAME)" \
222
- --label org.opencontainers.image.version="$tag" \
221
+ --label org.opencontainers.image.source="Generated by ruby-automation's build_image.sh ($USER@$HOSTNAME)" \
222
+ --label org.opencontainers.image.version="$full_tag" \
223
223
  --label shortref="$shortref" \
224
224
  --build-arg ALPINE_VERSION="$ALPINE_VERSION" \
225
225
  --build-arg RUBY_VERSION="$RUBY_VERSION" \
@@ -229,25 +229,26 @@ $runtime build --tag "$full_tag" "$@" \
229
229
  if ! $runtime login --get-login "$REGISTRY" >/dev/null 2>/dev/null
230
230
  then
231
231
  printf "Not logged in to '%s', trying to login\n" "$REGISTRY" >&2
232
- [ -z "$GITHUB_TOKEN" ] && die 9 "No GITHUB_TOKEN set, cannot login"
233
- printf "%s" "$GITHUB_TOKEN" | $runtime login -u "$GITHUB_TOKEN" --password-stdin "$REGISTRY" || die 10 "Failed to login to $REGISTRY"
232
+ [ -z "$REGISTRY_TOKEN" ] && die 9 "No REGISTRY_TOKEN (nor GITHUB_TOKEN) set, cannot login"
233
+ printf "%s" "$REGISTRY_TOKEN" | $runtime login -u "$REGISTRY_TOKEN" --password-stdin "$REGISTRY" || die 10 "Failed to login to $REGISTRY"
234
234
  fi
235
235
 
236
- mapfile -t tags < <(echo "$tag" | awk -F'.' 'NF==3{print $1"."$2"."$3; print $1"."$2; print $1; next} NF==2{print $1"."$2; print $1; next} {print}')
236
+ # Split 1.2.3 into 1.2.3, 1.2, 1. We want to tag our image with all 3 of these
237
+ mapfile -t tags < <(echo "$tag" | awk -F'.' 'NF==3{print; print $1"."$2; print $1; next} NF==2{print; print $1; next} {print}')
237
238
  for t in "${tags[@]}"
238
239
  do
239
240
  new_tag=$IMAGE_NAME:$t-ruby$RUBY_VERSION-alpine$ALPINE_VERSION
240
- debug "Tagging %s as %s\n" "$full_tag" "$new_tag"
241
+ registry_image_name="$REGISTRY/$owner/$new_tag"
241
242
  if [ "$runtime" = "podman" ]
242
243
  then
243
244
  if [ "$full_tag" != "$new_tag" ]
244
245
  then
246
+ debug "Tagging %s as %s\n" "$full_tag" "$new_tag"
245
247
  podman tag "$full_tag" "$new_tag" || die 11 "Failed to tag image $full_tag as $new_tag"
246
248
  fi
247
- registry_image_name="$REGISTRY/$owner/$new_tag"
248
249
  podman push "$new_tag" "$registry_image_name" || die 12 "Failed to push image $new_tag to $registry_image_name"
249
250
  else
250
- registry_image_name="$REGISTRY/$owner/$new_tag"
251
+ debug "Tagging %s as %s\n" "$full_tag" "$registry_image_name"
251
252
  docker tag "$full_tag" "$registry_image_name" || die 13 "Failed to tag image $full_tag as $registry_image_name"
252
253
  docker push "$registry_image_name" || die 14 "Failed to push image $new_tag to $registry_image_name"
253
254
  fi
@@ -1 +1 @@
1
- {"timestamp":1716154010,"command_name":"Unit Tests","files":[{"filename":"/home/bougyman/rubyists/dapr/lib/dapr.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,null,1,1,5,null,null,null,1,1,1,1,1,null,null]},"covered_strength":1.4,"covered_lines":10,"lines_of_code":10},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,1,1,1,null,1,1,null,1,1,1,1,1,null,1,4,null,1,1,null,null,1,9,null,null,1,1,null,null,1,12,null,null,null,1,1,null,1,5,null,null,1,1,1,1,null,1,null,null,1,1,null,null,null,null,null]},"covered_strength":1.7878787878787878,"covered_lines":33,"lines_of_code":33},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/configuration.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,1,1,1,null,null,null,null,null,null,null,1,1,1,1,null,null,1,1,1,null,null,null,null,null]},"covered_strength":1.0,"covered_lines":21,"lines_of_code":21},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/lock.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,1,6,6,null,null,null,null,null,null,1,6,6,null,null,null,1,6,6,5,5,null,null,1,null,null,null,1,4,4,4,null,3,3,null,null,1,null,null,1,18,null,null,null,null,null]},"covered_strength":3.0606060606060606,"covered_lines":33,"lines_of_code":33}],"metrics":{"covered_percent":100.0,"covered_strength":2.0103092783505154,"covered_lines":97,"total_lines":97}}
1
+ {"timestamp":1728408645,"command_name":"Unit Tests","files":[{"filename":"/home/bougyman/rubyists/dapr/lib/dapr.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,null,1,1,5,null,null,null,1,1,1,1,1,null,null]},"covered_strength":1.4,"covered_lines":10,"lines_of_code":10},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,1,1,1,null,1,1,null,1,1,1,1,1,null,1,4,null,1,1,null,null,1,9,null,null,1,1,null,null,1,12,null,null,null,1,1,null,1,5,null,null,1,1,1,1,null,1,null,null,1,1,null,null,null,null,null]},"covered_strength":1.7878787878787878,"covered_lines":33,"lines_of_code":33},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/configuration.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,1,1,1,null,null,null,null,null,null,null,1,1,1,1,null,null,1,1,1,null,null,null,null,null]},"covered_strength":1.0,"covered_lines":21,"lines_of_code":21},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/lock.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,null,null,null,null,null,1,6,6,null,null,null,null,null,null,1,6,6,null,null,null,1,6,6,5,5,null,null,1,null,null,null,1,4,4,4,null,3,3,null,null,1,null,null,1,18,null,null,null,null,null,1,6,null,null,null,null,null]},"covered_strength":3.085714285714286,"covered_lines":35,"lines_of_code":35},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/version.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,1,null,null,null]},"covered_strength":1.0,"covered_lines":3,"lines_of_code":3}],"metrics":{"covered_percent":100.0,"covered_strength":2.0098039215686274,"covered_lines":102,"total_lines":102}}
@@ -21,6 +21,11 @@ module Rubyists
21
21
  UnlockRequest = ::Dapr::Proto::Runtime::V1::UnlockRequest
22
22
  DEFAULT_STORE_NAME = 'locker'
23
23
 
24
+ # @param resource_id [String] The unique ID of the resource to lock
25
+ # @param store_name [String] The name of the Dapr lock store component to use
26
+ # @param ttl [Integer] The time-to-live for the lock in seconds
27
+ #
28
+ # @return [Lock] The lock object
24
29
  def self.acquire(resource_id, store_name: DEFAULT_STORE_NAME, ttl: 10)
25
30
  lock = new(store_name, resource_id)
26
31
  lock.lock!(ttl:)
@@ -37,7 +42,7 @@ module Rubyists
37
42
 
38
43
  # @param ttl [Integer] The time-to-live for the lock in seconds
39
44
  def lock!(ttl: 10)
40
- response = singleton.try_lock(LockRequest.new(store_name:, resource_id:, lock_owner:, expiry_in_seconds: ttl))
45
+ response = singleton.try_lock_alpha1 lock_request
41
46
  if response.success
42
47
  logger.info('Acquired lock', store_name:, resource_id:, ttl:, lock_owner:)
43
48
  return self
@@ -48,7 +53,7 @@ module Rubyists
48
53
  end
49
54
 
50
55
  def unlock!
51
- response = singleton.unlock(UnlockRequest.new(store_name:, resource_id:, lock_owner:))
56
+ response = singleton.unlock_alpha1(UnlockRequest.new(store_name:, resource_id:, lock_owner:))
52
57
  status = response.status
53
58
  return true if status == :SUCCESS
54
59
 
@@ -62,6 +67,13 @@ module Rubyists
62
67
  def lock_owner
63
68
  @lock_owner ||= SecureRandom.uuid
64
69
  end
70
+
71
+ # @param ttl [Integer] The time-to-live for the lock in seconds
72
+ #
73
+ # @return [LockRequest] The lock request
74
+ def lock_request(ttl: 10)
75
+ @lock_request ||= LockRequest.new(store_name:, resource_id:, lock_owner:, expiry_in_seconds: ttl)
76
+ end
65
77
  end
66
78
  end
67
79
  end
data/lib/dapr/version.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Rubyists
4
4
  module Dapr
5
5
  # x-release-please-start-version
6
- VERSION = '0.3.1'
6
+ VERSION = '0.3.3'
7
7
  # x-release-please-end
8
8
  end
9
9
  end
data/oci/Containerfile CHANGED
@@ -1,5 +1,5 @@
1
- ARG ALPINE_VERSION=3.19
2
- ARG RUBY_VERSION=3.3.1
1
+ ARG ALPINE_VERSION=3.20
2
+ ARG RUBY_VERSION=3.3.4
3
3
  FROM docker.io/ruby:$RUBY_VERSION-alpine$ALPINE_VERSION AS build-env
4
4
 
5
5
  # Setting env up
@@ -33,8 +33,8 @@ RUN bundle config set build.nokogiri --use-system-libraries && \
33
33
  RUN rm -rf node_modules tmp/cache app/assets vendor/assets spec
34
34
 
35
35
  ############### Build step done ###############
36
- ARG ALPINE_VERSION=3.19
37
- ARG RUBY_VERSION=3.3.1
36
+ ARG ALPINE_VERSION=3.20
37
+ ARG RUBY_VERSION=3.3.4
38
38
  FROM docker.io/ruby:$RUBY_VERSION-alpine$ALPINE_VERSION
39
39
 
40
40
  ARG APP_ROOT=/app
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tj (bougyman) Vanderpoel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-06-03 00:00:00.000000000 Z
12
+ date: 2024-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dapr-ruby
@@ -86,7 +86,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 3.2.0
89
+ version: 3.3.0
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - ">="