Giter Club home page Giter Club logo

get-issues's Introduction

pippinlee.com

get-issues's People

Contributors

mikemimik avatar pippinlee avatar raymond-h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

get-issues's Issues

Use github4 instead of request for public isssues

Instead of making http request via request module, we should make use the github4 module for all requests to github.

Currently the getIssues function uses the request module -- since we're switching over github4 module for all other requests, we should do the same for non-auth required requests to github.

Handle Github API limits for projects with high request volume

We should be aware of the problem of running get-issues for a public repo that doesn't require auth. Although it is likely our most common use case by a long shot Github's non-authed API has a rate limit that pretty easy to hit:

  • if a public repo has 100s of open issues and issue comments this will likely hit the rate limit
  • if a user is running get-issues on many projects they'll hit Github's rate limit

There are a few solutions to this:

  • we could make get-issues always require auth, even for public repos. This is a sound choice, but means we add one extra barrier to people getting their issues. The majority of use will be through smallish public repos, so have get-issues be a one step command would be important, for our most common use case
  • we could add logic that checks the api requests left, and if the rate limit will be hit before all issues have been downloaded locally, we can ask for auth. This would avoid us stopping the downloading of issues locally and asking for user auth which could get messy when keeping with state of issues downloaded.

TLDR: This likely isn't a big issue because most use of get-issues is for <100 issue projects that are public, bit it's something we may hear about. Least work path: we just suggest people fake switch IP's to get around rate-limiting.

forward slashes in filenames from issue titles cause write fails

Forward slashes in issues titles (which are then used as filenames for each issue) are causing failed writes.

Ex: add support for websockets / tcp.md

Two apparent options: figure out way to escape / characters, or take them out of filenames.

fs module already uses path.join so don't need to worry about platform compatibility for this specific issue.

Handle closed issues

This isn't immediately important but we should consider deleting old issues that are closed. Or, simpler, we could re-write the /issues dir everytime get-issues is run, which would then represent the CURRENT state of open issues for that repo.

Version 2.0 flow & user auth

@mikemimik let's use this as a guideline for async.waterfall flow. Let me know if flow doesn't make sense. I'll also use this as a guideline to make tests.

Initial

  • add “issues/“ to .gitignore if not already there
  • is ./issues created if it doesn’t exist
  • is remote URL found for repository

If Public repo

  • doesn’t need to ask for auth
  • successfully gets all open issues from github
  • successfully gets all comments in open issues
  • successfully console.log's all issue titles and saves each issue to ./issues

If Private repo

  • check if ~/.config/get-issues/setup.json and auth token exist
  • if no token locally, create one by prompting for user/pass
  • after creation, is auth token saved locally to ~/.config/get-issues/setup.json on Mac
  • after creation, is auth token saved locally to SOME/WINDOWNS/PATH on Windows
  • if token exists, read token and use for auth
  • use auth with github api to get all open issues and comments
  • console.log's all issue titles and save each issue to ./issues

If private repo and 2FA required

  • check if ~/.config/get-issues/setup.json and auth token exist
  • if no token locally, create one by prompting for user/pass, will also need to get user's auth code via sms
  • write newly created token locally
  • along with Basic Auth send header with user's auth code in X-GitHub-OTP header to Github
  • console.log's all issue titles and save each issue to ./issues

add support for private repos

For this first release get-issues only works for request to public URLs.

Ideally we could use github auth to allow use of ssh keys so that folks don't need to set user/pass for every repo they want issues from.

Deal with no issues logic

If no open issues exist we should tell the user explicitly.

Currently we don't return console.log anything except the fancy ascii logo if no issues are found.

blah impsum

thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf thing sldkfjslkj sljflsjf lsj fdljslfd ls jfl slf

slkdf sldjfls f sf

falksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls ffalksjf lejflfnlajflnalnf lanfnaflalnflnfalnflnalsnfnnfksf flk sl fls fl lds fls f

ES6-ify all the things

For code consistency we should ES6-ify all the code. Most folks are running node 4+ so this shouldn't be a problem.

Add CI

Adding Travis integration will help with future PRs. This will be part of adding tests.

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.