fbe 0.0.57 → 0.0.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbe/github_graph.rb +32 -23
- data/lib/fbe/octo.rb +4 -1
- data/lib/fbe.rb +1 -1
- data/test/fbe/test_github_graph.rb +23 -0
- 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: 037e6b31b619e5a79f4f986f6be016c8cafed2fe3b7b000f0f02de5780052df1
|
4
|
+
data.tar.gz: 85134954a6f355895224da28d587adfad1bca6f0f41b2b3da3b7ae6757d8038f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efcd99caa7002a17af0330cc0b9ab64bf049fee54d11c72454e90f4a99fca8b739b2f5ad351caa525023eb0bea0f15a7e964949821c953e77e4a76ff247d929b
|
7
|
+
data.tar.gz: b5d1c69ca30a4973400ceb74c447aa90e909103ab6c73d7e4aefd8e254bbfd868daa1e215a8080bf7da6135f312077de6525437a7fb12da1bad3570d2cfc2fdd
|
data/lib/fbe/github_graph.rb
CHANGED
@@ -82,7 +82,7 @@ class Fbe::Graph
|
|
82
82
|
}
|
83
83
|
GRAPHQL
|
84
84
|
)
|
85
|
-
result
|
85
|
+
result&.to_h&.dig('repository', 'pullRequest', 'reviewThreads', 'nodes') || []
|
86
86
|
end
|
87
87
|
|
88
88
|
def total_commits(owner, name, branch)
|
@@ -124,29 +124,38 @@ class Fbe::Graph
|
|
124
124
|
{}
|
125
125
|
end
|
126
126
|
|
127
|
-
def resolved_conversations(
|
128
|
-
|
129
|
-
|
130
|
-
'
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
127
|
+
def resolved_conversations(owner, name, _number)
|
128
|
+
data = {
|
129
|
+
zerocracy_baza: [
|
130
|
+
conversation('PRRT_kwDOK2_4A85BHZAR')
|
131
|
+
]
|
132
|
+
}
|
133
|
+
data[:"#{owner}_#{name}"] || []
|
134
|
+
end
|
135
|
+
|
136
|
+
private
|
137
|
+
|
138
|
+
def conversation(id)
|
139
|
+
{
|
140
|
+
'id' => id,
|
141
|
+
'isResolved' => true,
|
142
|
+
'comments' => {
|
143
|
+
'nodes' => [
|
144
|
+
{
|
145
|
+
'id' => 'PRRC_kwDOK2_4A85l3obO',
|
146
|
+
'body' => 'first message',
|
147
|
+
'author' => { '__typename' => 'User', 'login' => 'reviewer' },
|
148
|
+
'createdAt' => '2024-08-08T09:41:46Z'
|
149
|
+
},
|
150
|
+
{
|
151
|
+
'id' => 'PRRC_kwDOK2_4A85l3yTp',
|
152
|
+
'body' => 'second message',
|
153
|
+
'author' => { '__typename' => 'User', 'login' => 'programmer' },
|
154
|
+
'createdAt' => '2024-08-08T10:01:55Z'
|
155
|
+
}
|
156
|
+
]
|
148
157
|
}
|
149
|
-
|
158
|
+
}
|
150
159
|
end
|
151
160
|
end
|
152
161
|
end
|
data/lib/fbe/octo.rb
CHANGED
data/lib/fbe.rb
CHANGED
@@ -80,6 +80,15 @@ class TestGitHubGraph < Minitest::Test
|
|
80
80
|
g = Fbe.github_graph(options:, loog: Loog::NULL, global:)
|
81
81
|
result = g.resolved_conversations('zerocracy', 'baza', 172)
|
82
82
|
assert_equal(1, result.count)
|
83
|
+
result = g.resolved_conversations('zerocracy', 'baza', 0)
|
84
|
+
assert(Array, result.class)
|
85
|
+
assert(0, result.count)
|
86
|
+
result = g.resolved_conversations('zerocracy1', 'baza', 0)
|
87
|
+
assert(Array, result.class)
|
88
|
+
assert(0, result.count)
|
89
|
+
result = g.resolved_conversations('zerocracy', 'baza1', 0)
|
90
|
+
assert(Array, result.class)
|
91
|
+
assert(0, result.count)
|
83
92
|
end
|
84
93
|
|
85
94
|
def test_gets_total_commits_of_repo
|
@@ -91,4 +100,18 @@ class TestGitHubGraph < Minitest::Test
|
|
91
100
|
result = g.total_commits('zerocracy', 'baza', 'master')
|
92
101
|
assert(result.positive?)
|
93
102
|
end
|
103
|
+
|
104
|
+
def test_get_fake_empty_conversations
|
105
|
+
WebMock.disable_net_connect!
|
106
|
+
graph = Fbe.github_graph(options: Judges::Options.new('testing' => true), loog: Loog::NULL, global: {})
|
107
|
+
result = graph.resolved_conversations(nil, 'baza', 172)
|
108
|
+
assert(result.empty?)
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_get_fake_conversations
|
112
|
+
WebMock.disable_net_connect!
|
113
|
+
graph = Fbe.github_graph(options: Judges::Options.new('testing' => true), loog: Loog::NULL, global: {})
|
114
|
+
result = graph.resolved_conversations('zerocracy', 'baza', 172)
|
115
|
+
assert_equal(1, result.count)
|
116
|
+
end
|
94
117
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.58
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|