hephaestus 0.7.2.1 → 0.7.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c2f9d61793dbe5625865f819df27d6c9d63af6a8b62d24baad0179cb18292a
4
- data.tar.gz: 2b3b19c2cf731b161b8d669e82613ef734b3724580ffaed458912e16ea2dee4e
3
+ metadata.gz: 9a36275ab8b96791877c84c79337f5a2b059cb9e3d23e7596872b1cd5fe73f4a
4
+ data.tar.gz: da5dbdce2df2a9ae89276ceb952a46ddb722bc85d719fc70fae03c8e547dc84c
5
5
  SHA512:
6
- metadata.gz: 0dab68747b8859e1f6d0b24bb2d5d3243f4bb0278602d132eaa4a822d18b7ffaf69b9f683edf1fe1af807bfced0e009010433095725c083582decf8b0a4116f8
7
- data.tar.gz: aaf595de123fbb62eb0582e05d94f3f437c2e0eca9564c563ec6485ba65aede1f690c8d91b266be5235c5755770136b7c46a7646c0b49006131dff1978b78c13
6
+ metadata.gz: 7d1cd204b5e69fe476ac2f8dc9078a1f1c19114d9a05137f108a62315cfffaa9c405ec6663065e287bf7b463c254be62dac84835453b344c292ff4b91d86e97b
7
+ data.tar.gz: 3f6e1ff14ebec10daf227013e74ee0af44aa356bd70575bc0c2152271ee55aa020de9bf61b5b45f2d1d93c046678e38120424d37338cad7d1b1c6126e7cc0e26
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [v0.7.2.3] - 18-11-2024
2
+ ## What's Changed
3
+ * Remove package task by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/35
4
+
5
+
6
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.7.2.2...v0.7.2.3
7
+ # [v0.7.2.2] - 16-11-2024
8
+ ## What's Changed
9
+ * is not yet available by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/33
10
+
11
+
12
+ **Full Changelog**: https://github.com/yettoapp/hephaestus/compare/v0.7.2.1...v0.7.2.2
1
13
  # [v0.7.2.1] - 16-11-2024
2
14
  ## What's Changed
3
15
  * include all files in the gem by @gjtorikian in https://github.com/yettoapp/hephaestus/pull/31
@@ -1,17 +1,26 @@
1
1
  # typed: false
2
2
  # frozen_string_literal: true
3
3
 
4
- def set_env_var(production:, staging:, local:)
5
- case Rails.env
6
- when "production"
7
- %x(op read "#{production}").chomp
8
- when "staging"
9
- %x(op read "#{staging}").chomp
4
+ def fetch_plug_env_secret(label:, default:)
5
+ if productionish?
6
+ op_read("op://Plug-#{plug_name}/#{ENV["RAILS_ENV"].capitalize}/#{label}")
10
7
  else
11
- local
8
+ ENV.fetch(label.to_s, default.is_a?(Pathname) ? default.read : default)
12
9
  end
13
10
  end
14
11
 
12
+ def fetch_infra_secret(label:, default:)
13
+ if productionish?
14
+ op_read("op://Infra/Global Secrets/#{label}")
15
+ else
16
+ ENV.fetch(label.to_s, default.is_a?(Pathname) ? default.read : default)
17
+ end
18
+ end
19
+
20
+ def op_read(label)
21
+ %x(op read "#{label}").chomp
22
+ end
23
+
15
24
  def productionish?
16
25
  Rails.env.production? || Rails.env.staging?
17
26
  end
@@ -66,29 +75,16 @@ module Hephaestus
66
75
  "web.yetto.test"
67
76
  end
68
77
 
69
- SLACK_LOG_URL = set_env_var(
70
- production: "op://Infra/Secrets/SLACK_LOG_URL",
71
- staging: "op://Infra/Secrets/SLACK_LOG_URL",
72
- local: ENV.fetch("SLACK_LOG_URL", "https://slack.com/the_log_room"),
78
+ SLACK_LOG_URL = fetch_infra_secret(
79
+ label: "SLACK_LOG_URL",
80
+ default: "https://slack.com/the_log_room",
73
81
  )
74
82
 
75
83
  YETTO_API_URL = "#{YETTO_URL}/api"
76
84
  YETTO_REDIRECT_URL = productionish? ? "#{PROTOCOL}#{YETTO_URL}" : "#{PROTOCOL}127.0.0.1:3000"
77
85
 
78
86
  # Every plug has these secrets
79
- YETTO_PLUG_PEM = set_env_var(
80
- production: "op://Plug-#{plug_name}/Production/YETTO_PLUG_PEM",
81
- staging: "op://Plug-#{plug_name}/Staging/YETTO_PLUG_PEM",
82
- local: ENV.fetch("YETTO_PLUG_PEM", Rails.root.join("test/fixtures/files/fake_pem_file/fake.pem").read),
83
- )
84
- YETTO_SIGNING_SECRET = set_env_var(
85
- production: "op://Plug-#{plug_name}/Production/YETTO_SIGNING_SECRET",
86
- staging: "op://Plug-#{plug_name}/Staging/YETTO_SIGNING_SECRET",
87
- local: ENV.fetch("YETTO_SIGNING_SECRET", "super-secret"),
88
- )
89
- YETTO_PLUG_ID = set_env_var(
90
- production: "op://Plug-#{plug_name}/Production/YETTO_PLUG_ID",
91
- staging: "op://Plug-#{plug_name}/Staging/YETTO_PLUG_ID",
92
- local: ENV.fetch("YETTO_PLUG_ID", "plug-id"),
93
- )
87
+ YETTO_PLUG_PEM = fetch_plug_env_secret(label: "YETTO_PLUG_PEM", default: Rails.root.join("test/fixtures/files/fake_pem_file/fake.pem"))
88
+ YETTO_SIGNING_SECRET = fetch_plug_env_secret(label: "YETTO_SIGNING_SECRET", default: "super-secret")
89
+ YETTO_PLUG_ID = fetch_plug_env_secret(label: "YETTO_PLUG_ID", default: "plug-id")
94
90
  end
@@ -5,10 +5,9 @@ unless Rails.env.development?
5
5
  # establish the environment for OTEL
6
6
  ENV["OTEL_EXPORTER_OTLP_ENDPOINT"] = "https://api.honeycomb.io"
7
7
 
8
- ENV["OTEL_EXPORTER_OTLP_HEADERS"] = set_env_var(
9
- production: "op://Plug-#{plug_name}/Production/OTEL_EXPORTER_OTLP_HEADERS",
10
- staging: "op://Plug-#{plug_name}/Staging/OTEL_EXPORTER_OTLP_HEADERS",
11
- local: ENV.fetch("OTEL_EXPORTER_OTLP_HEADERS", "x-honeycomb-team=your-api-key"),
8
+ ENV["OTEL_EXPORTER_OTLP_HEADERS"] = fetch_plug_env_secret(
9
+ label: "OTEL_EXPORTER_OTLP_HEADERS",
10
+ default: "x-honeycomb-team=your-api-key",
12
11
  )
13
12
 
14
13
  ENV["OTEL_SERVICE_NAME"] = "plug-#{plug_shortname}-#{Rails.env}"
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Hephaestus
5
- VERSION = "0.7.2.1"
5
+ VERSION = "0.7.2.3"
6
6
  RAILS_VERSION = ">= 8.0"
7
7
  RUBY_VERSION = File
8
8
  .read("#{File.dirname(__FILE__)}/../../.ruby-version")
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.7.2.1
4
+ version: 0.7.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-16 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap
@@ -477,7 +477,6 @@ files:
477
477
  - lib/hephaestus/test_helper.rb
478
478
  - lib/hephaestus/version.rb
479
479
  - lib/tasks/hephaestus_tasks.rake
480
- - lib/tasks/package.rake
481
480
  - lib/tasks/rubocop.rake
482
481
  - lib/version.rb
483
482
  - templates/Dockerfile
@@ -1,9 +0,0 @@
1
- # typed: false
2
- # frozen_string_literal: true
3
-
4
- require "rubygems/package_task"
5
-
6
- GEMSPEC = Bundler.load_gemspec(File.join(__dir__, "..", "..", "hephaestus.gemspec")) unless defined?(GEMSPEC)
7
- gem_path = Gem::PackageTask.new(GEMSPEC).define
8
- desc "Package the ruby gem"
9
- task "package" => [gem_path]