Skip to content

Commit 0ded083

Browse files
CopilotantonkovalenkoCopilot
authored
feat: add bonus scoring for ":heart: xeno" and "feedback" labels (#3181)
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: antonkovalenko <[email protected]> Co-authored-by: Anton Kovalenko <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent e5b243a commit 0ded083

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

.github/workflows/priority-score.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,20 @@ jobs:
3333
"size/xl": 18
3434
};
3535
36+
// Bonus multipliers for special labels
37+
const HEART_XENO_MULTIPLIER = 1.5;
38+
const FEEDBACK_MULTIPLIER = 1.5;
39+
const MAX_PRIORITY_SCORE = 100000;
40+
3641
const issue = context.payload.issue;
3742
const labels = issue.labels.map(l => l.name);
3843
3944
// Find reach, impact, and effort values from labels
4045
let reach = null;
4146
let impact = null;
4247
let effort = null;
48+
let hasHeartXeno = false;
49+
let hasFeedback = false;
4350
4451
for (const label of labels) {
4552
if (reachWeights[label] !== undefined) {
@@ -51,21 +58,38 @@ jobs:
5158
if (effortWeights[label] !== undefined) {
5259
effort = effortWeights[label];
5360
}
61+
if (label === ":heart: xeno") {
62+
hasHeartXeno = true;
63+
}
64+
if (label === "feedback") {
65+
hasFeedback = true;
66+
}
5467
}
5568
69+
// Fallback default values
70+
const defaultReach = 75; // default to medium reach
71+
const defaultImpact = 75; // default to low impact
72+
const defaultEffort = 4; // default to medium effort
73+
5674
// Calculate priority score using formula: (reach * impact) / effort
57-
let finalScore = 0;
58-
if (reach !== null && impact !== null && effort !== null) {
59-
finalScore = Math.round((reach * impact) / effort);
60-
} else {
61-
// Fallback to default values if labels are missing
62-
const defaultReach = reach || 75; // default to medium reach
63-
const defaultImpact = impact || 75; // default to low impact
64-
const defaultEffort = effort || 4; // default to medium effort
65-
finalScore = Math.round((defaultReach * defaultImpact) / defaultEffort);
75+
const effectiveReach = reach || defaultReach;
76+
const effectiveImpact = impact || defaultImpact;
77+
const effectiveEffort = effort || defaultEffort;
78+
let baseScore = Math.round((effectiveReach * effectiveImpact) / effectiveEffort);
79+
80+
// Apply bonus multipliers for special labels
81+
let bonusMultiplier = 1;
82+
if (hasHeartXeno) {
83+
bonusMultiplier *= HEART_XENO_MULTIPLIER;
84+
}
85+
if (hasFeedback) {
86+
bonusMultiplier *= FEEDBACK_MULTIPLIER;
6687
}
6788
68-
console.log(`📊 Priority calculation: reach=${reach || 'default'}, impact=${impact || 'default'}, effort=${effort || 'default'} → score=${finalScore}`);
89+
// Calculate final score with cap to prevent excessively large values
90+
let finalScore = Math.min(Math.round(baseScore * bonusMultiplier), MAX_PRIORITY_SCORE);
91+
92+
console.log(`📊 Priority calculation: reach=${reach || 'default'}, impact=${impact || 'default'}, effort=${effort || 'default'}, heartXeno=${hasHeartXeno}, feedback=${hasFeedback} → baseScore=${baseScore}, multiplier=${bonusMultiplier}, finalScore=${finalScore}`);
6993
7094
const projectNumber = 24;
7195
const org = "ydb-platform";

0 commit comments

Comments
 (0)