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 +4 -4
- data/README.md +7 -1
- data/lib/gitlab/triage/resource/base.rb +5 -0
- data/lib/gitlab/triage/resource/merge_request.rb +9 -0
- data/lib/gitlab/triage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d17d4b0574943a4b6dc8419c28fe0d8d09577adebe135e6aafe6cdd06a2ebd12
|
4
|
+
data.tar.gz: 7e937ca82cec7feec0e7223d7a6e4a967cd0d0a65d54a26b807f32cad3bf8669
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
#####
|
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
|
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.
|
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-
|
11
|
+
date: 2020-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|