fastlane-plugin-jira_release_notes 0.3.0 → 0.7.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: d26d8c9a36e9fc6464778b2ae1284f25661b50b8ee2cd7a65266a56307038f7e
4
- data.tar.gz: 52b9101f537ceb31e6de5d29fda379822e261725dd8745036a8f1e982c918b3f
3
+ metadata.gz: 522a0c16ac8063f53756ed8bffd8d08c8b97e24052f548386f81abddab583039
4
+ data.tar.gz: 96375b97f3cf81dc88dd8eb9ea08fd25b2592646d1830b4bcf6f565e2e4de40c
5
5
  SHA512:
6
- metadata.gz: 344a6ddc7bf2e9d4014b0a08526edde8856709b6ab16c36bfdd67b6e2d97fcd669579a849ab4908513181978fad6d7e4dfb1db0b7cc36c7d9f22d938d3cf7d7d
7
- data.tar.gz: 717a599f65dd3be2792c97a40766466f5263e8c6ba43516928e1dad63fce9280deb6b4727fa319d2ecd5a2694372e890444f6bc6f72f0cee9ea543a7124a459d
6
+ metadata.gz: 374ae7e90980b2b7b6f1c9a7c460fda8d48244a0f18b960f537d11f06b99f74a2c4a011ee9f38b29ec7984d8202e65493be6c9fddb04bdcdd5cec23515362c92
7
+ data.tar.gz: a14d3b8ae0cc2c6bae8dc7e4271c492b5ad27591a1194b3f7450f240e295bf7194718e697f77b5aafffbd95ae0f2f2dbd4735b5de3fe952f8e20a39b5c3f3850
data/README.md CHANGED
@@ -19,6 +19,20 @@ 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
+ ```
22
36
 
23
37
  ## Options
24
38
 
@@ -35,6 +49,8 @@ username | Username for Jira instance | FL_JIRA_USERNAME |
35
49
  password | Password for Jira or api token | FL_JIRA_PASSWORD |
36
50
  project | Jira project name | FL_JIRA_PROJECT |
37
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 |
38
54
  format | Format text. Plain, html or none | FL_JIRA_RELEASE_NOTES_FORMAT | plain
39
55
  max_results | Maximum number of issues | FL_JIRA_RELEASE_NOTES_MAX_RESULTS | 50
40
56
 
@@ -15,6 +15,8 @@ module Fastlane
15
15
 
16
16
  version = params[:version]
17
17
  project = params[:project]
18
+ status = params[:status]
19
+ components = params[:components]
18
20
  max_results = params[:max_results].to_i
19
21
  issues = []
20
22
 
@@ -25,19 +27,26 @@ module Fastlane
25
27
  versions = client.Project.find(project).versions
26
28
  .select { |v| version.match(v.name) }
27
29
  .map { |v| "'#{v.name}'" } .join(', ')
28
- issues = client.Issue.jql("PROJECT = '#{project}' AND fixVersion in (#{versions})",
29
- max_results: max_results)
30
+ jql = "PROJECT = '#{project}' AND fixVersion in (#{versions})"
30
31
  else
31
- issues = client.Issue.jql("PROJECT = '#{project}' AND fixVersion = '#{version}'",
32
- max_results: max_results)
32
+ jql = "PROJECT = '#{project}' AND fixVersion = '#{version}'"
33
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
+
34
43
  rescue JIRA::HTTPError => e
35
44
  fields = [e.code, e.message]
36
45
  fields << e.response.body if e.response.content_type == "application/json"
37
46
  UI.user_error!("#{e} #{fields.join(', ')}")
38
47
  end
39
48
 
40
- 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}'")
41
50
 
42
51
  case params[:format]
43
52
  when "plain"
@@ -65,6 +74,10 @@ module Fastlane
65
74
  "List of issues from jira. Formatted string or class"
66
75
  end
67
76
 
77
+ def self.return_type
78
+ :string
79
+ end
80
+
68
81
  def self.available_options
69
82
  [
70
83
  FastlaneCore::ConfigItem.new(key: :url,
@@ -93,6 +106,17 @@ module Fastlane
93
106
  verify_block: proc do |value|
94
107
  UI.user_error!("No Jira project name") if value.to_s.length == 0
95
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: ""),
96
120
  FastlaneCore::ConfigItem.new(key: :version,
97
121
  env_name: "FL_JIRA_PROJECT_VERSION",
98
122
  description: "Jira project version",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module JiraReleaseNotes
3
- VERSION = "0.3.0"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
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.3.0
4
+ version: 0.7.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: 2019-08-22 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jira-ruby
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: 2.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.1'
26
+ version: 2.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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
- rubyforge_project:
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