Code Monkey home page Code Monkey logo

sprintly-github's Introduction

#Sprintly-GitHub

Sprint.ly is a great tool for managing work items; GitHub is a great tool for managing your code. The tools in this repository will help you take advantage of the integration with GitHub that Sprint.ly offers without drawing your attention away from the terminal. Use the sprintly command line tool to get a list of all items assigned to you. Install the commit-msg hook to facilitate Sprint.ly's GitHub integration.

#How to use sprintly

Usage: sprintly [options]

By default, your sprintly items will be shown.

Options:
  -h, --help        show this help message and exit
  --install         install this tool
  --update          update this tool
  --install-hook    install commit-msg hook in current directory (must be a
					git repository)
  --uninstall-hook  uninstall commit-msg hook in current directory (must be a
					git repository)
  --update-config   edit configuration

#Installing sprintly

The sprintly tool can now install itself. Follow the instructions below to get started:

Install with Curl

# download the latest version of the tool
curl -L -O https://raw.githubusercontent.com/sprintly/Sprintly-GitHub/master/sprintly

# install
sudo python sprintly --install

# clean up
rm sprintly

Install with Git

# download the latest version of the tool
git clone https://github.com/sprintly/Sprintly-GitHub.git

# change to the repo directory
cd Sprintly-GitHub

# install
sudo python sprintly --install

# clean up
cd ../
sudo rm -R Sprintly-Github

Once the installation is complete, run sprintly from any directory to get started. If you have never used the tool before, it will walk you through adding your Sprint.ly credentials:

$ sprintly
Creating config...
Enter sprint.ly username (email): [email protected]
Enter sprint.ly API Key: 3536bae19bacd16831fb5100b13e34d2
Enter default sprint.ly product id (117 - Company, 129 - Secret): 117
Configuration successfully created.

Note: (1) details on how to find your Sprint.ly API Key can be found here. (2) you will only be asked to enter a sprint.ly product id if you have more than one product.

To update sprintly, type sudo sprintly --update. When updating, you will see a warning:

$ sudo sprintly --update
Downloading latest version of sprintly tool from GitHub...
A file already exists at /usr/local/bin/sprintly. Overwrite file?

Entering y will overwrite the old installation with the latest version. Note: if you have another tool installed at /usr/local/bin/sprintly, enter n and manually install it under a different name.

#GitHub Integration: Installing the commit-msg hook.

The sprintly tool can install the hook for you. Navigate to a git repository and run:

$ sprintly --install-hook
Creating symlink...
Hook was installed at <repository>/.git/hooks/commit-msg

Important: you MUST install this manually in every git repository. This is a limitation of the way git implements hooks. Don't blame me!

Tip: make sure that your git user.email matches your Sprint.ly username, or the hook won't work. If this happens, you will see the following message:

$ sprintly --install-hook
Creating symlink...
Hook was installed at <repository>/.git/hooks/commit-msg
WARNING: Your git email ([email protected]) does not match your sprint.ly username ([email protected])
WARNING: Don't worry - there is an easy fix. Simply run one of the following:
	'git config --global user.email [email protected]' (all repos)
	'git config user.email [email protected]' (this repo only)

Note: the hook installed is actually a symbolic link to a shared copy of the hook found at /usr/local/share/sprintly/commit-msg. By doing this, the hook can be easily updated for all users and all repositories by calling sprintly --update.

###Uninstalling the commit-msg hook.

The sprintly tool can uninstall the hook for you as well. Navigate to the git repository in question and run:

$ sprintly --uninstall-hook
Hook has been uninstalled.

#Changing the Configuration

If, at some point, you wish to change your configuration (you get a new username, API key, or wish to change the default product), type sprintly --update-config. Pro tip: you don't have to re-type everything just to change your API Key. Simply press enter to keep the old version of any individual item:

$ sprintly --update-config
Updating config... Press enter to accept default value shown in brackets.
Enter sprint.ly username (email) [[email protected]]:
Enter sprint.ly API Key [3536bae19bacd16831fb5100b13e34d2]: 5c11931f26b4c5f6a435983d1a734839
Enter default sprint.ly product id (117 - Company, 129 - Secret):
Configuration successfully updated.

#Sample Output

Let's run through a few examples of how to take advantage of this tool.

Type sprintly at a command prompt to see a list of your current Sprint.ly items:

Product: Example Company (https://sprint.ly/product/#/)
	#1: As a developer, I want to open source our Sprintly-Github tools so that...
		#5: Publish it.
		#4: Write README
	#2: As a developer, I want a better set of unit tests so that changes to our...
		#3: Add tests to widget creation page

With the commit-msg hook installed, whenever a commit is made and pushed, a comment will be automatically published on the corresponding Sprint.ly item. Head to Sprint.ly for more details.

$ git commit -m "Normal commit message here."
Product: Example Company (https://sprint.ly/product/#/)
		#1: As a developer, I want to open source our Sprintly-Github tools so that...
			#5: Publish it.
			#4: Write README
		#2: As a developer, I want a better set of unit tests so that changes to our...
			#3: Add tests to widget creation page
#0 - Proceed without Sprint.ly item number.
Enter 1 or more item numbers separated by a space: 4
[master 1e71283] References #4. Normal commit message here.
 1 files changed, 1 insertions(+), 1 deletions(-)

To save time, include an item number at the beginning of your commit to automatically reference that item. You won't be prompted to select an item number if you go this route:

$ git commit -m "#42 Adding README"
[master 555a912] References #42 Adding README
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README

Or include Sprint.ly keywords followed by an item number anywhere in your message. Again, you won't be prompted to select an item number if you go this route:

$ git commit -m "Adding some samples. Closes #42. Refs #54."
[master bfb7a8b] Adding some samples. Closes #42. Refs #54.
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 sample

sprintly-github's People

Contributors

guildencrantz avatar impressiver avatar justinabrahms avatar markstos avatar nicholasserra avatar rngadam avatar robludwig avatar sgricci avatar wb avatar

Stargazers

 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

Watchers

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

sprintly-github's Issues

Closing #n can result in merged pull request

Seems as though there are some collisions between github's reference system and sprintly's. Today someone closed sprintly item #104 and inadvertently merged a pull request into master.

wish: move "references" to end up commit message, make it more compact

After using this tool and scanning our commit messages, they all now start with "References #..., " etc. Especially on a mobile device where only the first bit may be visible, this is far less useful then seeing the commit message instead. When two or three tickets are referenced, this becomes particularly unwieldy. I'd prefer an alternate syntax instead:

Here's my commit message. ( ref #X, ref #y )

This could possibly implemented with a format string in the configuration that allows people to choose how they want to the formatting to work.

Invalid Credentials

Getting an issue when running:

sprintly --install-hook

I get this output each time ( replaced private data with *** ):

Creating config...
Enter Sprint.ly username (email): [email protected]
Enter Sprint.ly API Key: ********************************
ERROR:__main__:Fatal Error: 'Invalid credentials. Unable to authenticate with Sprint.ly.'
Traceback (most recent call last):
  File "/usr/local/bin/sprintly", line 122, in run
    self.initialize()
  File "/usr/local/bin/sprintly", line 221, in initialize
    self.createSprintlyConfig()
  File "/usr/local/bin/sprintly", line 282, in createSprintlyConfig
    raise SprintlyException('Invalid credentials. Unable to authenticate with Sprint.ly.')
SprintlyException: 'Invalid credentials. Unable to authenticate with Sprint.ly.'
Program exiting.

However, when I do the API call via Curl, it works fine each time:

curl -u [email protected]:******************************** https://sprint.ly/api/user/whoami.json

Correctly returns:

{"first_name":"Peter","last_name":"Schmalfeldt","created_at":"2012-08-18T05:34:30+00:00","email":"[email protected]","last_login":"2012-11-19T17:06:23+00:00","id":****}#

Using latest from Repo with Python 2.7 on CentOS 5.5 server. Tried running as different users, and went through the install process with each ( even sudo ). Also added git config email to match my sprintly account incase there was some weird handshake thing happening on their end... but no luck.

Any ideas?

multiple sprint.ly products on one machine

Great product!

One small question - if I have two products I'm coding on the same machine, is there any way to associate a specific sprintly product with a specific git repo? I just installed hook on another project but when I run sprintly inside that directory, I get all the items for my other main product.

Thanks!

KeyError: u'someday'

Hello. I just installed the tool and am running into this issue:

~/Downloads ❯❯❯ sudo python sprintly --install
Downloading latest version of sprintly from GitHub...
Successfully installed sprintly to /usr/local/bin/sprintly
Downloading latest version of commit-msg hook from GitHub...
Hook was updated at /usr/local/share/sprintly/commit-msg

That's all! Type 'sprintly' and hit enter to get started.

~/Downloads ❯❯❯ sprintly
Creating config...
Enter Sprint.ly username (email): aaron@*******.com
Enter Sprint.ly API Key: *************
Configuration successfully created.
ERROR:__main__:Fatal Error: u'someday'
Traceback (most recent call last):
  File "/usr/local/bin/sprintly", line 142, in run
    self.listSprintlyItems()
  File "/usr/local/bin/sprintly", line 376, in listSprintlyItems
    self.printList(products)
  File "/usr/local/bin/sprintly", line 392, in printList
    if not product['id'] in statusTree[item['status']]:
KeyError: u'someday'
Program exiting.

missing .git/hooks directory gives misleading error

I have a git repository and I run the following command from the root of that repo:

sprintly --install-hook

Error:

ERROR:__main__:Fatal Error: 'This command can only be run from the root of a git repository.'
Traceback (most recent call last):
  File "/usr/local/bin/sprintly", line 136, in run
    self.installHook()
  File "/usr/local/bin/sprintly", line 590, in installHook
    raise SprintlyException('This command can only be run from the root of a git repository.')
SprintlyException: 'This command can only be run from the root of a git repository.'
Program exiting.

Investigating the code, it is looking for .git/hooks to exist as evidence of a git root repo. For whatever reason, I did not have this directory. Once I created it, the command worked fine.

Warning: unable to get items for '****'

Hi there. I'm bumping into an issue with the tool. I've checked and rechecked my credentials but it seems that the tool is having trouble fetching details from sprint.ly. Is there a verbose output flag for the tool? Thanks.

$ sprintly 
Creating config...
Enter Sprint.ly username (email): michael@****.com
Enter Sprint.ly API Key: *****
Enter default Sprint.ly product id (9167 - *****, 10210 - *****): 9167
Configuration successfully created.
Warning: unable to get items for '***' (https://sprint.ly/product/9167/)
$ sprintly
Warning: unable to get items for '***' (https://sprint.ly/product/9167/)

issue using sprintly-github with boxen

I had the sprintly commit hook working fine for our project, but then after formatting my laptop and using boxen to configure things, the commit hook just stopped working. I can see the sprintly tasks fine, but when I pick a number, it just fails with the following message:
#0 - Proceed without Sprint.ly item number.

Enter 1 or more item numbers separated by a space: 39

Traceback (most recent call last):
File ".git/hooks/commit-msg.original", line 143, in
sys.exit(subprocess.call([original_commit_msg, sys.argv[1]]))
File "/opt/boxen/homebrew/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/opt/boxen/homebrew/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/opt/boxen/homebrew/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1223, in _execute_child
self.pid = os.fork()
OSError: [Errno 35] Resource temporarily unavailable

I'm not sure if you're still supporting this, but I'd love some help as I really depend on this for the work we're doing. any ideas? Am I just missing something obvious? I've searched endlessly on google and haven't found any solid leads, though I've done a lot of brew doctor and brew unlinking and relinking to try...

when i run: which python, i get this: /opt/boxen/homebrew/bin/python

Thanks and thank you for the tool!

Checking out using github's application stops you from running --install-hook

Not sure how fixable this issue is, but some of our team originally checked out our repo using the github app -- When trying to run sprintly --install-hook, they get a message that says the hook can only be installed in a git repo.... even though it is a git repo.

Removing the .git/ folder and re checking out via the terminal fixes this problem, but obviously not the best.

Thanks

Root repository denied to install github hook

    sprintly --install-hook
    ERROR:__main__:Fatal Error: 'This command can only be run from the root of a git repository.'
    Traceback (most recent call last):
      File "/usr/local/bin/sprintly", line 136, in run
        self.installHook()
      File "/usr/local/bin/sprintly", line 590, in installHook
        raise SprintlyException('This command can only be run from the root of a git repository.')
    SprintlyException: 'This command can only be run from the root of a git repository.'
    Program exiting.

I'm in the repo's root dir. This error is being generated. Would like to use the hook but don't know how to go forward.

OSError: [Errno 35] Resource temporarily unavailable

I installed Sprintly-Github on my mac, installed the hook in my local project, can get the list of tasks/bugs/stories, but when I commit and select an item number to attach, I then get this error. This has happened to me before and I honestly can't remember what fixed it. I'm wondering if it's a permissions thing? I did install sprintly-github as sudo and i have brew python in addition to system python.

any ideas?

Traceback (most recent call last):
  File ".git/hooks/commit-msg.original", line 143, in <module>
    sys.exit(subprocess.call([original_commit_msg, sys.argv[1]]))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1231, in _execute_child
    self.pid = os.fork()
OSError: [Errno 35] Resource temporarily unavailable

wish: support for "fixes" and "re-open".

Besides referencing tickets, Sprint.ly also supports fixing and re-opening issues via commit message as well.

It would be nice for this tool to support that. Perhaps instead of entering raw ticket numbers from a list, you could also F15, as way to indicate "fixes #15" and O15 to indicate "open #15". A bare "15" would still indicate "references #15".

Enter 1 or more item numbers separated by a space -> fails

Hey. I haven't used the sprintly hook for a while (there was an OS update in between also). As I started to use it again I get an error when I'm trying to commit stuff. Just typing 'sprintly' works fine and I get the list of issues. But when I try to insert a number it fails.
Anyone an idea? Unfortunately I have no knowledge about Python and the task which are going on in the background. So I re-install sprintly and the hook but nothing different happens.

git commit -a -m 'test commit'
Backlog
Product: track-n-trace.it (https://sprint.ly/product/20##2/)
#63: Check process through registration
#15: As a bootstrap framework, I want a unify theme so that I will look better.

In Progress
Product: track-n-trace.it (https://sprint.ly/product/20##2/)
#68: Setup Test
#44: As an admin I like to add an IMEI to an User Account
#43: As a user, I want to see the position of my vehicle after login so that I can be sure it's still there.
#0 - Proceed without Sprint.ly item number.

Enter 1 or more item numbers separated by a space: 68
Traceback (most recent call last):
File ".git/hooks/commit-msg", line 143, in <module> sys.exit(subprocess.call([original_commit_msg, sys.argv[1]]))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception
OSError: [Errno 8] Exec format error

Github hook not posting comments to Sprint.ly

Hi there,

Great project! I love how it automatically pulls up a list of my active items.

For whatever reason, while it looks like it's hooking in properly, the commit message isn't being added to the comments for the issue I reference.

Is there any config in Sprint.ly that needs to be enabled to make this work?

Thanks!

Sprintly doesn't work in a virtualenv with Python 3

The sprintly command is installed globally in /usr/local/bin/sprintly, but within virtualenvs that use Python 3 (which is almost all of them for me these days), the command doesn't work at all.

$ sprintly --install-hook
  File "/usr/local/bin/sprintly", line 154
    print 'Downloading latest version of sprintly from GitHub...'
                                                                ^
SyntaxError: Missing parentheses in call to 'print'

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.