danger / peril

ā˜¢ļø Serious and immediate danger.
https://danger.systems
MIT License
461 stars 58 forks source link

Note for updating Danger #470

Open orta opened 4 years ago

orta commented 4 years ago

This will require source code changes: https://github.com/danger/danger-js/pull/983

steprescott commented 4 years ago

I've taken some time to look into updating Peril to use to latest 10.1.0 release to no success.

I've been using https://github.com/danger/danger-js/pull/983 as a reference guide to see what changes were made their to support the latest OctoKit. I am left with 9 errors each around TypeScript.

source/danger/append_peril.ts:109:75 - error TS2345: Argument of type '{ [x: string]: any; } & { [x: string]: any; } & Octokit & void & { paginate: PaginateInterface; } & RestEndpointMethods' is not assignable to parameter of type 'Octokit'.

109       sandbox.danger.github.utils = GitHubUtils(sandbox.danger.github.pr, api)

Any advice on resolving these?

Here are the changes so far. https://github.com/danger/peril/commit/855ca891e8d1406840e681fb07822361135a8b22

steprescott commented 4 years ago

@gr2m Any advice from you as you did the danger update.

gr2m commented 4 years ago

Would love to help, just give me a day or two please

gr2m commented 4 years ago

I am left with 9 errors each around TypeScript

This is the bane of my existence right now šŸ¤·

How can I reproduce the problem?

steprescott commented 4 years ago

Sorry for the late reply. I'm not a big fan of the new GitHub notifications UI so I miss these a lot.

I have a branch update/danger.

gr2m commented 4 years ago

It's hard to tell what is going on. It looks like different @octokit/rest versions are being used which might cause conflicts:

npm ls @octokit/rest
peril@0.0.1 /Users/gregor/Projects/peril/api
ā”œā”€ā”€ @octokit/rest@17.1.4 
ā”œā”€ā”¬ @peril/utils@1.0.3
ā”‚ ā””ā”€ā”€ @octokit/rest@16.22.0 
ā””ā”€ā”¬ danger@10.1.0
  ā””ā”€ā”€ @octokit/rest@16.43.1 

I'm trying to do my best to provide good TypeScript support with Octokit, but I'm by no means an expert. And all these errors seem to be TypeScript errors. And I haven't seen that one before.

I wish I could help better, but I honestly don't have the time to digg in further right now :( but please ping me if there is something down the road that I could help with

steprescott commented 4 years ago

Yer Iā€™m new to TypeScript myself. Thanks for what you have done this far.