the Git package creates a webhook but is not deleting it. There is a missing correlation between the trigger and the webhook.
@csantanapr , by correlation you mean we can return the id of the created hook and user could delete it with parameter in another command?
I searched and found those two docs:
https://developer.github.com/webhooks/
https://developer.github.com/v3/repos/hooks/
we only support create/delete, it seems ping/edit also doable.
@lzbj yes meaning that when user deletes the trigger from openwhisk, openwhisk will also go to github and delete the webhook from github. so when creating the trigger the webhook info should be saved.
Ok, got it, thank you.
@ChrBi points out that deleting the feed requires the appropriate webhook. This is related to #471 and #446.
what about we list all the webhooks created by the user, and check if the callback url contains the trigger name, we then delete the corresponding webhook. In this way, we don鈥檛 have to persist the webhook id somewhere. The bad is we delete all the webhooks with the trigger name.
this i think is now blocking ui testing, as i cannot re-test creating a webhook, because github squashes any attempt to create a new webhook with the same parameters.
@luz Please send a pull request if you have a propose solution. Attaching code makes it very difficult to review and provide feedback on code.
isn't it body[i].config.url? here is an example record in the array that api.github.com returns:
{
"type": "Repository",
"id": 8814032,
"name": "web",
"active": true,
"events": [
"push"
],
"config": {
"content_type": "json",
"url": "https://xxx:[email protected]/api/v1/namespaces/uitest3_uitest3/triggers/my git trigger"
},
"updated_at": "2016-06-19T23:44:40Z",
"created_at": "2016-06-19T23:44:40Z",
"url": "https://api.github.com/repos/testLime/lime/hooks/8814032",
"test_url": "https://api.github.com/repos/testLime/lime/hooks/8814032/test",
"ping_url": "https://api.github.com/repos/testLime/lime/hooks/8814032/pings",
"last_response": {
"code": 422,
"status": "misconfigured",
"message": "Invalid HTTP Response: 403"
}
}
i also notice that body[i].config.url doesn't URL-encode the trigger name. notice that my trigger name has spaces in it... https://github.com/openwhisk/openwhisk/issues/702
also observe the hard-coded use of the YP endpoint, despite me invoking this feed creation on YS1. https://github.com/openwhisk/openwhisk/issues/699
@lzbj Are you actively working to fix this bug?
@csantanapr , Yes, I try to propose solution for review, yes, I'll take care next time when I propose code snippet.
@starpit, thanks for your review, I'll propose a pull request try to address it.
please help review this pull request.
I'll test with it myself locally deployment, I suffer a slow network.
@starpit @ChrBi , could you please help take a look when you available? Thank you.
@bjustin-ibm this is one of the github bugs that are important to address soon.
Now that the GitHub trigger code has moved, this will be resolved by openwhisk/openwhisk-catalog#139.
Resolved by by openwhisk/openwhisk-catalog#139.
Most helpful comment
Resolved by by openwhisk/openwhisk-catalog#139.