Code Monkey home page Code Monkey logo

gh-canary's People

Contributors

andreybelym avatar dependabot[bot] avatar wentwrong avatar

Watchers

 avatar

Forkers

andreybelym

gh-canary's Issues

Github webhooks

We might add Github OAuth for safe user authorization (and webhook creation for repos selected by him). Do we need it at this moment?

Add GH authentication

Main functionality feature of our application should be maintainers notification through comments (user mention) on non-collaborator pull requests. For that purpose, at first, we need authenticate our comment-bot on Github.

My suggestions:

  • Authentication by personal access token set via .env variables;
  • New bot account?

Dividing frontend from backend

For now, useful content delivers to user via server-side rendering. I propose to split into client side logic (fetch data and render) and server-side REST-service.

Proposed improvements

  • Use webpack for bundling client-side .js/.css/etc (and injecting .js to .html via HtmlWebpackPlugin)
  • Use fetch on client-side for requesting data from server;
  • From server side, process data and return as JSON;

Improve error handling on the client side

  1. Use the debug module in client scripts.
  2. Add the unhandledrejection and error event handlers to the window object.

Notes:

  • Ideally, we should inform the server if something goes wrong on the client.
  • I will give you 1000 ⭐️ if you manage to separate the client error handling script from the other scripts and be able to inform the server about syntax errors in your client scripts.

Replace custom mocking mechanism with `nock` module

Currently, mock-data is retrieved manually and for tests we are using two services: one for actual App and another for mock github API endpoints.

Using Nock module can be quite useful:

  • fixtures-fetching can be automated;
  • no need for additional routing;
  • no need for dedicated App which host mock third-party API.

Thus, I think that using this module should lead to simplicity of code.

Templates on the client

As mentioned in the pull request #30, our template system on the client is far from perfect and can certainly be improved.

Use app.static to serve the page

We can move our page to a dedicate directory (e.g. resources/html) and use app.static to allow Express optimizing requests to it.

Use ES6 imports and TypeScript

Let's add TypeScript to our project and use import/export instead of require/module.exports.

I don't insist that you should transform all your JS files to TS files right now. Just try setting allowJS: true & checkJs: false and compile your JS files without type checking.

Some other hints about the initial configuration:
esModuleInterop: true
target: es2018

Note: we can use TypeScript for client scripts too, and enable the built-in SystemJS bundling.

Dynamically update the pull requests list via polling

We should be able to update user statuses on the fly. Let's do it via polling as the first attempt. We can introduce a config option (e.g. POLLING_INTERVAL) and constantly query our API. We also have to write a functional (e2e) test to cover this functionality.

MVP Prototype

Let's build a prototype that will be given via .env files or env variables:

  • a repo slug (organization name + / + repo name)
  • a list of comma-separated GitHub nicknames of repo maintainers
    should display:
  • a list of Pull Requests created by non-maintainers in the given repository

No fancy UI is required, you can use regular HTML tables to display the data.

Final tasks

  • Allow gathering PRs from a list of repositories
  • Add a text area and a submit button to allow batch commenting to selected PRs
  • Add checkboxes to PR descriptions to allow comment selectively.

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.