Skip to content
  • Patrick Talbert's avatar
    ack_nack: only get private token instance when needed · 2fb8fb1e
    Patrick Talbert authored
    
    
    reset_merge_request_approvals() can reset the approvals of an MR using
    the Gitlab API. It only needs to do this if the Gitlab project is not
    configured to do it automatically. In this case the function will assume
    there is a special API key environment var and use it to create a new
    gl_instance and gl_project. The problem is it tries to create these new
    instances even when the project handles the approvals reset and that
    will always fail because in those instances (kernel-ark) there is no
    special API key available.
    
    Fix this by only creating the new instances when reset_approvals_on_push
    is not set on the project.
    
    Signed-off-by: Patrick Talbert's avatarPatrick Talbert <ptalbert@redhat.com>
    2fb8fb1e