fbe 0.41.6 → 0.43.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/.github/workflows/actionlint.yml +1 -1
- data/.github/workflows/codecov.yml +1 -1
- data/.github/workflows/copyrights.yml +1 -1
- data/.github/workflows/markdown-lint.yml +2 -2
- data/.github/workflows/pdd.yml +1 -1
- data/.github/workflows/rake.yml +1 -1
- data/.github/workflows/reuse.yml +1 -1
- data/.github/workflows/typos.yml +2 -2
- data/.github/workflows/xcop.yml +1 -1
- data/.github/workflows/yamllint.yml +1 -1
- data/assets/pmp.xml +89 -0
- data/lib/fbe/pmp.rb +43 -12
- data/lib/fbe/tombstone.rb +28 -3
- data/lib/fbe.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5389d9ecc0b9c343ea11ce2054aa1c8bf2efaff8d62e320e92e142bc3b9ed1cc
|
|
4
|
+
data.tar.gz: e04b7d8d445789490aee49c7ee8a068da1256c6636b01ad1b350b74ddf8168e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4b269991d90d608370dd3c0fb2ad703d700f1a959022143a0f13291d9699d7af71f85125fa760b4cda3584c59a73fe2b49666445ee95beb4d1c104b66e44a75
|
|
7
|
+
data.tar.gz: ec874b7fb71b3c325c7d05cb3bba9c168270ddfe10e3c8294778a0ffabac5ebf2aa522fafc39eddf11f64f7f7308798d9d88c3adb41559241e97dd88436676fa
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
timeout-minutes: 15
|
|
16
16
|
runs-on: ubuntu-24.04
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
19
|
- name: Download actionlint
|
|
20
20
|
id: get_actionlint
|
|
21
21
|
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
data/.github/workflows/pdd.yml
CHANGED
data/.github/workflows/rake.yml
CHANGED
data/.github/workflows/reuse.yml
CHANGED
data/.github/workflows/typos.yml
CHANGED
data/.github/workflows/xcop.yml
CHANGED
data/assets/pmp.xml
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
<!--
|
|
3
|
+
SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
|
4
|
+
SPDX-License-Identifier: MIT
|
|
5
|
+
-->
|
|
6
|
+
<pmp>
|
|
7
|
+
<area name="hr">
|
|
8
|
+
<p>
|
|
9
|
+
<name>anger</name>
|
|
10
|
+
<default>2</default>
|
|
11
|
+
<type>int</type>
|
|
12
|
+
<memo>The level of anger</memo>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
<name>days_to_reward</name>
|
|
16
|
+
<default>14</default>
|
|
17
|
+
<type>int</type>
|
|
18
|
+
<memo>How many days ago an event must happen so that we reward it?</memo>
|
|
19
|
+
</p>
|
|
20
|
+
<p>
|
|
21
|
+
<name>days_of_running_score</name>
|
|
22
|
+
<default>56</default>
|
|
23
|
+
<type>int</type>
|
|
24
|
+
<memo>How many days to include into the score of a person?</memo>
|
|
25
|
+
</p>
|
|
26
|
+
<p>
|
|
27
|
+
<name>master_punish_days</name>
|
|
28
|
+
<default>4</default>
|
|
29
|
+
<type>int</type>
|
|
30
|
+
<memo>Every X days to punish for direct push to master</memo>
|
|
31
|
+
</p>
|
|
32
|
+
</area>
|
|
33
|
+
<area name="integration">
|
|
34
|
+
<p>
|
|
35
|
+
<name>eva_interval</name>
|
|
36
|
+
<default>10</default>
|
|
37
|
+
<type>int</type>
|
|
38
|
+
<memo>Every X days to collect EVA statistics</memo>
|
|
39
|
+
</p>
|
|
40
|
+
<p>
|
|
41
|
+
<name>eva_learn_hours</name>
|
|
42
|
+
<default>8</default>
|
|
43
|
+
<type>int</type>
|
|
44
|
+
<memo>Every X hours to collect EVA numbers and learn the model using them</memo>
|
|
45
|
+
</p>
|
|
46
|
+
</area>
|
|
47
|
+
<area name="quality">
|
|
48
|
+
<p>
|
|
49
|
+
<name>paranoia</name>
|
|
50
|
+
<default>2</default>
|
|
51
|
+
<type>int</type>
|
|
52
|
+
<memo>The level of paranoia</memo>
|
|
53
|
+
</p>
|
|
54
|
+
<p>
|
|
55
|
+
<name>qos_days</name>
|
|
56
|
+
<default>32</default>
|
|
57
|
+
<type>int</type>
|
|
58
|
+
<memo>For how many days to collect QoS data</memo>
|
|
59
|
+
</p>
|
|
60
|
+
</area>
|
|
61
|
+
<area name="scope">
|
|
62
|
+
<p>
|
|
63
|
+
<name>qod_days</name>
|
|
64
|
+
<default>32</default>
|
|
65
|
+
<type>int</type>
|
|
66
|
+
<memo>For how many days to collect QoD data</memo>
|
|
67
|
+
</p>
|
|
68
|
+
</area>
|
|
69
|
+
<area name="cost">
|
|
70
|
+
<p>
|
|
71
|
+
<name>love</name>
|
|
72
|
+
<default>2</default>
|
|
73
|
+
<type>int</type>
|
|
74
|
+
<memo>The level of love</memo>
|
|
75
|
+
</p>
|
|
76
|
+
<p>
|
|
77
|
+
<name>award_price</name>
|
|
78
|
+
<default>0.0</default>
|
|
79
|
+
<type>float</type>
|
|
80
|
+
<memo>How many USD to pay for each award point</memo>
|
|
81
|
+
</p>
|
|
82
|
+
<p>
|
|
83
|
+
<name>slaves</name>
|
|
84
|
+
<default>torvalds</default>
|
|
85
|
+
<type>string</type>
|
|
86
|
+
<memo>List of people, who are not supposed to be paid real cash</memo>
|
|
87
|
+
</p>
|
|
88
|
+
</area>
|
|
89
|
+
</pmp>
|
data/lib/fbe/pmp.rb
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
|
4
4
|
# SPDX-License-Identifier: MIT
|
|
5
5
|
|
|
6
|
+
require 'delegate'
|
|
7
|
+
require 'nokogiri'
|
|
6
8
|
require 'others'
|
|
7
9
|
require_relative '../fbe'
|
|
8
10
|
require_relative 'fb'
|
|
@@ -41,18 +43,47 @@ require_relative 'fb'
|
|
|
41
43
|
# # Get deadline from time area
|
|
42
44
|
# deadline = Fbe.pmp.time.deadline
|
|
43
45
|
def Fbe.pmp(fb: Fbe.fb, global: $global, options: $options, loog: $loog)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
xml = Nokogiri::XML(File.read(File.join(__dir__, '../../assets/pmp.xml')))
|
|
47
|
+
pmpv =
|
|
48
|
+
Class.new(SimpleDelegator) do
|
|
49
|
+
def initialize(value, dv)
|
|
50
|
+
super(value)
|
|
51
|
+
@dv = dv
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def default
|
|
55
|
+
@dv
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
Class.new do
|
|
59
|
+
define_method(:areas) do
|
|
60
|
+
xml.xpath('/pmp/area/@name').map(&:value)
|
|
48
61
|
end
|
|
49
|
-
others do |*
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
raise "Unknown area #{area.inspect}" if
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
others do |*args1|
|
|
63
|
+
area = args1.first.to_s
|
|
64
|
+
node = xml.at_xpath("/pmp/area[@name='#{area}']")
|
|
65
|
+
raise "Unknown area #{area.inspect}" if node.nil?
|
|
66
|
+
Class.new do
|
|
67
|
+
define_method(:properties) do
|
|
68
|
+
node.xpath('p/name').map(&:text)
|
|
69
|
+
end
|
|
70
|
+
others do |*args2|
|
|
71
|
+
param = args2.first.to_s
|
|
72
|
+
prop = node.at_xpath("p[name='#{param}']")
|
|
73
|
+
raise "Unknown property #{param.inspect} in the #{area.inspect} area" if prop.nil?
|
|
74
|
+
f = Fbe.fb(global:, fb:, options:, loog:).query("(and (eq what 'pmp') (eq area '#{area}'))").each.first
|
|
75
|
+
r = f&.[](param)&.first
|
|
76
|
+
d = prop.at_xpath('default').text
|
|
77
|
+
t = prop.at_xpath('type').text
|
|
78
|
+
dv =
|
|
79
|
+
case t
|
|
80
|
+
when 'int' then d.to_i
|
|
81
|
+
when 'float' then d.to_f
|
|
82
|
+
else d
|
|
83
|
+
end
|
|
84
|
+
pmpv.new(r || dv, dv)
|
|
85
|
+
end
|
|
86
|
+
end.new
|
|
56
87
|
end
|
|
57
|
-
end
|
|
88
|
+
end.new
|
|
58
89
|
end
|
data/lib/fbe/tombstone.rb
CHANGED
|
@@ -22,11 +22,32 @@ class Fbe::Tombstone
|
|
|
22
22
|
@fid = fid
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
# See all issues in the tombstone, as array of numbers.
|
|
26
|
+
# @param [String] where The place, e.g. "github"
|
|
27
|
+
# @param [Integer] repo ID of repository
|
|
28
|
+
# @return [Array<Integer>] IDs of issue
|
|
29
|
+
def issues(where, repo)
|
|
30
|
+
raise 'The type of "where" is not String' unless where.is_a?(String)
|
|
31
|
+
raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
|
|
32
|
+
f = @fb.query(
|
|
33
|
+
"(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
|
|
34
|
+
).each.first
|
|
35
|
+
return [] if f.nil?
|
|
36
|
+
f['issues'].map do |ii|
|
|
37
|
+
a, b = ii.split('-').map(&:to_i)
|
|
38
|
+
b = a if b.nil?
|
|
39
|
+
(a..b).map { |i| i }
|
|
40
|
+
end.flatten
|
|
41
|
+
end
|
|
42
|
+
|
|
25
43
|
# Put it there.
|
|
26
44
|
# @param [String] where The place, e.g. "github"
|
|
27
45
|
# @param [Integer] repo ID of repository
|
|
28
|
-
# @param [Integer] issue ID of issue (or array of them)
|
|
46
|
+
# @param [Integer, Array<Integer>] issue ID of issue (or array of them)
|
|
29
47
|
def bury!(where, repo, issue)
|
|
48
|
+
raise 'The type of "where" is not String' unless where.is_a?(String)
|
|
49
|
+
raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
|
|
50
|
+
raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
|
|
30
51
|
f =
|
|
31
52
|
Fbe.if_absent(fb: @fb, always: true) do |n|
|
|
32
53
|
n.what = 'tombstone'
|
|
@@ -48,16 +69,20 @@ class Fbe::Tombstone
|
|
|
48
69
|
end
|
|
49
70
|
end
|
|
50
71
|
Fbe.overwrite(
|
|
51
|
-
f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" },
|
|
72
|
+
f, 'issues', merged.map { |ii| ii[0] == ii[1] ? ii[0].to_s : "#{ii[0]}-#{ii[1]}" },
|
|
73
|
+
fb: @fb, fid: @fid
|
|
52
74
|
)
|
|
53
75
|
end
|
|
54
76
|
|
|
55
77
|
# Is it there?
|
|
56
78
|
# @param [String] where The place, e.g. "github"
|
|
57
79
|
# @param [Integer] repo ID of repository
|
|
58
|
-
# @param [Integer] issue ID of issue (or array of them)
|
|
80
|
+
# @param [Integer, Array<Integer>] issue ID of issue (or array of them)
|
|
59
81
|
# @return [Boolean] True if it's there
|
|
60
82
|
def has?(where, repo, issue)
|
|
83
|
+
raise 'The type of "where" is not String' unless where.is_a?(String)
|
|
84
|
+
raise 'The type of "repo" is not Integer' unless repo.is_a?(Integer)
|
|
85
|
+
raise 'The type of "issue" is neither Integer nor Array' unless issue.is_a?(Integer) || issue.is_a?(Array)
|
|
61
86
|
f = @fb.query(
|
|
62
87
|
"(and (eq where '#{where}') (eq what 'tombstone') (eq repository #{repo}) (exists issues))"
|
|
63
88
|
).each.first
|
data/lib/fbe.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fbe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.43.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yegor Bugayenko
|
|
@@ -375,6 +375,7 @@ files:
|
|
|
375
375
|
- assets/bylaws/published-release-was-rewarded.fe.liquid
|
|
376
376
|
- assets/bylaws/push-to-master-was-punished.fe.liquid
|
|
377
377
|
- assets/bylaws/resolved-bug-was-rewarded.fe.liquid
|
|
378
|
+
- assets/pmp.xml
|
|
378
379
|
- fbe.gemspec
|
|
379
380
|
- lib/fbe.rb
|
|
380
381
|
- lib/fbe/award.rb
|