jets 3.0.23 → 3.1.2

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: a02adce73b38c44ec15f546538285e9797f544bdf6abe1301bfd97369c2d5cec
4
- data.tar.gz: de64b60cfcc68e6af7b37f2c35ebd404c7d038dee00adb2f03f67c1a2d408ee0
3
+ metadata.gz: 9bb051dfd639163f3f633fbf6573d327ee67e802647d506da22c85733244a563
4
+ data.tar.gz: 4100d9d52b33f989af9fc8098a97e8214976525cda351b03e388e7111b4dd764
5
5
  SHA512:
6
- metadata.gz: d9e95182926df309068f600c5179a0ea327884ba412b374490ae19130dd44b2dfdf4b4d1106e8527150cf05722e5b17df876d4ecf92ebcae252ad363748d6608
7
- data.tar.gz: 12a73a2866479ab9e76466d7577a04cb319697f62441f90b86609f9f6567d48bd857fbaca1e8a3958ad0c9979e78da91b2e9afd82994e99f0e962c60faf4bfc4
6
+ metadata.gz: 0e249bf85b0fea5d5378e74938a9cf711beb25d24878427de1d18f72f807a56636ffc1db1acbc3e134099c4c4ffec743b8f7d3176a3a63be12f386580bc5828b
7
+ data.tar.gz: 0572c04c62eb4fe6a152787b3e9055df137c29f8ddc792584d7c85b9389565056f0c2d1fa78501a8fe9b38557af429da74961b41ec24284396033c31698ca2fc
@@ -16,7 +16,7 @@ details, you may be blocked from ever submitting issues to Jets again.
16
16
  Please use your best judgment. 👍
17
17
 
18
18
  If you are unsure this is a bug in Jets, please consider asking your question at:
19
- https://community.rubyonjets.com
19
+ https://community.boltops.com
20
20
 
21
21
  Thanks!
22
22
  -->
@@ -28,7 +28,7 @@ Make sure that you've done all of these. To mark a checkbox done, replace [ ] w
28
28
  -->
29
29
 
30
30
  - [ ] Upgrade Jets: Are you using the latest version of Jets? This allows Jets to fix issues fast. There's a `jets upgrade` command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/
31
- - [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.rubyonjets.com
31
+ - [ ] Reproducibility: Are you reporting a bug others will be able to reproduce and not asking a question. If you're unsure or want to ask a question, do so on https://community.boltops.com
32
32
  - [ ] Code sample: Have you put together a code sample to reproduce the issue and make it available? Code samples help speed up fixes dramatically. If it's an easily reproducible issue, then code samples are not needed. If you're unsure, please include a code sample.
33
33
 
34
34
  ## My Environment
@@ -7,7 +7,7 @@ assignees: ''
7
7
 
8
8
  ---
9
9
 
10
- The Jets issue tracker IS NOT for usage questions! Please post your question on our dedicated forum at https://community.rubyonjets.com
10
+ The Jets issue tracker IS NOT for usage questions! Please post your question on our dedicated forum at https://community.boltops.com
11
11
 
12
12
  To be sensitive to everyone's time, we may close issues asking questions without comment. If you repeatedly post questions in the issues tracker, you may be blocked from ever submitting issues to Jets again. Please use your best judgment. 👍
13
13
 
@@ -1,6 +1,6 @@
1
1
  Please fill out one of the templates on https://github.com/tongueroo/jets/issues/new/choose
2
2
 
3
- If you want to ask a question please do so on the Jets Community forum: https://community.rubyonjets.com
3
+ If you want to ask a question please do so on the Jets Community forum: https://community.boltops.com
4
4
 
5
5
  To be sensitive to everyone's time, we may close issues asking questions without comment. Posting your questions in the Jets community forum is the best place. It also benefits others by making the questions easier to find. Here are some additional options also http://rubyonjets.com/docs/support/ 👌
6
6
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 2.7.5
data/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [3.1.2] - 2022-04-24
7
+ - [#618](https://github.com/boltops-tools/jets/pull/618) Jets Console accepts environment cli argument
8
+ - [#621](https://github.com/boltops-tools/jets/pull/621) Add SQS and SNS event helpers for jobs
9
+ - [#624](https://github.com/boltops-tools/jets/pull/624) Add lambda.function.ephemeral_storage function property support
10
+
11
+ ## [3.1.1] - 2022-01-18
12
+ - [#615](https://github.com/boltops-tools/jets/pull/615) adjust required_ruby_version
13
+
14
+ ## [3.1.0] - 2022-01-08
15
+ - [#614](https://github.com/boltops-tools/jets/pull/614) support zeitwerk 2.5
16
+ - clean command alias -y for --yes option
17
+
18
+ ## [3.1.0] - 2022-01-08
19
+ - [#614](https://github.com/boltops-tools/jets/pull/614) support zeitwerk 2.5
20
+ - clean command alias -y for --yes option
21
+ - support zeitwerk 2.5
22
+ - update github templates: community.boltops.com
23
+
6
24
  ## [3.0.23] - 2021-12-14
7
25
  - [#610](https://github.com/boltops-tools/jets/pull/610) Rewrite PLATFORMS section to specify Ruby only
8
26
  - [#611](https://github.com/boltops-tools/jets/pull/611) Update ruby_packager.rb
data/jets.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://rubyonjets.com"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = '~> 2.5'
17
+ spec.required_ruby_version = ['>= 2.5.0', '< 3.0.0']
18
18
  spec.rdoc_options += Jets::Rdoc.options
19
19
 
20
20
  vendor_files = Dir.glob("vendor/**/*")
@@ -61,7 +61,7 @@ Gem::Specification.new do |spec|
61
61
  spec.add_dependency "shotgun"
62
62
  spec.add_dependency "text-table"
63
63
  spec.add_dependency "thor"
64
- spec.add_dependency "zeitwerk", "~> 2.4.0"
64
+ spec.add_dependency "zeitwerk", "~> 2.5.0"
65
65
 
66
66
  spec.add_development_dependency "bundler"
67
67
  spec.add_development_dependency "byebug"
@@ -59,6 +59,7 @@ class Jets::Application
59
59
  # default memory setting based on:
60
60
  # https://medium.com/epsagon/how-to-make-lambda-faster-memory-performance-benchmark-be6ebc41f0fc
61
61
  config.function.memory_size = 1536
62
+ config.function.ephemeral_storage = { size: 512 } # megabytes
62
63
 
63
64
  config.prewarm = ActiveSupport::OrderedOptions.new
64
65
  config.prewarm.enable = true
@@ -48,6 +48,9 @@ module Jets
48
48
  loader.do_not_eager_load("#{__dir__}/#{path}")
49
49
  end
50
50
 
51
+ internal_turbine_path = "#{__dir__}/internal/turbines"
52
+ loader.push_dir(internal_turbine_path)
53
+
51
54
  do_not_eager_load_paths.each do |path|
52
55
  loader.do_not_eager_load("#{__dir__}/#{path}")
53
56
  end
data/lib/jets/booter.rb CHANGED
@@ -43,7 +43,6 @@ class Jets::Booter
43
43
  # We eager load the extensions and then use the loaded modules to extend Jets::Stack directly.
44
44
  # Originally used an included hook but thats too early before app/shared/extensions is in the load_path.
45
45
  def load_shared_extensions
46
- Jets::Autoloaders.once.preload("#{Jets.root}/app/shared/extensions")
47
46
  base_path = "#{Jets.root}/app/shared/extensions"
48
47
  Dir.glob("#{base_path}/**/*.rb").each do |path|
49
48
  next unless File.file?(path)
@@ -103,8 +102,8 @@ class Jets::Booter
103
102
  end
104
103
 
105
104
  def load_internal_turbines
106
- Dir.glob("#{__dir__}/internal/turbines/**/*.rb").each do |path|
107
- Jets::Autoloaders.once.preload(path)
105
+ Jets::Autoloaders.once.on_setup do
106
+ Jets::Mailer # only one right now
108
107
  end
109
108
  end
110
109
 
data/lib/jets/cli.rb CHANGED
@@ -63,7 +63,8 @@ class Jets::CLI
63
63
  # Pretty tricky, we need to use the raw @given_args as thor_args eventually calls Commands::Base#eager_load!
64
64
  # which uses Jets.env before we get a chance to override ENV['JETS_ENV']
65
65
  command, env = @given_args[0..1]
66
- return unless %w[deploy delete].include?(command)
66
+
67
+ return unless %w[deploy delete console c].include?(command)
67
68
  env = nil if env&.starts_with?('-')
68
69
  return unless env
69
70
  ENV['JETS_ENV'] = env ? env : 'development'
@@ -2,7 +2,7 @@ module Jets::Commands
2
2
  class Clean < Jets::Commands::Base
3
3
  class_option :noop, type: :boolean, desc: "noop or dry-run mode"
4
4
  class_option :mute, type: :boolean, desc: "mute output"
5
- class_option :yes, type: :boolean, desc: "bypass are you sure prompt"
5
+ class_option :yes, aliases: "y", type: :boolean, desc: "bypass are you sure prompt"
6
6
 
7
7
  desc "log", "Cleans CloudWatch log groups assocated with app"
8
8
  long_desc Help.text('clean:log')
@@ -1,5 +1,11 @@
1
1
  class Jets::Commands::Console
2
- def self.run
2
+ attr_reader :environment
3
+
4
+ def initialize(environment)
5
+ @environment = environment
6
+ end
7
+
8
+ def run
3
9
  puts Jets::Booter.message
4
10
 
5
11
  # Thanks: https://mutelight.org/bin-console
@@ -61,10 +61,13 @@ module Jets::Commands
61
61
  Jets::Router.validate_routes!
62
62
  end
63
63
 
64
- desc "console", "REPL console with Jets environment loaded"
64
+ desc "console [environment]", "REPL console with Jets environment loaded"
65
65
  long_desc Help.text(:console)
66
- def console
67
- Console.run
66
+ # Note the environment is here to trick the Thor parser to allowing an
67
+ # environment parameter. It is not actually set here. It is set earlier
68
+ # in cli.rb: set_jets_env_from_cli_arg!
69
+ def console(environment=nil)
70
+ Console.new(options).run
68
71
  end
69
72
 
70
73
  desc "runner", "Run Ruby code in the context of Jets app non-interactively"
@@ -18,7 +18,7 @@ gem "mysql2", "~> 0.5.3"
18
18
  <% unless options[:mode] == 'job' -%>
19
19
  gem "dynomite"
20
20
  <% end -%>
21
- gem "zeitwerk", "~> 2.4.0"
21
+ gem "zeitwerk", "~> 2.5.0"
22
22
 
23
23
  # development and test groups are not bundled as part of the deployment
24
24
  group :development, :test do
@@ -35,6 +35,7 @@ Jets.application.configure do
35
35
  # security_group_ids: %w[sg-1 sg-2],
36
36
  # subnet_ids: %w[subnet-1 subnet-2],
37
37
  # }
38
+ # config.function.ephemeral_storage = { size: 1536 }
38
39
  # The config.function settings to the CloudFormation Lambda Function properties.
39
40
  # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html
40
41
  # Underscored format can be used for keys to make it look more ruby-ish.
data/lib/jets/job/base.rb CHANGED
@@ -13,6 +13,8 @@ module Jets::Job
13
13
  include Helpers::KinesisEventHelper
14
14
  include Helpers::LogEventHelper
15
15
  include Helpers::S3EventHelper
16
+ include Helpers::SnsEventHelper
17
+ include Helpers::SqsEventHelper
16
18
 
17
19
  # Tracks bucket each time an s3_event is declared
18
20
  # Map of bucket_name => stack_name (nested part)
@@ -0,0 +1,8 @@
1
+ module Jets::Job::Helpers
2
+ module SnsEventHelper
3
+ def sns_event_payload
4
+ message = event&.dig("Records", 0, "Sns", "Message")
5
+ @sns_event_payload ||= ActiveSupport::HashWithIndifferentAccess.new(JSON.load(message))
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module Jets::Job::Helpers
2
+ module SqsEventHelper
3
+ def sqs_event_payload
4
+ message = event&.dig("Records", 0, "body")
5
+ @sqs_event_payload ||= ActiveSupport::HashWithIndifferentAccess.new(JSON.parse(message))
6
+ end
7
+ end
8
+ end
@@ -57,6 +57,7 @@ module Jets::Lambda::Dsl
57
57
  PROPERTIES = %W[
58
58
  dead_letter_config
59
59
  description
60
+ ephemeral_storage
60
61
  handler
61
62
  kms_key_arn
62
63
  memory_size
@@ -33,6 +33,7 @@ module Jets::Stack::Main::Dsl
33
33
  runtime: :ruby,
34
34
  timeout: Jets.config.function.timeout,
35
35
  memory_size: Jets.config.function.memory_size,
36
+ ephemeral_storage: Jets.config.function.ephemeral_storage,
36
37
  description: description,
37
38
  }
38
39
 
data/lib/jets/stack.rb CHANGED
@@ -61,15 +61,6 @@ module Jets
61
61
  end
62
62
  memoize :template
63
63
 
64
- # Eager loading the app/shared resources to ensure shared resources have been registered.
65
- # Not being used anymore but keeping around just in case for now.
66
- def eager_load_shared_resources!
67
- Dir.glob("#{Jets.root}/app/shared/**").each do |path|
68
- next if path.include?("app/shared/functions")
69
- Jets::Autoloaders.main.preload(path)
70
- end
71
- end
72
-
73
64
  def lookup(logical_id)
74
65
  looker.output(logical_id)
75
66
  end
data/lib/jets/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jets
2
- VERSION = "3.0.23"
2
+ VERSION = "3.1.2"
3
3
  end
data/lib/jets.rb CHANGED
@@ -28,4 +28,7 @@ module Jets
28
28
  extend Core # root, logger, etc
29
29
  end
30
30
 
31
- Jets::Autoloaders.once.preload("#{__dir__}/jets/db.rb") # required for booter.rb: setup_db
31
+ # required for booter.rb: setup_db
32
+ Jets::Autoloaders.once.on_setup do
33
+ Jets::Db
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.23
4
+ version: 3.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-14 00:00:00.000000000 Z
11
+ date: 2022-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -492,14 +492,14 @@ dependencies:
492
492
  requirements:
493
493
  - - "~>"
494
494
  - !ruby/object:Gem::Version
495
- version: 2.4.0
495
+ version: 2.5.0
496
496
  type: :runtime
497
497
  prerelease: false
498
498
  version_requirements: !ruby/object:Gem::Requirement
499
499
  requirements:
500
500
  - - "~>"
501
501
  - !ruby/object:Gem::Version
502
- version: 2.4.0
502
+ version: 2.5.0
503
503
  - !ruby/object:Gem::Dependency
504
504
  name: bundler
505
505
  requirement: !ruby/object:Gem::Requirement
@@ -863,6 +863,8 @@ files:
863
863
  - lib/jets/job/helpers/kinesis_event_helper.rb
864
864
  - lib/jets/job/helpers/log_event_helper.rb
865
865
  - lib/jets/job/helpers/s3_event_helper.rb
866
+ - lib/jets/job/helpers/sns_event_helper.rb
867
+ - lib/jets/job/helpers/sqs_event_helper.rb
866
868
  - lib/jets/klass.rb
867
869
  - lib/jets/lambda/dsl.rb
868
870
  - lib/jets/lambda/function.rb
@@ -1086,16 +1088,19 @@ require_paths:
1086
1088
  - lib
1087
1089
  required_ruby_version: !ruby/object:Gem::Requirement
1088
1090
  requirements:
1089
- - - "~>"
1091
+ - - ">="
1092
+ - !ruby/object:Gem::Version
1093
+ version: 2.5.0
1094
+ - - "<"
1090
1095
  - !ruby/object:Gem::Version
1091
- version: '2.5'
1096
+ version: 3.0.0
1092
1097
  required_rubygems_version: !ruby/object:Gem::Requirement
1093
1098
  requirements:
1094
1099
  - - ">="
1095
1100
  - !ruby/object:Gem::Version
1096
1101
  version: '0'
1097
1102
  requirements: []
1098
- rubygems_version: 3.1.6
1103
+ rubygems_version: 3.3.10
1099
1104
  signing_key:
1100
1105
  specification_version: 4
1101
1106
  summary: Ruby Serverless Framework