pra 1.2.0 → 1.3.0

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
  SHA1:
3
- metadata.gz: 5d8d6958b72e8f36437ec53d445f6f2ebf534109
4
- data.tar.gz: aa381045ea18651af3ebc0bec87e0c6257bc92bf
3
+ metadata.gz: 89ec7f7f85002e86fe74ddf30a681f9ddf18c101
4
+ data.tar.gz: daae02b72670be46c098602e4250dd1503164881
5
5
  SHA512:
6
- metadata.gz: 0b0848e6357f350b38a3d7f48472f339d6a004020aa01f45697014d5a6e2387d172b654f6fbb14d49796b748fe9cdff431f5aa9d0af28a67ce1b0f33f8860d67
7
- data.tar.gz: 11cd8fd6da709723581b2e1e3137f278a9e1b0a5f5c5b2ce7d7123653d9edae27cc9b6e016df3ae65d041ef485a5f875607a2bbf27d64d67f02008ea5f8e8900
6
+ metadata.gz: a276f3ef1fdb56116663a3df39fa88cf40d5105e6adbb7f60ccc68644b172bd24e374fd082ae6acbe68835640878f42b7778ef45a9519858bece29d0b5a8e8ff
7
+ data.tar.gz: f27e44406fc7e07362fbc7ad5f12a94c248e7afe9073c8d702cb2700a6674c7334b6a4bad386da4e6d709f51aa6ecaab01460a2bc85963ba3eea5e98af4ac073
data/ChangeLog.md CHANGED
@@ -6,6 +6,12 @@ versions as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ #### v1.3.0
10
+
11
+ * Added support for Stash user profile repositories. This means you can now
12
+ have `pra` watch not only your Stash project housed repositories but also
13
+ your personal repositories that are housed under your Stash user profile.
14
+
9
15
  #### v1.2.0
10
16
 
11
17
  * Added Assignee blacklisting so that when you have a group user that
data/README.md CHANGED
@@ -21,11 +21,6 @@ directory. The following is an example config that can be used as a starter.
21
21
  **your.stash.server**, and the **repositories** sections of each of the pull
22
22
  sources.
23
23
 
24
- #### Assignee Blacklist
25
-
26
- Reduces noise to more easily determine which pull requests are unassigned. Names
27
- added will not appear in the assignee column.
28
-
29
24
  {
30
25
  "pull_sources": [
31
26
  {
@@ -37,6 +32,7 @@ added will not appear in the assignee column.
37
32
  "password": "your.password",
38
33
  "repositories": [
39
34
  { "project_slug": "CAP", "repository_slug": "capture_api" },
35
+ { "user_slug": "bob.villa", "repository_slug": "personal_notes" },
40
36
  { "project_slug": "RELENG", "repository_slug": "ramboo" }
41
37
  ]
42
38
  }
@@ -66,6 +62,25 @@ file to get you started. Then simply replace the appropriate fields and the
66
62
  **repositories** sections for all the pull sources with the repository
67
63
  information for the repositories you want to watch for open pull requests.
68
64
 
65
+ #### Stash User & Project Repositories
66
+
67
+ You may have noticed that the above example shows two repository objects in its
68
+ Stash **repositories** array.
69
+
70
+ 1. Project Scoped Repository - `{ "project_slug": "CAP", "repository_slug": "capture_api" },`
71
+ 2. User Scoped Repository - `{ "user_slug": "bob.villa", "repository_slug": "personal_notes" },`
72
+
73
+ This is because Stash has both the concept of repsositories that are organized
74
+ under Projects and repositories that are organized under Users. Therefore, you
75
+ would want to use the **User Scoped Repository** in scenarios where the
76
+ repository is housed under a user and the **Project Scoped Repository** in
77
+ scenarios where the repository is housed under a project.
78
+
79
+ #### Assignee Blacklist
80
+
81
+ Reduces noise to more easily determine which pull requests are unassigned. Names
82
+ added will not appear in the assignee column.
83
+
69
84
  ### GitHub Authentication
70
85
 
71
86
  #### Multi-Factor Authentication
@@ -26,7 +26,11 @@ module Pra
26
26
  end
27
27
 
28
28
  def rest_api_pull_request_url(repository_config)
29
- "#{@config['protocol']}://#{@config['host']}/rest/api/1.0/projects/#{repository_config["project_slug"]}/repos/#{repository_config["repository_slug"]}/pull-requests"
29
+ if repository_config.has_key?("user_slug")
30
+ "#{@config['protocol']}://#{@config['host']}/rest/api/1.0/users/#{repository_config["user_slug"]}/repos/#{repository_config["repository_slug"]}/pull-requests"
31
+ else
32
+ "#{@config['protocol']}://#{@config['host']}/rest/api/1.0/projects/#{repository_config["project_slug"]}/repos/#{repository_config["repository_slug"]}/pull-requests"
33
+ end
30
34
  end
31
35
 
32
36
  def rest_api_pull_request_resource(repository_config)
data/lib/pra/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pra
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -78,21 +78,42 @@ describe Pra::StashPullSource do
78
78
  end
79
79
 
80
80
  describe "#rest_api_pull_request_url" do
81
- let(:config) do
82
- {
83
- "protocol" => "https",
84
- "host" => "my.stash.instance",
85
- "username" => "foo",
86
- "password" => "bar",
87
- "repositories" => [
88
- { "project_slug" => "CAP", "repository_slug" => "capture_api" }
89
- ]
90
- }
81
+ context "when config is for a user repository" do
82
+ let(:config) do
83
+ {
84
+ "protocol" => "https",
85
+ "host" => "my.stash.instance",
86
+ "username" => "foo",
87
+ "password" => "bar",
88
+ "repositories" => [
89
+ { "user_slug" => "andrew.deponte", "repository_slug" => "capture_api" }
90
+ ]
91
+ }
92
+ end
93
+
94
+ it "returns the user pull request url compiled from the config options" do
95
+ pull_source = Pra::StashPullSource.new(config)
96
+ expect(pull_source.rest_api_pull_request_url({ "user_slug" => "andrew.deponte", "repository_slug" => "capture_api" })).to eq("https://my.stash.instance/rest/api/1.0/users/andrew.deponte/repos/capture_api/pull-requests")
97
+ end
91
98
  end
92
99
 
93
- it "returns the pull request url compiled from the config options" do
94
- pull_source = Pra::StashPullSource.new(config)
95
- pull_source.rest_api_pull_request_url({ "project_slug" => "CAP", "repository_slug" => "capture_api" }).should eq("https://my.stash.instance/rest/api/1.0/projects/CAP/repos/capture_api/pull-requests")
100
+ context "when config is for a project repository" do
101
+ let(:config) do
102
+ {
103
+ "protocol" => "https",
104
+ "host" => "my.stash.instance",
105
+ "username" => "foo",
106
+ "password" => "bar",
107
+ "repositories" => [
108
+ { "project_slug" => "CAP", "repository_slug" => "capture_api" }
109
+ ]
110
+ }
111
+ end
112
+
113
+ it "returns the project pull request url compiled from the config options" do
114
+ pull_source = Pra::StashPullSource.new(config)
115
+ pull_source.rest_api_pull_request_url({ "project_slug" => "CAP", "repository_slug" => "capture_api" }).should eq("https://my.stash.instance/rest/api/1.0/projects/CAP/repos/capture_api/pull-requests")
116
+ end
96
117
  end
97
118
  end
98
119
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2014-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler