fastlane-plugin-jira_release_notes 0.2.0 → 0.6.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df95b3762886fed53599c9c7e1496fbe859fd5516af8ebb60d0ef730b465660a
|
4
|
+
data.tar.gz: c880b43871c63e4e64c59bdbae968aa08a86c9434790dddffa49de0d85407e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d7d44a35cb79ca4b313a542f5cf99c840f7a544a604d5d1c2626e0074e454651825d2c756837eefda143bb0c0b2e4416e2b05607e0f055646a2283156ee456
|
7
|
+
data.tar.gz: 7f15cfce25c0586ccdbbbf34474566def59edb627c4a3aa6be2fec71ef8a51062c94cbe86fc5a95f60bdee2949a4a4955c0bc39dcdc37903b94c77fc03c462f1
|
data/README.md
CHANGED
@@ -19,6 +19,41 @@ Release notes from JIRA for version
|
|
19
19
|
|
20
20
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
21
21
|
|
22
|
+
```ruby
|
23
|
+
lane :notes do
|
24
|
+
text = jira_release_notes(
|
25
|
+
username: "me",
|
26
|
+
password: "123", # password or api token
|
27
|
+
url: "https://jira.example.com",
|
28
|
+
project: "OX",
|
29
|
+
version: "0.1",
|
30
|
+
status: "Testable",
|
31
|
+
format: "plain"
|
32
|
+
)
|
33
|
+
puts text
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
## Options
|
38
|
+
|
39
|
+
```
|
40
|
+
fastlane action jira_release_notes
|
41
|
+
```
|
42
|
+
|
43
|
+
[How to generate an API Access Token](https://confluence.atlassian.com/cloud/api-tokens-938839638.html)
|
44
|
+
|
45
|
+
Key | Description | Env Var | Default
|
46
|
+
----|-------------|---------|--------
|
47
|
+
url | URL for Jira instance | FL_JIRA_SITE |
|
48
|
+
username | Username for Jira instance | FL_JIRA_USERNAME |
|
49
|
+
password | Password for Jira or api token | FL_JIRA_PASSWORD |
|
50
|
+
project | Jira project name | FL_JIRA_PROJECT |
|
51
|
+
version | Jira project version | FL_JIRA_PROJECT_VERSION |
|
52
|
+
status | Jira issue status | FL_JIRA_STATUS |
|
53
|
+
components | An array of Jira issue components | FL_JIRA_COMPONENTS |
|
54
|
+
format | Format text. Plain, html or none | FL_JIRA_RELEASE_NOTES_FORMAT | plain
|
55
|
+
max_results | Maximum number of issues | FL_JIRA_RELEASE_NOTES_MAX_RESULTS | 50
|
56
|
+
|
22
57
|
|
23
58
|
## Run tests for this plugin
|
24
59
|
|
@@ -15,6 +15,9 @@ module Fastlane
|
|
15
15
|
|
16
16
|
version = params[:version]
|
17
17
|
project = params[:project]
|
18
|
+
status = params[:status]
|
19
|
+
components = params[:components]
|
20
|
+
max_results = params[:max_results].to_i
|
18
21
|
issues = []
|
19
22
|
|
20
23
|
UI.message("Fetch issues from JIRA project '#{project}', version '#{version}'")
|
@@ -24,17 +27,26 @@ module Fastlane
|
|
24
27
|
versions = client.Project.find(project).versions
|
25
28
|
.select { |v| version.match(v.name) }
|
26
29
|
.map { |v| "'#{v.name}'" } .join(', ')
|
27
|
-
|
30
|
+
jql = "PROJECT = '#{project}' AND fixVersion in (#{versions})"
|
28
31
|
else
|
29
|
-
|
32
|
+
jql = "PROJECT = '#{project}' AND fixVersion = '#{version}'"
|
30
33
|
end
|
34
|
+
unless status.nil? or status.empty?
|
35
|
+
jql += " AND status = '#{status}'"
|
36
|
+
end
|
37
|
+
unless components.nil? or components.empty?
|
38
|
+
jql += " AND component in (#{components.map{|s| "\"#{s}\""}.join(", ")})"
|
39
|
+
end
|
40
|
+
UI.message("jql '#{jql}'")
|
41
|
+
issues = client.Issue.jql(jql,max_results: max_results)
|
42
|
+
|
31
43
|
rescue JIRA::HTTPError => e
|
32
44
|
fields = [e.code, e.message]
|
33
45
|
fields << e.response.body if e.response.content_type == "application/json"
|
34
46
|
UI.user_error!("#{e} #{fields.join(', ')}")
|
35
47
|
end
|
36
48
|
|
37
|
-
UI.success("📝 #{issues.count} issues from JIRA project '#{project}', version '#{version}'")
|
49
|
+
UI.success("📝 #{issues.count} issues from JIRA project '#{project}', version '#{version}', status '#{status}', components '#{components}'")
|
38
50
|
|
39
51
|
case params[:format]
|
40
52
|
when "plain"
|
@@ -62,6 +74,10 @@ module Fastlane
|
|
62
74
|
"List of issues from jira. Formatted string or class"
|
63
75
|
end
|
64
76
|
|
77
|
+
def self.return_type
|
78
|
+
:string
|
79
|
+
end
|
80
|
+
|
65
81
|
def self.available_options
|
66
82
|
[
|
67
83
|
FastlaneCore::ConfigItem.new(key: :url,
|
@@ -78,7 +94,7 @@ module Fastlane
|
|
78
94
|
end),
|
79
95
|
FastlaneCore::ConfigItem.new(key: :password,
|
80
96
|
env_name: "FL_JIRA_PASSWORD",
|
81
|
-
description: "Password for Jira",
|
97
|
+
description: "Password or api token for Jira",
|
82
98
|
sensitive: true,
|
83
99
|
verify_block: proc do |value|
|
84
100
|
UI.user_error!("No password") if value.to_s.length == 0
|
@@ -90,6 +106,17 @@ module Fastlane
|
|
90
106
|
verify_block: proc do |value|
|
91
107
|
UI.user_error!("No Jira project name") if value.to_s.length == 0
|
92
108
|
end),
|
109
|
+
FastlaneCore::ConfigItem.new(key: :status,
|
110
|
+
env_name: "FL_JIRA_STATUS",
|
111
|
+
description: "Jira issue status",
|
112
|
+
sensitive: true,
|
113
|
+
default_value: ""),
|
114
|
+
FastlaneCore::ConfigItem.new(key: :components,
|
115
|
+
env_name: "FL_JIRA_COMPONENTS",
|
116
|
+
description: "Jira issue components",
|
117
|
+
type: Array,
|
118
|
+
sensitive: true,
|
119
|
+
default_value: ""),
|
93
120
|
FastlaneCore::ConfigItem.new(key: :version,
|
94
121
|
env_name: "FL_JIRA_PROJECT_VERSION",
|
95
122
|
description: "Jira project version",
|
@@ -103,7 +130,11 @@ module Fastlane
|
|
103
130
|
env_name: "FL_JIRA_RELEASE_NOTES_FORMAT",
|
104
131
|
description: "Format text. Plain, html or none",
|
105
132
|
sensitive: true,
|
106
|
-
default_value: "plain")
|
133
|
+
default_value: "plain"),
|
134
|
+
FastlaneCore::ConfigItem.new(key: :max_results,
|
135
|
+
env_name: "FL_JIRA_RELEASE_NOTES_MAX_RESULTS",
|
136
|
+
description: "Maximum number of issues",
|
137
|
+
default_value: "50")
|
107
138
|
]
|
108
139
|
end
|
109
140
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-jira_release_notes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Ignition
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jira-ruby
|
@@ -153,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 2.7.7
|
156
|
+
rubygems_version: 3.0.3
|
158
157
|
signing_key:
|
159
158
|
specification_version: 4
|
160
159
|
summary: Release notes from JIRA for version
|