Skip to content

Token Circuit Breaker Notification #18886

@hennevogel

Description

@hennevogel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureFrontendThings related to the OBS RoR appscm-ciThings related to the scm-ci feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions