Giter Club home page Giter Club logo

github-bot's People

Contributors

coco98 avatar hgiasac avatar imperfect-fourth avatar polrk avatar rajoshighosh avatar robertjdominguez avatar scriptnull avatar shahidhk avatar shark-h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-bot's Issues

add linter

We should add a linter (probably eslint) and CI to run on every pull request to avoid errors like 087e86e

add null check for pull request body

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:

  1. This case happened because the pull request was opened with an empty description. This leads GitHub to send a 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]
    }
  ]
}
  1. We also noticed another deprecation notice which we could also be fixed here
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.