gitlab-triage 1.6.1 → 1.7.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 115d63f58149d8ed49f22fcafc929b06ebcf7ba180cb1047121f61a7c67d890b
|
|
4
|
+
data.tar.gz: 13f5bfcfd2bcb8325a40566fe86e30e13f03eb2aa0e3935c0f91c53446867ae2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac6caff9332e7cc266ea22abb7beed863c577e4d4d4a2fb4c63171cf1834b14b1d4f0abaf616408d7a3ae9261a1668ce5e54ff6de971e14fd5136f584d7e7cd3
|
|
7
|
+
data.tar.gz: 24e71190417f5e36deca4d1b6b1ee1991eecdf7930b5af852c7b861b75dd8e50071e7c0c051c04a84f9247a9a89e4887ec016f7896823b333c5350cc1643b7ba
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# GitLab Triage Project
|
|
4
4
|
|
|
5
|
-
This project
|
|
5
|
+
This project allows to automate triaging of issues and merge requests for GitLab projects or groups.
|
|
6
6
|
|
|
7
7
|
## gitlab-triage gem
|
|
8
8
|
|
|
@@ -851,6 +851,8 @@ Here's a list of currently available Ruby expression API:
|
|
|
851
851
|
| labels_chronologically | [Label] | Same as `labels_with_details` but sorted chronologically |
|
|
852
852
|
| label_events | [LabelEvent] | A list of label events on the resource |
|
|
853
853
|
| instance_version | InstanceVersion | The version for the GitLab instance we're triaging with |
|
|
854
|
+
| project_path | String | The path with namespace to the issues or merge requests project |
|
|
855
|
+
| full_resource_reference | String | A full reference incuding project path to the issue or merge request |
|
|
854
856
|
|
|
855
857
|
##### Methods for `Milestone`
|
|
856
858
|
|
|
@@ -49,6 +49,20 @@ module Gitlab
|
|
|
49
49
|
@author ||= resource.dig(:author, :username)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
def project_path
|
|
53
|
+
@project_path ||=
|
|
54
|
+
request_project(resource[:project_id])[:path_with_namespace]
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def full_resource_reference
|
|
58
|
+
@full_resource_reference ||=
|
|
59
|
+
"#{project_path}#{reference}#{resource[:iid]}"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def reference
|
|
63
|
+
raise NotImplementedError
|
|
64
|
+
end
|
|
65
|
+
|
|
52
66
|
def root_id(
|
|
53
67
|
resource: source_resource,
|
|
54
68
|
max_levels: MAX_PARENT_LOOKUP)
|
|
@@ -72,6 +86,10 @@ module Gitlab
|
|
|
72
86
|
resource_url(sub_resource_type: 'resource_label_events'))
|
|
73
87
|
end
|
|
74
88
|
|
|
89
|
+
def request_project(project_id)
|
|
90
|
+
network.query_api_cached(project_url(project_id)).first
|
|
91
|
+
end
|
|
92
|
+
|
|
75
93
|
def request_group(group_id)
|
|
76
94
|
network.query_api_cached(group_url(group_id)).first
|
|
77
95
|
end
|
|
@@ -83,6 +101,14 @@ module Gitlab
|
|
|
83
101
|
source_id: group_id
|
|
84
102
|
).build
|
|
85
103
|
end
|
|
104
|
+
|
|
105
|
+
def project_url(project_id)
|
|
106
|
+
Gitlab::Triage::UrlBuilders::UrlBuilder.new(
|
|
107
|
+
network_options: network.options,
|
|
108
|
+
source: 'projects',
|
|
109
|
+
source_id: project_id
|
|
110
|
+
).build
|
|
111
|
+
end
|
|
86
112
|
end
|
|
87
113
|
end
|
|
88
114
|
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.7.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-
|
|
11
|
+
date: 2020-03-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|