danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.26k stars 368 forks source link

fix: gitlab api `diffForFile` #1320

Closed ivankatliarchuk closed 2 years ago

ivankatliarchuk commented 2 years ago

BUG

Impact

Gitlab functionality is broken. Construct await danger.git.diffForFile(file) throw an unhadled exception when file not found


found a regression. with gitlab library

if ((e as any).response.status === 404) {
        return ""
      }

@gitbreaker library

if ((e as any).response.statusCode === 404) {
        return ""
      }

gitbreaker does handle errors in un-documented way

tested locally with local installation

yarn build && yarn pack
ivankatliarchuk commented 2 years ago

Hi, @orta . Would it be possible to review this PR? The bug was introduced, probably some pipelines on Gitlab are failing if they automatically update danger version, ups...

orta commented 2 years ago

No need to ping me after a day, no-one gets a SLA on open source I run in my spare time.

That said this looks good, not sure when I'll get around to being on my mac to deploy, but we can merge 👍🏻