Skip to content

support launchpad.net webhooks #8137

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

Closed
iainlane opened this issue Apr 26, 2021 · 11 comments
Closed

support launchpad.net webhooks #8137

iainlane opened this issue Apr 26, 2021 · 11 comments
Labels
Needed: more information A reply from issue author is required Support Support question

Comments

@iainlane
Copy link

Details

I've got a project hosted on Launchpad which I have docs for. I'd like for our docs to be updated on push, but Launchpad's webhooks aren't supported by readthedocs, so while I have put the URL I got from rtd into Launchpad, nothing happens on push.

The format is documented here: https://help.launchpad.net/API/Webhooks

@stsewd
Copy link
Member

stsewd commented Apr 26, 2021

Hi, I don't think we would implement a webhook for launchpad, we support webhooks for our supported vcs providers (gitlab, github and bitbucket), and we also have a manual webhook for other services https://docs.readthedocs.io/en/stable/webhooks.html#using-the-generic-api-integration. Maybe you can hook that into your CI.

@stsewd stsewd added the Support Support question label Apr 26, 2021
@iainlane
Copy link
Author

I think Launchpad would have to be changed to support adding the token via POST to make a custom integration work.

A question - in theory, would you accept a contribution (PR) to add Launchpad support?

@stsewd
Copy link
Member

stsewd commented Apr 27, 2021

A question - in theory, would you accept a contribution (PR) to add Launchpad support?

Personally I don't think so, but maybe others have more opinions here /cc @readthedocs/core

I think Launchpad would have to be changed to support adding the token via POST to make a custom integration work.

If you are using a CI platform, I think that would be the easiest place to call the webhook.

@ericholscher
Copy link
Member

ericholscher commented May 3, 2021

Yea, I'm -1 on launchpad support. People using smaller platforms should use the generic webhooks. We don't want to promise to maintain launchpad support going forward, since we don't have a critical mass of users.

If there's improvements to the generic webhooks, we are definitely open to PR's and ideas there.

@stsewd stsewd added the Needed: more information A reply from issue author is required label May 11, 2021
@stsewd stsewd closed this as completed May 20, 2021
@astrojuanlu
Copy link
Contributor

I made a reference to this issue in #8364, since both Gitea and Launchpad (as well as others) seem to be using the same X-Hub-Signature header.

@cjwatson
Copy link
Contributor

cjwatson commented Aug 3, 2021

Supporting the generic webhook would require non-trivial work in Launchpad, because (like GitHub et al) we don't support sending a webhook delivery with a user-specified payload, only a payload with the structure as explained in https://help.launchpad.net/API/Webhooks. I guess we might need to do this work at some point, but it will take some thought. I'd rather have direct integration (whichever side ends up doing most of the work) rather than requiring a CI hook.

It's disappointing to hear that a PR for Launchpad support in readthedocs wouldn't be accepted. I started sketching out https://paste.ubuntu.com/p/NHWB9D4fxs/ for that a while back just to see how hard it would be, though of course it would have needed tests.

@cjwatson
Copy link
Contributor

cjwatson commented Aug 3, 2021

@astrojuanlu
Copy link
Contributor

@cjwatson Could you please test adding a GitHub webhook with the Launchpad URL and see if it works? From the preliminary investigation I did in #8364, I understood that Launchpad uses the same X-Hub-Signature header as GitHub does. A Gitea user reported success despite a dismissable error message.

@cjwatson
Copy link
Contributor

cjwatson commented Aug 3, 2021

@astrojuanlu I know it won't work. The X-Hub-Signature HTTP header is only one part of the problem; if you look at readthedocs.api.v2.views.integrations.GitHubWebhookView, it requires a particular payload structure as well that does not at all match what Launchpad sends.

@cjwatson
Copy link
Contributor

cjwatson commented Aug 3, 2021

Though I've added such a webhook for testing anyway, and will report back.

@cjwatson
Copy link
Contributor

cjwatson commented Aug 3, 2021

I can confirm that we just get a 400 error with no resulting builds. See https://readthedocs.org/dashboard/launchpad/integrations/161686/exchange/1f9c9c78-f6df-414e-b025-9758b082144f/, for instance. Gitea probably gets away with using the GitHub integration because it has a ref field in its payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: more information A reply from issue author is required Support Support question
Projects
None yet
Development

No branches or pull requests

5 participants