whatsup_github 0.0.1 → 0.1.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: 28f70d20f66860466a71e5f253d75db911d24bfd91c7403d8351bc6f62b9ba7e
4
- data.tar.gz: 43fd5d4cf2d8d29f150a2bbe61aeb1b92a7fdd76e099138622786db4a191e058
3
+ metadata.gz: da5ac25ee48ecbeb1219dae8e22c966ea1d3954b04c6cec344b1698095020671
4
+ data.tar.gz: f11b3a4b544675cc37cde564950b30b9162f3933335d44ae6e831408b8ed53db
5
5
  SHA512:
6
- metadata.gz: ea289b8d727aaed1ce88219250ccd41b30cf77c3417a3ca16e185afdcbcf5575f8f14554ebcf60196ca001e44b8fc140b11b2e4108a91032ec9bd30beed2b97a
7
- data.tar.gz: fa873b26c9faa0559c877904c10d33eae35dab773acf0a1eb0025964dd35fd69a314554b060eb33015be0b4cbe85096974ff6ceff672fc53e82ff18ed42eabb5
6
+ metadata.gz: f159bfdf36cd305cdbf2bfb7c16ce0aeae27e8405a87c0cc999fb0866f7a395d7de68e20e622a8b2dd69483a54bf2d7f7ab415b2523fa3b6af9241d179fe005a
7
+ data.tar.gz: 19275e16e836a8ef676cf03a8e0a98fd41b60699772c7d3890efd15f01cf67a08bdc54ebc808ef45af46d5875c2a47b912db4dc317b9d726565152b2a64db36d
@@ -0,0 +1 @@
1
+ ruby-2.6.5
@@ -2,6 +2,4 @@
2
2
  sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
- rvm:
6
- - 2.6.3
7
- before_install: gem install bundler -v 1.17.2
5
+ before_install: gem install bundler -v 1.17.3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- whatsup_github (0.0.1)
4
+ whatsup_github (0.1.1)
5
5
  netrc (~> 0.10)
6
6
  octokit (~> 4.14)
7
7
  thor (~> 0.20)
@@ -9,19 +9,18 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.6.0)
13
- public_suffix (>= 2.0.2, < 4.0)
14
- aruba (0.14.10)
15
- childprocess (>= 0.6.3, < 1.1.0)
12
+ addressable (2.7.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
+ aruba (0.14.14)
15
+ childprocess (>= 0.6.3, < 4.0.0)
16
16
  contracts (~> 0.9)
17
17
  cucumber (>= 1.3.19)
18
18
  ffi (~> 1.9)
19
19
  rspec-expectations (>= 2.99)
20
- thor (~> 0.19)
21
- backports (3.15.0)
22
- builder (3.2.3)
23
- childprocess (1.0.1)
24
- rake (< 13.0)
20
+ thor (>= 0.19, < 2.0)
21
+ backports (3.17.0)
22
+ builder (3.2.4)
23
+ childprocess (3.0.0)
25
24
  coderay (1.1.2)
26
25
  contracts (0.16.0)
27
26
  cucumber (3.1.2)
@@ -41,35 +40,36 @@ GEM
41
40
  cucumber-tag_expressions (1.1.1)
42
41
  cucumber-wire (0.0.1)
43
42
  diff-lcs (1.3)
44
- faraday (0.15.4)
43
+ faraday (1.0.0)
45
44
  multipart-post (>= 1.2, < 3)
46
- ffi (1.11.1)
45
+ ffi (1.12.2)
47
46
  gherkin (5.1.0)
48
- method_source (0.9.2)
49
- multi_json (1.13.1)
47
+ method_source (1.0.0)
48
+ multi_json (1.14.1)
50
49
  multi_test (0.1.2)
51
50
  multipart-post (2.1.1)
52
51
  netrc (0.11.0)
53
- octokit (4.14.0)
52
+ octokit (4.18.0)
53
+ faraday (>= 0.9)
54
54
  sawyer (~> 0.8.0, >= 0.5.3)
55
- pry (0.12.2)
56
- coderay (~> 1.1.0)
57
- method_source (~> 0.9.0)
58
- public_suffix (3.1.0)
59
- rake (10.5.0)
60
- rspec (3.8.0)
61
- rspec-core (~> 3.8.0)
62
- rspec-expectations (~> 3.8.0)
63
- rspec-mocks (~> 3.8.0)
64
- rspec-core (3.8.1)
65
- rspec-support (~> 3.8.0)
66
- rspec-expectations (3.8.4)
55
+ pry (0.13.0)
56
+ coderay (~> 1.1)
57
+ method_source (~> 1.0)
58
+ public_suffix (4.0.3)
59
+ rake (13.0.1)
60
+ rspec (3.9.0)
61
+ rspec-core (~> 3.9.0)
62
+ rspec-expectations (~> 3.9.0)
63
+ rspec-mocks (~> 3.9.0)
64
+ rspec-core (3.9.1)
65
+ rspec-support (~> 3.9.1)
66
+ rspec-expectations (3.9.1)
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.8.0)
69
- rspec-mocks (3.8.1)
68
+ rspec-support (~> 3.9.0)
69
+ rspec-mocks (3.9.1)
70
70
  diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.8.0)
72
- rspec-support (3.8.2)
71
+ rspec-support (~> 3.9.0)
72
+ rspec-support (3.9.2)
73
73
  sawyer (0.8.2)
74
74
  addressable (>= 2.3.5)
75
75
  faraday (> 0.8, < 2.0)
@@ -83,9 +83,9 @@ DEPENDENCIES
83
83
  bundler (~> 1.17)
84
84
  cucumber (~> 3.1)
85
85
  pry (~> 0.12)
86
- rake (~> 10.0)
86
+ rake (~> 13.0)
87
87
  rspec (~> 3.0)
88
88
  whatsup_github!
89
89
 
90
90
  BUNDLED WITH
91
- 1.17.2
91
+ 1.17.3
data/README.md CHANGED
@@ -1,13 +1,52 @@
1
1
  # WhatsupGithub
2
2
 
3
- The tool helps to update the [Whats New on DevDocs](http://devdocs.magento.com/whats-new.html).
4
- It filters by labels the pull requests merged into repositories and generates an output in a specified format (`markdown` or/and `yaml`).
5
- In the command line, provide the date since when you want to check changes.
6
- By default, the tool filters results for the passed week.
3
+ [![Build status](https://travis-ci.com/dshevtsov/whatsup_github.svg?branch=master)](https://travis-ci.com/dshevtsov/whatsup_github)
4
+ [![Gem version](https://img.shields.io/gem/v/whatsup_github.svg?style=flat)](https://rubygems.org/gems/whatsup_github)
5
+
6
+ This tool helps to update data for [Whats New on DevDocs](http://devdocs.magento.com/whats-new.html).
7
+ It filters GitHub pull requests and generates a data file.
8
+ One pull request - one data entity.
9
+ All filtering parameters are set in a configuration file, except dates.
10
+ _Since_ date is set as a CLI argument and the _till_ date is always the moment when the command is run.
11
+
12
+ ## Prerequisite
13
+
14
+ The resulting data file is generated from data pulled from GitHub.
15
+
16
+ ### `description`
17
+
18
+ Pull requests that will appear in search must have text that will fill out the _Description_ cell.
19
+ The text must follow the `whatsnew` keyword and be located at the very bottom of a pull request description field.
20
+
21
+ ```
22
+ This pull request adds ...
23
+
24
+ ...
25
+
26
+ whatsnew
27
+ Added documentation about [New Magento feature](https://devdocs.magento.com/new-magento-feature.html).
28
+ ```
29
+
30
+ ### `type`
31
+
32
+ Set as a list of `labels` in `.whatsup.yml`.
33
+
34
+ ### `versions`
35
+
36
+ Any GitHub label that starts from a digit followed by a dot (see regex `\d\.`).
37
+ Examples: `2.3.x`, `1.0.3-msi`, `2.x`
38
+
39
+ ### `date`
40
+
41
+ The date when pull request was merged.
7
42
 
8
43
  ## Installation
9
44
 
10
- Add this line to your application's Gemfile:
45
+ Same as any other gem.
46
+
47
+ ### Using Bundler as a part of your project
48
+
49
+ Add to your Gemfile:
11
50
 
12
51
  ```ruby
13
52
  gem 'whatsup_github'
@@ -19,21 +58,27 @@ And then execute:
19
58
  bundle
20
59
  ```
21
60
 
22
- Or install it yourself as:
61
+ ### Separately
23
62
 
24
- ```bash
63
+ ```
25
64
  gem install whatsup_github
26
65
  ```
27
66
 
28
- ## Usage
67
+ ## Configuration
68
+
69
+ The configuration file [`.whatsup.yml`](lib/template/.whatsup.yml) will be created automatically after first run unless it's already there.
70
+
71
+ ## Authentication
72
+
73
+ Use [`~/.netrc`](https://github.com/octokit/octokit.rb#using-a-netrc-file) file for authentication.
29
74
 
30
- Generate the output with recent updates since April 2 of the current year till today:
75
+ ## Usage
31
76
 
32
77
  ```bash
33
78
  whatsup_github since 'apr 2'
34
79
  ```
35
80
 
36
- By default, it generates recent updates for the passed week:
81
+ If run with no arguments, it generates data for the past week:
37
82
 
38
83
  ```bash
39
84
  whatsup_github
@@ -41,20 +86,48 @@ whatsup_github
41
86
 
42
87
  You can use different date formats like `'April 2'`, `'2 April'`, `'apr 2'`, `'2 Apr'`, `2018-04-02`.
43
88
 
44
- The result is returned into _tmp/whats-new.yml_ or _tmp/whats-new.md_ files, depending on the format specified in configuration.
89
+ ## Development
45
90
 
46
- ## Configuration
91
+ To install dependencies:
47
92
 
48
- The configuration file [`.whatsup.yml`](lib/template/.whatsup.yml) will be created during the first run.
93
+ ```
94
+ bin/setup
95
+ ```
49
96
 
50
- ## Authentication
97
+ To install the package:
51
98
 
52
- You can use the tool as anonymous user until you'll need to scan private repositories or merely reach the [rate limit of unauthenticted requests](https://developer.github.com/v3/#rate-limiting).
53
- In this case, use [`~/.netrc`](https://github.com/octokit/octokit.rb#using-a-netrc-file) file for authentication.
99
+ ```
100
+ rake install
101
+ ```
54
102
 
55
- ## Development
103
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
104
+
105
+ ### Testing
106
+
107
+ The project contains [rspec](https://rspec.info/) tests in `spec` and [cucumber](https://app.cucumber.pro/p/af1681aa-415f-44f0-8260-5454a69c472a/aruba/documents/branch/master/features/03_testing_frameworks/cucumber/steps/filesystem/check_existence_of_file.feature) tests in `features`.
108
+
109
+ #### specs
110
+
111
+ To run rspec tests:
56
112
 
57
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the Ruby tests, and `bundle exec cucumber features` to run CLI tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
113
+ ```
114
+ rake spec
115
+ ```
116
+
117
+ #### features
118
+
119
+ To run cucumber tests:
120
+
121
+ ```
122
+ rake features
123
+ ```
124
+
125
+ To pass the `output_file.feature` tests, you need to generate a non-empty `whats-new.yml`.
126
+ To test just file:
127
+
128
+ ```
129
+ bundle exec cucumber features/output_file.feature
130
+ ```
58
131
 
59
132
  ## Contributing
60
133
 
@@ -63,7 +136,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/dshevt
63
136
  ## License
64
137
 
65
138
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
66
-
67
- ## Code of Conduct
68
-
69
- Everyone interacting in the WhatsupGithub project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dshevtsov/whatsup_github/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,6 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'cucumber'
4
+ require 'cucumber/rake/task'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
8
  task :default => :spec
9
+
10
+ Cucumber::Rake::Task.new(:features) do |t|
11
+ t.cucumber_opts = "--format pretty" # Any valid command line option can go here.
12
+ end
13
+
14
+ task :test => [:spec, :features]
@@ -1,18 +1,16 @@
1
- # Name of the base branch in GitHub PRs
1
+ # Parameters for a GitHub search query
2
2
  base_branch: master
3
3
 
4
- # Repositories for scanning. If you want to search private repositories, use credentials to specify
5
4
  repos:
6
5
  - magento/devdocs
7
6
 
8
- # Labels for filtering (currently, hard-coded)
7
+ # Labels also will be used as a 'type' value in the output file
9
8
  labels:
10
- - New doc
11
- - Major update
9
+ - New Topic
10
+ - Major Update
12
11
  - Technical
13
12
 
14
- # Output format
13
+ # Format of output file
15
14
  output_format:
16
- # - markdown
17
15
  - yaml
18
-
16
+ # - markdown
@@ -22,7 +22,7 @@ module WhatsupGithub
22
22
 
23
23
  def load_from_yaml
24
24
  @config = YAML.load_file @file
25
- return {} unless @config
25
+ return {} if !@config
26
26
  @config
27
27
  end
28
28
  end
@@ -11,14 +11,12 @@ module WhatsupGithub
11
11
  @assignee = args[:assignee]
12
12
  @pr_number = args[:pr_number]
13
13
  @link = args[:pr_url]
14
+ @config = Config.instance
14
15
  end
15
16
 
16
- UPDATED_MASK = 'Major update'.freeze
17
- UPDATED_PHRASE = 'Major update'.freeze
18
- NEW_MASK = 'New topic'.freeze
19
- NEW_PHRASE = 'New topic'.freeze
20
- TECHNICAL_MASK = 'Technical'.freeze
21
- TECHNICAL_PHRASE = 'Technical changes'.freeze
17
+ def labels_from_config
18
+ @config.read('labels')
19
+ end
22
20
 
23
21
  def versions
24
22
  label_versions = labels.select { |label| label.start_with?(/\d\./) }
@@ -30,16 +28,7 @@ module WhatsupGithub
30
28
  end
31
29
 
32
30
  def type
33
- labels_string = labels.join(' ')
34
- label_type = /#{ UPDATED_MASK }|#{ NEW_MASK }|#{ TECHNICAL_MASK }/.match(labels_string)
35
- case label_type.to_s
36
- when /#{ UPDATED_MASK }/
37
- UPDATED_PHRASE
38
- when /#{ NEW_MASK }/
39
- NEW_PHRASE
40
- when /#{ TECHNICAL_MASK }/
41
- TECHNICAL_PHRASE
42
- end
31
+ (labels & labels_from_config).join(', ')
43
32
  end
44
33
 
45
34
  def parse_body
@@ -1,3 +1,3 @@
1
1
  module WhatsupGithub
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency "netrc", "~> 0.10"
39
39
 
40
40
  spec.add_development_dependency "bundler", "~> 1.17"
41
- spec.add_development_dependency "rake", "~> 10.0"
41
+ spec.add_development_dependency "rake", "~> 13.0"
42
42
  spec.add_development_dependency "rspec", "~> 3.0"
43
43
  spec.add_development_dependency "cucumber", "~> 3.1"
44
44
  spec.add_development_dependency "aruba", "~> 0.14"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatsup_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Shevtsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-16 00:00:00.000000000 Z
11
+ date: 2020-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '13.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -146,8 +146,8 @@ extra_rdoc_files: []
146
146
  files:
147
147
  - ".gitignore"
148
148
  - ".rspec"
149
+ - ".ruby-version"
149
150
  - ".travis.yml"
150
- - ".whatsnew.yml"
151
151
  - CHANGELOG.md
152
152
  - Gemfile
153
153
  - Gemfile.lock
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
- rubygems_version: 3.0.3
195
+ rubygems_version: 3.1.2
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: Collect info from GitHub pull requests.
@@ -1,17 +0,0 @@
1
- # Name of the base branch in GitHub PRs
2
- base_branch: master
3
-
4
- # Repos for scanning
5
- repos:
6
- - magento/devdocs
7
-
8
- # Labels for filtering
9
- labels:
10
- - New doc
11
- - Major update
12
- - Technical
13
-
14
- # Output format
15
- output_format:
16
- # - markdown
17
- - yaml