Skip to content

[BUG] Not Found error when running danger with GitLab CE without MR approvals API #1106

Open
@pgrosslicht

Description

Describe the bug
Our builds have started failing with the following error since using v10.6.2:

Error:  { HTTPError: Not Found
    at fn (/root/.npm/_npx/15/lib/node_modules/danger/node_modules/ky/umd.js:266:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HTTPError',
  response:
   Response {
     size: 0,
     timeout: 0,
     [Symbol(Body internals)]: { body: [PassThrough], disturbed: true, error: null },
     [Symbol(Response internals)]:
      { url:
         'https://$GITLAB/api/v4/projects/$PROJECT/merge_requests/579/approvals',
        status: 404,
        statusText: 'Not Found',
        headers: [Headers],
        counter: 0 } },
  description: '404 Not Found' }

To Reproduce
Steps to reproduce the behavior:

  1. Execute danger with selfhosted GitLab CE without MR approvals API (for example 12.8.6)
  2. Above error will occur

Expected behavior

Danger shouldn't fail, either by allowing the user to configure skipping using this approvals API or ignoring the error and carrying on without these API results. Or maybe there is a more elegant solution that I am not thinking of at the moment.

Screenshots
If applicable, add screenshots to help explain your problem.

Your Environment

software version
danger.js 10.6.2
node 10.23.2
Operating System swift:5.2 docker image (Ubuntu 18.04)
Gitlab GitLab Community Edition 12.8.6

Additional context
Also according to https://docs.gitlab.com/ee/api/merge_request_approvals.html#merge-request-level-mr-approvals this API will be moved to GitLab Premium only in 13.9, so expecting the API to exist/work might become problematic then as well.
Probably introduced in #1098.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions