gitcycle 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,7 +2,7 @@
2
2
  *.gem
3
3
  .bundle
4
4
  coverage
5
- features/config.yml
5
+ features/config/config.yml
6
6
  features/fixtures
7
7
  Gemfile.lock
8
8
  pkg
data/README.md CHANGED
@@ -35,6 +35,11 @@ Type `gitc branch` + your ticket URL to create a new branch:
35
35
 
36
36
  gitc branch https://xxx.lighthouseapp.com/projects/0000/tickets/0000-my-ticket
37
37
 
38
+ To collaborate with another user, use a full path when prompted:
39
+
40
+ Q: What branch would you like to eventually merge into?
41
+ A: user/branch
42
+
38
43
  Pull
39
44
  ----
40
45
 
@@ -116,6 +121,13 @@ Label the issue with "Fail" and regenerate the QA branch without the failing iss
116
121
 
117
122
  Label all issues "Pass" and the merge the QA branch into target branch.
118
123
 
124
+ ### Immediate Pass
125
+
126
+ gitc checkout [TARGET BRANCH]
127
+ gitc qa pass [GITHUB ISSUE #] [...]
128
+
129
+ Immediately merge issue into the target branch.
130
+
119
131
  ### Status
120
132
 
121
133
  See who is QA'ing what:
@@ -125,12 +137,6 @@ See who is QA'ing what:
125
137
  Checkout
126
138
  --------
127
139
 
128
- ### Collaborate
129
-
130
- Checkout branches from other forks:
131
-
132
- gitc checkout [USER] [BRANCH]
133
-
134
140
  ### From Ticket
135
141
 
136
142
  Checkout a branch from a ticket URL:
@@ -148,7 +154,6 @@ Todo
148
154
 
149
155
  * Conflict recording not working
150
156
  * Add comment on lighthouse with issue URL
151
- * Allow QA branches to be created from any branch and allow any issue to merge into it
152
157
  * 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.
153
158
  Lighthouse ticket changes to pending-qa if ticket is not the same as the parent.
154
159
  * Hook to run after gitc qa pass, so I can write a script for amit that will auto merge master into rc
@@ -167,4 +172,6 @@ $ gitc st - shortcut
167
172
  * There's still a Tagging Issue I tried to fix parseLabel http://d.pr/8eOS , Pass should remove Pending, but remove the Branch Name
168
173
  * gitc qa pass 1234 # doesnt update lighthouse and screws up git issue tags
169
174
  * [issue number] it marks it pending-qa and failed.. not correct. I'll take a look at this over the weekend -Tung
170
- * 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
175
+ * gitc qa clean # to clean up old branches
176
+ * gitc qa pass # if ticket resolved, it should stay resolved
177
+ * 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
@@ -0,0 +1,96 @@
1
+ Feature: Branch
2
+
3
+ Scenario: Yes to all (easiest route)
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And gitcycle runs
9
+ Then output includes
10
+ """
11
+ Your work will eventually merge into 'master'. Is this correct? (y/n)
12
+ Retrieving branch information from gitcycle.
13
+ Would you like to name your branch 'master-ticket.id'? (y/n)
14
+ Adding remote repo 'config.owner/config.repo'.
15
+ Fetching remote 'config.owner'.
16
+ Checking out remote branch 'master-ticket.id' from 'config.owner/config.repo/master'.
17
+ Fetching remote 'origin'.
18
+ Pushing 'origin/master-ticket.id'.
19
+ Sending branch information to gitcycle.
20
+ """
21
+ And redis entries valid
22
+
23
+ Scenario: Custom branch name
24
+ Given a fresh set of repositories
25
+ When I cd to the user repo
26
+ And I execute gitcycle branch with a new URL or string
27
+ And I enter "y"
28
+ And I enter "n"
29
+ And I enter "master-ticket.id-rename"
30
+ And gitcycle runs
31
+ Then output includes
32
+ """
33
+ Your work will eventually merge into 'master'. Is this correct? (y/n)
34
+ Retrieving branch information from gitcycle.
35
+ Would you like to name your branch 'master-ticket.id'? (y/n)
36
+ What would you like to name your branch?
37
+ Adding remote repo 'config.owner/config.repo'.
38
+ Fetching remote 'config.owner'.
39
+ Checking out remote branch 'master-ticket.id-rename' from 'config.owner/config.repo/master'.
40
+ Fetching remote 'origin'.
41
+ Pushing 'origin/master-ticket.id-rename'.
42
+ Sending branch information to gitcycle.
43
+ """
44
+ And redis entries valid
45
+
46
+ Scenario: Change source branch
47
+ Given a fresh set of repositories
48
+ When I cd to the user repo
49
+ And I create a new branch "some_branch"
50
+ And I checkout some_branch
51
+ And I execute gitcycle branch with a new URL or string
52
+ And I enter "n"
53
+ And I enter "master"
54
+ And I enter "y"
55
+ And gitcycle runs
56
+ Then output includes
57
+ """
58
+ Your work will eventually merge into 'some_branch'. Is this correct? (y/n)
59
+ What branch would you like to eventually merge into?
60
+ Retrieving branch information from gitcycle.
61
+ Would you like to name your branch 'master-ticket.id'? (y/n)
62
+ Adding remote repo 'config.owner/config.repo'.
63
+ Fetching remote 'config.owner'.
64
+ Checking out remote branch 'master-ticket.id' from 'config.owner/config.repo/master'.
65
+ Fetching remote 'origin'.
66
+ Pushing 'origin/master-ticket.id'.
67
+ Sending branch information to gitcycle.
68
+ """
69
+ And redis entries valid
70
+
71
+ Scenario: Collaborator
72
+ Given a fresh set of repositories
73
+ When I cd to the owner repo
74
+ And I create a new branch "some_branch"
75
+ And I checkout some_branch
76
+ And I push some_branch
77
+ And I cd to the user repo
78
+ And I execute gitcycle branch with a new URL or string
79
+ And I enter "n"
80
+ And I enter "config.owner/some_branch"
81
+ And I enter "y"
82
+ And gitcycle runs
83
+ Then output includes
84
+ """
85
+ Your work will eventually merge into 'master'. Is this correct? (y/n)
86
+ What branch would you like to eventually merge into?
87
+ Retrieving branch information from gitcycle.
88
+ Would you like to name your branch 'config.owner-some_branch-ticket.id'? (y/n)
89
+ Adding remote repo 'config.owner/config.repo'.
90
+ Fetching remote 'config.owner'.
91
+ Checking out remote branch 'config.owner-some_branch-ticket.id' from 'config.owner/config.repo/some_branch'.
92
+ Fetching remote 'origin'.
93
+ Pushing 'origin/config.owner-some_branch-ticket.id'.
94
+ Sending branch information to gitcycle.
95
+ """
96
+ And redis entries valid
@@ -0,0 +1,27 @@
1
+ Feature: Checkout
2
+
3
+ Scenario: Existing branch
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And I execute gitcycle checkout with the last URL or string
9
+ And gitcycle runs
10
+ Then output includes
11
+ """
12
+ Retrieving branch information from gitcycle.
13
+ Checking out branch 'master-ticket.id'.
14
+ """
15
+ And current branch is "master-ticket.id"
16
+
17
+ Scenario: Fresh repo
18
+ Given a fresh set of repositories
19
+ When I cd to the user repo
20
+ And I execute gitcycle checkout with the last URL or string
21
+ And gitcycle runs
22
+ Then output includes
23
+ """
24
+ Retrieving branch information from gitcycle.
25
+ Tracking branch 'origin/master-last_ticket.id'.
26
+ """
27
+ And current branch is "master-last_ticket.id"
@@ -0,0 +1,46 @@
1
+ Feature: Discuss
2
+
3
+ Scenario: No parameters and nothing committed
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And I execute gitcycle with "discuss"
9
+ And gitcycle runs
10
+ Then output includes
11
+ """
12
+ Retrieving branch information from gitcycle.
13
+ Creating GitHub pull request.
14
+ You must push code before opening a pull request.
15
+ """
16
+ And redis entries valid
17
+
18
+ Scenario: No parameters and something committed
19
+ Given a fresh set of repositories
20
+ When I cd to the user repo
21
+ And I execute gitcycle branch with a new URL or string
22
+ And I give default input
23
+ And gitcycle runs
24
+ And I commit something
25
+ And I execute gitcycle with "discuss"
26
+ And gitcycle runs
27
+ Then output includes
28
+ """
29
+ Retrieving branch information from gitcycle.
30
+ Creating GitHub pull request.
31
+ Labeling issue as 'Discuss'.
32
+ """
33
+ And output includes "Opening issue" with URL
34
+ And URL is a valid issue
35
+ And redis entries valid
36
+
37
+ Scenario: Parameters
38
+ When I cd to the user repo
39
+ And I execute gitcycle with "discuss issue.id"
40
+ And gitcycle runs
41
+ Then output includes "Retrieving branch information from gitcycle."
42
+ And output does not include "Creating GitHub pull request."
43
+ And output does not include "Branch not found."
44
+ And output does not include "You must push code before opening a pull request."
45
+ And output includes "Opening issue" with URL
46
+ And URL is a valid issue
@@ -0,0 +1,11 @@
1
+ Feature: Errors
2
+
3
+ Scenario: No command given
4
+ When I execute gitcycle with nothing
5
+ And gitcycle runs
6
+ Then output includes "No command specified"
7
+
8
+ Scenario: Non-existent command
9
+ When I execute gitcycle with "blah blah"
10
+ And gitcycle runs
11
+ Then output includes "Command not recognized."
@@ -0,0 +1,23 @@
1
+ Feature: Pull
2
+
3
+ Scenario: Pull changes from upstream
4
+ Given a fresh set of repositories
5
+ When I cd to the owner repo
6
+ And I checkout master
7
+ And I commit something
8
+ And I cd to the user repo
9
+ And I checkout master
10
+ And I execute gitcycle with "pull"
11
+ And gitcycle runs
12
+ Then output includes
13
+ """
14
+ Retrieving branch information from gitcycle.
15
+ Retrieving repo information from gitcycle.
16
+ Adding remote repo 'config.owner/config.repo'.
17
+ Fetching remote 'config.owner'.
18
+ Merging remote branch 'master' from 'config.owner/config.repo'.
19
+ Adding remote repo 'config.user/config.repo'.
20
+ Fetching remote 'config.user'.
21
+ Merging remote branch 'master' from 'config.user/config.repo'.
22
+ """
23
+ And git log should contain the last commit
@@ -0,0 +1,97 @@
1
+ Feature: QA
2
+
3
+ Scenario: QA issue
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And gitcycle runs
9
+ And I commit something
10
+ And I execute gitcycle with "ready"
11
+ And gitcycle runs
12
+ And I cd to the owner repo
13
+ And I checkout master
14
+ And I execute gitcycle with "qa issue.id"
15
+ And I enter "y"
16
+ And gitcycle runs
17
+ Then output includes
18
+ """
19
+ Do you want to create a QA branch from 'master'? (y/n)
20
+ Retrieving branch information from gitcycle.
21
+ Adding remote repo 'config.owner/config.repo'.
22
+ Fetching remote 'config.owner'.
23
+ Checking out remote branch 'qa_master_config.user' from 'config.owner/config.repo/master'.
24
+ Fetching remote 'origin'.
25
+ Pushing 'origin/qa_master_config.user'.
26
+ Adding remote repo 'config.user/config.repo'.
27
+ Fetching remote 'config.user'.
28
+ Merging remote branch 'master-ticket.id' from 'config.user/config.repo'.
29
+ Pushing branch 'qa_master_config.user'.
30
+ Type 'gitc qa pass' to approve all issues in this branch.
31
+ Type 'gitc qa fail' to reject all issues in this branch.
32
+ """
33
+
34
+ Scenario: QA issue pass w/ issue number
35
+ Given a fresh set of repositories
36
+ When I cd to the user repo
37
+ And I execute gitcycle branch with a new URL or string
38
+ And I give default input
39
+ And gitcycle runs
40
+ And I commit something
41
+ And I execute gitcycle with "ready"
42
+ And gitcycle runs
43
+ And I cd to the owner repo
44
+ And I checkout master
45
+ And I execute gitcycle with "qa pass issue.id"
46
+ And I enter "y"
47
+ And gitcycle runs
48
+ Then output includes
49
+ """
50
+ WARNING: This issue will merge straight into 'master' without testing.
51
+ Continue? (y/n)
52
+ Retrieving branch information from gitcycle.
53
+ Deleting old QA branch 'qa_master_config.user'.
54
+ Adding remote repo 'config.owner/config.repo'.
55
+ Fetching remote 'config.owner'.
56
+ Checking out remote branch 'qa_master_config.user' from 'config.owner/config.repo/master'.
57
+ Fetching remote 'origin'.
58
+ Pushing 'origin/qa_master_config.user'.
59
+ Adding remote repo 'config.user/config.repo'.
60
+ Fetching remote 'config.user'.
61
+ Merging remote branch 'master-ticket.id' from 'config.user/config.repo'.
62
+ Pushing branch 'qa_master_config.user'.
63
+ Retrieving branch information from gitcycle.
64
+ Checking out branch 'master'.
65
+ Adding remote repo 'config.owner/config.repo'.
66
+ Fetching remote 'config.owner'.
67
+ Merging remote branch 'qa_master_config.user' from 'config.owner/config.repo'.
68
+ Pushing branch 'master'.
69
+ Labeling all issues as 'Pass'.
70
+ """
71
+
72
+ Scenario: QA issue pass
73
+ When I cd to the owner repo
74
+ And I checkout qa_master_config.user
75
+ And I execute gitcycle with "qa pass"
76
+ And gitcycle runs
77
+ Then output includes
78
+ """
79
+ Retrieving branch information from gitcycle.
80
+ Checking out branch 'master'.
81
+ Adding remote repo 'config.owner/config.repo'.
82
+ Fetching remote 'config.owner'.
83
+ Merging remote branch 'qa_master_config.user' from 'config.owner/config.repo'.
84
+ Pushing branch 'master'.
85
+ Labeling all issues as 'Pass'.
86
+ """
87
+
88
+ Scenario: QA issue list
89
+ When I cd to the owner repo
90
+ And I checkout master
91
+ And I execute gitcycle with "qa"
92
+ And gitcycle runs
93
+ Then output includes
94
+ """
95
+ qa_master_config.user
96
+ issue #issue.id\tconfig.user/master-last_ticket.id
97
+ """
@@ -0,0 +1,46 @@
1
+ Feature: Ready
2
+
3
+ Scenario: Ready issue
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And gitcycle runs
9
+ And I commit something
10
+ And I execute gitcycle with "ready"
11
+ And gitcycle runs
12
+ Then output includes
13
+ """
14
+ Retrieving branch information from gitcycle.
15
+ Adding remote repo 'config.owner/config.repo'.
16
+ Fetching remote 'config.owner'.
17
+ Merging remote branch 'master' from 'config.owner/config.repo'.
18
+ Adding remote repo 'config.user/config.repo'.
19
+ Fetching remote 'config.user'.
20
+ Merging remote branch 'master-ticket.id' from 'config.user/config.repo'.
21
+ Creating GitHub pull request.
22
+ Labeling issue as 'Pending Review'.
23
+ """
24
+
25
+ Scenario: Collaborator
26
+ Given a fresh set of repositories
27
+ When I cd to the owner repo
28
+ And I create a new branch "some_branch"
29
+ And I checkout some_branch
30
+ And I push some_branch
31
+ And I cd to the user repo
32
+ And I execute gitcycle branch with a new URL or string
33
+ And I enter "n"
34
+ And I enter "config.owner/some_branch"
35
+ And I enter "y"
36
+ And gitcycle runs
37
+ And I commit something
38
+ And I execute gitcycle with "ready"
39
+ And gitcycle runs
40
+ Then output includes
41
+ """
42
+ Retrieving branch information from gitcycle.
43
+ Adding remote repo 'config.owner/config.repo'.
44
+ Fetching remote 'config.owner'.
45
+ Pushing branch 'config.owner/some_branch'.
46
+ """
@@ -0,0 +1,27 @@
1
+ Feature: Review
2
+
3
+ Scenario: No parameters
4
+ Given a fresh set of repositories
5
+ When I cd to the user repo
6
+ And I execute gitcycle branch with a new URL or string
7
+ And I give default input
8
+ And gitcycle runs
9
+ And I commit something
10
+ And I execute gitcycle with "ready"
11
+ And gitcycle runs
12
+ And I execute gitcycle with "review pass"
13
+ And gitcycle runs
14
+ Then output includes "Labeling issue as 'Pending QA'."
15
+
16
+ Scenario: Parameters
17
+ Given a fresh set of repositories
18
+ When I cd to the user repo
19
+ And I execute gitcycle branch with a new URL or string
20
+ And I give default input
21
+ And gitcycle runs
22
+ And I commit something
23
+ And I execute gitcycle with "ready"
24
+ And gitcycle runs
25
+ And I execute gitcycle with "review pass issue.id"
26
+ And gitcycle runs
27
+ Then output includes "Labeling issues as 'Pending QA'."