Giter Club home page Giter Club logo

github-bot's Introduction

GitHub Bot

Redwood's GitHub bot.

Usage

Although this repo is named github-bot, it has a script that you can run locally to validate all of redwoodjs/redwood's open issues and pull requests:

yarn validate

You'll need to a personal-access token (PAT—provision one here) set to GITHUB_TOKEN in your env with the appropriate permissions to run this.

validate.mov

The github.ts function does as much as it can to process issues and pull requests as they're opened, and responds to all the events it can to keep them in sync. But there's just some events—like an issue being linked to a pull request—that it can't listen to. And even if it could listen to everything, things will still get out of sync anyway.

That's where this script comes in: it'll sort out most of the inconsistencies on its own, and will prompt you to handle issues or pull requests that require your attention (because they're unprioritized or stale).

Architecture

This repo is basically just a backend right now. It makes heavy use of Redwood's services.

All the logic for processing a webhook is in github.ts. That function mostly contains routing logic—it calls out to the services as much as it can.

Contributing

Contributing to this is a bit tricky. To test your changes, you have to fork this repo, make a GitHub app, and install it on one of your repos.

github-bot's People

Contributors

jtoar avatar redwoodjsbot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

simoncrypta

github-bot's Issues

[Tracking issue]: some next steps

  • look into use of Promise.all and Promise.allSettled
  • #71
  • #70
  • #66
  • fix logger cluttering github.test.ts
  • improve use of TS
  • improve visual output of validate (specifically, add loading spinner); and it seems like exec doesn't wait on async functions
  • [Bug?]: it seems like you can't expect functions to throw in jest a62bb07
  • clean up scripts
  • fix Jun 26 02:47:07 PM 05:47:07 🚨 Function "" was not found. in render deploy logs
  • documentation
  • reconsider process.env.OWNER and process.env.REPO
  • how does it handle other repos?
  • consider using a queue for validate https://ryanchenkie.com/blog/how-to-use-queues-with-redwoodjs
  • #64
  • reconsider convention around error naming
  • maybe validations shouldn't be linear?
  • add noire munich
  • update graphql to ProjectV2 https://github.blog/changelog/2022-06-23-the-new-github-issues-june-23rd-update/#%F0%9F%A4%96-graphql-api-improvements
  • previous cycle error needs to handle draft issues; the logs were truncated (on render)
  • logging in handleContentLabeled now showing up way later (but I suppose that's to be expected)
  • more could be and needs to be done for triage—maybe a custom UI?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update octokit monorepo (@octokit/webhooks-types, octokit)
  • chore(deps): update octokit monorepo (major) (@octokit/webhooks-types, octokit)
  • fix(deps): update dependency msw to v1
  • fix(deps): update react monorepo to v18 (major) (react, react-dom)
  • fix(deps): update redwood monorepo to v5 (major) (@redwoodjs/api, @redwoodjs/api-server, @redwoodjs/core, @redwoodjs/forms, @redwoodjs/graphql-server, @redwoodjs/router, @redwoodjs/web)
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • redwoodjs/project-ci-action v0.1.1
npm
api/package.json
  • @redwoodjs/api 3.2.0
  • @redwoodjs/api-server 3.2.0
  • @redwoodjs/graphql-server 3.2.0
  • @snaplet/copycat 0.5.1
  • msw 0.47.4
  • octokit 2.0.9
  • smee-client 1.2.3
  • @octokit/webhooks-types 6.7.0
package.json
  • @redwoodjs/core 3.2.0
  • chalk 4.1.2
  • clipanion 3.2.0-rc.13
  • date-fns 2.29.3
  • node-fetch 2.6.7
  • node >=14.17 <=16.x
  • yarn 3.2.4
web/package.json
  • @redwoodjs/forms 3.2.0
  • @redwoodjs/router 3.2.0
  • @redwoodjs/web 3.2.0
  • prop-types 15.8.1
  • react 17.0.2
  • react-dom 17.0.2
nvm
.nvmrc

  • Check this box to trigger a request for Renovate to run again on this repository

Some improvements we can make

While we're using the bot to see what hiccups it has / what features we want, here are some immediate next steps:

  • integrate with slack for monitoring
  • write tests!
  • -> PR linked to issue -> issue comes off board
  • use RedwoodJS's api side
  • type more things, probably via comments (autocomplete is a godsend here)
  • try converting more stuff to graphql to see if it makes a difference
    • in particular, every github resource has a globally unique node_id. it feels like we should be able to cache milestones node_ids somehow so we don't have to go fetch it everytime

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.