gitx 3.0.2 → 3.1.0.ci.216.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/gitx.gemspec +5 -7
- data/lib/gitx/cli/integrate_command.rb +1 -1
- data/lib/gitx/cli/review_command.rb +6 -6
- data/lib/gitx/cli/start_command.rb +5 -2
- data/lib/gitx/cli/update_command.rb +1 -1
- data/lib/gitx/github.rb +2 -2
- data/lib/gitx/version.rb +1 -1
- data/spec/gitx/cli/integrate_command_spec.rb +2 -2
- data/spec/gitx/cli/start_command_spec.rb +21 -2
- data/spec/gitx/cli/update_command_spec.rb +2 -2
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9a0e5095268a2282c0869ce70378bc5133d88596954107555e2d67e320afc3c6
|
4
|
+
data.tar.gz: f5b18e5c168961348ea0737f56e072629b0ec1d2d06fd531d547960e18658412
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e43223974ea4505f234ef68af94ef99e76d2dff4c90c1e6e092993d23c1885738b72eaa50ea1a6acff00e935b7efd58c4962ae94563932a1860d1de8ee5a504
|
7
|
+
data.tar.gz: a48b3516a6c9d36566c3f42edf6cc5ef4c01556da25c45b377cbac151875e824ab1d71047679aa7d486407d8e8cd265986da92f986b302c42df1eda007c7be70
|
data/gitx.gemspec
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
1
|
lib = File.expand_path('../lib', __FILE__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
3
|
require 'gitx/version'
|
@@ -19,19 +17,19 @@ Gem::Specification.new do |spec|
|
|
19
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
18
|
spec.require_paths = ['lib']
|
21
19
|
|
20
|
+
spec.add_runtime_dependency 'octokit'
|
22
21
|
spec.add_runtime_dependency 'rugged', '~> 0.26.0'
|
23
22
|
spec.add_runtime_dependency 'thor'
|
24
|
-
spec.add_runtime_dependency 'octokit'
|
25
23
|
|
26
24
|
spec.add_development_dependency 'bundler'
|
25
|
+
spec.add_development_dependency 'coveralls'
|
26
|
+
spec.add_development_dependency 'pry'
|
27
27
|
spec.add_development_dependency 'rake'
|
28
28
|
spec.add_development_dependency 'rspec', '>= 3.0'
|
29
|
-
spec.add_development_dependency '
|
30
|
-
spec.add_development_dependency 'webmock'
|
29
|
+
spec.add_development_dependency 'rubocop'
|
31
30
|
spec.add_development_dependency 'timecop'
|
32
31
|
spec.add_development_dependency 'vcr'
|
33
|
-
spec.add_development_dependency '
|
34
|
-
spec.add_development_dependency 'rubocop'
|
32
|
+
spec.add_development_dependency 'webmock'
|
35
33
|
|
36
34
|
# configure gem version for continuous integration builds
|
37
35
|
if ENV['TRAVIS_JOB_NUMBER']
|
@@ -41,7 +41,7 @@ module Gitx
|
|
41
41
|
fetch_remote_branch(integration_branch)
|
42
42
|
begin
|
43
43
|
run_git_cmd 'merge', '--no-ff', '--message', commit_message(branch, integration_branch, pull_request), branch
|
44
|
-
rescue
|
44
|
+
rescue Gitx::Executor::ExecutionError
|
45
45
|
raise MergeError, "Merge conflict occurred. Please fix merge conflict and rerun command with --resume #{branch} flag"
|
46
46
|
end
|
47
47
|
run_git_cmd 'push', 'origin', 'HEAD'
|
@@ -9,28 +9,28 @@ module Gitx
|
|
9
9
|
include Gitx::Github
|
10
10
|
|
11
11
|
BUMP_COMMENT_PREFIX = '[gitx] review bump :tada:'.freeze
|
12
|
-
BUMP_COMMENT_FOOTER = <<-
|
12
|
+
BUMP_COMMENT_FOOTER = <<-MESSAGE.dedent
|
13
13
|
# Bump comments should include:
|
14
14
|
# * Summary of what changed
|
15
15
|
#
|
16
16
|
# This footer will automatically be stripped from the created comment
|
17
|
-
|
17
|
+
MESSAGE
|
18
18
|
APPROVAL_COMMENT_PREFIX = '[gitx] review approved :shipit:'.freeze
|
19
|
-
APPROVAL_COMMENT_FOOTER = <<-
|
19
|
+
APPROVAL_COMMENT_FOOTER = <<-MESSAGE.dedent
|
20
20
|
# Approval comments can include:
|
21
21
|
# * Feedback
|
22
22
|
# * Follow-up items for after release
|
23
23
|
#
|
24
24
|
# This footer will automatically be stripped from the created comment
|
25
|
-
|
25
|
+
MESSAGE
|
26
26
|
REJECTION_COMMENT_PREFIX = '[gitx] review rejected'.freeze
|
27
|
-
REJECTION_COMMENT_FOOTER = <<-
|
27
|
+
REJECTION_COMMENT_FOOTER = <<-MESSAGE.dedent
|
28
28
|
# Rejection comments should include:
|
29
29
|
# * Feedback
|
30
30
|
# * Required changes before approved
|
31
31
|
#
|
32
32
|
# This footer will automatically be stripped from the created comment
|
33
|
-
|
33
|
+
MESSAGE
|
34
34
|
|
35
35
|
desc 'review', 'Create or update a pull request on github'
|
36
36
|
method_option :title, type: :string, aliases: '-t', desc: 'pull request title'
|
@@ -9,7 +9,7 @@ module Gitx
|
|
9
9
|
VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/
|
10
10
|
|
11
11
|
desc 'start', 'start a new git branch with latest changes from master'
|
12
|
-
method_option :issue, type: :
|
12
|
+
method_option :issue, type: :string, aliases: '-i', desc: 'Issue identifier'
|
13
13
|
def start(branch_name = nil)
|
14
14
|
until valid_new_branch_name?(branch_name)
|
15
15
|
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})")
|
@@ -26,7 +26,10 @@ module Gitx
|
|
26
26
|
|
27
27
|
def commit_message(branch_name)
|
28
28
|
message = "[gitx] Start work on #{branch_name}"
|
29
|
-
|
29
|
+
if (issue = options[:issue])
|
30
|
+
issue = issue.dup.prepend('#') if issue =~ /\A\d+\z/
|
31
|
+
message += "\n\nConnected to #{issue}"
|
32
|
+
end
|
30
33
|
message
|
31
34
|
end
|
32
35
|
|
data/lib/gitx/github.rb
CHANGED
@@ -7,7 +7,7 @@ module Gitx
|
|
7
7
|
GLOBAL_CONFIG_FILE = '~/.config/gitx/github.yml'.freeze
|
8
8
|
REVIEW_CONTEXT = 'peer_review'.freeze
|
9
9
|
CLIENT_URL = 'https://github.com/wireframe/gitx'.freeze
|
10
|
-
PULL_REQUEST_FOOTER = <<-
|
10
|
+
PULL_REQUEST_FOOTER = <<-MESSAGE.dedent
|
11
11
|
# Pull Request Protips(tm):
|
12
12
|
# * Describe how this change accomplishes the task at hand
|
13
13
|
# * Use GitHub flavored Markdown http://github.github.com/github-flavored-markdown/
|
@@ -16,7 +16,7 @@ module Gitx
|
|
16
16
|
# * Review CONTRIBUTING.md for relevant workflow requirements
|
17
17
|
#
|
18
18
|
# This footer will automatically be stripped from the pull request description
|
19
|
-
|
19
|
+
MESSAGE
|
20
20
|
|
21
21
|
def find_or_create_pull_request(branch)
|
22
22
|
pull_request = find_pull_request(branch)
|
data/lib/gitx/version.rb
CHANGED
@@ -159,10 +159,10 @@ describe Gitx::Cli::IntegrateCommand do
|
|
159
159
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'staging').ordered
|
160
160
|
expect(executor).to receive(:execute).with('git', 'checkout', 'staging').ordered
|
161
161
|
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Integrate feature-branch into staging\n\nConnected to #10", 'feature-branch')
|
162
|
-
.and_raise(
|
162
|
+
.and_raise(Gitx::Executor::ExecutionError).ordered
|
163
163
|
|
164
164
|
VCR.use_cassette('pull_request_does_exist_with_success_status') do
|
165
|
-
expect { cli.integrate }.to raise_error(/Merge conflict occurred. Please fix merge conflict and rerun command with --resume feature-branch flag/)
|
165
|
+
expect { cli.integrate }.to raise_error(Gitx::Cli::BaseCommand::MergeError, /Merge conflict occurred. Please fix merge conflict and rerun command with --resume feature-branch flag/)
|
166
166
|
end
|
167
167
|
end
|
168
168
|
it 'raises a helpful error' do
|
@@ -112,10 +112,10 @@ describe Gitx::Cli::StartCommand do
|
|
112
112
|
should meet_expectations
|
113
113
|
end
|
114
114
|
end
|
115
|
-
context 'when --issue option is used' do
|
115
|
+
context 'when --issue option is used with a numeric issue ID' do
|
116
116
|
let(:options) do
|
117
117
|
{
|
118
|
-
issue: 10
|
118
|
+
issue: '10'
|
119
119
|
}
|
120
120
|
end
|
121
121
|
before do
|
@@ -131,5 +131,24 @@ describe Gitx::Cli::StartCommand do
|
|
131
131
|
should meet_expectations
|
132
132
|
end
|
133
133
|
end
|
134
|
+
context 'when --issue option is used with a non-numeric issue ID' do
|
135
|
+
let(:options) do
|
136
|
+
{
|
137
|
+
issue: 'FOO-123'
|
138
|
+
}
|
139
|
+
end
|
140
|
+
before do
|
141
|
+
expect(cli).to receive(:checkout_branch).with('master').ordered
|
142
|
+
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
143
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
|
144
|
+
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
145
|
+
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', "[gitx] Start work on new-branch\n\nConnected to FOO-123").ordered
|
146
|
+
|
147
|
+
cli.start 'new-branch'
|
148
|
+
end
|
149
|
+
it 'creates empty commit with link to issue id' do
|
150
|
+
should meet_expectations
|
151
|
+
end
|
152
|
+
end
|
134
153
|
end
|
135
154
|
end
|
@@ -41,7 +41,7 @@ describe Gitx::Cli::UpdateCommand do
|
|
41
41
|
before do
|
42
42
|
allow(cli).to receive(:say)
|
43
43
|
|
44
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').and_raise(
|
44
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').and_raise(Gitx::Executor::ExecutionError).ordered
|
45
45
|
|
46
46
|
expect { cli.update }.to raise_error(Gitx::Cli::BaseCommand::MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command')
|
47
47
|
end
|
@@ -54,7 +54,7 @@ describe Gitx::Cli::UpdateCommand do
|
|
54
54
|
allow(cli).to receive(:say)
|
55
55
|
|
56
56
|
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').ordered
|
57
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'master').and_raise(
|
57
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'master').and_raise(Gitx::Executor::ExecutionError).ordered
|
58
58
|
|
59
59
|
expect { cli.update }.to raise_error(Gitx::Cli::BaseCommand::MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command')
|
60
60
|
end
|
metadata
CHANGED
@@ -1,45 +1,45 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.1.0.ci.216.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: octokit
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rugged
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.26.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.26.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: coveralls
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,21 +81,21 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,21 +109,21 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
117
|
+
version: '3.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
124
|
+
version: '3.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: rubocop
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: timecop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: vcr
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
@@ -165,7 +165,7 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: webmock
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - ">="
|
@@ -277,12 +277,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
|
-
- - "
|
280
|
+
- - ">"
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version:
|
282
|
+
version: 1.3.1
|
283
283
|
requirements: []
|
284
284
|
rubyforge_project:
|
285
|
-
rubygems_version: 2.
|
285
|
+
rubygems_version: 2.7.1
|
286
286
|
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: Utility scripts for Git to increase productivity for common operations
|