If a Token::Workflow fails to deliver to the SCM with certain messages, it get's disabled.
|
def update_as_failed(message) |
|
update(response_body: message, status: 'fail') |
|
|
|
# |
|
# Circuit breaker for authorization problems |
|
# |
|
# If message is one of these strings, we disable the token: |
|
# |
|
# "Failed to report back to GitLab: Unauthorized request. Please check your credentials again." |
|
# "Failed to report back to GitLab: Request forbidden." |
|
# "Failed to report back to GitHub: Unauthorized request. Please check your credentials again." |
|
# "Failed to report back to GitHub: Request is forbidden." |
|
|
|
token.update(enabled: false) if message.include?('Unauthorized request') || /Request (is )?forbidden/.match?(message) |
|
end |
This should trigger an event, a notification and have a default enabled subscription.
Reported by @dirkmueller
If a Token::Workflow fails to deliver to the SCM with certain messages, it get's disabled.
open-build-service/src/api/app/models/workflow_run.rb
Lines 71 to 85 in a080c24
This should trigger an event, a notification and have a default enabled subscription.
Reported by @dirkmueller