probot / adapter-aws-lambda-serverless

An extension for running Probot on Lambda
ISC License
93 stars 36 forks source link

When to expect a release that supports Probot v12? #82

Closed jaylenw closed 2 years ago

jaylenw commented 2 years ago

Background Info

I have a Probot application running Probot major version 11.4.1 that depends on this AWS Lambda Serverless adapter. I upgraded this adapter to v2.1.0 in my Probot application. I also understand that the v2.1.0 release had type definitions added seen here which is excellent. I then proceeded to upgrade my Probot application to the latest release version which is v12.1.1.

Problem

I am now unable to build my Probot application with TypeScript as I understand that the current latest release of this adapter does not support Probot v12. You can see below that I am encountering a type mismatch:

src/handler.ts(12,48): error TS2345: Argument of type '(app: Probot) => void' is not assignable to parameter of type 'ApplicationFunction'.
  Types of parameters 'app' and 'app' are incompatible.
    Type 'import("/home/user/WorkSpace/GitHub/myapp/node_modules/@probot/adapter-aws-lambda-serverless/node_modules/probot/lib/probot").Probot' is not assignable to type 'import("/home/user/WorkSpace/GitHub/myapp/node_modules/probot/lib/probot").Probot'.
      The types returned by 'webhooks.sign(...)' are incompatible between these types.
        Type 'string' is not assignable to type 'Promise<string>'.

Please note I am using almost the exact same code that is currently on the README that should be in handler.js / handler.ts.

The key string to notice is Type 'string' is not assignable to type 'Promise<string>'. This is the result to the changes made to Probot v12, if I understood correctly, the octokit webhooks has been changed (see here for the diff with some test cases reflecting this relating to "x-hub-signature": sign("secret", body), and "x-hub-signature-256": await sign("secret", body),.

Question

Long story short, when may we expect a new major version for this adapter to support Probot v12? I am thinking at minimum the Probot version in the package.json file will need to be set to v12 and that should update the type definitions.

I thank all of the contributors for their hard work on the project! 👍🏽

gr2m commented 2 years ago

A pull request would be most welcome 😁 I can help review and merge a PR and release a new version, but I cannot do the work myself. I'm not very familiar with AWS Lamda / serverless myself anyway, it would be good to find a maintainer willing to help with that adapter in particular

jaylenw commented 2 years ago

Hello @gr2m , I will see what my team and I can do in providing a pull request soon! Will keep you updated. Thank you.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: