ndr_dev_support 7.3.5 → 7.3.7
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 +10 -0
- data/SECURITY.md +35 -0
- data/lib/ndr_dev_support/capistrano/bundler_deployment.rb +100 -0
- data/lib/ndr_dev_support/capistrano/ndr_model.rb +1 -0
- data/lib/ndr_dev_support/capistrano/restart.rb +10 -0
- data/lib/ndr_dev_support/version.rb +1 -1
- data/ndr_dev_support.gemspec +4 -4
- metadata +18 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8fd8bba1f3c88cc84df99dd1fe9b1f3a8877d49ede2736d4a1b8b362c6217663
|
|
4
|
+
data.tar.gz: b0476e365b2ed4cda0d6cace8107c9a569e91af2b67b6bace8284bc3393e320f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a6457d87e9cc922d07c94944b88c5a032cdd9401d2de59960fa8611f6736d1f86fc4943fd707b38de01a6c1a9e4ae6d4692b4e01ebf918b72bf26bdbe30d1ea
|
|
7
|
+
data.tar.gz: 0d47c0e6fa632d39610dbd3acde0f6b71b617e2a436439d28d40d8d95bfaa6ab344fd254d5fb40ae0c227b9c4fa1cccd4d6c8c34e201bc1741b1139c0714b34f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
*no unreleased changes*
|
|
3
3
|
|
|
4
|
+
## 7.3.7 / 2026-06-29
|
|
5
|
+
### Fixed
|
|
6
|
+
* Drop support for Ruby 3.1 and 3.2, Rails 7.0
|
|
7
|
+
* Capistrano: deployment should continue even if cleanup cannot delete files
|
|
8
|
+
|
|
9
|
+
## 7.3.6 / 2026-01-13
|
|
10
|
+
### Added
|
|
11
|
+
* Support Rails 8.1, Ruby 4.0
|
|
12
|
+
* capistrano: Support bundler 4 with capistrano 2
|
|
13
|
+
|
|
4
14
|
## 7.3.5 / 2025-10-16
|
|
5
15
|
### Fixed
|
|
6
16
|
* Capistrano: Do not include macOS extended attributes in tar files
|
data/SECURITY.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
NHS England takes security and the protection of private data extremely seriously. If you believe you have found a vulnerability or other issue which has compromised or could compromise the security of any of our systems and/or private data managed by our systems, please do not hesitate to contact us using the methods outlined below.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Security](#security)
|
|
8
|
+
- [Table of Contents](#table-of-contents)
|
|
9
|
+
- [Reporting a vulnerability](#reporting-a-vulnerability)
|
|
10
|
+
- [Email](#email)
|
|
11
|
+
- [NCSC](#ncsc)
|
|
12
|
+
- [General Security Enquiries](#general-security-enquiries)
|
|
13
|
+
|
|
14
|
+
## Reporting a vulnerability
|
|
15
|
+
|
|
16
|
+
Please note, email is our preferred method of receiving reports.
|
|
17
|
+
|
|
18
|
+
### Email
|
|
19
|
+
|
|
20
|
+
If you wish to notify us of a vulnerability via email, please include detailed information on the nature of the vulnerability and any steps required to reproduce it.
|
|
21
|
+
|
|
22
|
+
You can reach us at:
|
|
23
|
+
|
|
24
|
+
- [Brian.Shand@nhs.net](mailto:Brian.Shand@nhs.net)
|
|
25
|
+
- [cybersecurity@nhs.net](mailto:cybersecurity@nhs.net)
|
|
26
|
+
|
|
27
|
+
### NCSC
|
|
28
|
+
|
|
29
|
+
You can send your report to the National Cyber Security Centre, who will assess your report and pass it on to NHS England if necessary.
|
|
30
|
+
|
|
31
|
+
You can report vulnerabilities here: [https://www.ncsc.gov.uk/information/vulnerability-reporting](https://www.ncsc.gov.uk/information/vulnerability-reporting)
|
|
32
|
+
|
|
33
|
+
## General Security Enquiries
|
|
34
|
+
|
|
35
|
+
If you have general enquiries regarding our cybersecurity, please reach out to us at [cybersecurity@nhs.net](mailto:cybersecurity@nhs.net)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Support capistrano 2 with old (< 4) and new (>= 4) bundler versions
|
|
2
|
+
#
|
|
3
|
+
# Add "require 'ndr_dev_support/capistrano/ndr_model'" in your Capistrano deploy.rb,
|
|
4
|
+
# but remove calls to "require 'bundler/capistrano'", and
|
|
5
|
+
# Bundler will be activated after each new deployment.
|
|
6
|
+
|
|
7
|
+
unless defined?(Bundler::Deployment)
|
|
8
|
+
# Redefine deployment helpers for Capistrano 2, previously defined in bundler < 4
|
|
9
|
+
# cf. https://blog.rubygems.org/2025/12/03/upgrade-to-rubygems-bundler-4.html
|
|
10
|
+
# Code copied from bundler 2 source files bundler/deployment.rb and bundler/capistrano.rb
|
|
11
|
+
# then modified to support bundler >= 2
|
|
12
|
+
# rubocop:disable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
|
|
13
|
+
module Bundler
|
|
14
|
+
class Deployment
|
|
15
|
+
def self.define_task(context, task_method = :task, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity
|
|
16
|
+
if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
|
|
17
|
+
context_name = "capistrano"
|
|
18
|
+
role_default = "{:except => {:no_release => true}}"
|
|
19
|
+
error_type = ::Capistrano::CommandError
|
|
20
|
+
else
|
|
21
|
+
context_name = "vlad"
|
|
22
|
+
role_default = "[:app]"
|
|
23
|
+
error_type = ::Rake::CommandFailedError
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
roles = context.fetch(:bundle_roles, false)
|
|
27
|
+
opts[:roles] = roles if roles
|
|
28
|
+
|
|
29
|
+
context.send :namespace, :bundle do
|
|
30
|
+
send :desc, <<-DESC
|
|
31
|
+
Install the current Bundler environment. By default, gems will be \
|
|
32
|
+
installed to the shared/bundle path. Gems in the development and \
|
|
33
|
+
test group will not be installed. The install command is executed \
|
|
34
|
+
with the --deployment and --quiet flags. If the bundle cmd cannot \
|
|
35
|
+
be found then you can override the bundle_cmd variable to specify \
|
|
36
|
+
which one it should use. The base path to the app is fetched from \
|
|
37
|
+
the :latest_release variable. Set it for custom deploy layouts.
|
|
38
|
+
|
|
39
|
+
You can override any of these defaults by setting the variables shown below.
|
|
40
|
+
|
|
41
|
+
N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \
|
|
42
|
+
in your deploy.rb file.
|
|
43
|
+
|
|
44
|
+
set :bundle_gemfile, "Gemfile"
|
|
45
|
+
set :bundle_dir, File.join(fetch(:shared_path), 'bundle')
|
|
46
|
+
set :bundle_flags, "--deployment --quiet"
|
|
47
|
+
set :bundle_without, [:development, :test]
|
|
48
|
+
set :bundle_with, [:mysql]
|
|
49
|
+
set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle"
|
|
50
|
+
set :bundle_roles, #{role_default} # e.g. [:app, :batch]
|
|
51
|
+
DESC
|
|
52
|
+
send task_method, :install, opts do
|
|
53
|
+
bundle_cmd = context.fetch(:bundle_cmd, "bundle")
|
|
54
|
+
bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet")
|
|
55
|
+
bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), "bundle"))
|
|
56
|
+
bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile")
|
|
57
|
+
bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact
|
|
58
|
+
bundle_with = [*context.fetch(:bundle_with, [])].compact
|
|
59
|
+
app_path = context.fetch(:latest_release)
|
|
60
|
+
if app_path.to_s.empty?
|
|
61
|
+
raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.")
|
|
62
|
+
end
|
|
63
|
+
# Separate out flags that need to be sent to `bundle config` with Bundler 4
|
|
64
|
+
if bundle_flags.include?('--deployment')
|
|
65
|
+
bundle_flags = bundle_flags.split(/ /).grep_v('--deployment').join(' ')
|
|
66
|
+
config_settings = ['deployment true']
|
|
67
|
+
else
|
|
68
|
+
config_settings = []
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"]
|
|
72
|
+
config_settings << "path #{bundle_dir}" unless bundle_dir.to_s.empty?
|
|
73
|
+
args << bundle_flags.to_s
|
|
74
|
+
config_settings << "without #{bundle_without.join(" ")}" unless bundle_without.empty?
|
|
75
|
+
config_settings << "with #{bundle_with.join(" ")}" unless bundle_with.empty?
|
|
76
|
+
|
|
77
|
+
bundle_cmds = config_settings.collect do |settings|
|
|
78
|
+
"#{bundle_cmd} config set --local #{settings}"
|
|
79
|
+
end + ["#{bundle_cmd} install #{args.join(" ")}"]
|
|
80
|
+
run "cd #{app_path} && #{bundle_cmds.join(' && ')}"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Capistrano task for Bundler.
|
|
88
|
+
require "capistrano/version"
|
|
89
|
+
|
|
90
|
+
if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
|
|
91
|
+
raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
|
95
|
+
before "deploy:finalize_update", "bundle:install"
|
|
96
|
+
Bundler::Deployment.define_task(self, :task, except: { no_release: true })
|
|
97
|
+
set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
|
|
98
|
+
end
|
|
99
|
+
# rubocop:enable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
|
|
100
|
+
end
|
|
@@ -5,5 +5,15 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
5
5
|
# The tmp/ directory should be shared, so this affects all prior deployments
|
|
6
6
|
run "touch #{shared_path}/tmp/restart.txt"
|
|
7
7
|
end
|
|
8
|
+
|
|
9
|
+
desc <<~DESC
|
|
10
|
+
Clean up old releases. Overrides the default deploy:cleanup but without blocking \
|
|
11
|
+
subsequent tasks if cleanup fails (e.g. because of locked files or permissions issues).
|
|
12
|
+
DESC
|
|
13
|
+
task :cleanup, except: { no_release: true } do
|
|
14
|
+
count = fetch(:keep_releases, 5).to_i
|
|
15
|
+
try_sudo "ls -1dt #{releases_path}/* | tail -n +#{count + 1} | #{try_sudo} xargs -r rm -rf " \
|
|
16
|
+
"|| echo 'cap deploy:cleanup failed - continuing, but check permissions.' >&2"
|
|
17
|
+
end
|
|
8
18
|
end
|
|
9
19
|
end
|
data/ndr_dev_support.gemspec
CHANGED
|
@@ -13,14 +13,14 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.license = 'MIT'
|
|
14
14
|
|
|
15
15
|
gem_files = %w[CHANGELOG.md CODE_OF_CONDUCT.md LICENSE.txt README.md
|
|
16
|
-
config lib ndr_dev_support.gemspec]
|
|
16
|
+
SECURITY.md config lib ndr_dev_support.gemspec]
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").
|
|
18
18
|
select { |f| gem_files.include?(f.split('/')[0]) }
|
|
19
19
|
spec.bindir = 'exe'
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
21
21
|
spec.require_paths = ['lib']
|
|
22
22
|
|
|
23
|
-
spec.required_ruby_version = '>= 3.
|
|
23
|
+
spec.required_ruby_version = '>= 3.2'
|
|
24
24
|
|
|
25
25
|
spec.add_dependency 'pry'
|
|
26
26
|
|
|
@@ -39,12 +39,12 @@ Gem::Specification.new do |spec|
|
|
|
39
39
|
# Integration test dependencies:
|
|
40
40
|
spec.add_dependency 'capybara', '>= 3.34'
|
|
41
41
|
spec.add_dependency 'capybara-screenshot'
|
|
42
|
-
spec.add_dependency 'minitest', '
|
|
42
|
+
spec.add_dependency 'minitest', '>= 5.11', '< 7.0'
|
|
43
43
|
spec.add_dependency 'selenium-webdriver', '~> 4.8'
|
|
44
44
|
spec.add_dependency 'show_me_the_cookies'
|
|
45
45
|
|
|
46
46
|
# CI server dependencies:
|
|
47
|
-
spec.add_dependency 'activesupport', '>=
|
|
47
|
+
spec.add_dependency 'activesupport', '>= 7.0', '< 8.2'
|
|
48
48
|
spec.add_dependency 'brakeman', '>= 4.7.1'
|
|
49
49
|
spec.add_dependency 'bundler-audit'
|
|
50
50
|
spec.add_dependency 'github-linguist'
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ndr_dev_support
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.3.
|
|
4
|
+
version: 7.3.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- NCRS Development Team
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: pry
|
|
@@ -168,16 +167,22 @@ dependencies:
|
|
|
168
167
|
name: minitest
|
|
169
168
|
requirement: !ruby/object:Gem::Requirement
|
|
170
169
|
requirements:
|
|
171
|
-
- - "
|
|
170
|
+
- - ">="
|
|
172
171
|
- !ruby/object:Gem::Version
|
|
173
172
|
version: '5.11'
|
|
173
|
+
- - "<"
|
|
174
|
+
- !ruby/object:Gem::Version
|
|
175
|
+
version: '7.0'
|
|
174
176
|
type: :runtime
|
|
175
177
|
prerelease: false
|
|
176
178
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
179
|
requirements:
|
|
178
|
-
- - "
|
|
180
|
+
- - ">="
|
|
179
181
|
- !ruby/object:Gem::Version
|
|
180
182
|
version: '5.11'
|
|
183
|
+
- - "<"
|
|
184
|
+
- !ruby/object:Gem::Version
|
|
185
|
+
version: '7.0'
|
|
181
186
|
- !ruby/object:Gem::Dependency
|
|
182
187
|
name: selenium-webdriver
|
|
183
188
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -212,20 +217,20 @@ dependencies:
|
|
|
212
217
|
requirements:
|
|
213
218
|
- - ">="
|
|
214
219
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: '
|
|
220
|
+
version: '7.0'
|
|
216
221
|
- - "<"
|
|
217
222
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: '8.
|
|
223
|
+
version: '8.2'
|
|
219
224
|
type: :runtime
|
|
220
225
|
prerelease: false
|
|
221
226
|
version_requirements: !ruby/object:Gem::Requirement
|
|
222
227
|
requirements:
|
|
223
228
|
- - ">="
|
|
224
229
|
- !ruby/object:Gem::Version
|
|
225
|
-
version: '
|
|
230
|
+
version: '7.0'
|
|
226
231
|
- - "<"
|
|
227
232
|
- !ruby/object:Gem::Version
|
|
228
|
-
version: '8.
|
|
233
|
+
version: '8.2'
|
|
229
234
|
- !ruby/object:Gem::Dependency
|
|
230
235
|
name: brakeman
|
|
231
236
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -404,11 +409,13 @@ files:
|
|
|
404
409
|
- CODE_OF_CONDUCT.md
|
|
405
410
|
- LICENSE.txt
|
|
406
411
|
- README.md
|
|
412
|
+
- SECURITY.md
|
|
407
413
|
- config/rubocop/ndr.yml
|
|
408
414
|
- lib/minitest/rake_ci.rb
|
|
409
415
|
- lib/minitest/rake_ci_plugin.rb
|
|
410
416
|
- lib/ndr_dev_support.rb
|
|
411
417
|
- lib/ndr_dev_support/capistrano/assets.rb
|
|
418
|
+
- lib/ndr_dev_support/capistrano/bundler_deployment.rb
|
|
412
419
|
- lib/ndr_dev_support/capistrano/deploy_secrets.rb
|
|
413
420
|
- lib/ndr_dev_support/capistrano/install_ruby.rb
|
|
414
421
|
- lib/ndr_dev_support/capistrano/macos_bsdtar.rb
|
|
@@ -473,7 +480,6 @@ homepage: https://github.com/NHSDigital/ndr_dev_support
|
|
|
473
480
|
licenses:
|
|
474
481
|
- MIT
|
|
475
482
|
metadata: {}
|
|
476
|
-
post_install_message:
|
|
477
483
|
rdoc_options: []
|
|
478
484
|
require_paths:
|
|
479
485
|
- lib
|
|
@@ -481,15 +487,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
481
487
|
requirements:
|
|
482
488
|
- - ">="
|
|
483
489
|
- !ruby/object:Gem::Version
|
|
484
|
-
version: '3.
|
|
490
|
+
version: '3.2'
|
|
485
491
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
486
492
|
requirements:
|
|
487
493
|
- - ">="
|
|
488
494
|
- !ruby/object:Gem::Version
|
|
489
495
|
version: '0'
|
|
490
496
|
requirements: []
|
|
491
|
-
rubygems_version: 3.
|
|
492
|
-
signing_key:
|
|
497
|
+
rubygems_version: 3.6.9
|
|
493
498
|
specification_version: 4
|
|
494
499
|
summary: NDR Developer Support library
|
|
495
500
|
test_files: []
|