Skip to content

Commit fed1f7d

Browse files
redreceiptCopilot
andauthored
Update leaderboard scoring (#75)
* Extract priority scoring constant * Update constants.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3676d29 commit fed1f7d

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

constants.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Constants used across the application
2+
3+
# Points awarded for each Linear priority level
4+
# priority: score
5+
# Priority levels:
6+
# 1 = Urgent
7+
# 2 = High
8+
# 3 = Medium
9+
# 4 = Low
10+
# 5 = Very Low
11+
PRIORITY_TO_SCORE = {1: 10, 2: 10, 3: 5, 4: 1, 5: 1}

jobs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
get_stale_issues_by_assignee,
2020
)
2121
from openai_client import get_chat_function_call
22+
from constants import PRIORITY_TO_SCORE
2223

2324
load_dotenv()
2425

@@ -144,7 +145,7 @@ def post_leaderboard():
144145
+ get_completed_issues(5, "New Feature", 7)
145146
+ get_completed_issues(5, "Technical Change", 7)
146147
)
147-
priority_to_score = {1: 10, 2: 10, 3: 5, 4: 1, 5: 1}
148+
priority_to_score = PRIORITY_TO_SCORE
148149
leaderboard = {}
149150
for item in items:
150151
assignee = item["assignee"]

linear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from gql.transport.aiohttp import AIOHTTPTransport
88

99
from config import get_platforms
10+
from constants import PRIORITY_TO_SCORE
1011

1112
load_dotenv()
1213

@@ -280,8 +281,7 @@ def by_assignee(issues):
280281
assignee_issues[assignee] = {"score": 0, "issues": []}
281282
assignee_issues[assignee]["issues"].append(issue)
282283
# high - 10, medium - 5, everything else - 1
283-
priority_to_score = {1: 10, 2: 10, 3: 5, 4: 1, 5: 1}
284-
score = priority_to_score.get(issue["priority"], 1)
284+
score = PRIORITY_TO_SCORE.get(issue["priority"], 1)
285285
assignee_issues[assignee]["score"] += score
286286
# sort by the score
287287
return dict(

0 commit comments

Comments
 (0)