Skip to content
Browse files

First pass at README, adding ability to specify tickets to fail or pa…

…ss back in
  • Loading branch information...
1 parent 19be840 commit d9aaae07a68b36350b67f4e3faa3b63da2ed141d @winton committed Jan 17, 2012
Showing with 130 additions and 20 deletions.
  1. +87 −6 README.md
  2. +43 −14 lib/gitcycle.rb
View
93 README.md
@@ -3,14 +3,95 @@ Gitcycle
Tame your development cycle.
-Requirements
+Get Started
+-----------
+
+Visit [gitcycle.com](http://gitcycle.com) to set up your environment.
+
+Create Branch
+-------------
+
+Checkout the branch that you will eventually merge your feature into:
+
+ git checkout master
+
+Type `gitc` + your ticket URL to create a new branch:
+
+ gitc https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
+
+Pull Changes from Upstream
+--------------------------
+
+When you're developing, you may need to pull new changes from the upstream branch that you will eventually merge your feature into:
+
+ gitc pull
+
+Discuss Code
------------
-<pre>
-gem install gitcycle
-</pre>
+After pushing one or two commits, put the code up for discussion:
-Get Started
+ gitc discuss
+
+Mark as Ready
+-------------
+
+When the branch is ready for merging, mark it as ready:
+
+ gitc ready
+
+This will mark the pull request as "Pending Review".
+
+Code Review
-----------
-Visit [gitcycle.com](http://gitcycle.com) to get set up.
+Managers will periodically check for "Pending Review" issues on GitHub.
+
+Once reviewed, they will mark the issue as reviewed:
+
+ gitc reviewed 0000
+
+Where 0000 is the Github issue number.
+
+Quality Assurance
+-----------------
+
+QA engineers will periodically check for "Pending QA" issues on Github.
+
+To create a new QA branch:
+
+ gitc qa 0000 0001
+
+This will create a new QA branch containing the commits from the related Github issue numbers.
+
+This branch can be deployed to a staging environment for QA.
+
+QA Fail
+-------
+
+If a feature does not pass QA:
+
+ gitc qa fail 0000
+
+Where 0000 is the Github issue number.
+
+To fail all issues:
+
+ gitc qa fail
+
+This will add a "fail" label to the issue.
+
+QA Pass
+-------
+
+If a feature passes QA:
+
+ gitc qa pass 0000
+
+Where 0000 is the Github issue number.
+
+To pass all issues:
+
+ gitc qa pass
+
+This will add a "pass" label to the issue and will complete the pull request by merging the feature branch into the target branch.
View
57 lib/gitcycle.rb
@@ -178,23 +178,52 @@ def qa(*issues)
puts "Checking out #{qa_branch['source']}.".green
run("git checkout #{qa_branch['source']}")
- puts "Merging '#{branch}' into '#{qa_branch['source']}'.\n".green
- run("git merge #{branch}")
- run("git push origin #{qa_branch['source']}")
-
- puts "\nLabeling all issues as '#{label}'.\n".green
- get('label',
- 'qa_branch[source]' => branch.gsub(/^qa_/, ''),
- 'labels' => [ label ]
- )
+ if issues[1..-1].empty?
+ if issues.first = 'pass'
+ puts "Merging '#{branch}' into '#{qa_branch['source']}'.\n".green
+ run("git merge #{branch}")
+ run("git push origin #{qa_branch['source']}")
+ end
+
+ puts "\nLabeling all issues as '#{label}'.\n".green
+ get('label',
+ 'qa_branch[source]' => branch.gsub(/^qa_/, ''),
+ 'labels' => [ label ]
+ )
- branches = qa_branch['branches']
+ branches = qa_branch['branches']
+ else
+ issues = [1..-1]
+
+ branches = qa_branch['branches'].select do |b|
+ issues.include?(b['issue'])
+ end
- puts "\nMarking Lighthouse tickets as 'pending-approval'.\n".green
- branches = branches.collect do |b|
- { :name => b['branch'], :repo => b['repo'], :user => b['user'] }
+ branches.each do |branch|
+ if issues.first = 'pass'
+ merge_remote_branch(
+ :user => branch['user'],
+ :repo => branch['repo'].split(':'),
+ :branch => branch['branch']
+ )
+ end
+
+ puts "\nLabeling issue #{branch['issue']} as '#{label}'.\n".green
+ get('label',
+ 'qa_branch[source]' => branch.gsub(/^qa_/, ''),
+ 'issue' => branch['issue'],
+ 'labels' => [ label ]
+ )
+ end
+ end
+
+ if issues.first = 'pass'
+ puts "\nMarking Lighthouse tickets as 'pending-approval'.\n".green
+ branches = branches.collect do |b|
+ { :name => b['branch'], :repo => b['repo'], :user => b['user'] }
+ end
+ get('ticket_resolve', 'branches' => Yajl::Encoder.encode(branches))
end
- get('ticket_resolve', 'branches' => Yajl::Encoder.encode(branches))
else
puts "\nYou are not in a QA branch.\n".red
end

0 comments on commit d9aaae0

Please sign in to comment.
Something went wrong with that request. Please try again.