hephaestus 0.8.22 → 0.8.23
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/CHANGELOG.md +12 -0
- data/app/controllers/hephaestus/settings_controller.rb +1 -1
- data/app/services/hephaestus/yetto_service.rb +6 -1
- data/config/initializers/filter_job_params.rb +1 -1
- data/lib/hephaestus/engine.rb +4 -4
- data/lib/hephaestus/support/hephaestus/webmocks/yetto_webmock.rb +12 -0
- data/lib/hephaestus/version.rb +1 -1
- data/templates/app/controllers/settings_controller.rb +1 -1
- data/templates/bin/bundle +13 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa9f21425f766448e2c070b8fabe81fe73ea30084bd7d6fbff0caf9908aef0d0
|
4
|
+
data.tar.gz: d0456c6050bd9f866c63f67162b0ef9c70d61c708665f327e1a23ccf3e7ef15e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f1bdfd55bd31163ae15f8a440705f54feed8b2758ee9d7b6495f46ac58d426eb8cc42286d8ae217a04847ad0c078401b623c9f976a4b9958b00a286ba62bb4e
|
7
|
+
data.tar.gz: ec00c5dc4d4fa067a984f7498ef2fbaea03b3ecead3266edfbeb4b2c5f42f224c0db703aacfa716aa5b3fc9b1d8d16f09d5ad6441ca87294d4d2fcc22f61aeb3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# [v0.8.23] - 15-07-2025
|
2
|
+
## What's Changed
|
3
|
+
* Send trigger event service by @balevine in https://github.com/yettoapp/hephaestus/pull/135
|
4
|
+
|
5
|
+
|
6
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.22.1...v0.8.23
|
7
|
+
# [v0.8.22.1] - 04-07-2025
|
8
|
+
## What's Changed
|
9
|
+
* Revert bad lint by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/133
|
10
|
+
|
11
|
+
|
12
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.22...v0.8.22.1
|
1
13
|
# [v0.8.22] - 02-07-2025
|
2
14
|
## What's Changed
|
3
15
|
* change plugs to use solstice dependabot updates by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/130
|
@@ -21,7 +21,7 @@ module Hephaestus
|
|
21
21
|
|
22
22
|
class << self
|
23
23
|
def yetto_client
|
24
|
-
|
24
|
+
Thread.current[:yetto_client] ||= Httpsensible::Client.new(user_agent: "#{Rails.application.class.module_parent.name}/#{Hephaestus::Engine::GIT_SHA}")
|
25
25
|
end
|
26
26
|
|
27
27
|
def encoded_jwt
|
@@ -89,6 +89,11 @@ module Hephaestus
|
|
89
89
|
yetto_client.with_headers({ "Authorization" => "Bearer #{encoded_jwt}" }).get("#{YETTO_API_VERSION_URL}/plug/installations#{to_filter_query(filter)}")
|
90
90
|
end
|
91
91
|
|
92
|
+
def send_trigger_event(plug_installation_id, integration_record, integration_event, payload: {})
|
93
|
+
trigger_url = "#{YETTO_API_VERSION_URL}/plug/installations/#{plug_installation_id}/triggers/#{integration_record}/#{integration_event}"
|
94
|
+
yetto_client.with_headers({ "Authorization" => "Bearer #{encoded_jwt}" }).post(trigger_url, json: payload)
|
95
|
+
end
|
96
|
+
|
92
97
|
private def to_filter_query(hash)
|
93
98
|
return "" if hash.nil?
|
94
99
|
|
@@ -9,7 +9,7 @@ Rails.application.config.after_initialize do
|
|
9
9
|
class LogSubscriber < ActiveSupport::LogSubscriber
|
10
10
|
alias_method :original_format, :format
|
11
11
|
|
12
|
-
private
|
12
|
+
private def format(arg)
|
13
13
|
if arg.is_a?(Hash)
|
14
14
|
parameter_filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
|
15
15
|
parameter_filter.filter(arg.transform_values { |value| original_format(value) })
|
data/lib/hephaestus/engine.rb
CHANGED
@@ -75,7 +75,7 @@ module Hephaestus
|
|
75
75
|
|
76
76
|
def op_read(label)
|
77
77
|
if within_op_rate_limit?
|
78
|
-
%x(#{
|
78
|
+
%x(#{sudo_ish}op read "#{label}").chomp.tap do
|
79
79
|
Rails.logger.error("Failed to fetch `#{label}` from 1Password") && return unless $CHILD_STATUS.success?
|
80
80
|
end
|
81
81
|
end
|
@@ -85,7 +85,7 @@ module Hephaestus
|
|
85
85
|
# skip this unless we're in a Docker container
|
86
86
|
return true unless ENV.fetch("DOCKER", "0") == "1"
|
87
87
|
|
88
|
-
results = %x(#{
|
88
|
+
results = %x(#{sudo_ish}op service-account ratelimit --format=json).chomp.tap do |_result|
|
89
89
|
unless $CHILD_STATUS.success?
|
90
90
|
Rails.logger.error("Failed to retrieve rate limits")
|
91
91
|
return false
|
@@ -107,7 +107,7 @@ module Hephaestus
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def cli_installed?
|
110
|
-
%x(#{
|
110
|
+
%x(#{sudo_ish}op --version 2> /dev/null)
|
111
111
|
$CHILD_STATUS.success?
|
112
112
|
end
|
113
113
|
|
@@ -115,7 +115,7 @@ module Hephaestus
|
|
115
115
|
ENV.fetch("PRECOMPILING", nil).present?
|
116
116
|
end
|
117
117
|
|
118
|
-
def
|
118
|
+
def sudo_ish
|
119
119
|
ENV.fetch("DOCKER", false) == "1" ? "sudo -E " : ""
|
120
120
|
end
|
121
121
|
|
@@ -190,6 +190,18 @@ module Hephaestus
|
|
190
190
|
body: response.to_json,
|
191
191
|
)
|
192
192
|
end
|
193
|
+
|
194
|
+
def stub_send_trigger_event(plug_installation_id, integration_record, integration_event, payload: {}, response: {}, status: 200)
|
195
|
+
stub_request(:post, "#{Hephaestus::YettoService::YETTO_API_VERSION_URL}/plug/installations/#{plug_installation_id}/triggers/#{integration_record}/#{integration_event}")
|
196
|
+
.with(
|
197
|
+
body: payload,
|
198
|
+
)
|
199
|
+
.to_return(
|
200
|
+
status: status,
|
201
|
+
headers: { content_type: "application/json; charset=utf-8" },
|
202
|
+
body: response.to_json,
|
203
|
+
)
|
204
|
+
end
|
193
205
|
end
|
194
206
|
end
|
195
207
|
end
|
data/lib/hephaestus/version.rb
CHANGED
@@ -8,7 +8,7 @@ class SettingsController < ApplicationController
|
|
8
8
|
|
9
9
|
sig { void }
|
10
10
|
def edit
|
11
|
-
@step = params.fetch(:step, 1).to_i
|
11
|
+
@step = params.fetch(:step, 1).to_i
|
12
12
|
|
13
13
|
plug_installation_id = params[:plug_installation_id]
|
14
14
|
response = ::Hephaestus::YettoService.get_plug_installation(plug_installation_id)
|
data/templates/bin/bundle
CHANGED
@@ -13,15 +13,15 @@ require "rubygems"
|
|
13
13
|
m = Module.new do
|
14
14
|
module_function
|
15
15
|
|
16
|
-
|
16
|
+
def invoked_as_script?
|
17
17
|
File.expand_path($PROGRAM_NAME) == File.expand_path(__FILE__)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
20
|
+
def env_var_version
|
21
21
|
ENV["BUNDLER_VERSION"]
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
def cli_arg_version
|
25
25
|
return unless invoked_as_script? # don't want to hijack other binstubs
|
26
26
|
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
27
27
|
|
@@ -39,14 +39,14 @@ m = Module.new do
|
|
39
39
|
bundler_version
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
def gemfile
|
43
43
|
gemfile = ENV["BUNDLE_GEMFILE"]
|
44
44
|
return gemfile if gemfile && !gemfile.empty? # rubocop:disable Rails/Present
|
45
45
|
|
46
46
|
File.expand_path("../Gemfile", __dir__)
|
47
47
|
end
|
48
48
|
|
49
|
-
|
49
|
+
def lockfile
|
50
50
|
lockfile =
|
51
51
|
case File.basename(gemfile)
|
52
52
|
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
|
@@ -55,7 +55,7 @@ m = Module.new do
|
|
55
55
|
File.expand_path(lockfile)
|
56
56
|
end
|
57
57
|
|
58
|
-
|
58
|
+
def lockfile_version
|
59
59
|
return unless File.file?(lockfile)
|
60
60
|
|
61
61
|
lockfile_contents = File.read(lockfile)
|
@@ -64,14 +64,16 @@ m = Module.new do
|
|
64
64
|
Regexp.last_match(1)
|
65
65
|
end
|
66
66
|
|
67
|
-
|
67
|
+
# rubocop:disable ThreadSafety/ClassInstanceVariable
|
68
|
+
def bundler_requirement
|
68
69
|
@bundler_requirement ||=
|
69
70
|
env_var_version ||
|
70
71
|
cli_arg_version ||
|
71
72
|
bundler_requirement_for(lockfile_version)
|
72
73
|
end
|
74
|
+
# rubocop:enable ThreadSafety/ClassInstanceVariable
|
73
75
|
|
74
|
-
|
76
|
+
def bundler_requirement_for(version)
|
75
77
|
return "#{Gem::Requirement.default}.a" unless version
|
76
78
|
|
77
79
|
bundler_gem_version = Gem::Version.new(version)
|
@@ -79,13 +81,13 @@ m = Module.new do
|
|
79
81
|
bundler_gem_version.approximate_recommendation
|
80
82
|
end
|
81
83
|
|
82
|
-
|
84
|
+
def load_bundler!
|
83
85
|
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
84
86
|
|
85
87
|
activate_bundler
|
86
88
|
end
|
87
89
|
|
88
|
-
|
90
|
+
def activate_bundler
|
89
91
|
gem_error = activation_error_handling do
|
90
92
|
gem("bundler", bundler_requirement)
|
91
93
|
end
|
@@ -100,7 +102,7 @@ m = Module.new do
|
|
100
102
|
exit(42)
|
101
103
|
end
|
102
104
|
|
103
|
-
|
105
|
+
def activation_error_handling
|
104
106
|
yield
|
105
107
|
nil
|
106
108
|
rescue StandardError, LoadError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hephaestus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-07-
|
11
|
+
date: 2025-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootsnap
|