• This repository has been archived on 18/Jun/2020
  • Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Git commands for integration with Pivotal Tracker

Git Pivotal Tracker Integration

Build Status Gem Version Dependency Status Code Climate

git-pivotal-tracker-integration provides a set of additional Git commands to help developers when working with Pivotal Tracker.

Installation

git-pivotal-tracker-integration requires at least Ruby 1.8.7 and Git 1.8.2.1 in order to run. It is tested against Rubies 1.8.7, 1.9.3, and 2.0.0. In order to install it, do the following:

$ gem install git-pivotal-tracker-integration

Usage

git-pivotal-tracker-integration is intended to be a very lightweight tool, meaning that it won't affect your day to day workflow very much. To be more specific, it is intended to automate branch creation and destruction as well as story state changes, but will not affect when you commit, when development branches are pushed to origin, etc. The typical workflow looks something like the following:

$ git start       # Creates branch and starts story
$ git commit ...
$ git commit ...  # Your existing development process
$ git commit ...
$ git finish      # Merges and destroys branch, pushes to origin, and finishes story

Configuration

Git Client

In order to use git-pivotal-tracker-integration, two Git client configuration properties must be set. If these properties have not been set, you will be prompted for them and your Git configuration will be updated.

Name Description
pivotal.api-token Your Pivotal Tracker API Token. This can be found in your profile and should be set globally.
pivotal.project-id The Pivotal Tracker project id for the repository your are working in. This can be found in the project's URL and should be set.

Git Server

In order to take advantage of automatic issue completion, the Pivotal Tracker Source Code Integration must be enabled. If you are using GitHub, this integration is easy to enable by navgating to your project's 'Service Hooks' settings and configuring it with the proper credentials.

Commands

git start [ type | story-id ]

This command starts a story by creating a Git branch and changing the story's state to started. This command can be run in three ways. First it can be run specifying the id of the story that you want to start.

$ git start 12345678

The second way to run the command is by specyifying the type of story that you would like to start. In this case it will then offer you the first five stories (based on the backlog's order) of that type to choose from.

$ git start feature

1. Lorem ipsum dolor sit amet, consectetur adipiscing elit
2. Pellentesque sit amet ante eu tortor rutrum pharetra
3. Ut at purus dolor, vel ultricies metus
4. Duis egestas elit et leo ultrices non fringilla ante facilisis
5. Ut ut nunc neque, quis auctor mauris
Choose story to start:

Finally the command can be run without specifying anything. In this case, it will then offer the first five stories (based on the backlog's order) of any type to choose from.

$ git start

1. FEATURE Donec convallis leo mi, dictum ornare sem
2. CHORE   Sed et magna lectus, sed auctor purus
3. FEATURE In a nunc et enim tincidunt interdum vitae et risus
4. FEATURE Fusce facilisis varius lorem, at tristique sem faucibus in
5. BUG     Donec iaculis ante neque, ut tempus augue
Choose story to start:

Once a story has been selected by one of the three methods, the command then prompts for the name of the branch to create.

$ git start 12345678
        Title: Lorem ipsum dolor sit amet, consectetur adipiscing elitattributes
  Description: Ut consequat sapien ut erat volutpat egestas. Integer venenatis lacinia facilisis.

Enter branch name (12345678-<branch-name>):

The value entered here will be prepended with the story id such that the branch name is <story-id>-<branch-name>. This branch is then created and checked out.

If it doesn't exist already, a prepare-commit-msg commit hook is added to your repository. This commit hook augments the existing commit messsage pattern by appending the story id to the message automatically.


[#12345678]
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch 12345678-lorem-ipsum
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   dolor.txt
#

git finish [--no-complete]

This command finishes a story by merging and cleaning up its branch and then pushing the changes to a remote server. This command can be run in two ways. First it can be run without the --no-complete option.

$ git finish
Checking for trivial merge from 12345678-lorem-ipsum to master... OK
Merging 12345678-lorem-ipsum to master... OK
Deleting 12345678-lorem-ipsum... OK
Pushing to origin... OK

The command checks that it will be able to do a trivial merge from the development branch to the target branch before it does anything. The check has the following constraints

  1. The local repository must be up to date with the remote repository (e.g. origin)
  2. The local merge target branch (e.g. master) must be up to date with the remote merge target branch (e.g. origin/master)
  3. The common ancestor (i.e. the branch point) of the development branch (e.g. 12345678-lorem-ipsum) must be tip of the local merge target branch (e.g. master)

If all of these conditions are met, the development branch will be merged into the target branch with a message of:

Merge 12345678-lorem-ipsum to master

[Completes #12345678]

The second way is with the --no-complete option specified. In this case finish performs the same actions except the Completes... statement in the commit message will be supressed.

Merge 12345678-lorem-ipsum to master

[#12345678]

After merging, the development branch is deleted and the changes are pushed to the remote repository.

git release [story-id]

This command creates a release for a story. It does this by updating the version string in the project and creating a tag. This command can be run in two ways. First it can be run specifying the release that you want to create.

$ git release 12345678

The other way the command can be run without specifying anything. In this case, it will select the first release story (based on the backlog's order).

$ git release
      Title: Lorem ipsum dolor sit amet, consectetur adipiscing elitattributes

Once a story has been selected by one of the two methods, the command then prompts for the release version and next development version.

$ git release
      Title: Lorem ipsum dolor sit amet, consectetur adipiscing elitattributes

Enter release version (current: 1.0.0.BUILD-SNAPSHOT): 1.0.0.M1
Enter next development version (current: 1.0.0.BUILD-SNAPSHOT): 1.1.0.BUILD-SNAPSHOT
Creating tag v1.0.0.M1... OK
Pushing to origin... OK

Once these have been entered, the version string for the current project is updated to the release version and a tag is created. Then the version string for the current project is updated to the next development version and a new commit along the original branch is created. Finally the tag and changes are pushed to the remote sever.

Version update is currently supported for the following kinds of projects. If you do not see a project type that you would like supported, please open an issue or submit a pull request.

  • Gradle

More Repositories

1

WhiskyNotebook

Whisky Notebook iOS Application
Swift
81
star
2

JsonPath

A Java implementation of the JSONPath specification
Java
45
star
3

spring-one-2012

Presentation and Code for SpringOne 2012
Java
34
star
4

spring-one-2013

Presentation and Code for SpringOne 2013
Java
31
star
5

spring-one-2014

Presentation and Code for SpringOne 2014
Java
19
star
6

mtls-sample

Java
18
star
7

teslamate-discovery

Home Assistant MQTT Discovery for Teslamate Cars
Go
14
star
8

build-monitor

A dashboard to monitor the status of builds
Java
10
star
9

new-relic-service-broker

On-premise New Relic Service Broker
Java
7
star
10

grunt-plugin-angular-template-inline

A GruntJS plugin that inlines AngularJS templates into an HTML file
JavaScript
5
star
11

devoxx-2013

Presentation and code for Devoxx 2013
Java
4
star
12

cf-java-client-webinar-2016

Sample Application for the Introducing the Cloud Foundry Java Client Webinar
Java
4
star
13

devoxx-2012

Presentation and Code for Devoxx 2012
3
star
14

cf-build

Shell
3
star
15

cfsummit-2014

Presentation and Code for Cloud Foundry Summit 2014
Java
2
star
16

reactive-streams-swift

Reactive Streams Specification for Swift
Swift
2
star
17

client-go

Service Bindings for Kubernetes Go Client
Go
2
star
18

grunt-plugin-buster

A GruntJS plugin that runs BusterJS tests
JavaScript
2
star
19

gpx-converter

An application that converts GPX files
Java
2
star
20

sf-meetup-2014

Presentation and Code for San Francisco Pivotal Open Source Hub Meetup 2014
Java
2
star
21

new-relic-on-pivotal-cloud-foundry-2016

1
star
22

homebrew-personal

Personal Homebrew Tap
Ruby
1
star
23

cnb-common

Shell
1
star
24

client-ruby

Service Bindings for Kubernetes Ruby Client
Ruby
1
star
25

atomist-resource

Shell
1
star
26

pong_matcher_spring

Java
1
star
27

apps-manager-demo

Spring Boot and PCF Applications Manager Demonstration Application
Java
1
star
28

client-jvm

Service Bindings for Kubernetes Java Client
Java
1
star
29

spring-exchange-2014

Presentation and Code for Spring Exchange 2014
Java
1
star
30

3d-models

3D Models
1
star
31

kpack-scale-demo

Java
1
star
32

circuit-breaker-demo

Java
1
star