Permalink
Browse files

QA pass now merges entire QA branch

  • Loading branch information...
1 parent a1f16fa commit 412a22d3a03505db048f82631ad74a38b35bbab2 @winton committed Feb 21, 2012
Showing with 31 additions and 17 deletions.
  1. +0 −4 README.md
  2. +17 −4 features/qa.feature
  3. +14 −9 lib/gitcycle.rb
View
@@ -148,7 +148,6 @@ Todo
* Conflict recording not working
* Add comment on lighthouse with issue URL
-* Allow QA branches to be created from any branch and allow any issue to merge into it
* Collab fork should change gitc ready to auo merge to the parent fork. gitc pull should pull from br and parent fork. gitc push should push to your same fork.
Lighthouse ticket changes to pending-qa if ticket is not the same as the parent.
* Hook to run after gitc qa pass, so I can write a script for amit that will auto merge master into rc
@@ -167,9 +166,6 @@ $ gitc st - shortcut
* There's still a Tagging Issue I tried to fix parseLabel http://d.pr/8eOS , Pass should remove Pending, but remove the Branch Name
* gitc qa pass 1234 # doesnt update lighthouse and screws up git issue tags
* [issue number] it marks it pending-qa and failed.. not correct. I'll take a look at this over the weekend -Tung
-* gitc qa pass # since we're changing this to pass all the tickets, we need to loop through all the merged issues and update the lighthouse state to pending-qa
-* When conflict happens on gitc qa pass, label does not get updated on issue
-* gitc qa resolved is not working, we need gitc qa pass to merge the whole branch into the target branch
* gitc qa clean # to clean up old branches
* gitc qa pass # if ticket resolved, it should stay resolved
* gitc ready # if pull requests already created, it should prompt and explain that a new branch and issue is being created, consider effect of multiple developers
View
@@ -31,7 +31,7 @@ Scenario: QA issue
Type 'gitc qa fail' to reject all issues in this branch.
"""
-Scenario: QA issue pass
+Scenario: QA issue pass w/ issue number
Given a fresh set of repositories
When I cd to the user repo
And I execute gitcycle branch with a new URL or string
@@ -46,15 +46,28 @@ Scenario: QA issue pass
And I enter "y"
And gitcycle runs
And I checkout qa_master_config.user
+ And I execute gitcycle with "qa pass issue.number"
+ And gitcycle runs with exit
+ Then output includes
+ """
+ Retrieving branch information from gitcycle.
+ Checking out branch 'master'.
+ You cannot pass individual issues. You must pass the entire QA branch.
+ Please run 'gitc qa pass' to pass the entire QA branch.
+ """
+
+Scenario: QA issue pass
+ When I cd to the owner repo
+ And I checkout qa_master_config.user
And I execute gitcycle with "qa pass"
And gitcycle runs
Then output includes
"""
Retrieving branch information from gitcycle.
Checking out branch 'master'.
- Adding remote repo 'config.user/config.repo'.
- Fetching remote 'config.user'.
- Merging remote branch 'ticket.id' from 'config.user/config.repo'.
+ Adding remote repo 'config.owner/config.repo'.
+ Fetching remote 'config.owner'.
+ Merging remote branch 'qa_master_config.user' from 'config.owner/config.repo'.
Pushing branch 'master'.
Labeling all issues as 'Pass'.
"""
View
@@ -326,19 +326,24 @@ def qa(*issues)
end
end
- branches.each do |branch|
- if pass_fail == 'pass'
+ if pass_fail == 'pass'
+ if issues.empty?
+ owner, repo = qa_branch['repo'].split(':')
merge_remote_branch(
- :owner => branch['home'],
- :repo => branch['repo'].split(':')[1],
- :branch => branch['branch'],
- :issue => branch['issue'],
- :issues => qa_branch['branches'].collect { |b| b['issue'] },
+ :owner => owner,
+ :repo => repo,
+ :branch => "qa_#{qa_branch['source']}_#{qa_branch['user']}",
:type => :from_qa
)
+ else
+ puts "\nYou cannot pass individual issues. You must pass the entire QA branch.\n".red
+ puts "\nPlease run 'gitc qa pass' to pass the entire QA branch.".green
+ exit
end
+ end
- unless issues.empty?
+ unless issues.empty?
+ branches.each do |branch|
puts "\nLabeling issue #{branch['issue']} as '#{label}'.\n".green
get('label',
'qa_branch[source]' => qa_branch['source'],
@@ -685,7 +690,7 @@ def fix_conflict(options)
if $? != 0
puts "Conflict occurred when merging '#{branch}'#{" (issue ##{issue})" if issue}.\n".red
- if type # from_qa or to_qa
+ if type == :to_qa
puts "Please resolve this conflict with '#{owner}'.\n".yellow
puts "\nSending conflict information to gitcycle.\n".green

0 comments on commit 412a22d

Please sign in to comment.