Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable trello build notification by default #204

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dotenv.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ KURREN_NOTIFY_SLACK_OBS=true
# Default: false
KURREN_NOTIFY_SLACK_OPENQA=false

# Notify trello about failed OBS builds
# Default: false
KURREN_NOTIFY_TRELLO_OBS=false

### openQA Configuration
# Your openQA API key
# Default: none (you need to set this)
Expand Down
2 changes: 0 additions & 2 deletions lib/obs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def notify(status:)
@trello.status = status
@trello.notify

return unless ENV.fetch('KURREN_NOTIFY_SLACK_OBS', true)

slack_message = 'Build failed for obs-server. https://build.opensuse.org/package/live_build_log/OBS:Server:Unstable/obs-server/15.5/x86_64'
@slack.notify(message: slack_message) if status == :failed
end
Expand Down
2 changes: 2 additions & 0 deletions lib/slack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class Slack
SLACK_URL = ENV.fetch('OBS_TOOLS_SLACK_URL')

def notify(message:)
return unless ENV.fetch('KURREN_NOTIFY_SLACK_OBS', 'false') == 'true'

response = Faraday.post(SLACK_URL) do |request|
request.headers['Content-Type'] = 'application/json'
request.body = { text: message }.to_json
Expand Down
2 changes: 2 additions & 0 deletions lib/trello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Trello
attr_accessor :status

def notify
return unless ENV.fetch('KURREN_NOTIFY_TRELLO_OBS', 'false') == 'true'

change_card_content
change_card_cover
end
Expand Down