govuk_app_config 4.6.2 → 4.7.1

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: 0f3849d5bf53877e6244bcda92162ec86e9a37c5788a491e1f436af79da3433e
4
- data.tar.gz: 8d198f89774cf5962ae877e5437bff4025123c102645ac7d4a2b81b2525ef0c3
3
+ metadata.gz: 4980a3e44e9119b3542865caa4e07b57078c535e0eca7f3b6fb9952cf602080a
4
+ data.tar.gz: 8bcd1e8e02392e09241501dd23936a959d883833683aa1c9087938fbe095548d
5
5
  SHA512:
6
- metadata.gz: e5c4e6173b2c7b41ff37430b603bb1d04dcc108fd24c4b374f2d4731512ce780fb1dd43d7bdd13a0bdc4e0948be48f4a6a6913cabb337ff1afe5a3110213d650
7
- data.tar.gz: 3a810d79466ce2780c3e19b77da1edaf3a98546cc0ddbb28f6e10deb20558bc8a2eac44e1777af90be739138059176401535d75ff1bb918362e855fccb7ce1ca
6
+ metadata.gz: bd601933a5242b4e06135e36c5254b78002336cdac975726a4bde1eabb205827d797b175b5a50b52d5b0ef9536b5f74e1e9d56cda42910b8f144cea27bb5df63
7
+ data.tar.gz: 003c1505e61831f46160a768a4f990811b0513f94dce388d4cdc00242df74cf2812e3e1ff70a405d2e4d0c24d2ebb1694d0e8b6edef3d971523125cd8ceedc58
@@ -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,11 @@
1
+ # 4.7.0
2
+
3
+ - Adds Prometheus Sidekiq monitoring ([#255](https://github.com/alphagov/govuk_app_config/pull/255))
4
+
5
+ # 4.6.3
6
+
7
+ - Adds `region1.google-analytics.com` to the security policy for GA ([#250](https://github.com/alphagov/govuk_app_config/pull/250))
8
+
1
9
  # 4.6.2
2
10
 
3
11
  - Adds a new domain to the security policy for GA ([#248](https://https://github.com/alphagov/govuk_app_config/pull/248))
@@ -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
@@ -19,7 +19,8 @@ module GovukContentSecurityPolicy
19
19
  ssl.google-analytics.com
20
20
  stats.g.doubleclick.net
21
21
  www.googletagmanager.com
22
- www.region1.google-analytics.com].freeze
22
+ www.region1.google-analytics.com
23
+ region1.google-analytics.com].freeze
23
24
 
24
25
  GOOGLE_STATIC_DOMAINS = %w[www.gstatic.com].freeze
25
26
 
@@ -1,13 +1,40 @@
1
1
  module GovukPrometheusExporter
2
+ def self.should_configure
3
+ if File.basename($PROGRAM_NAME) == "rake" ||
4
+ defined?(Rails) && (Rails.const_defined?("Console") || Rails.env == "test")
5
+ false
6
+ else
7
+ ENV["GOVUK_PROMETHEUS_EXPORTER"] == "true"
8
+ end
9
+ end
10
+
2
11
  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"
12
+ return unless should_configure
13
+
14
+ require "prometheus_exporter"
15
+ require "prometheus_exporter/server"
16
+ require "prometheus_exporter/middleware"
17
+
18
+ if defined?(Sidekiq)
19
+ Sidekiq.configure_server do |config|
20
+ require "prometheus_exporter/instrumentation"
21
+ config.server_middleware do |chain|
22
+ chain.add PrometheusExporter::Instrumentation::Sidekiq
23
+ end
24
+ config.death_handlers << PrometheusExporter::Instrumentation::Sidekiq.death_handler
25
+ config.on :startup do
26
+ PrometheusExporter::Instrumentation::Process.start(type: "sidekiq")
27
+ PrometheusExporter::Instrumentation::SidekiqProcess.start
28
+ PrometheusExporter::Instrumentation::SidekiqQueue.start
29
+ PrometheusExporter::Instrumentation::SidekiqStats.start
30
+ end
31
+ end
32
+ end
7
33
 
8
- server = PrometheusExporter::Server::WebServer.new bind: "0.0.0.0", port: 9394
9
- server.start
34
+ server = PrometheusExporter::Server::WebServer.new bind: "0.0.0.0", port: 9394
35
+ server.start
10
36
 
37
+ if defined?(Rails)
11
38
  Rails.application.middleware.unshift PrometheusExporter::Middleware
12
39
  end
13
40
  end
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "4.6.2".freeze
2
+ VERSION = "4.7.1".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.2
4
+ version: 4.7.1
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-17 00:00:00.000000000 Z
11
+ date: 2022-08-18 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