hasura / github-bot Goto Github PK
View Code? Open in Web Editor NEWHasura's own GitHub bot :robot:
Home Page: https://hasura-github-bot.vercel.app
License: MIT License
Hasura's own GitHub bot :robot:
Home Page: https://hasura-github-bot.vercel.app
License: MIT License
@shahidhk Is this repo is the code of the famous Hasura bot?
https://github.com/hasura-bot
When one of the pull requests got opened, then our github bot failed to request for a shadow PR recently. After inspecting the particular event, we discovered two things that we should be fixing here:
null
body in the JSON webhook payload. But we seem to miss a null check here and it fails with the following error:received pull request event: 86444960-0101-11ec-87d3-da8bfea710bd
Error occured in "pull_request handler: TypeError: Cannot read property 'startsWith' of null
at /var/task/pull_request.js:38:17
at /var/task/node_modules/@octokit/webhooks/event-handler/receive.js:45:14
at async Promise.all (index 0)"
2021-08-19T16:46:49.418Z cff2e006-2b76-46cc-918a-1fbedd9d0ed9 ERROR ERROR: Error: Webhook handler error
at /var/task/node_modules/@octokit/webhooks/event-handler/receive.js:58:19 {
errors: [
TypeError: Cannot read property 'startsWith' of null
at /var/task/pull_request.js:38:17
at /var/task/node_modules/@octokit/webhooks/event-handler/receive.js:45:14
at async Promise.all (index 0) {
event: [Object]
}
]
}
2021-08-19T17:19:35.405Z b635adfc-b4eb-46b5-b835-5141b19a08ec WARN Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`.
at RequestError.code (/var/task/node_modules/@octokit/request-error/dist-node/index.js:29:17)
at /var/task/pull_request.js:56:13
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Promise.all (index 0)
This piece of code is not being used anymore: https://github.com/hasura/github-bot/blob/master/webhooks.js#L52-L64
So it is safe to remove it.
For local development, we will need to set these envs and use the vercel dev
command. After that use ngrok to port forward and setup GitHub webhook settings.
We should add a linter (probably eslint) and CI to run on every pull request to avoid errors like 087e86e
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.