Giter VIP home page Giter VIP logo

geet's Introduction

Build Status

Geet

Command line interface for performing Git hosting service operations.

This tool is a provider-independent version of Hub and Lab.

Development status/plan

The current focus is implementing Gitlab functionalities (0.3.x series).

Everything is tracked in detail via issues and milestones.

Operation/providers support

The functionalities currently supported are:

  • Github/Gitlab:
    • create label
    • list issues, labels, milestones, MR/PRs
    • merge MR/PR
    • open repository
  • Github:
    • comment PR
    • create gist, issue, milestone, PR

Samples

Prerequisite(s)

Geet requires the API token environment variable to be set, eg:

export GITHUB_API_TOKEN=0123456789abcdef0123456789abcdef    # for GitHub
export GITLAB_API_TOKEN=0123456789abcd-ef0-1                # for GitLab

All the commands need to be run from the git repository.

Create an issue (with label and assignees)

Basic creation of an issue:

$ geet issue create

The default editor will be used for title/description:

Issue creation editing screenshot

Labels, milestone and assignees will be asked with menu selection:

Please select the label(s): (Use arrow keys, press Space to select and Enter to finish, and alphanumeric/underscore characters to filter)
‣ ⬡ bug
  ⬡ enhancement
  ⬡ not_an_issue
  ⬡ requires_design

Labels, milestone and assignees can be directly specified with the respective parameters:

$ geet issue create --labels bug,wip --assignees johncarmark --milestone 1.0

After creation, the issue page will be automatically opened in the default browser.

Create a PR (with label, reviewers, and assigned to self)

Basic creation of a PR:

$ geet pr create

The default editor will be used for title/description:

Issue creation editing screenshot

More advanced PR creation, with label and reviewers, assigned to self:

$ geet pr create --labels "code review" --reviewers kevin,tom,adrian

After creation, the issue page will be automatically opened in the default browser.

List issues/PRs

List the open issues, in default order (inverse creation date):

$ geet issue list
> 16. Implement issue opening (https://github.com/saveriomiroddi/geet/issues/16)
> 14. Update README (https://github.com/saveriomiroddi/geet/issues/14)
> 8. Implement milestones listing/show (https://github.com/saveriomiroddi/geet/issues/8)
> 4. Allow writing description in an editor (https://github.com/saveriomiroddi/geet/issues/4)
> 2. Support opening PR into other repositories (https://github.com/saveriomiroddi/geet/issues/2)

List the open PRs, in default order (inverse creation date):

$ geet pr list
> 21. Add PRs listing support (https://github.com/saveriomiroddi/geet/pull/21)

List milestones

$ geet milestone list
> 9. 0.2.0
>   4. Allow writing description in an editor (https://github.com/saveriomiroddi/geet/issues/4)
> 6. 0.2.1
>   69. Display warning when some operations are performed on a forked repository (https://github.com/saveriomiroddi/geet/issues/69)
>   60. Update Create PR test suite; the UTs are not inspecting some of the changes (https://github.com/saveriomiroddi/geet/issues/60)
>   51. Services should take repository in the initializer (https://github.com/saveriomiroddi/geet/issues/51)
> 7. 0.2.2
>   43. PR Merging: upstream support (https://github.com/saveriomiroddi/geet/issues/43)
>   35. Improve design of repository-independent actions (https://github.com/saveriomiroddi/geet/issues/35)

List labels

$ geet label list
> - bug (#ee0701)
> - enhancement (#84b6eb)
> - technical_debt (#ee0701)
> - top_priority (#d93f0b)

Create a gist

Create a private gist:

$ geet gist create /path/to/myfile

Create a public gist, with description:

$ geet gist create --public /path/to/myfile 'Gist description'

Using menus for options selection

Menus can be used for selecting attributes (labels, collaborators, milestones...).

This is an example of multiple choice selection:

Please select the label(s): (Use arrow keys, press Space to select and Enter to finish, and alphanumeric/underscore characters to filter)
‣ ⬡ bug
  ⬡ enhancement
  ⬡ not_an_issue
  ⬡ requires_design

Typing alphanumeric keys and underscore will enable filtering:

Please select the label(s): (Filter: "b")
‣ ⬡ bug
  ⬡ technical_debt

When a filter is active, use Backspace to cancel the last character, and Canc to reset it.

Help

Display the help:

$ geet [command [subcommand]] --help

Examples:

$ geet --help
$ geet pr --help
$ geet pr create --help

geet's People

Contributors

64kramsystem avatar

Stargazers

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

Watchers

 avatar  avatar

geet's Issues

Refactor Repository/ApiHelper

ApiHelper took over concepts that should belong to the repository, e.g. links.

Likely, a refactoring would be:

  • move those methods into the repository
  • encapsulate the api helper inside the repository
  • only move the repository around

Update Create PR test suite; the UTs are not inspecting some of the changes

There are currently two omissions in the VCR testing, at least, in the default configuration.

No expectation about what is sent and what not

The VCR gem replays responses to known requests, and raises an error on unknown requests, but doesn't verify that the expected requests are sent.

It needs to be made sure that the requests sent after creating the PR in the test suite, are really sent.

The body is not checked

The body is not sent. For example, if the service instance doesn't stub GitClient#current_branch:

described_class.new(upstream_repository) #, git_client: git_client)

the body sent will be:

{"title":"Title","body":"Description","head":"<developer_branch>","base":"master"}

different from the expected:

{"title":"Title","body":"Description","head":"mybranch1","base":"master"}

and the UT will still pass.

Implement issues listing (base)

The base will list all the open issues assigned to the currently logged in user, ordered by newest one (this is the standard github display).

In the future, other options will be designed, in particular:

  • filters
  • custom formatters
  • etc.etc.

Improve Gemfile

  • the dependencies should be defined in the gemspec, and the Gemfile should have a reference to it
  • the Gemfile.lock file should be taken out of the repository

Review merge AbstractIssue.list with Issue.list

The API path is the same; Issue#list can therefore be removed, but it must be checked what's the GitLab API.

  • remove code duplication
  • when GitLab PR listing is implemented, decide if Issue.list must be kept or not.

Add test suites

Add tests suites:

  • Research stubbing of external services
  • Add test suites
    • list labels
    • list issues
    • list prs
    • create gist
    • create pr
    • list issues (upstream)
    • list prs (upstream)
    • create issue
    • merge pr

Issue/PR creation fails when milestone+upstream is set

Command: geet {issue,pr} create -m- -u

Stacktrace:

Finding milestone...
lib/geet/utils/manual_list_selection.rb:17:in `select': No milestone provided! (RuntimeError)
  from lib/geet/services/create_issue.rb:136:in `select_entries'
  from lib/geet/services/create_issue.rb:34:in `execute'
  from bin/geet:30:in `launch'

Review tty-prompt

Check if implement (none) entry is usable for lists (no) selection.

Don't autoopen browser

Disable browser autoopen, and make it configurable.

Think about output (stderr/stdout). Will need:

  • an extra output, for the errors
  • a review of all the missed stderr instances
  • likely redirection options to execute_command

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.