lita-jira-issues 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +7 -0
- data/lib/lita/handlers/jira_issues.rb +3 -1
- data/lita-jira-issues.gemspec +1 -1
- data/spec/lita/handlers/jira_issues_spec.rb +30 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41460e79444d88c618386fb02fbe9057ccb36736
|
4
|
+
data.tar.gz: ff8facb4607f63e1c04ba7911afdc515a207b550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b68cbc5e9d3e15b90b494e5462ba183d452d321bee94edc5d852f046d5064606dee4810e657a214ee760eb85b19595beddde5ac7e79289f63633250a66ce79ca
|
7
|
+
data.tar.gz: e3d58d93cec5707754a9ece3177c4cceb648cda08e8eae2d08ccfcf68fdc839e945527c8bf5e137613c243417731cfa34b9530f833d68aff1b4c403378ab338a
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [Unreleased][unreleased]
|
6
|
+
|
7
|
+
## [0.2.2] - 2015-04-11
|
8
|
+
### Added
|
9
|
+
- A mechanism to ignore a list of users. Thanks to @jlambert121 for contributing.
|
10
|
+
|
11
|
+
## [0.2.1] - 2014-11-20
|
12
|
+
### Fixes
|
13
|
+
- Display mentioned JIRA issue only once, not each time the issue is mentioned.
|
14
|
+
|
15
|
+
## [0.2.0] - 2014-10-30
|
16
|
+
### Changed
|
17
|
+
- Upgrade to Lita 4, handler will only work with Lita 4 from this version on.
|
18
|
+
|
19
|
+
## [0.1.0] - 2014-10-30
|
20
|
+
### Added
|
21
|
+
- Initial release. Handler to output JIRA issue information when a JIRA key is
|
22
|
+
mentioned.
|
23
|
+
- This plugin is inspired by the [Hubot jira-issue plugin](
|
24
|
+
https://github.com/github/hubot-scripts/blob/master/src/scripts/jira-issues.coffee)
|
25
|
+
|
26
|
+
|
27
|
+
[unreleased]: https://github.com/amaltson/lita-jira-issues/compare/v0.2.2...HEAD
|
28
|
+
[0.2.2]: https://github.com/amaltson/lita-jira-issues/compare/v0.2.1...v0.2.2
|
29
|
+
[0.2.1]: https://github.com/amaltson/lita-jira-issues/compare/v0.2.0...v0.2.1
|
30
|
+
[0.2.0]: https://github.com/amaltson/lita-jira-issues/compare/v0.1.0...v0.2.0
|
31
|
+
[0.1.0]: https://github.com/amaltson/lita-jira-issues/compare/0b10b90...v0.1.0
|
data/README.md
CHANGED
@@ -35,6 +35,13 @@ config.handlers.jira_issues.password = ENV['JIRA_PASSWORD'] || 'password'
|
|
35
35
|
As in the example above, you can always use environment variables for sensitive
|
36
36
|
information like the JIRA user's password.
|
37
37
|
|
38
|
+
Optionally you can prevent JIRA issue lookups from certain users using the ignore
|
39
|
+
configuration parameter
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
config.handlers.jira_issues.ignore = [ 'Jira', 'Github' ]
|
43
|
+
```
|
44
|
+
|
38
45
|
## Usage
|
39
46
|
|
40
47
|
Simply mention any JIRA valid key in upper or lower case, eg. JIRA-123, proj-8,
|
@@ -8,12 +8,14 @@ module Lita
|
|
8
8
|
config :url, required: true, type: String
|
9
9
|
config :username, required: true, type: String
|
10
10
|
config :password, required: true, type: String
|
11
|
+
config :ignore, default: [], type: Array
|
11
12
|
|
12
13
|
route /[a-zA-Z]+-\d+/, :jira_message, help: {
|
13
14
|
"KEY-123" => "Replies with information about the given JIRA key"
|
14
15
|
}
|
15
16
|
|
16
17
|
def jira_message(response)
|
18
|
+
return if config.ignore.include?(response.user.name)
|
17
19
|
@jira ||= JiraGateway.new(http, config)
|
18
20
|
Set.new(response.matches).each do | key |
|
19
21
|
handle_key(response, key)
|
@@ -69,7 +71,7 @@ module Lita
|
|
69
71
|
|
70
72
|
def priority(data)
|
71
73
|
if data[:priority]
|
72
|
-
", priority: #{data[:priority][:name]}"
|
74
|
+
", priority: #{data[:priority][:name]}"
|
73
75
|
else
|
74
76
|
""
|
75
77
|
end
|
data/lita-jira-issues.gemspec
CHANGED
@@ -66,6 +66,36 @@ http://jira.local/browse/PROJ-9872
|
|
66
66
|
expect(replies.pop).to include('[PROJ-9872] Too many bugs')
|
67
67
|
end
|
68
68
|
|
69
|
+
it 'should handle ignoring users' do
|
70
|
+
Lita.config.handlers.jira_issues.ignore = ['Bob Smith']
|
71
|
+
|
72
|
+
mock_jira('KEY-424', {
|
73
|
+
key:'KEY-424',
|
74
|
+
fields: {
|
75
|
+
summary: 'Another issue',
|
76
|
+
status: {
|
77
|
+
name: 'Fixed'
|
78
|
+
},
|
79
|
+
assignee: {
|
80
|
+
displayName: 'User'
|
81
|
+
},
|
82
|
+
reporter: {
|
83
|
+
displayName: 'Reporter'
|
84
|
+
},
|
85
|
+
fixVersions: [ { name: 'Sprint 2' } ],
|
86
|
+
priority: { name: 'Undecided' }
|
87
|
+
}
|
88
|
+
})
|
89
|
+
|
90
|
+
bob = Lita::User.create(123, name: "Bob Smith")
|
91
|
+
fred = Lita::User.create(123, name: "Fred Smith")
|
92
|
+
|
93
|
+
send_message('Some message KEY-424 more text', as: bob)
|
94
|
+
expect(replies.last).not_to match('KEY-424')
|
95
|
+
send_message('Some message KEY-424 more text', as: fred)
|
96
|
+
expect(replies.last).to match('KEY-424')
|
97
|
+
end
|
98
|
+
|
69
99
|
def mock_jira(key, result)
|
70
100
|
allow_any_instance_of(JiraGateway).to receive(:data_for_issue)
|
71
101
|
.with(key)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-jira-issues
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Maltson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -103,6 +103,7 @@ extra_rdoc_files: []
|
|
103
103
|
files:
|
104
104
|
- ".gitignore"
|
105
105
|
- ".travis.yml"
|
106
|
+
- CHANGELOG.md
|
106
107
|
- Gemfile
|
107
108
|
- LICENSE
|
108
109
|
- README.md
|