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
fix: determine webhook path for createNodeMiddleware()
via env variable
#1881
Conversation
I prefer the singular form WEBHOOK_PATH. webhooksPath comes from the @probot/webhooks package. Just for some background: So we used webhooksPath option. The PR makes it possible that probot picks up the webhooks path from the env variable. |
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 think this pull request does more than necessary. I agree with the first test but the 2nd test is odd, all environment variables should be set explicitly as the env
argument in createProbot(), no other process.env.*
variables should matter, it would result in unforeseen side effects
711e328
to
ccb078c
Compare
Implemented as requested. ;) |
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'm still a bit unsure about exposing probot.webhookPath
. The path on with webhook requests are received does not logically belong to the probot
instance, it belongs to whatever mechanism is used to receive requests, such as createNodeMiddleware or the express server.
Sorry for making this hard, I try to avoid a future breaking change. Once we introduce probot.webhookPath
we cannot remove it. I think we should try to solve this in a way that does not require any changes to to create-probot.ts
if possible, can you avoid force-pushing to pull requests once reviews started? It makes it harder to keep track of progress. PRs can get messy as they need be, we will squash them at the end anyway |
Sry regarding forced pushing. Kind of bad habit from creating PRs for nodejs. When I am at home I will check again. I just want to be able to overwrite the webhookPath via env variable when using createNodeMiddleware. |
maybe we should move reading that env variable into |
I really invested now multiple hours on this, but your request is contradictive. createProbot has the env option, where I need to pass WEBHOOK_PATH. So I would expect that that env would handle WEBHOOK_PATH properly. So it has to expose the knowledge somehow. The only other solution I can propose is to make the state attribute of probot public and make it start with |
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.
okay I'm sorry I rather not have you frustrated, I don't mind getting this merged, we can revise in the future if needed, but for now lets ship it
createNodeMiddleware()
via env variable
🎉 This PR is included in version 13.0.0-beta.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #1878
When using probot 13 beta i realized that it was totally unintuitive that setting the WEBHOOK_PATH had no effect on our bots.