git_reflow 0.8.10 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/.ruby-version +1 -1
  4. data/Appraisals +1 -6
  5. data/CHANGELOG.md +426 -348
  6. data/Gemfile.lock +15 -19
  7. data/LICENSE +20 -20
  8. data/README.md +27 -7
  9. data/Rakefile +8 -8
  10. data/bin/console +7 -7
  11. data/bin/setup +6 -6
  12. data/circle.yml +5 -5
  13. data/exe/git-reflow +9 -30
  14. data/git_reflow.gemspec +1 -2
  15. data/lib/git_reflow/config.rb +22 -13
  16. data/lib/git_reflow/git_helpers.rb +69 -22
  17. data/lib/git_reflow/git_server/base.rb +68 -68
  18. data/lib/git_reflow/git_server/git_hub/pull_request.rb +15 -13
  19. data/lib/git_reflow/git_server/pull_request.rb +4 -2
  20. data/lib/git_reflow/merge_error.rb +9 -9
  21. data/lib/git_reflow/rspec/command_line_helpers.rb +9 -1
  22. data/lib/git_reflow/rspec/stub_helpers.rb +13 -13
  23. data/lib/git_reflow/rspec/workflow_helpers.rb +18 -0
  24. data/lib/git_reflow/rspec.rb +1 -0
  25. data/lib/git_reflow/sandbox.rb +1 -0
  26. data/lib/git_reflow/version.rb +1 -1
  27. data/lib/git_reflow/workflow.rb +277 -9
  28. data/lib/git_reflow/workflows/FlatMergeWorkflow +38 -0
  29. data/lib/git_reflow/workflows/core.rb +208 -79
  30. data/lib/git_reflow.rb +3 -14
  31. data/spec/fixtures/awesome_workflow.rb +2 -6
  32. data/spec/fixtures/git/git_config +7 -7
  33. data/spec/fixtures/issues/comment.json.erb +27 -27
  34. data/spec/fixtures/issues/comments.json +29 -29
  35. data/spec/fixtures/issues/comments.json.erb +15 -15
  36. data/spec/fixtures/pull_requests/comment.json.erb +45 -45
  37. data/spec/fixtures/pull_requests/comments.json +47 -47
  38. data/spec/fixtures/pull_requests/comments.json.erb +15 -15
  39. data/spec/fixtures/pull_requests/commits.json +29 -29
  40. data/spec/fixtures/pull_requests/external_pull_request.json +145 -145
  41. data/spec/fixtures/pull_requests/pull_request.json +142 -142
  42. data/spec/fixtures/pull_requests/pull_request.json.erb +142 -142
  43. data/spec/fixtures/pull_requests/pull_request_branch_nonexistent_error.json +32 -0
  44. data/spec/fixtures/pull_requests/pull_request_exists_error.json +32 -32
  45. data/spec/fixtures/pull_requests/pull_requests.json +136 -136
  46. data/spec/fixtures/repositories/commit.json +53 -53
  47. data/spec/fixtures/repositories/commit.json.erb +53 -53
  48. data/spec/fixtures/repositories/commits.json.erb +13 -13
  49. data/spec/fixtures/repositories/statuses.json +31 -31
  50. data/spec/lib/git_reflow/git_helpers_spec.rb +115 -12
  51. data/spec/lib/git_reflow/git_server/git_hub/pull_request_spec.rb +6 -6
  52. data/spec/lib/git_reflow/git_server/pull_request_spec.rb +9 -3
  53. data/spec/lib/git_reflow/workflow_spec.rb +190 -11
  54. data/spec/lib/git_reflow/workflows/core_spec.rb +224 -65
  55. data/spec/lib/git_reflow/workflows/flat_merge_spec.rb +17 -6
  56. data/spec/lib/git_reflow_spec.rb +2 -25
  57. data/spec/spec_helper.rb +3 -0
  58. data/spec/support/github_helpers.rb +1 -1
  59. data/spec/support/mock_pull_request.rb +17 -17
  60. data/spec/support/web_mocks.rb +39 -39
  61. metadata +9 -28
  62. data/lib/git_reflow/commands/deliver.rb +0 -10
  63. data/lib/git_reflow/commands/refresh.rb +0 -20
  64. data/lib/git_reflow/commands/review.rb +0 -13
  65. data/lib/git_reflow/commands/setup.rb +0 -11
  66. data/lib/git_reflow/commands/stage.rb +0 -9
  67. data/lib/git_reflow/commands/start.rb +0 -18
  68. data/lib/git_reflow/commands/status.rb +0 -7
  69. data/lib/git_reflow/workflows/flat_merge.rb +0 -10
  70. data/spec/fixtures/workflow_with_super.rb +0 -8
@@ -1,29 +1,29 @@
1
- [
2
- {
3
- "id": 1,
4
- "url": "https://api.github.com/repos/reenhanced/repo/issues/comments/1",
5
- "html_url": "https://github.com/reenhanced/repo/issues/1#issuecomment-1",
6
- "body": "Me too",
7
- "user": {
8
- "login": "reenhanced",
9
- "id": 1,
10
- "avatar_url": "https://github.com/images/error/octocat_happy.gif",
11
- "gravatar_id": "somehexcode",
12
- "url": "https://api.github.com/users/reenhanced",
13
- "html_url": "https://github.com/reenhanced",
14
- "followers_url": "https://api.github.com/users/reenhanced/followers",
15
- "following_url": "https://api.github.com/users/reenhanced/following{/other_user}",
16
- "gists_url": "https://api.github.com/users/reenhanced/gists{/gist_id}",
17
- "starred_url": "https://api.github.com/users/reenhanced/starred{/owner}{/repo}",
18
- "subscriptions_url": "https://api.github.com/users/reenhanced/subscriptions",
19
- "organizations_url": "https://api.github.com/users/reenhanced/orgs",
20
- "repos_url": "https://api.github.com/users/reenhanced/repos",
21
- "events_url": "https://api.github.com/users/reenhanced/events{/privacy}",
22
- "received_events_url": "https://api.github.com/users/reenhanced/received_events",
23
- "type": "User",
24
- "site_admin": false
25
- },
26
- "created_at": "2011-04-14T16:00:49Z",
27
- "updated_at": "2011-04-14T16:00:49Z"
28
- }
29
- ]
1
+ [
2
+ {
3
+ "id": 1,
4
+ "url": "https://api.github.com/repos/reenhanced/repo/issues/comments/1",
5
+ "html_url": "https://github.com/reenhanced/repo/issues/1#issuecomment-1",
6
+ "body": "Me too",
7
+ "user": {
8
+ "login": "reenhanced",
9
+ "id": 1,
10
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
11
+ "gravatar_id": "somehexcode",
12
+ "url": "https://api.github.com/users/reenhanced",
13
+ "html_url": "https://github.com/reenhanced",
14
+ "followers_url": "https://api.github.com/users/reenhanced/followers",
15
+ "following_url": "https://api.github.com/users/reenhanced/following{/other_user}",
16
+ "gists_url": "https://api.github.com/users/reenhanced/gists{/gist_id}",
17
+ "starred_url": "https://api.github.com/users/reenhanced/starred{/owner}{/repo}",
18
+ "subscriptions_url": "https://api.github.com/users/reenhanced/subscriptions",
19
+ "organizations_url": "https://api.github.com/users/reenhanced/orgs",
20
+ "repos_url": "https://api.github.com/users/reenhanced/repos",
21
+ "events_url": "https://api.github.com/users/reenhanced/events{/privacy}",
22
+ "received_events_url": "https://api.github.com/users/reenhanced/received_events",
23
+ "type": "User",
24
+ "site_admin": false
25
+ },
26
+ "created_at": "2011-04-14T16:00:49Z",
27
+ "updated_at": "2011-04-14T16:00:49Z"
28
+ }
29
+ ]
@@ -1,15 +1,15 @@
1
- [
2
- <% comment_json = [] %>
3
- <% comments.each_with_index do |comment, index| %>
4
- <% comment_json << Fixture.new('issues/comment.json.erb',
5
- id: comment[:id] || index + 1,
6
- author: comment[:author],
7
- pull_request_number: pull_request_number,
8
- repo_owner: repo_owner,
9
- repo_name: repo_name,
10
- body: comment[:body] || 'Hmmm...',
11
- created_at: comment[:created_at] || '2011-04-14T16:00:49Z'
12
- ).to_s %>
13
- <% end %>
14
- <%= comment_json.join(", ") %>
15
- ]
1
+ [
2
+ <% comment_json = [] %>
3
+ <% comments.each_with_index do |comment, index| %>
4
+ <% comment_json << Fixture.new('issues/comment.json.erb',
5
+ id: comment[:id] || index + 1,
6
+ author: comment[:author],
7
+ pull_request_number: pull_request_number,
8
+ repo_owner: repo_owner,
9
+ repo_name: repo_name,
10
+ body: comment[:body] || 'Hmmm...',
11
+ created_at: comment[:created_at] || '2011-04-14T16:00:49Z'
12
+ ).to_s %>
13
+ <% end %>
14
+ <%= comment_json.join(", ") %>
15
+ ]
@@ -1,45 +1,45 @@
1
- {
2
- "url": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/comments/<%= id || 1 %>",
3
- "id": <%= id || 1 %>,
4
- "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
5
- "path": "file1.txt",
6
- "position": 1,
7
- "original_position": 4,
8
- "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
9
- "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
10
- "user": {
11
- "login": "<%= author %>",
12
- "id": 1,
13
- "avatar_url": "https://github.com/images/error/octocat_happy.gif",
14
- "gravatar_id": "somehexcode",
15
- "url": "https://api.github.com/users/<%= author %>",
16
- "html_url": "https://github.com/<%= author %>",
17
- "followers_url": "https://api.github.com/users/<%= author %>/followers",
18
- "following_url": "https://api.github.com/users/<%= author %>/following{/other_user}",
19
- "gists_url": "https://api.github.com/users/<%= author %>/gists{/gist_id}",
20
- "starred_url": "https://api.github.com/users/<%= author %>/starred{/owner}{/repo}",
21
- "subscriptions_url": "https://api.github.com/users/<%= author %>/subscriptions",
22
- "organizations_url": "https://api.github.com/users/<%= author %>/orgs",
23
- "repos_url": "https://api.github.com/users/<%= author %>/repos",
24
- "events_url": "https://api.github.com/users/<%= author %>/events{/privacy}",
25
- "received_events_url": "https://api.github.com/users/<%= author %>/received_events",
26
- "type": "User",
27
- "site_admin": false
28
- },
29
- "body": "<%= body || "Great stuff" %>",
30
- "created_at": "<%= created_at || "2011-04-14T16:00:49Z" %>",
31
- "updated_at": "<%= updated_at || created_at || "2011-04-14T16:00:49Z" %>",
32
- "html_url": "https://github.com/<%= repo_owner %>/<%= repo_name %>/pull/<%= pull_request_number %>#discussion-diff-<%= id || 1 %>",
33
- "pull_request_url": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/<%= pull_request_number %>",
34
- "_links": {
35
- "self": {
36
- "href": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/comments/<%= pull_request_number %>"
37
- },
38
- "html": {
39
- "href": "https://github.com/<%= repo_owner %>/<%= repo_name %>/pull/<%= pull_request_number %>#discussion-diff-<%= id || 1 %>"
40
- },
41
- "pull_request": {
42
- "href": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/<%= pull_request_number %>"
43
- }
44
- }
45
- }
1
+ {
2
+ "url": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/comments/<%= id || 1 %>",
3
+ "id": <%= id || 1 %>,
4
+ "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
5
+ "path": "file1.txt",
6
+ "position": 1,
7
+ "original_position": 4,
8
+ "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
9
+ "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
10
+ "user": {
11
+ "login": "<%= author %>",
12
+ "id": 1,
13
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
14
+ "gravatar_id": "somehexcode",
15
+ "url": "https://api.github.com/users/<%= author %>",
16
+ "html_url": "https://github.com/<%= author %>",
17
+ "followers_url": "https://api.github.com/users/<%= author %>/followers",
18
+ "following_url": "https://api.github.com/users/<%= author %>/following{/other_user}",
19
+ "gists_url": "https://api.github.com/users/<%= author %>/gists{/gist_id}",
20
+ "starred_url": "https://api.github.com/users/<%= author %>/starred{/owner}{/repo}",
21
+ "subscriptions_url": "https://api.github.com/users/<%= author %>/subscriptions",
22
+ "organizations_url": "https://api.github.com/users/<%= author %>/orgs",
23
+ "repos_url": "https://api.github.com/users/<%= author %>/repos",
24
+ "events_url": "https://api.github.com/users/<%= author %>/events{/privacy}",
25
+ "received_events_url": "https://api.github.com/users/<%= author %>/received_events",
26
+ "type": "User",
27
+ "site_admin": false
28
+ },
29
+ "body": "<%= body || "Great stuff" %>",
30
+ "created_at": "<%= created_at || "2011-04-14T16:00:49Z" %>",
31
+ "updated_at": "<%= updated_at || created_at || "2011-04-14T16:00:49Z" %>",
32
+ "html_url": "https://github.com/<%= repo_owner %>/<%= repo_name %>/pull/<%= pull_request_number %>#discussion-diff-<%= id || 1 %>",
33
+ "pull_request_url": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/<%= pull_request_number %>",
34
+ "_links": {
35
+ "self": {
36
+ "href": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/comments/<%= pull_request_number %>"
37
+ },
38
+ "html": {
39
+ "href": "https://github.com/<%= repo_owner %>/<%= repo_name %>/pull/<%= pull_request_number %>#discussion-diff-<%= id || 1 %>"
40
+ },
41
+ "pull_request": {
42
+ "href": "https://api.github.com/repos/<%= repo_owner %>/<%= repo_name %>/pulls/<%= pull_request_number %>"
43
+ }
44
+ }
45
+ }
@@ -1,47 +1,47 @@
1
- [
2
- {
3
- "url": "https://api.github.com/repos/reenhanced/repo/pulls/comments/1",
4
- "id": 1,
5
- "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
6
- "path": "file1.txt",
7
- "position": 1,
8
- "original_position": 4,
9
- "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
10
- "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
11
- "user": {
12
- "login": "reenhanced",
13
- "id": 1,
14
- "avatar_url": "https://github.com/images/error/octocat_happy.gif",
15
- "gravatar_id": "somehexcode",
16
- "url": "https://api.github.com/users/reenhanced",
17
- "html_url": "https://github.com/reenhanced",
18
- "followers_url": "https://api.github.com/users/reenhanced/followers",
19
- "following_url": "https://api.github.com/users/reenhanced/following{/other_user}",
20
- "gists_url": "https://api.github.com/users/reenhanced/gists{/gist_id}",
21
- "starred_url": "https://api.github.com/users/reenhanced/starred{/owner}{/repo}",
22
- "subscriptions_url": "https://api.github.com/users/reenhanced/subscriptions",
23
- "organizations_url": "https://api.github.com/users/reenhanced/orgs",
24
- "repos_url": "https://api.github.com/users/reenhanced/repos",
25
- "events_url": "https://api.github.com/users/reenhanced/events{/privacy}",
26
- "received_events_url": "https://api.github.com/users/reenhanced/received_events",
27
- "type": "User",
28
- "site_admin": false
29
- },
30
- "body": "Great stuff",
31
- "created_at": "2011-04-14T16:00:49Z",
32
- "updated_at": "2011-04-14T16:00:49Z",
33
- "html_url": "https://github.com/reenhanced/repo/pull/1#discussion-diff-1",
34
- "pull_request_url": "https://api.github.com/repos/reenhanced/repo/pulls/1",
35
- "_links": {
36
- "self": {
37
- "href": "https://api.github.com/repos/reenhanced/repo/pulls/comments/1"
38
- },
39
- "html": {
40
- "href": "https://github.com/reenhanced/repo/pull/1#discussion-diff-1"
41
- },
42
- "pull_request": {
43
- "href": "https://api.github.com/repos/reenhanced/repo/pulls/1"
44
- }
45
- }
46
- }
47
- ]
1
+ [
2
+ {
3
+ "url": "https://api.github.com/repos/reenhanced/repo/pulls/comments/1",
4
+ "id": 1,
5
+ "diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
6
+ "path": "file1.txt",
7
+ "position": 1,
8
+ "original_position": 4,
9
+ "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
10
+ "original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
11
+ "user": {
12
+ "login": "reenhanced",
13
+ "id": 1,
14
+ "avatar_url": "https://github.com/images/error/octocat_happy.gif",
15
+ "gravatar_id": "somehexcode",
16
+ "url": "https://api.github.com/users/reenhanced",
17
+ "html_url": "https://github.com/reenhanced",
18
+ "followers_url": "https://api.github.com/users/reenhanced/followers",
19
+ "following_url": "https://api.github.com/users/reenhanced/following{/other_user}",
20
+ "gists_url": "https://api.github.com/users/reenhanced/gists{/gist_id}",
21
+ "starred_url": "https://api.github.com/users/reenhanced/starred{/owner}{/repo}",
22
+ "subscriptions_url": "https://api.github.com/users/reenhanced/subscriptions",
23
+ "organizations_url": "https://api.github.com/users/reenhanced/orgs",
24
+ "repos_url": "https://api.github.com/users/reenhanced/repos",
25
+ "events_url": "https://api.github.com/users/reenhanced/events{/privacy}",
26
+ "received_events_url": "https://api.github.com/users/reenhanced/received_events",
27
+ "type": "User",
28
+ "site_admin": false
29
+ },
30
+ "body": "Great stuff",
31
+ "created_at": "2011-04-14T16:00:49Z",
32
+ "updated_at": "2011-04-14T16:00:49Z",
33
+ "html_url": "https://github.com/reenhanced/repo/pull/1#discussion-diff-1",
34
+ "pull_request_url": "https://api.github.com/repos/reenhanced/repo/pulls/1",
35
+ "_links": {
36
+ "self": {
37
+ "href": "https://api.github.com/repos/reenhanced/repo/pulls/comments/1"
38
+ },
39
+ "html": {
40
+ "href": "https://github.com/reenhanced/repo/pull/1#discussion-diff-1"
41
+ },
42
+ "pull_request": {
43
+ "href": "https://api.github.com/repos/reenhanced/repo/pulls/1"
44
+ }
45
+ }
46
+ }
47
+ ]
@@ -1,15 +1,15 @@
1
- [
2
- <% comments_json = [] %>
3
- <% comments.each_with_index do |comment, index| %>
4
- <% comments_json << Fixture.new('pull_requests/comment.json.erb',
5
- id: index,
6
- author: comment[:author],
7
- pull_request_number: pull_request_number,
8
- repo_owner: repo_owner,
9
- repo_name: repo_name,
10
- body: comment[:body] || 'Hammer time',
11
- created_at: comment[:created_at] || Chronic.parse('October 21, 2015 07:28:00')
12
- ).to_s %>
13
- <% end %>
14
- <%= comments_json.join(", ") %>
15
- ]
1
+ [
2
+ <% comments_json = [] %>
3
+ <% comments.each_with_index do |comment, index| %>
4
+ <% comments_json << Fixture.new('pull_requests/comment.json.erb',
5
+ id: index,
6
+ author: comment[:author],
7
+ pull_request_number: pull_request_number,
8
+ repo_owner: repo_owner,
9
+ repo_name: repo_name,
10
+ body: comment[:body] || 'Hammer time',
11
+ created_at: comment[:created_at] || Chronic.parse('October 21, 2015 07:28:00')
12
+ ).to_s %>
13
+ <% end %>
14
+ <%= comments_json.join(", ") %>
15
+ ]
@@ -1,29 +1,29 @@
1
- [
2
- {
3
- "commit": {
4
- "sha": "7638417db6d59f3c431d3e1f261cc637155684cd",
5
- "url": "https://api.github.com/repos/reenhanced/repo/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd",
6
- "author": {
7
- "date": "2010-04-10T14:10:01-07:00",
8
- "name": "Draco Powers",
9
- "email": "draco@reenhanced.com"
10
- },
11
- "committer": {
12
- "date": "2010-04-10T14:10:01-07:00",
13
- "name": "Draco Powers",
14
- "email": "draco@reenhanced.com"
15
- },
16
- "message": "added readme, because im a good github citizen\n",
17
- "tree": {
18
- "url": "https://api.github.com/repos/reenhanced/repo/git/trees/691272480426f78a0138979dd3ce63b77f706feb",
19
- "sha": "691272480426f78a0138979dd3ce63b77f706feb"
20
- },
21
- "parents": [
22
- {
23
- "url": "https://api.github.com/repos/reenhanced/repo/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5",
24
- "sha": "1acc419d4d6a9ce985db7be48c6349a0475975b5"
25
- }
26
- ]
27
- }
28
- }
29
- ]
1
+ [
2
+ {
3
+ "commit": {
4
+ "sha": "7638417db6d59f3c431d3e1f261cc637155684cd",
5
+ "url": "https://api.github.com/repos/reenhanced/repo/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd",
6
+ "author": {
7
+ "date": "2010-04-10T14:10:01-07:00",
8
+ "name": "Draco Powers",
9
+ "email": "draco@reenhanced.com"
10
+ },
11
+ "committer": {
12
+ "date": "2010-04-10T14:10:01-07:00",
13
+ "name": "Draco Powers",
14
+ "email": "draco@reenhanced.com"
15
+ },
16
+ "message": "added readme, because im a good github citizen\n",
17
+ "tree": {
18
+ "url": "https://api.github.com/repos/reenhanced/repo/git/trees/691272480426f78a0138979dd3ce63b77f706feb",
19
+ "sha": "691272480426f78a0138979dd3ce63b77f706feb"
20
+ },
21
+ "parents": [
22
+ {
23
+ "url": "https://api.github.com/repos/reenhanced/repo/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5",
24
+ "sha": "1acc419d4d6a9ce985db7be48c6349a0475975b5"
25
+ }
26
+ ]
27
+ }
28
+ }
29
+ ]