hephaestus 0.8.14 → 0.8.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/bin/hephaestus +2 -1
- data/config/queue.yml +1 -2
- data/lib/hephaestus/app_name.rb +2 -2
- data/lib/hephaestus/engine.rb +1 -1
- data/lib/hephaestus/middleware/openapi_validation.rb +1 -0
- data/lib/hephaestus/version.rb +1 -1
- data/templates/lib/schemas/api/2023-03-06/components/schemas/{yetto.json → yetto.json.tt} +2 -2
- data/templates/lib/schemas/api/2023-03-06/paths/yetto/plug_installation_created.json +1 -1
- data/templates/root/hephaestus_gitignore +1 -0
- data/templates/script/edit-credentials +5 -0
- data/templates/script/ngrok.tt +1 -1
- data/templates/test/controllers/app_controller_test.rb.tt +8 -7
- data/templates/test/controllers/yetto_controller_test.rb +1 -1
- data/templates/test/jobs/some_job_test.rb +7 -0
- metadata +12 -10
- /data/script/{edit-credentials → templates/edit-credentials} +0 -0
- /data/script/{setup-vault → templates/setup-vault} +0 -0
- /data/script/{vault.json → templates/vault.json} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 351e1e10bdbe87d1060a074493567578397261bc988cdfd9ad5e181f183aaadf
|
4
|
+
data.tar.gz: 3627d0becfc5c75f52f53d5d14edc7b60d413ed9ba3c07120b4e9f4072e923b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca673429b1da48268c99b94f2add25c2e874f45f7ee4f0203b48a1a7d4396fa7088a1b5564ee0108da962112b54f62bd7db92214671a9917a14b33cb65f273ea
|
7
|
+
data.tar.gz: 524baa78665bc9c78e270c16d5b12646ff0a749b46471d2b1670df04391c259649a8543666132389decebc6d0445eb861b0fd59aa9479628fafda9076f047a35
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# [v0.8.15] - 15-01-2025
|
2
|
+
## What's Changed
|
3
|
+
* Move hephaestus' plug scripts to subfolder + other fixups by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/104
|
4
|
+
|
5
|
+
|
6
|
+
**Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.8.14...v0.8.15
|
1
7
|
# [v0.8.14] - 19-12-2024
|
2
8
|
## What's Changed
|
3
9
|
* Add scripting logic to Hephaestus by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/102
|
data/bin/hephaestus
CHANGED
@@ -101,7 +101,8 @@ end
|
|
101
101
|
case ARGV[0]
|
102
102
|
when "run"
|
103
103
|
ENV["HEPHAESTUS_CAPITAL_PLUG_NAME"] = `grep 'module Plug\S*' config/application.rb | sed -E 's/module Plug//'`.strip
|
104
|
-
|
104
|
+
ENV["HEPHAESTUS_LOWERCASE_PLUG_NAME"] = ENV["HEPHAESTUS_CAPITAL_PLUG_NAME"].underscore
|
105
|
+
script_dir = File.join(ENGINE_ROOT, "script", "templates")
|
105
106
|
puts `#{File.join(script_dir, ARGV[1..-1].join(' '))}`
|
106
107
|
else
|
107
108
|
Hephaestus::AppGenerator.start
|
data/config/queue.yml
CHANGED
@@ -4,9 +4,8 @@ default: &default
|
|
4
4
|
batch_size: 500
|
5
5
|
workers:
|
6
6
|
- queues: [plug_<%= plug_shortname %>_high_priority*, plug_<%= plug_shortname %>_mid_priority*, plug_<%= plug_shortname %>_low_priority*]
|
7
|
-
threads: 5
|
8
7
|
- queues: "plug_<%= plug_shortname %>_*" # default, mailers, etc
|
9
|
-
threads:
|
8
|
+
threads: 1
|
10
9
|
|
11
10
|
development:
|
12
11
|
<<: *default
|
data/lib/hephaestus/app_name.rb
CHANGED
@@ -10,12 +10,12 @@ module Hephaestus
|
|
10
10
|
"plug-#{Rails.application.class.module_parent.name.underscore[5..-1]}"
|
11
11
|
end
|
12
12
|
|
13
|
-
# like, `slack`, github
|
13
|
+
# like, `slack`, `github`, or `html_proofer`
|
14
14
|
def plug_name
|
15
15
|
app_name.split("-", 2).last
|
16
16
|
end
|
17
17
|
|
18
|
-
# like, `Slack`, `GitHub`, or `
|
18
|
+
# like, `Slack`, `GitHub`, or `HtmlProofer`
|
19
19
|
def capital_plug_name
|
20
20
|
plug_name.camelcase
|
21
21
|
end
|
data/lib/hephaestus/engine.rb
CHANGED
@@ -71,7 +71,7 @@ module Hephaestus
|
|
71
71
|
|
72
72
|
def op_read(label)
|
73
73
|
%x(#{include_sudo?}op read "#{label}").chomp.tap do
|
74
|
-
|
74
|
+
Rails.logger.error("Failed to fetch `#{label}` from 1Password") && return unless $CHILD_STATUS.success?
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -41,6 +41,7 @@ module Hephaestus
|
|
41
41
|
else
|
42
42
|
case validated_request.error.type
|
43
43
|
when :not_found
|
44
|
+
Rails.logger.error("Request path not found. Is it defined in openai.json? ") if print_user_api_errors?
|
44
45
|
[Hephaestus::HTTP::NOT_FOUND_I, { "Content-Type" => "application/json" }, [format_str("Not Found")]]
|
45
46
|
else
|
46
47
|
error_message = if validated_request.error.errors.present?
|
data/lib/hephaestus/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"Create<%= capital_plug_name %>Message": {
|
3
3
|
"type": "object",
|
4
4
|
"required": [
|
5
5
|
"yetto"
|
@@ -77,7 +77,7 @@
|
|
77
77
|
},
|
78
78
|
"additionalProperties": false
|
79
79
|
},
|
80
|
-
"
|
80
|
+
"CreatedPlugInstallation": {
|
81
81
|
"type": "object",
|
82
82
|
"required": [
|
83
83
|
"yetto"
|
data/templates/script/ngrok.tt
CHANGED
@@ -176,13 +176,14 @@ class <%= capital_plug_name %>ControllerTest < ActionDispatch::IntegrationTest
|
|
176
176
|
assert_response :bad_request
|
177
177
|
end
|
178
178
|
|
179
|
-
|
180
|
-
assert_enqueued_with(job: Process<%= capital_plug_name %>IssueCommentJob) do
|
181
|
-
plug(:post, "/webhook", body: @valid_issue_comment_created_webhook_body, headers: { "HTTP_X_GITHUB_EVENT" => "issue_comment", "HTTP_X_HUB_SIGNATURE_256" => auth_header(@valid_issue_comment_created_webhook_body) })
|
182
|
-
end
|
179
|
+
# TODO: Add your own controller tests here; for example
|
183
180
|
|
184
|
-
|
185
|
-
|
181
|
+
# test "webhook passes to job when issue_comment is created" do
|
182
|
+
# assert_enqueued_with(job: Process<%= capital_plug_name %>IssueCommentJob) do
|
183
|
+
# plug(:post, "/webhook", body: @valid_issue_comment_created_webhook_body, headers: { "HTTP_X_GITHUB_EVENT" => "issue_comment", "HTTP_X_HUB_SIGNATURE_256" => auth_header(@valid_issue_comment_created_webhook_body) })
|
184
|
+
# end
|
185
|
+
#
|
186
|
+
# assert_response :ok
|
187
|
+
# end
|
186
188
|
|
187
|
-
# TODO: Add your own controller tests here
|
188
189
|
end
|
@@ -104,7 +104,7 @@ class YettoControllerTest < ActionDispatch::IntegrationTest
|
|
104
104
|
assert_response :bad_request
|
105
105
|
end
|
106
106
|
|
107
|
-
test "it performs
|
107
|
+
test "it performs **SomeJob** to **do something** to your platform" do
|
108
108
|
incoming_body = @after_create_message
|
109
109
|
|
110
110
|
job_args = {
|
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.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen Torikian
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootsnap
|
@@ -377,7 +377,7 @@ dependencies:
|
|
377
377
|
description: 'Hephaestus is a Rails generator to create plugs for Yetto.
|
378
378
|
|
379
379
|
'
|
380
|
-
email:
|
380
|
+
email:
|
381
381
|
executables:
|
382
382
|
- hephaestus
|
383
383
|
extensions: []
|
@@ -445,9 +445,9 @@ files:
|
|
445
445
|
- lib/hephaestus/version.rb
|
446
446
|
- lib/tasks/hephaestus_tasks.rake
|
447
447
|
- lib/tasks/rubocop.rake
|
448
|
-
- script/edit-credentials
|
449
|
-
- script/setup-vault
|
450
|
-
- script/vault.json
|
448
|
+
- script/templates/edit-credentials
|
449
|
+
- script/templates/setup-vault
|
450
|
+
- script/templates/vault.json
|
451
451
|
- templates/app/controllers/app_controller.rb.tt
|
452
452
|
- templates/app/controllers/application_controller.rb
|
453
453
|
- templates/app/controllers/concerns/authable.rb.tt
|
@@ -495,7 +495,7 @@ files:
|
|
495
495
|
- templates/lib/schemas/api/2023-03-06/components/parameters/plugInstallation.json
|
496
496
|
- templates/lib/schemas/api/2023-03-06/components/schemas/plug.json
|
497
497
|
- templates/lib/schemas/api/2023-03-06/components/schemas/responses.json
|
498
|
-
- templates/lib/schemas/api/2023-03-06/components/schemas/yetto.json
|
498
|
+
- templates/lib/schemas/api/2023-03-06/components/schemas/yetto.json.tt
|
499
499
|
- templates/lib/schemas/api/2023-03-06/openapi.json
|
500
500
|
- templates/lib/schemas/api/2023-03-06/paths/app.json
|
501
501
|
- templates/lib/schemas/api/2023-03-06/paths/yetto/message_created.json
|
@@ -517,6 +517,7 @@ files:
|
|
517
517
|
- templates/root/hephaestus_ruby-version
|
518
518
|
- templates/script/docker-build-prod.tt
|
519
519
|
- templates/script/docker-run.tt
|
520
|
+
- templates/script/edit-credentials
|
520
521
|
- templates/script/hmac_text
|
521
522
|
- templates/script/licenses
|
522
523
|
- templates/script/ngrok.tt
|
@@ -531,6 +532,7 @@ files:
|
|
531
532
|
- templates/test/fixtures/files/fake_pem_file/fake.pem
|
532
533
|
- templates/test/fixtures/files/plug_installation_settings/invalid.json
|
533
534
|
- templates/test/fixtures/files/plug_installation_settings/valid.json
|
535
|
+
- templates/test/jobs/some_job_test.rb
|
534
536
|
- templates/test/support/rails.rb
|
535
537
|
- templates/test/support/webmocks/app_webmock.rb.tt
|
536
538
|
- templates/test/test_helper.rb
|
@@ -540,7 +542,7 @@ homepage: http://github.com/yettoapp/hephaestus
|
|
540
542
|
licenses:
|
541
543
|
- MIT
|
542
544
|
metadata: {}
|
543
|
-
post_install_message:
|
545
|
+
post_install_message:
|
544
546
|
rdoc_options:
|
545
547
|
- "--charset=UTF-8"
|
546
548
|
require_paths:
|
@@ -558,7 +560,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
558
560
|
version: 3.4.7
|
559
561
|
requirements: []
|
560
562
|
rubygems_version: 3.5.22
|
561
|
-
signing_key:
|
563
|
+
signing_key:
|
562
564
|
specification_version: 4
|
563
565
|
summary: Generate a Rails app that can be used to create plugs for Yetto.
|
564
566
|
test_files: []
|
File without changes
|
File without changes
|
File without changes
|