unwrappr 0.4.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +23 -0
- data/.rubocop.yml +2 -1
- data/.tool-versions +1 -0
- data/CHANGELOG.md +56 -1
- data/README.md +4 -4
- data/lib/unwrappr/cli.rb +63 -21
- data/lib/unwrappr/gem_change.rb +1 -0
- data/lib/unwrappr/git_command_runner.rb +11 -11
- data/lib/unwrappr/github/client.rb +16 -10
- data/lib/unwrappr/github/pr_source.rb +3 -2
- data/lib/unwrappr/lock_file_annotator.rb +4 -2
- data/lib/unwrappr/lock_file_comparator.rb +3 -1
- data/lib/unwrappr/lock_file_diff.rb +1 -1
- data/lib/unwrappr/ruby_gems.rb +1 -1
- data/lib/unwrappr/version.rb +1 -1
- data/lib/unwrappr/writers/project_links.rb +20 -3
- data/lib/unwrappr/writers/security_vulnerabilities.rb +1 -1
- data/unwrappr.gemspec +11 -8
- metadata +14 -13
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e53f322cf4057535b08607023edcf655e1f6aed5dda15538615f0fd5b06fc2f
|
4
|
+
data.tar.gz: 348ae550a3a6c1692502d9138639a9fa3a111a6a61f13b54dbd3f6c391637463
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b132cf79ce405129eacc7423c9769a7e90962e1c35869ea6af4491320815f47467b2755a756cdff75c8bb6efedf40e2a1d5c416ecbad438cc3e3d28120688f
|
7
|
+
data.tar.gz: 168c20cc164596e3abe39ebc00a7c605022295fce8364973a4901381cd59405df68ea85cdbabc76fbb10d859b5505b74c5b2f97f9051039644685fdef388804f
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
strategy:
|
8
|
+
fail-fast: false
|
9
|
+
matrix:
|
10
|
+
ruby: ['2.5', '2.6', '2.7', '3.0']
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- name: Checkout
|
15
|
+
uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake
|
data/.rubocop.yml
CHANGED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.0.0
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
-
[Unreleased]: https://github.com/envato/unwrappr/compare/v0.
|
9
|
+
[Unreleased]: https://github.com/envato/unwrappr/compare/v0.8.0...HEAD
|
10
|
+
|
11
|
+
## [0.8.0] 2021-07-22
|
12
|
+
|
13
|
+
### Add
|
14
|
+
|
15
|
+
- Ability to perform a `bundle update` in subdirectories with the `-R` /
|
16
|
+
`--recursive` flag. ([#90])
|
17
|
+
|
18
|
+
[0.8.0]: https://github.com/envato/unwrappr/compare/v0.7.0...v0.8.0
|
19
|
+
[#90]: https://github.com/envato/unwrappr/pull/90
|
20
|
+
|
21
|
+
## [0.7.0] 2021-07-15
|
22
|
+
|
23
|
+
### Add
|
24
|
+
- Include link to gem contents diff in gem change annotation ([#88]).
|
25
|
+
|
26
|
+
### Fix
|
27
|
+
- Fix Rubocop issues ([#89]).
|
28
|
+
|
29
|
+
[0.7.0]: https://github.com/envato/unwrappr/compare/v0.6.0...v0.7.0
|
30
|
+
[#88]: https://github.com/envato/unwrappr/pull/88
|
31
|
+
[#89]: https://github.com/envato/unwrappr/pull/89
|
32
|
+
|
33
|
+
## [0.6.0] 2021-05-12
|
34
|
+
|
35
|
+
### Add
|
36
|
+
- Allow specification of Gemfile lock files to annotate. ([#86])
|
37
|
+
|
38
|
+
[0.6.0]: https://github.com/envato/unwrappr/compare/v0.5.0..v0.6.0
|
39
|
+
[#86]: https://github.com/envato/unwrappr/pull/86
|
40
|
+
|
41
|
+
## [0.5.0] 2021-01-04
|
42
|
+
|
43
|
+
### Add
|
44
|
+
- Support for Ruby 3. ([#79])
|
45
|
+
- Allow specification of base branch, upon which to base the pull-request
|
46
|
+
([#80], [#84])
|
47
|
+
|
48
|
+
### Changed
|
49
|
+
- Moved CI to GitHub Actions ([#78])
|
50
|
+
- Fixed homepage URL in gemspec ([#77])
|
51
|
+
- Default branch is now `main`([#81])
|
52
|
+
- Rename private predicate methods in GitCommandRunner to be more descriptive.
|
53
|
+
([#82])
|
54
|
+
- Upgrade Faraday dependency to version 1 ([#85])
|
55
|
+
|
56
|
+
[0.5.0]: https://github.com/envato/unwrappr/compare/v0.4.0..v0.5.0
|
57
|
+
[#77]: https://github.com/envato/unwrappr/pull/77
|
58
|
+
[#78]: https://github.com/envato/unwrappr/pull/78
|
59
|
+
[#79]: https://github.com/envato/unwrappr/pull/79
|
60
|
+
[#80]: https://github.com/envato/unwrappr/pull/80
|
61
|
+
[#81]: https://github.com/envato/unwrappr/pull/81
|
62
|
+
[#82]: https://github.com/envato/unwrappr/pull/82
|
63
|
+
[#84]: https://github.com/envato/unwrappr/pull/84
|
64
|
+
[#85]: https://github.com/envato/unwrappr/pull/85
|
10
65
|
|
11
66
|
## [0.4.0] 2020-04-14
|
12
67
|
### Changed
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ to get regular dependency updates into production.
|
|
16
16
|
- Vulnerability advisory information using [bundler-audit](https://github.com/rubysec/bundler-audit)
|
17
17
|
- Links to the home page, source code and change log (where available) of each gem
|
18
18
|
|
19
|
-
## Development status [![
|
19
|
+
## Development status [![CI Status](https://github.com/envato/unwrappr/workflows/CI/badge.svg)](https://github.com/envato/unwrappr/actions?query=workflow%3ACI)
|
20
20
|
|
21
21
|
`unwrappr` is used in many projects around [Envato][envato]
|
22
22
|
However, it is still undergoing development and features are likely to change
|
@@ -85,16 +85,16 @@ See https://github.com/settings/tokens to set up personal access tokens.
|
|
85
85
|
- [Em Esc](https://github.com/emesc)
|
86
86
|
- [Chun-wei Kuo](https://github.com/Domon)
|
87
87
|
|
88
|
-
## License [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/envato/unwrappr/blob/
|
88
|
+
## License [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://github.com/envato/unwrappr/blob/HEAD/LICENSE.txt)
|
89
89
|
|
90
90
|
`unwrappr` uses MIT license. See
|
91
|
-
[`LICENSE.txt`](https://github.com/envato/unwrappr/blob/
|
91
|
+
[`LICENSE.txt`](https://github.com/envato/unwrappr/blob/HEAD/LICENSE.txt) for
|
92
92
|
details.
|
93
93
|
|
94
94
|
## Code of Conduct
|
95
95
|
|
96
96
|
We welcome contribution from everyone. Read more about it in
|
97
|
-
[`CODE_OF_CONDUCT.md`](https://github.com/envato/unwrappr/blob/
|
97
|
+
[`CODE_OF_CONDUCT.md`](https://github.com/envato/unwrappr/blob/HEAD/CODE_OF_CONDUCT.md)
|
98
98
|
|
99
99
|
## Contributing [![PRs welcome](https://img.shields.io/badge/PRs-welcome-orange.svg?style=flat-square)](https://github.com/envato/unwrappr/issues)
|
100
100
|
|
data/lib/unwrappr/cli.rb
CHANGED
@@ -8,15 +8,36 @@ module Unwrappr
|
|
8
8
|
class CLI < Clamp::Command
|
9
9
|
self.default_subcommand = 'all'
|
10
10
|
|
11
|
+
option(['-b', '--base'],
|
12
|
+
'BRANCH',
|
13
|
+
<<~DESCRIPTION,
|
14
|
+
the branch upon which to base the pull-request. Omit this option
|
15
|
+
to use the current branch, or repository's default branch
|
16
|
+
(typically 'origin/main') on clone.
|
17
|
+
DESCRIPTION
|
18
|
+
attribute_name: :base_branch)
|
19
|
+
|
20
|
+
option ['-f', '--lock-file'],
|
21
|
+
'LOCK_FILE1 [-f LOCK_FILE2] [-f LOCK_FILE3] [-f ...]',
|
22
|
+
'The Gemfile.lock files to annotate. Useful when working with multiple lock files.',
|
23
|
+
multivalued: true,
|
24
|
+
default: ['Gemfile.lock'],
|
25
|
+
attribute_name: :lock_files
|
26
|
+
|
11
27
|
option ['-v', '--version'], :flag, 'Show version' do
|
12
28
|
puts "unwrappr v#{Unwrappr::VERSION}"
|
13
29
|
exit(0)
|
14
30
|
end
|
15
31
|
|
16
|
-
subcommand 'all', 'run bundle update, push to
|
32
|
+
subcommand 'all', 'run bundle update, push to GitHub, '\
|
17
33
|
'create a pr and annotate changes' do
|
34
|
+
option ['-R', '--recursive'],
|
35
|
+
:flag,
|
36
|
+
'Recurse into subdirectories',
|
37
|
+
attribute_name: :recursive
|
38
|
+
|
18
39
|
def execute
|
19
|
-
Unwrappr.
|
40
|
+
Unwrappr.run_unwrappr_in_pwd(base_branch: base_branch, lock_files: lock_files, recursive: recursive?)
|
20
41
|
end
|
21
42
|
end
|
22
43
|
|
@@ -27,13 +48,14 @@ module Unwrappr
|
|
27
48
|
required: true
|
28
49
|
|
29
50
|
option ['-p', '--pr'], 'PR',
|
30
|
-
'The
|
51
|
+
'The GitHub PR number',
|
31
52
|
required: true
|
32
53
|
|
33
54
|
def execute
|
34
55
|
LockFileAnnotator.annotate_github_pull_request(
|
35
56
|
repo: repo,
|
36
|
-
pr_number: pr.to_i
|
57
|
+
pr_number: pr.to_i,
|
58
|
+
lock_files: lock_files
|
37
59
|
)
|
38
60
|
end
|
39
61
|
end
|
@@ -45,38 +67,58 @@ module Unwrappr
|
|
45
67
|
option(['-r', '--repo'],
|
46
68
|
'REPO',
|
47
69
|
<<~DESCRIPTION,
|
48
|
-
a repo in
|
70
|
+
a repo in GitHub <owner/project>, may be specified multiple times
|
49
71
|
DESCRIPTION
|
50
72
|
required: true,
|
51
73
|
multivalued: true)
|
52
74
|
|
75
|
+
option ['-R', '--recursive'],
|
76
|
+
:flag,
|
77
|
+
'Recurse into subdirectories',
|
78
|
+
attribute_name: :recursive
|
79
|
+
|
53
80
|
def execute
|
54
81
|
repo_list.each do |repo|
|
55
|
-
unless Dir.exist?(repo)
|
56
|
-
GitCommandRunner.clone_repository(
|
57
|
-
"https://github.com/#{repo}",
|
58
|
-
repo
|
59
|
-
)
|
60
|
-
end
|
82
|
+
GitCommandRunner.clone_repository("https://github.com/#{repo}", repo) unless Dir.exist?(repo)
|
61
83
|
|
62
|
-
Dir.chdir(repo)
|
84
|
+
Dir.chdir(repo) do
|
85
|
+
Unwrappr.run_unwrappr_in_pwd(base_branch: base_branch, lock_files: lock_files, recursive: recursive?)
|
86
|
+
end
|
63
87
|
end
|
64
88
|
end
|
65
89
|
end
|
66
90
|
end
|
67
91
|
|
68
|
-
def self.
|
69
|
-
return unless
|
70
|
-
|
71
|
-
puts "Doing the unwrappr thing in #{Dir.pwd}"
|
92
|
+
def self.run_unwrappr_in_pwd(base_branch:, lock_files:, recursive:)
|
93
|
+
return unless any_lockfile_present?(lock_files)
|
72
94
|
|
73
|
-
GitCommandRunner.create_branch!
|
74
|
-
|
95
|
+
GitCommandRunner.create_branch!(base_branch: base_branch)
|
96
|
+
bundle_update!(lock_files: lock_files, recursive: recursive)
|
75
97
|
GitCommandRunner.commit_and_push_changes!
|
76
|
-
GitHub::Client.make_pull_request!
|
98
|
+
GitHub::Client.make_pull_request!(lock_files)
|
77
99
|
end
|
78
100
|
|
79
|
-
def self.
|
80
|
-
GitCommandRunner.file_exist?(
|
101
|
+
def self.any_lockfile_present?(lock_files)
|
102
|
+
lock_files.any? { |lock_file| GitCommandRunner.file_exist?(lock_file) }
|
103
|
+
end
|
104
|
+
|
105
|
+
def self.bundle_update!(lock_files:, recursive:)
|
106
|
+
directories(lock_files: lock_files, recursive: recursive).each do |dir|
|
107
|
+
Dir.chdir(dir) do
|
108
|
+
puts "Doing the unwrappr thing in #{Dir.pwd}"
|
109
|
+
BundlerCommandRunner.bundle_update!
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.directories(lock_files:, recursive:)
|
115
|
+
if recursive
|
116
|
+
lock_files
|
117
|
+
.flat_map { |f| Dir.glob("**/#{f}") }
|
118
|
+
.map { |f| File.dirname(f) }
|
119
|
+
.uniq
|
120
|
+
else
|
121
|
+
%w[.]
|
122
|
+
end
|
81
123
|
end
|
82
124
|
end
|
data/lib/unwrappr/gem_change.rb
CHANGED
@@ -7,15 +7,15 @@ module Unwrappr
|
|
7
7
|
# Runs Git commands
|
8
8
|
module GitCommandRunner
|
9
9
|
class << self
|
10
|
-
def create_branch!
|
10
|
+
def create_branch!(base_branch:)
|
11
11
|
raise 'Not a git working dir' unless git_dir?
|
12
|
-
raise
|
12
|
+
raise "failed to create branch from '#{base_branch}'" unless checkout_target_branch(base_branch: base_branch)
|
13
13
|
end
|
14
14
|
|
15
15
|
def commit_and_push_changes!
|
16
|
-
raise 'failed to add git changes' unless
|
17
|
-
raise 'failed to commit changes' unless
|
18
|
-
raise 'failed to push changes' unless
|
16
|
+
raise 'failed to add git changes' unless stage_all_changes
|
17
|
+
raise 'failed to commit changes' unless commit_staged_changes
|
18
|
+
raise 'failed to push changes' unless push_current_branch_to_origin
|
19
19
|
end
|
20
20
|
|
21
21
|
def reset_client
|
@@ -50,23 +50,23 @@ module Unwrappr
|
|
50
50
|
git_wrap { !current_branch_name.empty? }
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
53
|
+
def checkout_target_branch(base_branch:)
|
54
54
|
timestamp = Time.now.strftime('%Y%m%d-%H%M').freeze
|
55
55
|
git_wrap do
|
56
|
-
git.checkout(
|
56
|
+
git.checkout(base_branch) unless base_branch.nil?
|
57
57
|
git.branch("auto_bundle_update_#{timestamp}").checkout
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def stage_all_changes
|
62
62
|
git_wrap { git.add(all: true) }
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
65
|
+
def commit_staged_changes
|
66
66
|
git_wrap { git.commit('Automatic Bundle Update') }
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
69
|
+
def push_current_branch_to_origin
|
70
70
|
git_wrap { git.push('origin', current_branch_name) }
|
71
71
|
end
|
72
72
|
|
@@ -80,7 +80,7 @@ module Unwrappr
|
|
80
80
|
|
81
81
|
def log_options
|
82
82
|
{}.tap do |opt|
|
83
|
-
opt[:log] = Logger.new(
|
83
|
+
opt[:log] = Logger.new($stdout) if ENV['DEBUG']
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -12,8 +12,8 @@ module Unwrappr
|
|
12
12
|
@github_token = nil
|
13
13
|
end
|
14
14
|
|
15
|
-
def make_pull_request!
|
16
|
-
create_and_annotate_pull_request
|
15
|
+
def make_pull_request!(lock_files)
|
16
|
+
create_and_annotate_pull_request(lock_files)
|
17
17
|
rescue Octokit::ClientError => e
|
18
18
|
raise "Failed to create and annotate pull request: #{e}"
|
19
19
|
end
|
@@ -27,15 +27,20 @@ module Unwrappr
|
|
27
27
|
[m[:org], m[:repo]].join('/')
|
28
28
|
end
|
29
29
|
|
30
|
-
def create_and_annotate_pull_request
|
30
|
+
def create_and_annotate_pull_request(lock_files)
|
31
31
|
pr = git_client.create_pull_request(
|
32
32
|
repo_name_and_org,
|
33
|
-
|
33
|
+
repo_default_branch,
|
34
34
|
Unwrappr::GitCommandRunner.current_branch_name,
|
35
35
|
'Automated Bundle Update',
|
36
36
|
pull_request_body
|
37
37
|
)
|
38
|
-
annotate_pull_request(pr.number)
|
38
|
+
annotate_pull_request(pr.number, lock_files)
|
39
|
+
end
|
40
|
+
|
41
|
+
def repo_default_branch
|
42
|
+
git_client.repository(repo_name_and_org)
|
43
|
+
.default_branch
|
39
44
|
end
|
40
45
|
|
41
46
|
def pull_request_body
|
@@ -45,10 +50,11 @@ module Unwrappr
|
|
45
50
|
BODY
|
46
51
|
end
|
47
52
|
|
48
|
-
def annotate_pull_request(pr_number)
|
53
|
+
def annotate_pull_request(pr_number, lock_files)
|
49
54
|
LockFileAnnotator.annotate_github_pull_request(
|
50
55
|
repo: repo_name_and_org,
|
51
56
|
pr_number: pr_number,
|
57
|
+
lock_files: lock_files,
|
52
58
|
client: git_client
|
53
59
|
)
|
54
60
|
end
|
@@ -58,16 +64,16 @@ module Unwrappr
|
|
58
64
|
end
|
59
65
|
|
60
66
|
def github_token
|
61
|
-
@github_token ||= ENV.fetch('GITHUB_TOKEN')
|
62
|
-
|
67
|
+
@github_token ||= ENV.fetch('GITHUB_TOKEN')
|
68
|
+
rescue KeyError
|
69
|
+
raise %(
|
63
70
|
Missing environment variable GITHUB_TOKEN.
|
64
71
|
See https://github.com/settings/tokens to set up personal access tokens.
|
65
72
|
Add to the environment:
|
66
73
|
|
67
74
|
export GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
68
75
|
|
69
|
-
)
|
70
|
-
end
|
76
|
+
)
|
71
77
|
end
|
72
78
|
end
|
73
79
|
end
|
@@ -9,9 +9,10 @@ module Unwrappr
|
|
9
9
|
# Implements the `lock_file_diff_source` interface as defined by the
|
10
10
|
# LockFileAnnotator.
|
11
11
|
class PrSource
|
12
|
-
def initialize(repo, pr_number, client)
|
12
|
+
def initialize(repo, pr_number, lock_files, client)
|
13
13
|
@repo = repo
|
14
14
|
@pr_number = pr_number
|
15
|
+
@lock_files = lock_files
|
15
16
|
@client = client
|
16
17
|
end
|
17
18
|
|
@@ -33,7 +34,7 @@ module Unwrappr
|
|
33
34
|
@lock_file_diffs ||= @client
|
34
35
|
.pull_request_files(@repo, @pr_number)
|
35
36
|
.select do |file|
|
36
|
-
File.basename(file.filename)
|
37
|
+
@lock_files.include?(File.basename(file.filename))
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
@@ -18,10 +18,10 @@ module Unwrappr
|
|
18
18
|
class LockFileAnnotator
|
19
19
|
# rubocop:disable Metrics/MethodLength
|
20
20
|
def self.annotate_github_pull_request(
|
21
|
-
repo:, pr_number:, client: Octokit.client
|
21
|
+
repo:, pr_number:, lock_files:, client: Octokit.client
|
22
22
|
)
|
23
23
|
new(
|
24
|
-
lock_file_diff_source: Github::PrSource.new(repo, pr_number, client),
|
24
|
+
lock_file_diff_source: Github::PrSource.new(repo, pr_number, lock_files, client),
|
25
25
|
annotation_sink: Github::PrSink.new(repo, pr_number, client),
|
26
26
|
annotation_writer: Writers::Composite.new(
|
27
27
|
Writers::Title,
|
@@ -54,6 +54,8 @@ module Unwrappr
|
|
54
54
|
|
55
55
|
def annotate
|
56
56
|
@lock_file_diff_source.each_file do |lock_file_diff|
|
57
|
+
puts "Annotating #{lock_file_diff.filename}"
|
58
|
+
|
57
59
|
lock_file_diff.each_gem_change do |gem_change|
|
58
60
|
gem_change_info = @gem_researcher.research(gem_change, {})
|
59
61
|
message = @annotation_writer.write(gem_change, gem_change_info)
|
@@ -63,7 +63,7 @@ module Unwrappr
|
|
63
63
|
# '+ websocket-driver (0.6.5)'
|
64
64
|
# Careful not to match this (note the wider indent):
|
65
65
|
# '+ websocket-extensions (>= 0.1.0)'
|
66
|
-
pattern = /^(?<change_type>[
|
66
|
+
pattern = /^(?<change_type>[+\-]) (?<gem_name>\S+) \(\d/
|
67
67
|
match = pattern.match(line)
|
68
68
|
return match[:gem_name], match[:change_type] unless match.nil?
|
69
69
|
end
|
data/lib/unwrappr/ruby_gems.rb
CHANGED
data/lib/unwrappr/version.rb
CHANGED
@@ -18,19 +18,36 @@ module Unwrappr
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def write
|
21
|
-
"[_#{change_log}, #{source_code}_]\n"
|
21
|
+
"[_#{change_log}, #{source_code}, #{gem_diff}_]\n"
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def change_log
|
27
27
|
link_or_strikethrough('change-log',
|
28
|
-
|
28
|
+
ruby_gems_info&.changelog_uri)
|
29
29
|
end
|
30
30
|
|
31
31
|
def source_code
|
32
32
|
link_or_strikethrough('source-code',
|
33
|
-
|
33
|
+
ruby_gems_info&.source_code_uri)
|
34
|
+
end
|
35
|
+
|
36
|
+
GEM_DIFF_URL_TEMPLATE = 'https://my.diffend.io/gems/%s/%s/%s'
|
37
|
+
private_constant :GEM_DIFF_URL_TEMPLATE
|
38
|
+
|
39
|
+
def gem_diff
|
40
|
+
if !ruby_gems_info.nil? && !@gem_change.added? && !@gem_change.removed?
|
41
|
+
gem_diff_url = format(GEM_DIFF_URL_TEMPLATE,
|
42
|
+
@gem_change.name,
|
43
|
+
@gem_change.base_version.to_s,
|
44
|
+
@gem_change.head_version.to_s)
|
45
|
+
end
|
46
|
+
link_or_strikethrough('gem-diff', gem_diff_url)
|
47
|
+
end
|
48
|
+
|
49
|
+
def ruby_gems_info
|
50
|
+
@gem_change_info[:ruby_gems]
|
34
51
|
end
|
35
52
|
|
36
53
|
def link_or_strikethrough(text, url)
|
@@ -88,7 +88,7 @@ module Unwrappr
|
|
88
88
|
# rubocop:disable Style/GuardClause
|
89
89
|
if advisory.cvss_v2
|
90
90
|
"CVSS V2: [#{advisory.cvss_v2} #{advisory.criticality}]"\
|
91
|
-
|
91
|
+
"(#{cvss_v2_url(advisory.cve_id)})"
|
92
92
|
end
|
93
93
|
# rubocop:enable Style/GuardClause
|
94
94
|
end
|
data/unwrappr.gemspec
CHANGED
@@ -12,6 +12,9 @@ AUTHORS = {
|
|
12
12
|
'vladimir.chervanev@envato.com' => 'Vladimir Chervanev'
|
13
13
|
}.freeze
|
14
14
|
|
15
|
+
GITHUB_URL = 'https://github.com/envato/unwrappr'
|
16
|
+
HOMEPAGE_URL = 'https://opensource.envato.com/projects/unwrappr.html'
|
17
|
+
|
15
18
|
Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength:
|
16
19
|
spec.name = 'unwrappr'
|
17
20
|
spec.version = Unwrappr::VERSION
|
@@ -20,9 +23,9 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength:
|
|
20
23
|
|
21
24
|
spec.summary = "A tool to unwrap your gems and see what's changed easily"
|
22
25
|
spec.description = 'bundle update PRs: Automated. Annotated.'
|
23
|
-
spec.homepage =
|
26
|
+
spec.homepage = HOMEPAGE_URL
|
24
27
|
spec.license = 'MIT'
|
25
|
-
spec.required_ruby_version = '
|
28
|
+
spec.required_ruby_version = '>= 2.5'
|
26
29
|
spec.required_rubygems_version = '>= 2.7'
|
27
30
|
|
28
31
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
@@ -35,7 +38,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength:
|
|
35
38
|
spec.add_dependency 'bundler', '< 3'
|
36
39
|
spec.add_dependency 'bundler-audit', '>= 0.6.0'
|
37
40
|
spec.add_dependency 'clamp', '~> 1'
|
38
|
-
spec.add_dependency 'faraday', '~>
|
41
|
+
spec.add_dependency 'faraday', '~> 1'
|
39
42
|
spec.add_dependency 'git', '~> 1'
|
40
43
|
spec.add_dependency 'octokit', '~> 4.0'
|
41
44
|
spec.add_dependency 'safe_shell', '~> 1'
|
@@ -49,10 +52,10 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength:
|
|
49
52
|
spec.add_development_dependency 'rubocop', '>= 0.49.0'
|
50
53
|
|
51
54
|
spec.metadata = {
|
52
|
-
'bug_tracker_uri' =>
|
53
|
-
'changelog_uri' =>
|
54
|
-
'documentation_uri' =>
|
55
|
-
'homepage_uri' =>
|
56
|
-
'source_code_uri' =>
|
55
|
+
'bug_tracker_uri' => "#{GITHUB_URL}/issues",
|
56
|
+
'changelog_uri' => "#{GITHUB_URL}/blob/HEAD/CHANGELOG.md",
|
57
|
+
'documentation_uri' => "#{GITHUB_URL}/blob/HEAD/README.md",
|
58
|
+
'homepage_uri' => HOMEPAGE_URL,
|
59
|
+
'source_code_uri' => GITHUB_URL
|
57
60
|
}
|
58
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unwrappr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emilyn Escabarte
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
- Orien Madgwick
|
10
10
|
- Pete Johns
|
11
11
|
- Vladimir Chervanev
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -62,14 +62,14 @@ dependencies:
|
|
62
62
|
requirements:
|
63
63
|
- - "~>"
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: '
|
65
|
+
version: '1'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
70
|
- - "~>"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
72
|
+
version: '1'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: git
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -225,10 +225,11 @@ files:
|
|
225
225
|
- ".buildkite/pipeline.yml"
|
226
226
|
- ".buildkite/steps/rspec.sh"
|
227
227
|
- ".buildkite/steps/rubocop.sh"
|
228
|
+
- ".github/workflows/ci.yml"
|
228
229
|
- ".gitignore"
|
229
230
|
- ".rspec"
|
230
231
|
- ".rubocop.yml"
|
231
|
-
- ".
|
232
|
+
- ".tool-versions"
|
232
233
|
- CHANGELOG.md
|
233
234
|
- CODE_OF_CONDUCT.md
|
234
235
|
- Gemfile
|
@@ -267,22 +268,22 @@ files:
|
|
267
268
|
- lib/unwrappr/writers/title.rb
|
268
269
|
- lib/unwrappr/writers/version_change.rb
|
269
270
|
- unwrappr.gemspec
|
270
|
-
homepage:
|
271
|
+
homepage: https://opensource.envato.com/projects/unwrappr.html
|
271
272
|
licenses:
|
272
273
|
- MIT
|
273
274
|
metadata:
|
274
275
|
bug_tracker_uri: https://github.com/envato/unwrappr/issues
|
275
|
-
changelog_uri: https://github.com/envato/unwrappr/blob/
|
276
|
-
documentation_uri: https://github.com/envato/unwrappr/blob/
|
276
|
+
changelog_uri: https://github.com/envato/unwrappr/blob/HEAD/CHANGELOG.md
|
277
|
+
documentation_uri: https://github.com/envato/unwrappr/blob/HEAD/README.md
|
277
278
|
homepage_uri: https://opensource.envato.com/projects/unwrappr.html
|
278
279
|
source_code_uri: https://github.com/envato/unwrappr
|
279
|
-
post_install_message:
|
280
|
+
post_install_message:
|
280
281
|
rdoc_options: []
|
281
282
|
require_paths:
|
282
283
|
- lib
|
283
284
|
required_ruby_version: !ruby/object:Gem::Requirement
|
284
285
|
requirements:
|
285
|
-
- - "
|
286
|
+
- - ">="
|
286
287
|
- !ruby/object:Gem::Version
|
287
288
|
version: '2.5'
|
288
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -291,8 +292,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
292
|
- !ruby/object:Gem::Version
|
292
293
|
version: '2.7'
|
293
294
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
295
|
-
signing_key:
|
295
|
+
rubygems_version: 3.2.22
|
296
|
+
signing_key:
|
296
297
|
specification_version: 4
|
297
298
|
summary: A tool to unwrap your gems and see what's changed easily
|
298
299
|
test_files: []
|