eco-helpers 2.7.6 → 2.7.8

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: 7c7e7c6c61dc2fa5886b5a396f54051e216bf8ffbf6e31ab98388b3ed21c5e5b
4
- data.tar.gz: 4cea27b25b939efd57a4bfcf1d540df660f94cd7b48be45cf96b67dde5d01033
3
+ metadata.gz: 73af9e54de9fc73f1986db49810ae91ad2a8c0153c26d40681873cc52754a923
4
+ data.tar.gz: eb978a976711797b852cfbf2d39f68cfc760906463753a8440e9c6f595269c51
5
5
  SHA512:
6
- metadata.gz: 4c0a48790cf660cb326fa6a06e60e8fc4395f4cfcefd00ca71aa79be79daceb8bf5e4dfd74c33957e07f1cb1f7d8cf298fd062544ecdecd620681c33706fec57
7
- data.tar.gz: 0dfb7e2c7ad703782373bd6c6b24bacc872238009cc9552998e40c55ff05f7bb61b667ee65d333e55b3623f8b139792ea42f5f3eab6a2f737ff182c01b28cd16
6
+ metadata.gz: c454c5ec9ed3713e6bb4fd0e73b582343d5bc96fe6de677b63070838af87b93cb86dad96d1446ba4c6ead007587798c90d30d7c73cea601067db6acd9da32156
7
+ data.tar.gz: afd3bb1f221ddd4db2056a5347799f88c0ad70bbf6dbf868c1f8a231a1ee311df252db2e899f95ada3e31925b8376d74145bb55b0449aa88793d10b33dea1583
data/CHANGELOG.md CHANGED
@@ -1,9 +1,42 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.7.6] - 2024-05-xx
4
+ ## [2.7.9] - 2024-05-xx
5
5
 
6
6
  ### Added
7
+ ### Changed
8
+ ### Fixed
9
+
10
+ ## [2.7.8] - 2024-05-16
11
+
12
+ ### Added
13
+ - `Eco::API::UseCases::GraphQL::Helpers::Location::Command:Result`
14
+ - Feedback original command.
15
+
16
+ ### Changed
17
+ - upgraded `ecoportal-api-graphql` gem
18
+ - able to skip email via options (`-no-email`)
19
+
20
+ ## [2.7.8] - 2024-05-xx
21
+
22
+ ### Added
23
+ - `Eco::API::UseCases::GraphQL::Helpers::Location::Command:Result`
24
+ - Feedback original command.
25
+
26
+ ### Changed
27
+ - upgraded `ecoportal-api-graphql` gem
28
+ - able to skip email via options (`-no-email`)
29
+
30
+ ### Fixed
31
+
32
+ ## [2.7.7] - 2024-05-16
33
+
34
+ ### Fixed
35
+ - `Eco::API::UseCases::OozeSamples::TargetOozesUpdateCase`
36
+ - default prompt to user to `Y` when in remote mode.
37
+
38
+ ## [2.7.6] - 2024-05-16
39
+
7
40
  ### Changed
8
41
  - upgraded `ecoportal-api-graphql` gem, and `ecoportal-api` gem
9
42
  - `Eco::API::Common::People::Entries` (**optimization**)
data/eco-helpers.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_dependency 'ecoportal-api', '>= 0.9.8', '< 0.10'
34
34
  spec.add_dependency 'ecoportal-api-v2', '>= 1.1.8', '< 1.2'
35
- spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.17', '< 0.4'
35
+ spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.18', '< 0.4'
36
36
  spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
37
37
  spec.add_dependency 'aws-sdk-ses', '>= 1.58.0', '< 2'
38
38
  spec.add_dependency 'dotenv', '>= 2.8.1', '< 3'
@@ -24,7 +24,7 @@ class Eco::API::Common::People::DefaultParsers::DateParser < Eco::API::Common::L
24
24
  date = Date.parse(value)
25
25
  return date if valid_range?(date)
26
26
 
27
- wrong!(value, attr: attr, desc: 'Date out of range (1900-2099). Given: ')
27
+ wrong!(value, attr: attr, desc: 'Date out of range (1900-2099). Given:')
28
28
  rescue TypeError, Date::Error
29
29
  nil
30
30
  end
@@ -9,7 +9,6 @@ class Eco::API::UseCases::GraphQL::Base < Eco::API::Common::Loaders::UseCase
9
9
  include Eco::Language::Methods::CallDetector
10
10
 
11
11
  def main(_sess, options, _case)
12
- options.deep_merge!(workflow: {no_email: true}) # prevent the default mailer to quick in
13
12
  options[:end_get] = false
14
13
  process
15
14
  end
@@ -41,13 +41,16 @@ module Eco::API::UseCases::GraphQL::Helpers::Location::Command
41
41
 
42
42
  def error_msg
43
43
  return nil unless error?
44
- msg = ''
45
- msg << "(#{command} '#{node_id}') #{error.message}\n"
46
- return msg if error.validationErrors.empty?
47
44
 
48
- msg << " "
49
- msg << error.validationErrors.map(&:message).join("\n • ")
50
- msg
45
+ msg = []
46
+ msg << "(#{command} '#{node_id}') #{error.message}"
47
+
48
+ feed = []
49
+ feed.concat(error.validationErrors.map(&:message)) unless error.validationErrors.empty?
50
+ feed << "Command: #{command_input_data.pretty_inspect}"
51
+
52
+ msg << " • #{feed.join("\n • ")}"
53
+ msg.join("\n")
51
54
  end
52
55
 
53
56
  def command_result
@@ -66,7 +66,7 @@ module Eco::API::UseCases::GraphQL::Helpers::Location::Command
66
66
  end
67
67
 
68
68
  def errored?
69
- !errored.empty?
69
+ errored.any?
70
70
  end
71
71
 
72
72
  def first_errored
@@ -82,6 +82,8 @@ class Eco::API::UseCases::GraphQL::Samples::Location
82
82
 
83
83
  def email_digest(title)
84
84
  return if simulate?
85
+ return if options.dig(:workflow, :no_email)
86
+
85
87
  digest_msgs = logger.cache.logs(level: %i[info error warn])
86
88
  exception = exception ? " - Exception!" : ''
87
89
  subject = "#{config.active_enviro} - #{title}#{exception}"
@@ -50,7 +50,14 @@ class Eco::API::UseCases::OozeSamples::TargetOozesUpdateCase < Eco::API::UseCase
50
50
  dups_str = dups.count.positive? ? "There are #{dups.count} duplicated ids" : "No duplicates detected"
51
51
  msg = "Total target entries: #{target_ids.count} (#{dups_str})"
52
52
 
53
- session.prompt_user("Do you want to proceed (y/N):", explanation: msg, default: "N", timeout: 10) do |res|
53
+ default_answer = session.config.run_mode_remote?? "Y" : "N"
54
+
55
+ session.prompt_user(
56
+ "Do you want to proceed (y/N):",
57
+ explanation: msg,
58
+ default: default_answer,
59
+ timeout: 10
60
+ ) do |res|
54
61
  unless res.upcase.start_with?("Y")
55
62
  puts "..."
56
63
  log(:info) { "Aborting script..." }
@@ -1,8 +1,8 @@
1
- ASSETS.cli.config do |cnf|
2
- cnf.options_set do |options_set, options|
3
- options_set.add("--help", "Offers a HELP") do |options, sesssion|
1
+ ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength
2
+ cnf.options_set do |options_set, options| # rubocop:disable Metrics/BlockLength
3
+ options_set.add("--help", "Offers a HELP") do |options, session|
4
4
  conf = ASSETS.cli.config
5
- active = Proc.new do |opt|
5
+ active = proc do |opt|
6
6
  if there = SCR.get_arg(opt)
7
7
  refine = SCR.get_arg(opt, with_param: true)
8
8
  end
@@ -37,7 +37,7 @@ ASSETS.cli.config do |cnf|
37
37
  desc = "Redirect Standard Ouput to file"
38
38
  options_set.add("-stdout", desc) do |options, session|
39
39
  file = SCR.get_arg("-stdout", with_param: true) || "output.txt"
40
- STDOUT.reopen(file, "w+")
40
+ $stdout.reopen(file, "w+")
41
41
  end
42
42
 
43
43
  desc = "Skips the check of the headers"
@@ -125,14 +125,14 @@ ASSETS.cli.config do |cnf|
125
125
  options.deep_merge!(report: {people: {csv: file}})
126
126
  end
127
127
 
128
- desc = "Runs in dry-run (no requests sent to server)"
128
+ desc = "Runs in dry-run (no requests sent to server)"
129
129
  options_set.add(["-dry-run", "-simulate"], desc) do |options, session|
130
130
  options[:dry_run] = true
131
131
  options[:simulate] = true
132
132
  session.config.dry_run!
133
133
  end
134
134
 
135
- desc = "Runs runs post_launch cases even if in dry-run"
135
+ desc = "Runs runs post_launch cases even if in dry-run"
136
136
  options_set.add("-run-postlaunch", desc) do |options, session|
137
137
  options.deep_merge!(post_launch: {run: true})
138
138
  end
@@ -181,6 +181,11 @@ ASSETS.cli.config do |cnf|
181
181
  options.deep_merge!(search: {soft: true, strict: false})
182
182
  end
183
183
 
184
+ desc = "Prevent email to be sent (experimental)"
185
+ options_set.add("-no-email", desc) do |options|
186
+ options.deep_merge!(workflow: {no_email: true})
187
+ end
188
+
184
189
  desc = "Silence notifications on account creation or invites"
185
190
  options_set.add(["-no-invites", "-exclude-invites"], desc) do |options|
186
191
  options.merge!(send_invites: false)
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = '2.7.6'.freeze
2
+ VERSION = '2.7.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.6
4
+ version: 2.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -156,7 +156,7 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.17
159
+ version: 0.3.18
160
160
  - - "<"
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0.4'
@@ -166,7 +166,7 @@ dependencies:
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 0.3.17
169
+ version: 0.3.18
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0.4'