geet 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb8303d92a18b3d8e486b1475cfb20377c24a5861afe96f199f622999f0d26ed
4
- data.tar.gz: d1174bcc496064b9629cfb6b0e57c11217654e631a5efd61d3375d8c5537aa12
3
+ metadata.gz: 92ec0750a0b9b19fcac605a9dbf4b5a746ac3149eb3685f85ccadae8a7500a94
4
+ data.tar.gz: 5b56daef325b4a667d2b5aef5b28f5f5f1cdbe2bea6195d6ead8c58173a4580f
5
5
  SHA512:
6
- metadata.gz: a2122ebc682e0b9cf4d2fe377234d02e390dd5492741d10029ebb49781e0e08ebc82e667cfac7a01d8b4ed4980b45b6a396011d8ee25e1cefe2947c2c0cd9410
7
- data.tar.gz: 850b79ce5de169567f17164a9f1b6766f611c88ca47cc5c9b3c735706d0079628f3cdcd4c74075f809b2de1b67aeb34143d056aab9298593df5929f823c947e1
6
+ metadata.gz: de248a32d080a7804b3c2abcb22ad00b6269f2e2d16c30efd5a8b522414e3392e92c563b8798fb59b81d5de6cefeb1b53772ea5cddf13e61d0f94e5d9e25ff27
7
+ data.tar.gz: 2c6d236e604a29525d73f9a3f356808575b0ddec25bc197436be5badf12063feb6ee2938d8e47e48778814ab912bcb348101c41bd41771ca104044a48ce1fe1a
data/bin/geet CHANGED
@@ -59,6 +59,8 @@ class GeetLauncher
59
59
  Services::ListPrs.new(repository).execute
60
60
  when PR_MERGE_COMMAND
61
61
  Services::MergePr.new(repository).execute(options)
62
+ when PR_OPEN_COMMAND
63
+ Services::OpenPr.new(repository).execute(options)
62
64
  else
63
65
  raise "Internal error - Unrecognized command #{command.inspect}"
64
66
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.required_ruby_version = '>= 2.3.0'
12
12
  s.authors = ['Saverio Miroddi']
13
- s.date = '2019-03-25'
13
+ s.date = '2019-08-28'
14
14
  s.email = ['saverio.pub2@gmail.com']
15
15
  s.homepage = 'https://github.com/saveriomiroddi/geet'
16
16
  s.summary = 'Commandline interface for performing SCM host operations, eg. create a PR on GitHub'
@@ -12,6 +12,7 @@ module Geet
12
12
  PR_CREATE_COMMAND = 'pr.create'
13
13
  PR_LIST_COMMAND = 'pr.list'
14
14
  PR_MERGE_COMMAND = 'pr.merge'
15
+ PR_OPEN_COMMAND = 'pr.open'
15
16
  end
16
17
  end
17
18
  end
@@ -79,6 +79,10 @@ module Geet
79
79
  long_help: 'Merge the PR for the current branch'
80
80
  ]
81
81
 
82
+ PR_OPEN_OPTIONS = [
83
+ long_help: 'Open in the browser the PR for the current branch'
84
+ ]
85
+
82
86
  # Commands decoding table
83
87
 
84
88
  COMMANDS_DECODING_TABLE = {
@@ -100,6 +104,7 @@ module Geet
100
104
  'create' => PR_CREATE_OPTIONS,
101
105
  'list' => PR_LIST_OPTIONS,
102
106
  'merge' => PR_MERGE_OPTIONS,
107
+ 'open' => PR_OPEN_OPTIONS,
103
108
  },
104
109
  }
105
110
 
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'English'
4
+ require 'open3'
5
+ require 'shellwords'
6
+
7
+ module Geet
8
+ module Helpers
9
+ # Helper for services common workflow, for example, find the merge head.
10
+ #
11
+ module ServicesWorkflowHelper
12
+ # Requires: @git_client
13
+ #
14
+ def find_merge_head
15
+ [@git_client.owner, @git_client.current_branch]
16
+ end
17
+
18
+ # Expect to find only one.
19
+ #
20
+ # Requires: @out, @repository.
21
+ #
22
+ def checked_find_branch_pr(owner, head)
23
+ @out.puts "Finding PR with head (#{owner}:#{head})..."
24
+
25
+ prs = @repository.prs(owner: owner, head: head)
26
+
27
+ raise "Expected to find only one PR for the current branch; found: #{prs.size}" if prs.size != 1
28
+
29
+ prs[0]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../helpers/services_workflow_helper'
4
+
3
5
  module Geet
4
6
  module Services
5
7
  # Merges the PR for the current branch.
@@ -9,6 +11,8 @@ module Geet
9
11
  # constraints, but speeds up the workflow.
10
12
  #
11
13
  class MergePr
14
+ include Geet::Helpers::ServicesWorkflowHelper
15
+
12
16
  DEFAULT_GIT_CLIENT = Geet::Utils::GitClient.new
13
17
 
14
18
  def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT)
@@ -27,21 +31,6 @@ module Geet
27
31
 
28
32
  private
29
33
 
30
- def find_merge_head
31
- [@git_client.owner, @git_client.current_branch]
32
- end
33
-
34
- # Expect to find only one.
35
- def checked_find_branch_pr(owner, head)
36
- @out.puts "Finding PR with head (#{owner}:#{head})..."
37
-
38
- prs = @repository.prs(owner: owner, head: head)
39
-
40
- raise "Expected to find only one PR for the current branch; found: #{prs.size}" if prs.size != 1
41
-
42
- prs[0]
43
- end
44
-
45
34
  def merge_pr(pr)
46
35
  @out.puts "Merging PR ##{pr.number}..."
47
36
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../helpers/os_helper'
4
+ require_relative '../helpers/services_workflow_helper'
5
+
6
+ module Geet
7
+ module Services
8
+ # Open in the browser the PR for the current branch.
9
+ #
10
+ class OpenPr
11
+ include Geet::Helpers::OsHelper
12
+ include Geet::Helpers::ServicesWorkflowHelper
13
+
14
+ DEFAULT_GIT_CLIENT = Geet::Utils::GitClient.new
15
+
16
+ def initialize(repository, out: $stdout, git_client: DEFAULT_GIT_CLIENT)
17
+ @repository = repository
18
+ @out = out
19
+ @git_client = git_client
20
+ end
21
+
22
+ def execute(delete_branch: false)
23
+ merge_owner, merge_head = find_merge_head
24
+ pr = checked_find_branch_pr(merge_owner, merge_head)
25
+ open_file_with_default_application(pr.link)
26
+ pr
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geet
4
- VERSION = '0.3.12'
4
+ VERSION = '0.3.13'
5
5
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ require_relative '../../lib/geet/git/repository'
6
+ require_relative '../../lib/geet/services/open_pr'
7
+
8
+ describe Geet::Services::OpenPr do
9
+ let(:git_client) { Geet::Utils::GitClient.new }
10
+ let(:repository) { Geet::Git::Repository.new(git_client: git_client) }
11
+ let(:owner) { 'donaldduck' }
12
+ let(:branch) { 'mybranch' }
13
+
14
+ context 'with github.com' do
15
+ let(:repository_name) { 'testrepo_upstream' }
16
+
17
+ it 'should open the PR for the current branch' do
18
+ allow(git_client).to receive(:current_branch).and_return(branch)
19
+ allow(git_client).to receive(:remote).with('origin').and_return("git@github.com:#{owner}/#{repository_name}")
20
+
21
+ expected_pr_number = 3
22
+ expected_output = <<~STR
23
+ Finding PR with head (#{owner}:#{branch})...
24
+ STR
25
+
26
+ actual_output = StringIO.new
27
+ service_instance = described_class.new(repository, out: actual_output, git_client: git_client)
28
+
29
+ expect(service_instance).to receive(:open_file_with_default_application).with("https://github.com/#{owner}/#{repository_name}/pull/#{expected_pr_number}") do
30
+ # do nothing; just don't open the browser
31
+ end
32
+
33
+ service_result = VCR.use_cassette('github_com/open_pr') do
34
+ service_instance.execute
35
+ end
36
+
37
+ actual_pr_number = service_result.number
38
+
39
+ expect(actual_output.string).to eql(expected_output)
40
+ expect(actual_pr_number).to eql(expected_pr_number)
41
+ end
42
+
43
+ end # context 'with github.com'
44
+ end
@@ -0,0 +1,81 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.github.com/repos/donaldduck/testrepo_upstream/pulls?head=donaldduck:mybranch
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - application/vnd.github.v3+json
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - api.github.com
18
+ Authorization:
19
+ - Basic <GITHUB_CREDENTIALS>
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Date:
26
+ - Fri, 23 Aug 2019 11:00:45 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Server:
32
+ - GitHub.com
33
+ Status:
34
+ - 200 OK
35
+ X-Ratelimit-Limit:
36
+ - '5000'
37
+ X-Ratelimit-Remaining:
38
+ - '4974'
39
+ X-Ratelimit-Reset:
40
+ - '1566561447'
41
+ Cache-Control:
42
+ - private, max-age=60, s-maxage=60
43
+ Vary:
44
+ - Accept, Authorization, Cookie, X-GitHub-OTP
45
+ - Accept-Encoding
46
+ Etag:
47
+ - W/"e7f7cf9d886cc29625d28673dd96aa14"
48
+ X-Oauth-Scopes:
49
+ - admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook,
50
+ delete_repo, gist, notifications, repo, user
51
+ X-Accepted-Oauth-Scopes:
52
+ - ''
53
+ X-Github-Media-Type:
54
+ - github.v3; format=json
55
+ Access-Control-Expose-Headers:
56
+ - ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
57
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
58
+ X-GitHub-Media-Type
59
+ Access-Control-Allow-Origin:
60
+ - "*"
61
+ Strict-Transport-Security:
62
+ - max-age=31536000; includeSubdomains; preload
63
+ X-Frame-Options:
64
+ - deny
65
+ X-Content-Type-Options:
66
+ - nosniff
67
+ X-Xss-Protection:
68
+ - 1; mode=block
69
+ Referrer-Policy:
70
+ - origin-when-cross-origin, strict-origin-when-cross-origin
71
+ Content-Security-Policy:
72
+ - default-src 'none'
73
+ X-Github-Request-Id:
74
+ - 854A:1462F:532947A:6585CE4:5D5FC75D
75
+ body:
76
+ encoding: ASCII-8BIT
77
+ string: '[{"url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3","id":123456484,"node_id":"MDExOlB1bGxSZXF1ZXN0MzEwMzM3NDg0","html_url":"https://github.com/donaldduck/testrepo_upstream/pull/3","diff_url":"https://github.com/donaldduck/testrepo_upstream/pull/3.diff","patch_url":"https://github.com/donaldduck/testrepo_upstream/pull/3.patch","issue_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/3","number":3,"state":"open","locked":false,"title":"Add
78
+ testfile3","user":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-08-23T10:58:42Z","updated_at":"2019-08-23T10:58:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19d715aa53a33c334d0063c9a68fe5e321fe2378","assignee":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"assignees":[{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3/commits","review_comments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3/comments","review_comment_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/comments{/number}","comments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/3/comments","statuses_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/statuses/e8eec66553b6ab93b0c9315d7fddf7328c9d9d0e","head":{"label":"donaldduck:mybranch","ref":"mybranch","sha":"e8eec66553b6ab93b0c9315d7fddf7328c9d9d0e","user":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"repo":{"id":123456212,"node_id":"MDEwOlJlcG9zaXRvcnkxNzc1NjgyMTI=","name":"testrepo_upstream","full_name":"donaldduck/testrepo_upstream","private":true,"owner":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"html_url":"https://github.com/donaldduck/testrepo_upstream","description":null,"fork":false,"url":"https://api.github.com/repos/donaldduck/testrepo_upstream","forks_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/forks","keys_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/teams","hooks_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/hooks","issue_events_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/events{/number}","events_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/events","assignees_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/assignees{/user}","branches_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/branches{/branch}","tags_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/tags","blobs_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/refs{/sha}","trees_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/statuses/{sha}","languages_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/languages","stargazers_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/stargazers","contributors_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/contributors","subscribers_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/subscribers","subscription_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/subscription","commits_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/commits{/sha}","git_commits_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/commits{/sha}","comments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/comments{/number}","issue_comment_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/comments{/number}","contents_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/contents/{+path}","compare_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/merges","archive_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/downloads","issues_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues{/number}","pulls_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls{/number}","milestones_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/milestones{/number}","notifications_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/labels{/name}","releases_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/releases{/id}","deployments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/deployments","created_at":"2019-03-25T10:54:43Z","updated_at":"2019-03-25T11:16:56Z","pushed_at":"2019-08-23T10:58:43Z","git_url":"git://github.com/donaldduck/testrepo_upstream.git","ssh_url":"git@github.com:donaldduck/testrepo_upstream.git","clone_url":"https://github.com/donaldduck/testrepo_upstream.git","svn_url":"https://github.com/donaldduck/testrepo_upstream","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"donaldduck:master","ref":"master","sha":"f73f5f313b1bde716ad5f1975b7ed0234d945177","user":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"repo":{"id":123456212,"node_id":"MDEwOlJlcG9zaXRvcnkxNzc1NjgyMTI=","name":"testrepo_upstream","full_name":"donaldduck/testrepo_upstream","private":true,"owner":{"login":"donaldduck","id":1234566,"node_id":"MDQ6VXNlcjE1OTUzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1234566?v=4","gravatar_id":"","url":"https://api.github.com/users/donaldduck","html_url":"https://github.com/donaldduck","followers_url":"https://api.github.com/users/donaldduck/followers","following_url":"https://api.github.com/users/donaldduck/following{/other_user}","gists_url":"https://api.github.com/users/donaldduck/gists{/gist_id}","starred_url":"https://api.github.com/users/donaldduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donaldduck/subscriptions","organizations_url":"https://api.github.com/users/donaldduck/orgs","repos_url":"https://api.github.com/users/donaldduck/repos","events_url":"https://api.github.com/users/donaldduck/events{/privacy}","received_events_url":"https://api.github.com/users/donaldduck/received_events","type":"User","site_admin":false},"html_url":"https://github.com/donaldduck/testrepo_upstream","description":null,"fork":false,"url":"https://api.github.com/repos/donaldduck/testrepo_upstream","forks_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/forks","keys_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/keys{/key_id}","collaborators_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/teams","hooks_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/hooks","issue_events_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/events{/number}","events_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/events","assignees_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/assignees{/user}","branches_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/branches{/branch}","tags_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/tags","blobs_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/refs{/sha}","trees_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/trees{/sha}","statuses_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/statuses/{sha}","languages_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/languages","stargazers_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/stargazers","contributors_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/contributors","subscribers_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/subscribers","subscription_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/subscription","commits_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/commits{/sha}","git_commits_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/git/commits{/sha}","comments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/comments{/number}","issue_comment_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/comments{/number}","contents_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/contents/{+path}","compare_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/compare/{base}...{head}","merges_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/merges","archive_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/downloads","issues_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues{/number}","pulls_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls{/number}","milestones_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/milestones{/number}","notifications_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/labels{/name}","releases_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/releases{/id}","deployments_url":"https://api.github.com/repos/donaldduck/testrepo_upstream/deployments","created_at":"2019-03-25T10:54:43Z","updated_at":"2019-03-25T11:16:56Z","pushed_at":"2019-08-23T10:58:43Z","git_url":"git://github.com/donaldduck/testrepo_upstream.git","ssh_url":"git@github.com:donaldduck/testrepo_upstream.git","clone_url":"https://github.com/donaldduck/testrepo_upstream.git","svn_url":"https://github.com/donaldduck/testrepo_upstream","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3"},"html":{"href":"https://github.com/donaldduck/testrepo_upstream/pull/3"},"issue":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/3"},"comments":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/donaldduck/testrepo_upstream/statuses/e8eec66553b6ab93b0c9315d7fddf7328c9d9d0e"}},"author_association":"OWNER"}]'
79
+ http_version:
80
+ recorded_at: Fri, 23 Aug 2019 11:00:45 GMT
81
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-25 00:00:00.000000000 Z
11
+ date: 2019-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_scripting
@@ -96,6 +96,7 @@ files:
96
96
  - lib/geet/gitlab/user.rb
97
97
  - lib/geet/helpers/json_helper.rb
98
98
  - lib/geet/helpers/os_helper.rb
99
+ - lib/geet/helpers/services_workflow_helper.rb
99
100
  - lib/geet/helpers/summary_helper.rb
100
101
  - lib/geet/resources/templates/edit_summary.md
101
102
  - lib/geet/services/abstract_create_issue.rb
@@ -108,6 +109,7 @@ files:
108
109
  - lib/geet/services/list_milestones.rb
109
110
  - lib/geet/services/list_prs.rb
110
111
  - lib/geet/services/merge_pr.rb
112
+ - lib/geet/services/open_pr.rb
111
113
  - lib/geet/shared/http_error.rb
112
114
  - lib/geet/shared/repo_permissions.rb
113
115
  - lib/geet/shared/selection.rb
@@ -125,6 +127,7 @@ files:
125
127
  - spec/integration/list_milestones_spec.rb
126
128
  - spec/integration/list_prs_spec.rb
127
129
  - spec/integration/merge_pr_spec.rb
130
+ - spec/integration/open_pr_spec.rb
128
131
  - spec/spec_helper.rb
129
132
  - spec/vcr_cassettes/create_gist_private.yml
130
133
  - spec/vcr_cassettes/create_gist_public.yml
@@ -146,6 +149,7 @@ files:
146
149
  - spec/vcr_cassettes/github_com/list_milestones.yml
147
150
  - spec/vcr_cassettes/github_com/merge_pr.yml
148
151
  - spec/vcr_cassettes/github_com/merge_pr_with_branch_deletion.yml
152
+ - spec/vcr_cassettes/github_com/open_pr.yml
149
153
  - spec/vcr_cassettes/gitlab_com/create_label.yml
150
154
  - spec/vcr_cassettes/gitlab_com/list_issues.yml
151
155
  - spec/vcr_cassettes/gitlab_com/list_issues_with_assignee.yml