Skip to content

Commit

Permalink
If event of exception is recurring event then add on comment in case …
Browse files Browse the repository at this point in the history
…of open issue
  • Loading branch information
Arpit committed May 28, 2020
1 parent dcdeda9 commit 61ed591
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby_git_issue-1.0.2.gem
ruby_git_issue-*
9 changes: 7 additions & 2 deletions lib/ruby_git_issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ def client
# column_id ## Integer => Get column id from project and its columns
# column_id can be blank as well. Issue will not be assigned to and project column if column_id is blank
def generate_issue(column_id=nil)
issue_data = client.create_issue("#{organization}/#{repo}", issue_options[:title], compose_body(exception_data, request), issue_options)
add_issue_to_project(issue_data, column_id) unless column_id.nil?
existing_issue = client.list_issues("#{organization}/#{repo}").select{|issue| issue[:title] == issue_options[:title]}.try(:first)
if existing_issue.nil?
issue_data = client.create_issue("#{organization}/#{repo}", issue_options[:title], compose_body(exception_data, request), issue_options)
add_issue_to_project(issue_data, column_id) unless column_id.nil?
else
client.add_comment("#{organization}/#{repo}", existing_issue.number, compose_body(exception_data, request))
end
end

# Get Github project based on the organization passed while initializing client
Expand Down
2 changes: 1 addition & 1 deletion ruby_git_issue.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |gem|
gem.name = 'ruby_git_issue'
gem.version = '1.0.2'
gem.version = '1.1.0'
gem.date = '2020-05-11'
gem.summary = "Ruby Git Issue on exception generation"
gem.description = "When rails throws excpetion, this gem will create issue and if project available, it will create project, assign developer and set tags if availabe"
Expand Down

0 comments on commit 61ed591

Please sign in to comment.