GithubHelp home page GithubHelp logo

cp8_cli's Introduction

CP8 Cli

CP8 is a command line tool which aids in interacting with Github.

CP8 helps you open draft pull requests, suggests branch names and opens your CI for a branch.

Installation

gem install cp8_cli

Usage

cp8 help

License

The gem is available as open source under the terms of the MIT License.

cp8_cli's People

Contributors

balvig avatar benhowes avatar bitdivision avatar davidstosik avatar mshka avatar robertomiranda avatar sogamoso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cp8_cli's Issues

Archive this project?

Yes, it is with a heavy feeling of history coming to an end that I ask this question ๐Ÿ˜…, but I have been playing around with the GitHub CLI recently and found that it can actually now do most of what cp8_cli does, ie:

cp8 open โ†’ gh pr view --web
cp8 ci โ†’ gh pr checks

The one "killer feature" missing was cp8 start, but I have ported the code as an extension to gh that does the same, ie:

gh extension install https://github.com/balvig/gh-start
gh start "my new story"

I have been using gh-start for the past few weeks and found that it is now only muscle memory that might prompt me to reach for cp8 instead. ๐Ÿ˜…

I don't yet have a replacement for cp8 suggest but am thinking of adding it as an extension as well.

So...if anyone still uses this ๐Ÿ˜† what do you think?

Simplify token input

Github's Hub can fetch a token after prompting the user for username and password.

$ hub api
github.com username: davidstosik
github.com password for davidstosik (never stored): 
two-factor authentication code: 
# ...

$ cat ~/.config/hub
github.com:
- user: davidstosik
  oauth_token: CENSORED
  protocol: https

Would be nice to have something similar, or maybe we could make direct use of the hub command?

Error message when Github token is invalid

When the Github token becomes invalid, the output is not very useful and doesn't tell you what you need to do. It would be nice to improve that.

Context

I just tried to run cp8 start ... and got an error that required me to look into the source code to find out where the Github token was is stored so that I could update it.

cp8 start https://github.com/cookpad/...issues/2852
Traceback (most recent call last):
	...
/.../ruby/gems/2.6.0/gems/octokit-4.14.0/lib/octokit/response/raise_error.rb:16:in `on_complete': GET https://api.github.com/repos/cookpad/.../issues/2852: 401 - Bad credentials // See: https://developer.github.com/v3 (Octokit::Unauthorized)

Proposed solution

Rescue from the error that's being raised (if any) or read the response status code and show an error message such as: "Your Github token is no longer valid, please generate a new one in https://github.com/settings/tokens and update it in ~/.trello_flow" or something along those lines.

Error when trying to create commit

This is the output I got when running: cp8 start https://github.com/cookpad/global-web/issues/7601

git commit --allow-empty -m"NoMethodError: undefined method `include?' for nil:NilClass"
sh: -c: line 0: unexpected EOF while looking for matching ``'
sh: -c: line 1: syntax error: unexpected end of file
Error running: git commit --allow-empty -m"NoMethodError: undefined method `include?' for nil:NilClass"

Branches prefix has high collision rate and make branches difficult to find

At the moment, cp8 generates branches prefixed with authors initials. This is problematic, because collisions with someone else in the same repository are likely.

On a related note, why is user name prefix used in the first place? It discourages collaboration (branch is "owned") and makes older branches difficult to find (do you always know who opened it?).

Alternative suggestions:

  1. <ticket number>_<summary>: Does it even need to be nested under anything? The type is irrelevant when looking for a branch name. People usually know the ticket number.
  2. feature/<ticket number>_<summary>: GitFlow approach.
  3. <ticket number>_<ticket type>_<summary>: If a ticket type is a must have. This will at least list branches by number.
  4. <github user name>/<ticket number>_<ticket type>_<summary>: No collisions, ordered by ticket number rather than type.

`cp8 open` doesn't open the right Pull Request

With the new version that uses branch names like pb/foo-bar, when I type cp8 open it apparently opens the most recent PR in the repository, instead of the PR associated with that branch

Optional disable feature for PR opening under open command

Sometimes just for investigation or doing some experimental I opening a branch for myself, but I don't want to merge it, or not yet. Because it I don't really like the feature which open a PR immediately with cp8 open, I prefer much more to create the PR only under cp8 submit command. I had some empty PR because it.

What do you think, could we create an env variable to disable this feature?

The cp8 help command saying the same logic:

  cp8 start [URL|TITLE]  # Picks up existing issue/creates new ad hoc story and checks out branch
  cp8 submit             # Pushes branch to GitHub and opens PR

Trollop has been deprecated and replaced by Optimist

FYI: I got this message when installing cp8_cli

Fetching: trollop-2.9.9.gem (100%)
!    The 'trollop' gem has been deprecated and has been replaced by 'optimist'.
!    See: https://rubygems.org/gems/optimist
!    And: https://github.com/ManageIQ/optimist

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.