whatsup_github 0.0.1 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28f70d20f66860466a71e5f253d75db911d24bfd91c7403d8351bc6f62b9ba7e
4
- data.tar.gz: 43fd5d4cf2d8d29f150a2bbe61aeb1b92a7fdd76e099138622786db4a191e058
3
+ metadata.gz: a0633d017c04fd64dfdd657e5c88db7dfed9ec1ff6fd91d4fe6471a50d1e0308
4
+ data.tar.gz: 819d3cd2c72f38ea8df1fbd496a394b727d522ac52c620221fc9bb4f71b2a31e
5
5
  SHA512:
6
- metadata.gz: ea289b8d727aaed1ce88219250ccd41b30cf77c3417a3ca16e185afdcbcf5575f8f14554ebcf60196ca001e44b8fc140b11b2e4108a91032ec9bd30beed2b97a
7
- data.tar.gz: fa873b26c9faa0559c877904c10d33eae35dab773acf0a1eb0025964dd35fd69a314554b060eb33015be0b4cbe85096974ff6ceff672fc53e82ff18ed42eabb5
6
+ metadata.gz: 9f545b95c7dd6e2e6facb23eec0ffa26d4f8e9f7330698c7c2bd471a2affcc98bbbddef433b35ff74ae8ace4a639b223262409fd32caf9014ed5d5b1d47fd9ab
7
+ data.tar.gz: '0910958934e53e7a8feb8d63121f9193133a725057b7139df5fef6d4c2e16d506e44014afe55320027fda6c3514f1b8214a0f1fa9143583c79220054f16e2790'
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.7.2
data/.travis.yml CHANGED
@@ -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 2.2.15
data/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ # Changelog
2
+
3
+ ## 0.4.0
4
+
5
+ ### General
6
+
7
+ - Loading more data about pull requests via API
8
+ - Loading data about configured organization members via API
9
+ - Upgraded gem specs
10
+ - Removed non-working tests. TODO: Add tests for the output file.
11
+
12
+ ### New configuration option
13
+
14
+ Added `membership` to configuration. Value: name of an organization to check membership of a contributor.
15
+
16
+ ### New output data
17
+
18
+ Added `merge_commit`, `labels`, and `membership` to YAML output.
19
+ Values for `membership`:
20
+ - `true` if contributor is a member of the configured organization
21
+ - `false` if not a member
22
+ - empty if not configured
23
+
24
+ ## 0.3.1
25
+
26
+ - Added `contributor` and `profile` output data.
27
+
28
+ ## 0.3.0
29
+
30
+ - Added "magic word" to configuration file
31
+ - Added the requested GitHub query to terminal output (#13)
32
+ - Fixed the issue with empty description (#21)
33
+
34
+ ## 0.2.0
35
+
36
+ - Implemented two types of labels in configuration: 'optional' and 'required'.
37
+
1
38
  ## 0.0.1
2
39
 
3
40
  The tool is released as a gem.
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  # Specify your gem's dependencies in whatsup_github.gemspec
6
8
  gemspec
data/Gemfile.lock CHANGED
@@ -1,91 +1,129 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- whatsup_github (0.0.1)
5
- netrc (~> 0.10)
6
- octokit (~> 4.14)
7
- thor (~> 0.20)
4
+ whatsup_github (0.4.0)
5
+ netrc (~> 0.11)
6
+ octokit (~> 4.20)
7
+ thor (~> 1.1)
8
8
 
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)
16
- contracts (~> 0.9)
17
- cucumber (>= 1.3.19)
18
- ffi (~> 1.9)
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)
25
- coderay (1.1.2)
12
+ activesupport (6.1.3.1)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ zeitwerk (~> 2.3)
18
+ addressable (2.7.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
20
+ aruba (1.0.4)
21
+ childprocess (>= 2.0, < 5.0)
22
+ contracts (~> 0.16.0)
23
+ cucumber (>= 2.4, < 6.0)
24
+ rspec-expectations (~> 3.4)
25
+ thor (~> 1.0)
26
+ builder (3.2.4)
27
+ childprocess (4.0.0)
28
+ coderay (1.1.3)
29
+ concurrent-ruby (1.1.8)
26
30
  contracts (0.16.0)
27
- cucumber (3.1.2)
28
- builder (>= 2.1.2)
29
- cucumber-core (~> 3.2.0)
30
- cucumber-expressions (~> 6.0.1)
31
- cucumber-wire (~> 0.0.1)
32
- diff-lcs (~> 1.3)
33
- gherkin (~> 5.1.0)
34
- multi_json (>= 1.7.5, < 2.0)
35
- multi_test (>= 0.1.2)
36
- cucumber-core (3.2.1)
37
- backports (>= 3.8.0)
38
- cucumber-tag_expressions (~> 1.1.0)
39
- gherkin (~> 5.0)
40
- cucumber-expressions (6.0.1)
41
- cucumber-tag_expressions (1.1.1)
42
- cucumber-wire (0.0.1)
43
- diff-lcs (1.3)
44
- faraday (0.15.4)
31
+ cucumber (5.3.0)
32
+ builder (~> 3.2, >= 3.2.4)
33
+ cucumber-core (~> 8.0, >= 8.0.1)
34
+ cucumber-create-meta (~> 2.0, >= 2.0.2)
35
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
36
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
37
+ cucumber-html-formatter (~> 9.0, >= 9.0.0)
38
+ cucumber-messages (~> 13.1, >= 13.1.0)
39
+ cucumber-wire (~> 4.0, >= 4.0.1)
40
+ diff-lcs (~> 1.4, >= 1.4.4)
41
+ multi_test (~> 0.1, >= 0.1.2)
42
+ sys-uname (~> 1.2, >= 1.2.1)
43
+ cucumber-core (8.0.1)
44
+ cucumber-gherkin (~> 15.0, >= 15.0.2)
45
+ cucumber-messages (~> 13.0, >= 13.0.1)
46
+ cucumber-tag-expressions (~> 2.0, >= 2.0.4)
47
+ cucumber-create-meta (2.0.4)
48
+ cucumber-messages (~> 13.1, >= 13.1.0)
49
+ sys-uname (~> 1.2, >= 1.2.1)
50
+ cucumber-cucumber-expressions (10.3.0)
51
+ cucumber-gherkin (15.0.2)
52
+ cucumber-messages (~> 13.0, >= 13.0.1)
53
+ cucumber-html-formatter (9.0.0)
54
+ cucumber-messages (~> 13.0, >= 13.0.1)
55
+ cucumber-messages (13.2.1)
56
+ protobuf-cucumber (~> 3.10, >= 3.10.8)
57
+ cucumber-tag-expressions (2.0.4)
58
+ cucumber-wire (4.0.1)
59
+ cucumber-core (~> 8.0, >= 8.0.1)
60
+ cucumber-cucumber-expressions (~> 10.3, >= 10.3.0)
61
+ cucumber-messages (~> 13.0, >= 13.0.1)
62
+ diff-lcs (1.4.4)
63
+ faraday (1.3.0)
64
+ faraday-net_http (~> 1.0)
45
65
  multipart-post (>= 1.2, < 3)
46
- ffi (1.11.1)
47
- gherkin (5.1.0)
48
- method_source (0.9.2)
49
- multi_json (1.13.1)
66
+ ruby2_keywords
67
+ faraday-net_http (1.0.1)
68
+ ffi (1.15.0)
69
+ i18n (1.8.9)
70
+ concurrent-ruby (~> 1.0)
71
+ method_source (1.0.0)
72
+ middleware (0.1.0)
73
+ minitest (5.14.4)
50
74
  multi_test (0.1.2)
51
75
  multipart-post (2.1.1)
52
76
  netrc (0.11.0)
53
- octokit (4.14.0)
77
+ octokit (4.20.0)
78
+ faraday (>= 0.9)
54
79
  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)
80
+ protobuf-cucumber (3.10.8)
81
+ activesupport (>= 3.2)
82
+ middleware
83
+ thor
84
+ thread_safe
85
+ pry (0.14.0)
86
+ coderay (~> 1.1)
87
+ method_source (~> 1.0)
88
+ public_suffix (4.0.6)
89
+ rake (13.0.3)
90
+ rspec (3.10.0)
91
+ rspec-core (~> 3.10.0)
92
+ rspec-expectations (~> 3.10.0)
93
+ rspec-mocks (~> 3.10.0)
94
+ rspec-core (3.10.1)
95
+ rspec-support (~> 3.10.0)
96
+ rspec-expectations (3.10.1)
67
97
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.8.0)
69
- rspec-mocks (3.8.1)
98
+ rspec-support (~> 3.10.0)
99
+ rspec-mocks (3.10.2)
70
100
  diff-lcs (>= 1.2.0, < 2.0)
71
- rspec-support (~> 3.8.0)
72
- rspec-support (3.8.2)
101
+ rspec-support (~> 3.10.0)
102
+ rspec-support (3.10.2)
103
+ ruby2_keywords (0.0.4)
73
104
  sawyer (0.8.2)
74
105
  addressable (>= 2.3.5)
75
106
  faraday (> 0.8, < 2.0)
76
- thor (0.20.3)
107
+ sys-uname (1.2.2)
108
+ ffi (~> 1.1)
109
+ thor (1.1.0)
110
+ thread_safe (0.3.6)
111
+ tzinfo (2.0.4)
112
+ concurrent-ruby (~> 1.0)
113
+ zeitwerk (2.4.2)
77
114
 
78
115
  PLATFORMS
79
116
  ruby
117
+ x86_64-darwin-19
80
118
 
81
119
  DEPENDENCIES
82
- aruba (~> 0.14)
83
- bundler (~> 1.17)
84
- cucumber (~> 3.1)
85
- pry (~> 0.12)
86
- rake (~> 10.0)
87
- rspec (~> 3.0)
120
+ aruba (~> 1.0)
121
+ bundler (~> 2.2)
122
+ cucumber (~> 5.3)
123
+ pry (~> 0.14)
124
+ rake (~> 13.0)
125
+ rspec (~> 3.10)
88
126
  whatsup_github!
89
127
 
90
128
  BUNDLED WITH
91
- 1.17.2
129
+ 2.2.15
data/README.md CHANGED
@@ -1,39 +1,123 @@
1
- # WhatsupGithub
1
+ # whatsup_github
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 updating 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 sources 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
+ ## What's generated
13
+
14
+ A resulting YAML file `tmp/whats-new.yml` is generated from GitHub data.
15
+
16
+ ### `description`
17
+
18
+ Text for `description` is taken from individual pull request's description (same as body).
19
+ The text must follow the `whatsnew` keyword and be located at the end.
20
+
21
+ Example:
22
+
23
+ ```
24
+ This pull request adds ...
25
+
26
+ Some other details about this pull request.
27
+
28
+ whatsnew
29
+ Added documentation about [New Magento feature](https://devdocs.magento.com/new-magento-feature.html).
30
+ ```
31
+
32
+ ### `type`
33
+
34
+ Set as a list of `labels` in `.whatsup.yml`. There are two types of labels in configuration:
35
+
36
+ - `required` are labels that must include `whatsnew`. Otherwise, resulting output will warn about missing `whatsnew`.
37
+ - `optional` are labels that may include `whatsnew`. If `whatsnew` is missing, you won't get any notification about this.
38
+
39
+ ### `versions`
40
+
41
+ Any GitHub label that starts from a digit followed by a period like in regex `\d\.`.
42
+ Examples: `2.3.x`, `1.0.3-msi`, `2.x`
43
+
44
+ ### `date`
45
+
46
+ Date when the pull request was merged.
47
+
48
+ ### `link`
49
+
50
+ URL of the pull request.
51
+
52
+ ### `contributor`
53
+
54
+ An author of a pull request.
55
+
56
+ ### `merge_commit`
57
+
58
+ Merge commit SHA of the pull request.
59
+
60
+ ### `membership`
61
+
62
+ Memebership of the contributor in a configured organization.
63
+
64
+ ### `labels`
65
+
66
+ All labels added to the pull request.
7
67
 
8
68
  ## Installation
9
69
 
10
- Add this line to your application's Gemfile:
70
+ This gem can be installed as a system command-line tool or as a command-line tool available in a project.
71
+
72
+ ### System installation
73
+
74
+ ```
75
+ gem install whatsup_github
76
+ ```
77
+
78
+ ### Project installation
79
+
80
+ Add to your Gemfile:
11
81
 
12
82
  ```ruby
13
83
  gem 'whatsup_github'
14
84
  ```
15
85
 
16
- And then execute:
86
+ And install:
17
87
 
18
88
  ```bash
19
89
  bundle
20
90
  ```
21
91
 
22
- Or install it yourself as:
92
+ ## Configuration
93
+
94
+ The configuration file [`.whatsup.yml`](lib/template/.whatsup.yml) will be created automatically after first run unless it's already there.
95
+
96
+ ## Authentication
97
+
98
+ Use [`~/.netrc`](https://github.com/octokit/octokit.rb#using-a-netrc-file) file for authentication.
23
99
 
24
- ```bash
25
- gem install whatsup_github
100
+ ```
101
+ machine api.github.com
102
+ login <GitHub login>
103
+ password <GitHub token>
26
104
  ```
27
105
 
28
- ## Usage
106
+ Example:
107
+
108
+ ```
109
+ machine api.github.com
110
+ login dshevtsov
111
+ password y9o6YvEoa7IukRWUFdnkpuxNjJ3uwiDQp4zkAdU0
112
+ ```
29
113
 
30
- Generate the output with recent updates since April 2 of the current year till today:
114
+ ## Usage
31
115
 
32
116
  ```bash
33
117
  whatsup_github since 'apr 2'
34
118
  ```
35
119
 
36
- By default, it generates recent updates for the passed week:
120
+ If run with no arguments, it generates data for the past week:
37
121
 
38
122
  ```bash
39
123
  whatsup_github
@@ -41,20 +125,68 @@ whatsup_github
41
125
 
42
126
  You can use different date formats like `'April 2'`, `'2 April'`, `'apr 2'`, `'2 Apr'`, `2018-04-02`.
43
127
 
44
- The result is returned into _tmp/whats-new.yml_ or _tmp/whats-new.md_ files, depending on the format specified in configuration.
128
+ ## Development
45
129
 
46
- ## Configuration
130
+ To install dependencies:
47
131
 
48
- The configuration file [`.whatsup.yml`](lib/template/.whatsup.yml) will be created during the first run.
132
+ ```
133
+ bin/setup
134
+ ```
49
135
 
50
- ## Authentication
136
+ To install the package:
51
137
 
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.
138
+ ```
139
+ rake install
140
+ ```
54
141
 
55
- ## Development
142
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
143
+
144
+ ### Testing
145
+
146
+ 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`.
147
+
148
+ #### specs
149
+
150
+ To run rspec tests:
151
+
152
+ ```
153
+ rake spec
154
+ ```
56
155
 
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.
156
+ #### features
157
+
158
+ To run Cucumber tests:
159
+
160
+ ```
161
+ rake features
162
+ ```
163
+
164
+ To pass the `output_file.feature` tests, you need to generate a non-empty `whats-new.yml`.
165
+ To test just file:
166
+
167
+ ```
168
+ bundle exec cucumber features/since.feature
169
+ ```
170
+
171
+ NOTE: Cucumber tests will use the configuration file from code `lib/template/.whatsup.yml`.
172
+
173
+ #### Individual files
174
+
175
+ Individual files can have tests at the end of a file in a format like:
176
+
177
+ ```ruby
178
+ if $PROGRAM_NAME == __FILE__
179
+ # test code here
180
+ end
181
+ ```
182
+
183
+ To run such test, run the corresponding file:
184
+
185
+ ```bash
186
+ ruby lib/whatsup_github/config_reader.rb
187
+ ```
188
+
189
+ The tests use the root `.whatsup.yml` file to read configuration.
58
190
 
59
191
  ## Contributing
60
192
 
@@ -63,7 +195,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/dshevt
63
195
  ## License
64
196
 
65
197
  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).