ndr_dev_support 6.1.2 → 6.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/ndr_dev_support/version.rb +1 -1
- data/lib/tasks/audit_bundle.rake +34 -1
- data/lib/tasks/audit_code.rake +6 -3
- 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: f9b372449b95e60ead7c4da7289b8d98de92a18c894fb79c14391fcf3d6370fe
|
4
|
+
data.tar.gz: 8847e9f85ba14c6268c49a1ee031411833674bcd506966b3a54aae03f283d95f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5217032e0347fd837e0cf31f3dce1c173bf701a6c1f1b8f2c28762b37239c75bf01884e6c0de629c1668198aa978a278d4dc629fb8efdd070b60d84e0a6e230
|
7
|
+
data.tar.gz: 9b6f2ef06634b6fbe67cef8b196c55167456c8ab4cc513ab38c09ab0261c5ba13922da46bae3d3e4875c52ffa8396dcd1cbe204700ae63e0df49e38336eccca2
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
* No unreleased changes
|
3
3
|
|
4
|
+
## 6.1.5 / 2022-06-24
|
5
|
+
### Fixed
|
6
|
+
* audit:code should allow special characters in filenames
|
7
|
+
|
8
|
+
## 6.1.4 / 2022-06-16
|
9
|
+
### Added
|
10
|
+
* Add warning when upgrading webpacker
|
11
|
+
|
12
|
+
## 6.1.3 / 2022-05-25
|
13
|
+
### Fixed
|
14
|
+
* bundle:update should update secondary gem lock files
|
15
|
+
|
4
16
|
## 6.1.2 / 2022-05-24
|
5
17
|
### Fixed
|
6
18
|
* bundle:update should fetch binary gems for all bundled platforms
|
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)
|
@@ -111,12 +115,39 @@ namespace :bundle do
|
|
111
115
|
gem_list = Bundler.with_unbundled_env { `bundle exec gem list ^#{gem}$` }
|
112
116
|
new_gem_version2 = gem_list.match(/ \(([0-9.]+)( [a-z0-9_-]*)?\)$/).to_a[1]
|
113
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
|
+
|
114
140
|
# Retrieve binary gems for platforms listed in Gemfile.lock
|
115
141
|
platforms = `bundle platform`.split("\n").grep(/^[*] x86_64-/).collect { |s| s[2..] }
|
116
142
|
Dir.chdir('vendor/cache') do
|
117
143
|
platforms.each do |platform|
|
118
144
|
system("gem fetch #{gem} --version=#{new_gem_version2} --platform=#{platform}")
|
119
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'
|
120
151
|
end
|
121
152
|
|
122
153
|
if File.exist?(SAFETY_FILE)
|
@@ -140,7 +171,9 @@ namespace :bundle do
|
|
140
171
|
puts "Looking for changed files using git status\n\n"
|
141
172
|
files_to_git_rm = `git status vendor/cache/|grep 'deleted: ' | \
|
142
173
|
grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
|
143
|
-
|
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| \
|
144
177
|
grep 'modified: ' | \
|
145
178
|
grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
|
146
179
|
files_to_git_add += `git status vendor/cache|expand|grep '^\s*vendor/cache' | \
|
data/lib/tasks/audit_code.rake
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'csv'
|
2
2
|
require 'pathname'
|
3
3
|
require 'yaml'
|
4
|
+
require 'shellwords'
|
4
5
|
|
5
6
|
SAFETY_FILE =
|
6
7
|
if File.exist?('code_safety.yml')
|
@@ -338,7 +339,8 @@ def get_last_changed_revision(repo, fname)
|
|
338
339
|
%x[git log -n 1 -- "#{fname}"].split("\n").first[7..-1]
|
339
340
|
when 'git-svn', 'svn'
|
340
341
|
begin
|
341
|
-
|
342
|
+
dest = "#{repo}/#{fname}@"
|
343
|
+
svn_info = %x[svn info -r head #{Shellwords.escape(dest)}]
|
342
344
|
rescue
|
343
345
|
puts 'we have an error in the svn info line'
|
344
346
|
end
|
@@ -376,9 +378,10 @@ def capture_file_diffs(repo, fname, safe_revision, repolatest)
|
|
376
378
|
cmd =
|
377
379
|
case repository_type
|
378
380
|
when 'git'
|
379
|
-
|
381
|
+
['git', '--no-pager', 'diff', '--color', '-b', "#{safe_revision}..#{repolatest}", fname]
|
380
382
|
when 'git-svn', 'svn'
|
381
|
-
|
383
|
+
['svn', 'diff', '-r', "#{safe_revision.to_i}:#{repolatest.to_i}", '-x', '-b',
|
384
|
+
"#{repo}/#{fname}@"]
|
382
385
|
end
|
383
386
|
|
384
387
|
stdout_and_err_str, _status = Open3.capture2e(*cmd)
|
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.5
|
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-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|