-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update @octokit/webhooks
to v9
#1481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use probot as user but I'm not familiar with the code. Cloning the repo and taking a look into your PR. Additionally on my comments, are there any checks or tries you would like us to do? Generating a local probot and try something?
Generating a local probot in typescript would be helpful, fixing up tests. One thing I'm really not sure is the |
I won't have time to look into this for another 2-3 weeks, but I have it in my backlog |
4f47403
to
2eb781f
Compare
2eb781f
to
7d785ae
Compare
@@ -93,15 +93,7 @@ export class Probot { | |||
|
|||
this.webhooks = getWebhooks(this.state); | |||
|
|||
this.on = (eventNameOrNames, callback) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a breaking change, just pointing it out so you know to expect it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change necessary because of the new types? Anyway to avoid it? It will be quite impactful. I want to make this change eventually anyway, but if we do it now we at least need to add a deprecation to the current version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the change is required because of the new types because support for the *'
event was removed in @octokit/webhooks
v8
It would require rewriting a bunch of the types from @octokit/webhooks
just to make this change backwards compatible
I don't think there is any way to avoid it
These are the jest logs, and they are failing.
@gr2m Can you take a look? |
will do! |
after checking out your branch and running
Any idea? |
That is actually an oversight of mine in octokit/webhooks#466 |
In the mean time, you can apply this diff --- a/node_modules/@octokit/webhooks-examples/index.d.ts
+++ b/node_modules/@octokit/webhooks-examples/index.d.ts
@@ -5,7 +5,7 @@ export type WebhookDefinition<
name: TName;
actions: string[];
description: string;
- examples: WebhookEventMap[TName];
+ examples: WebhookEventMap[TName][];
properties: Record<
string,
{ |
thanks, that helped 👍🏼 |
I gotta run now, but just a reminder that we have to include the relevant breaking changes in the release notes for probot: https://github.com/octokit/webhooks.js/releases/tag/v9.0.0 the node middleware tests fail because the
|
cbcbf19
to
81d5a9b
Compare
BREAKING CHANGE: removes the `webhookPath` option on `new Probot({})` for the webhooks middleware
…iddleware.test.ts`
…ally a breaking change, if the `x-hub-signature-256` header is not present, the `webhooks.onError()` callback is not called, because it does not even get that far. But I do not think that it is worth mentioning
…les`, add direct dependency to `@octokit/webhooks-types`
dc258f6
to
28144bc
Compare
I've rebased on latest master. There is a problem with the |
The beta branch isn't up to date with master iirc |
I don't think there is a nice way to do anything with If we remove it, the functions of the If we try to update it, then TS will complain that |
This (tries to) resolves some type incompatibilities with
@octokit/webhooks
due to the change in the way we generate payload types, and some deprecated code that got removed./ref #1472
/cc @G-Rath @gr2m
Breaking Changes
'*'
eventapp.webhooks.middleware
has been removedwebhookPath
option onnew Probot({})
for the webhooks middlewareCloses #1558