govuk_app_config 4.6.3 → 4.7.0

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: cff338c8b3be717888644d1bd0b93df938c222250f13d25977c119fb567ef7fa
4
- data.tar.gz: 69141cb68b950829dc7f7c714e426cf1d49ddb9cf679f4d839bb09ffe5283f95
3
+ metadata.gz: ca0a86d04eac2f6c9d28dac8fe8971f2d9a7b318466145bed5d314eb0ce57529
4
+ data.tar.gz: f309aece319f90ddc1eeaee8ab30188121caec53e2d3f86e7236a38a54307952
5
5
  SHA512:
6
- metadata.gz: b816ba7e9b980a4473f67f4ef5ecd59b61c26658ccef8bc6daab2d938fac015ea96e1f2edeee101246db31aedd7359ff1c4e5ff7fa533a16e3cbe5783ffc0466
7
- data.tar.gz: 8bad47cadbba6ad9a5aa1622a30ccdc13d98ae9588605d18a919ce7f15a439eb541f21550f9d0462a276486f167d138a95abf6f73bb3564a2cc868677f99813c
6
+ metadata.gz: 8e54af80454cb90fbf63f1b3b4b81ee89f7edf5adc589fb24f0fe3a16e232d6a6663d3c9d56870b6922e0907c2f8e36aa66f17942384ba2444e38158d164892a
7
+ data.tar.gz: 24223d4a1aca01eec6d2dba4f5a6bfe70d09135fb4d3504a0db77624bf3b8055d6c769446f3c6b8af95e311851952dc36ae58c37a870f1b228145dcc5726a7db
@@ -24,33 +24,12 @@ jobs:
24
24
  runs-on: ubuntu-latest
25
25
  steps:
26
26
  - run: echo "All matrix tests have passed 🚀"
27
-
28
- release:
27
+
28
+ publish:
29
29
  needs: test
30
- runs-on: ubuntu-latest
31
30
  if: ${{ github.ref == 'refs/heads/main' }}
32
31
  permissions:
33
32
  contents: write
34
- steps:
35
- - uses: actions/checkout@v3
36
- - uses: ruby/setup-ruby@v1
37
- with:
38
- rubygems: latest
39
- - env:
40
- GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
41
- GEM_NAME: govuk_app_config
42
- run: |
43
- VERSION=$(ruby -e "puts eval(File.read('$GEM_NAME.gemspec')).version")
44
- GEM_VERSION=$(gem list --exact --remote $GEM_NAME)
45
-
46
- # Publish to RubyGems.org
47
- if [ "${GEM_VERSION}" != "$GEM_NAME (${VERSION})" ]; then
48
- gem build $GEM_NAME.gemspec
49
- gem push "$GEM_NAME-${VERSION}.gem"
50
- fi
51
-
52
- # Create a release tag
53
- if ! git ls-remote --tags --exit-code origin v${VERSION}; then
54
- git tag v${VERSION}
55
- git push --tags
56
- fi
33
+ uses: alphagov/govuk-infrastructure/.github/workflows/publish-rubygem.yaml@main
34
+ secrets:
35
+ GEM_HOST_API_KEY: ${{ secrets.ALPHAGOV_RUBYGEMS_API_KEY }}
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.7.0
2
+
3
+ - Adds Prometheus Sidekiq monitoring ([#255](https://github.com/alphagov/govuk_app_config/pull/255))
4
+
1
5
  # 4.6.3
2
6
 
3
7
  - Adds `region1.google-analytics.com` to the security policy for GA ([#250](https://github.com/alphagov/govuk_app_config/pull/250))
@@ -30,11 +30,11 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  spec.add_development_dependency "byebug"
32
32
  spec.add_development_dependency "climate_control"
33
- spec.add_development_dependency "rack-test", "~> 1.1"
33
+ spec.add_development_dependency "rack-test", "~> 2.0"
34
34
  spec.add_development_dependency "rails", "~> 7"
35
35
  spec.add_development_dependency "rake", "~> 13.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.10"
37
37
  spec.add_development_dependency "rspec-its", "~> 1.3"
38
- spec.add_development_dependency "rubocop-govuk", "4.4.0"
38
+ spec.add_development_dependency "rubocop-govuk", "4.6.0"
39
39
  spec.add_development_dependency "webmock"
40
40
  end
@@ -1,13 +1,35 @@
1
1
  module GovukPrometheusExporter
2
+ def self.should_configure
3
+ ENV["GOVUK_PROMETHEUS_EXPORTER"] == "true" && !(defined?(Rails) && Rails.env == "test")
4
+ end
5
+
2
6
  def self.configure
3
- unless Rails.env == "test" || (ENV["GOVUK_PROMETHEUS_EXPORTER"]) != "true"
4
- require "prometheus_exporter"
5
- require "prometheus_exporter/server"
6
- require "prometheus_exporter/middleware"
7
+ return unless should_configure
8
+
9
+ require "prometheus_exporter"
10
+ require "prometheus_exporter/server"
11
+ require "prometheus_exporter/middleware"
12
+
13
+ if defined?(Sidekiq)
14
+ Sidekiq.configure_server do |config|
15
+ require "prometheus_exporter/instrumentation"
16
+ config.server_middleware do |chain|
17
+ chain.add PrometheusExporter::Instrumentation::Sidekiq
18
+ end
19
+ config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
20
+ config.on :startup do
21
+ PrometheusExporter::Instrumentation::Process.start(type: "sidekiq")
22
+ PrometheusExporter::Instrumentation::SidekiqProcess.start
23
+ PrometheusExporter::Instrumentation::SidekiqQueue.start
24
+ PrometheusExporter::Instrumentation::SidekiqStats.start
25
+ end
26
+ end
27
+ end
7
28
 
8
- server = PrometheusExporter::Server::WebServer.new bind: "0.0.0.0", port: 9394
9
- server.start
29
+ server = PrometheusExporter::Server::WebServer.new bind: "0.0.0.0", port: 9394
30
+ server.start
10
31
 
32
+ if defined?(Rails)
11
33
  Rails.application.middleware.unshift PrometheusExporter::Middleware
12
34
  end
13
35
  end
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "4.6.3".freeze
2
+ VERSION = "4.7.0".freeze
3
3
  end
@@ -6,9 +6,9 @@ require "govuk_app_config/govuk_i18n"
6
6
  # This require is deprecated and should be removed on next major version bump
7
7
  # and should be required by applications directly.
8
8
  require "govuk_app_config/govuk_unicorn"
9
+ require "govuk_app_config/govuk_prometheus_exporter"
9
10
 
10
11
  if defined?(Rails)
11
- require "govuk_app_config/govuk_prometheus_exporter"
12
12
  require "govuk_app_config/govuk_logging"
13
13
  require "govuk_app_config/govuk_content_security_policy"
14
14
  require "govuk_app_config/railtie"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.3
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-27 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstasher
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '1.1'
145
+ version: '2.0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '1.1'
152
+ version: '2.0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rails
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: 4.4.0
215
+ version: 4.6.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: 4.4.0
222
+ version: 4.6.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: webmock
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  - !ruby/object:Gem::Version
297
297
  version: '0'
298
298
  requirements: []
299
- rubygems_version: 3.3.16
299
+ rubygems_version: 3.3.20
300
300
  signing_key:
301
301
  specification_version: 4
302
302
  summary: Base configuration for GOV.UK applications