@@ -13,19 +13,58 @@ jobs:
13
13
with :
14
14
github-token : ${{ secrets.YDBOT_TOKEN }}
15
15
script : |
16
- const labelWeights = {
17
- "prio/high": 1000,
18
- "prio/medium": 500,
19
- "prio/low": 100
16
+ // Priority estimation based on reach/impact/effort methodology
17
+ const reachWeights = {
18
+ "reach:high": 100,
19
+ "reach:medium": 75,
20
+ "reach:low": 50
21
+ };
22
+
23
+ const impactWeights = {
24
+ "impact:high": 200,
25
+ "impact:medium": 137.5,
26
+ "impact:low": 75
27
+ };
28
+
29
+ const effortWeights = {
30
+ "effort:high": 10,
31
+ "effort:medium": 5,
32
+ "effort:low": 2
20
33
};
21
34
22
35
const issue = context.payload.issue;
23
36
const labels = issue.labels.map(l => l.name);
24
- const basePriority = Math.min(...labels.map(l => labelWeights[l] || 10), 1000);
25
37
26
- const createdAt = new Date(issue.created_at);
27
- const daysOld = Math.floor((Date.now() - createdAt.getTime()) / (1000 * 60 * 60 * 24));
28
- const finalScore = basePriority + daysOld;
38
+ // Find reach, impact, and effort values from labels
39
+ let reach = null;
40
+ let impact = null;
41
+ let effort = null;
42
+
43
+ for (const label of labels) {
44
+ if (reachWeights[label] !== undefined) {
45
+ reach = reachWeights[label];
46
+ }
47
+ if (impactWeights[label] !== undefined) {
48
+ impact = impactWeights[label];
49
+ }
50
+ if (effortWeights[label] !== undefined) {
51
+ effort = effortWeights[label];
52
+ }
53
+ }
54
+
55
+ // Calculate priority score using formula: (reach * impact) / effort
56
+ let finalScore = 0;
57
+ if (reach !== null && impact !== null && effort !== null) {
58
+ finalScore = Math.round((reach * impact) / effort);
59
+ } else {
60
+ // Fallback to default values if labels are missing
61
+ const defaultReach = reach || 50; // default to medium-low reach
62
+ const defaultImpact = impact || 75; // default to low impact
63
+ const defaultEffort = effort || 5; // default to medium effort
64
+ finalScore = Math.round((defaultReach * defaultImpact) / defaultEffort);
65
+ }
66
+
67
+ console.log(`📊 Priority calculation: reach=${reach || 'default'}, impact=${impact || 'default'}, effort=${effort || 'default'} → score=${finalScore}`);
29
68
30
69
const projectNumber = 24;
31
70
const org = "ydb-platform";
0 commit comments