gitlab-triage 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87679dea12bb15870422da7cbb53b8f884a9be57adc31121f630f627cf623c31
4
- data.tar.gz: 174f84a54229c2149676585d549c2e5d632e1af08e8d20b06185cf5a25658ccb
3
+ metadata.gz: d17d4b0574943a4b6dc8419c28fe0d8d09577adebe135e6aafe6cdd06a2ebd12
4
+ data.tar.gz: 7e937ca82cec7feec0e7223d7a6e4a967cd0d0a65d54a26b807f32cad3bf8669
5
5
  SHA512:
6
- metadata.gz: 38d5da0ee38003cb2721661ec274fd29b8e5d6ad5c13ee71fa7b10568a27e54ee8fd8542ea22006e7f37122bf13324f4466ce7eb965dab785133be2e6d10e0ef
7
- data.tar.gz: 5de453ccaa7ace322a77a318f267421336a38ade1986a83b3e0a4611edbb8f6f6990272dc130872a47c9c394f337f53699cb96a097b7b021dbdeff250e16eb5c
6
+ metadata.gz: 7041a271066e0b933dfc3d3fa47b7150592746c3a0f25352b363cfc4f6de9c48556ede940394e72c5054e7076244e3e87cc4c2e068755a43e66bbf3d1934f5ed
7
+ data.tar.gz: bf26c4395bc081ac3930f001448f33d4342dcb2f3a0aac8f74cff84aabe2f665675be8adf5578a2ef3a39d573c5d6f7dbcfeafa7a88339b389ab839a5c7918aa
data/README.md CHANGED
@@ -909,7 +909,7 @@ Which could generate an issue like:
909
909
 
910
910
  Here's a list of currently available Ruby expression API:
911
911
 
912
- ##### API
912
+ ##### Methods for `Issue` and `MergeRequest` (the context)
913
913
 
914
914
  | Name | Return type | Description |
915
915
  | ---- | ---- | ---- |
@@ -924,6 +924,12 @@ Here's a list of currently available Ruby expression API:
924
924
  | project_path | String | The path with namespace to the issues or merge requests project |
925
925
  | full_resource_reference | String | A full reference incuding project path to the issue or merge request |
926
926
 
927
+ ##### Methods for `MergeRequest` (merge request context)
928
+
929
+ | Method | Return type | Description |
930
+ | ---- | ---- | ---- |
931
+ | first_contribution? | Boolean | `true` if it's the author's first contribution to the project; `false` otherwise. This API requires an additional API request for the merge request, thus would be slower. |
932
+
927
933
  ##### Methods for `Milestone`
928
934
 
929
935
  | Method | Return type | Description |
@@ -41,6 +41,11 @@ module Gitlab
41
41
 
42
42
  private
43
43
 
44
+ def expand_resource!(params: {})
45
+ resource.merge!(
46
+ network.query_api_cached(resource_url(params: params)).first)
47
+ end
48
+
44
49
  def source_resource
45
50
  @source_resource ||= network.query_api_cached(source_url).first
46
51
  end
@@ -12,6 +12,15 @@ module Gitlab
12
12
  def reference
13
13
  '!'
14
14
  end
15
+
16
+ def first_contribution?
17
+ if resource.key?(:first_contribution)
18
+ resource[:first_contribution]
19
+ else
20
+ expanded = expand_resource!
21
+ expanded[:first_contribution]
22
+ end
23
+ end
15
24
  end
16
25
  end
17
26
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module Triage
5
- VERSION = '1.8.0'
5
+ VERSION = '1.9.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-triage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport