ndr_dev_support 6.1.1 → 6.1.4
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 +12 -0
- data/lib/ndr_dev_support/version.rb +1 -1
- data/lib/tasks/audit_bundle.rake +45 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 665f148ac622b9f75c0150d8b1d6770aaeaaf5c9d1bb561c5a1d34a3f9b8bf2d
|
4
|
+
data.tar.gz: af2bd48cfef10426450978b40071f134d40af2524edec37cf380b5ffa820a409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 706873fa19d231e950bec7f26a74946a5c19d9d594930b5fe6b64e0b4be12545254b2371c82067a7ed0b420153ac050f449980c84c3eb15b8a2a58940e6a64ab
|
7
|
+
data.tar.gz: a20045257bbd629bca137e8b8724549836c2c484e05d1074b245dbdf56c607608cfd572141619c4bfe18786ae8645581ebe6777ed0068bd849e1bb8d97d95306
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
* No unreleased changes
|
3
3
|
|
4
|
+
## 6.1.4 / 2022-06-16
|
5
|
+
### Added
|
6
|
+
* Add warning when upgrading webpacker
|
7
|
+
|
8
|
+
## 6.1.3 / 2022-05-25
|
9
|
+
### Fixed
|
10
|
+
* bundle:update should update secondary gem lock files
|
11
|
+
|
12
|
+
## 6.1.2 / 2022-05-24
|
13
|
+
### Fixed
|
14
|
+
* bundle:update should fetch binary gems for all bundled platforms
|
15
|
+
|
4
16
|
## 6.1.1 / 2022-04-29
|
5
17
|
### Fixed
|
6
18
|
* CI: fix crashes when brakeman parsing fails
|
data/lib/tasks/audit_bundle.rake
CHANGED
@@ -11,6 +11,10 @@ namespace :bundle do
|
|
11
11
|
Updates the bundled gem (e.g. rails) version to e.g. 6.0.4.7
|
12
12
|
and provides instructions for committing changes.
|
13
13
|
It will attempt to modify a hardcoded version in the Gemfile if necessary.
|
14
|
+
|
15
|
+
If a secondary Gemfile is present in the same directory, e.g. Gemfile.monterey,
|
16
|
+
and it defines constants such as BUNDLER_OVERRIDE_PUMA=true, then this task
|
17
|
+
will attempt to update the secondary lock file, e.g. Gemfile.monterey.lock too.
|
14
18
|
USAGE
|
15
19
|
task(:update) do
|
16
20
|
unless %w[git git-svn].include?(repository_type)
|
@@ -108,14 +112,49 @@ namespace :bundle do
|
|
108
112
|
exit 1
|
109
113
|
end
|
110
114
|
|
115
|
+
gem_list = Bundler.with_unbundled_env { `bundle exec gem list ^#{gem}$` }
|
116
|
+
new_gem_version2 = gem_list.match(/ \(([0-9.]+)( [a-z0-9_-]*)?\)$/).to_a[1]
|
117
|
+
|
118
|
+
# Update secondary Gemfile.lock to keep vendored gems in sync
|
119
|
+
secondary_gemfiles = `git ls-tree --name-only HEAD Gemfile.*`.split("\n").grep_v(/[.]lock$/)
|
120
|
+
secondary_gemfiles.each do |secondary_gemfile|
|
121
|
+
gem_re = /^BUNDLER_OVERRIDE_([^ =]*) *=/
|
122
|
+
secondary_gems = File.readlines(secondary_gemfile).grep(gem_re).
|
123
|
+
collect { |s| gem_re.match(s)[1].downcase }
|
124
|
+
if secondary_gems.empty?
|
125
|
+
puts "Warning: cannot update #{secondary_gemfile}.lock - no BUNDLER_OVERRIDE_... entries"
|
126
|
+
next
|
127
|
+
end
|
128
|
+
puts "Updating #{secondary_gemfile}.lock"
|
129
|
+
FileUtils.cp('Gemfile.lock', "#{secondary_gemfile}.lock")
|
130
|
+
Bundler.with_unbundled_env do
|
131
|
+
system("BUNDLE_GEMFILE=#{secondary_gemfile} bundle update --quiet \
|
132
|
+
--conservative --minor #{secondary_gems.join(' ')}")
|
133
|
+
end
|
134
|
+
system('git checkout -q vendor/cache/')
|
135
|
+
system('git clean -q -f vendor/cache')
|
136
|
+
Bundler.with_unbundled_env { system('bundle install --local --quiet 2> /dev/null') }
|
137
|
+
puts "Finished updating #{secondary_gemfile}.lock"
|
138
|
+
end
|
139
|
+
|
140
|
+
# Retrieve binary gems for platforms listed in Gemfile.lock
|
141
|
+
platforms = `bundle platform`.split("\n").grep(/^[*] x86_64-/).collect { |s| s[2..] }
|
142
|
+
Dir.chdir('vendor/cache') do
|
143
|
+
platforms.each do |platform|
|
144
|
+
system("gem fetch #{gem} --version=#{new_gem_version2} --platform=#{platform}")
|
145
|
+
end
|
146
|
+
end if Dir.exist?('vendor/cache')
|
147
|
+
|
148
|
+
if gem == 'webpacker'
|
149
|
+
puts 'TODO: update package.json and yarn.lock with bin/rails webpacker:install'
|
150
|
+
puts ' and git add / git remove files in vendor/npm-packages-offline-cache'
|
151
|
+
end
|
152
|
+
|
111
153
|
if File.exist?(SAFETY_FILE)
|
112
154
|
# Remove references to unused files in code_safety.yml
|
113
155
|
system('rake audit:tidy_code_safety_file')
|
114
156
|
end
|
115
157
|
|
116
|
-
gem_list = Bundler.with_unbundled_env { `bundle exec gem list ^#{gem}$` }
|
117
|
-
new_gem_version2 = gem_list.match(/ \(([0-9.]+)( [a-z0-9_-]*)?\)$/).to_a[1]
|
118
|
-
|
119
158
|
if new_gem_version && new_gem_version != new_gem_version2
|
120
159
|
puts <<~MSG
|
121
160
|
Error: Tried to update gem #{gem} to version #{new_gem_version} but ended up at version #{new_gem_version2}. Aborting.
|
@@ -132,7 +171,9 @@ namespace :bundle do
|
|
132
171
|
puts "Looking for changed files using git status\n\n"
|
133
172
|
files_to_git_rm = `git status vendor/cache/|grep 'deleted: ' | \
|
134
173
|
grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
|
135
|
-
|
174
|
+
secondary_lockfiles = secondary_gemfiles.collect { |s| "#{s}.lock" }
|
175
|
+
files_to_git_add = `git status Gemfile Gemfile.lock #{secondary_gemfiles.join(' ')} \
|
176
|
+
#{secondary_lockfiles.join(' ')} code_safety.yml config/code_safety.yml| \
|
136
177
|
grep 'modified: ' | \
|
137
178
|
grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
|
138
179
|
files_to_git_add += `git status vendor/cache|expand|grep '^\s*vendor/cache' | \
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_dev_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|