lib/jira_sync/plugin.rb in danger-jira_sync-0.0.1 vs lib/jira_sync/plugin.rb in danger-jira_sync-0.0.2
- old
+ new
@@ -41,10 +41,14 @@
# instance. Generate one here: https://id.atlassian.com/manage/api-tokens
#
# @return [JIRA::Client] The underlying jira-ruby JIRA::Client instance
#
def configure(jira_url:, jira_username:, jira_api_token:)
+ warn "danger-jira_sync plugin configuration is missing jira_url" if jira_url.blank?
+ warn "danger-jira_sync plugin configuration is missing jira_username" if jira_username.blank?
+ warn "danger-jira_sync plugin configuration is missing jira_api_token" if jira_api_token.blank?
+
@jira_client = JIRA::Client.new(
site: jira_url,
username: jira_username,
password: jira_api_token,
context_path: "",
@@ -108,10 +112,10 @@
begin
issue = @jira_client.Issue.find(key)
labels << issue.project.key
labels += issue.components.map(&:name)
rescue JIRA::HTTPError => e
- warn "Error while retrieving JIRA issue \"#{key}\": #{e.message}"
+ warn "#{e.code} Error while retrieving JIRA issue \"#{key}\": #{e.message}"
# No reason to continue if Unauthorized
break if e.code == 503
end
end
labels.compact.uniq