Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,31 @@ def index():
days = request.args.get("days", default=30, type=int)
created_priority_bugs = get_created_issues(2, "Bug", days)
open_priority_bugs = get_open_issues(2, "Bug")
completed_priority_bugs = get_completed_issues(2, "Bug", days)
completed_bugs = get_completed_issues(5, "Bug", days)
completed_new_features = get_completed_issues(
5,
"New Feature",
days,
)
completed_technical_changes = get_completed_issues(
5,
"Technical Change",
days,
)
# Only include non-project issues in the index summary
completed_priority_bugs = [
issue for issue in get_completed_issues(2, "Bug", days)
if not issue.get("project")
]
completed_bugs = [
issue for issue in get_completed_issues(5, "Bug", days)
if not issue.get("project")
]
completed_new_features = [
issue for issue in get_completed_issues(
5,
"New Feature",
days,
)
if not issue.get("project")
]
completed_technical_changes = [
issue for issue in get_completed_issues(
5,
"Technical Change",
days,
)
if not issue.get("project")
]
open_work = (
get_open_issues(5, "Bug")
+ get_open_issues(5, "New Feature")
Expand Down
26 changes: 25 additions & 1 deletion jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from dotenv import load_dotenv

from config import load_config
from constants import PRIORITY_TO_SCORE
from github import (
get_prs_waiting_for_review_by_reviewer,
get_prs_with_changes_requested_by_reviewer,
Expand All @@ -19,7 +20,6 @@
get_stale_issues_by_assignee,
)
from openai_client import get_chat_function_call
from constants import PRIORITY_TO_SCORE

load_dotenv()

Expand Down Expand Up @@ -324,6 +324,30 @@ def post_weekly_changelog():
unique.append(issue)
issues = unique

# Include only issues without a project or from the configured cycle initiative projects
config = load_config()
cycle_init = config.get("cycle_initiative")
if cycle_init:
projects = get_projects()
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_projects() call is made inside the filtering logic but the result is only used when cycle_init is configured. Consider moving this call inside the if cycle_init block to avoid unnecessary API calls when no cycle initiative is configured.

Copilot uses AI. Check for mistakes.
cycle_projects = [
p["name"]
for p in projects
if any(
node.get("name") == cycle_init
for node in p.get("initiatives", {}).get("nodes", [])
)
]
issues = [
issue
for issue in issues
if not issue.get("project") or issue.get("project") in cycle_projects
]
else:
issues = [issue for issue in issues if not issue.get("project")]

if not issues:
return

chunks = []
for issue in issues:
desc = issue.get("description") or ""
Expand Down
13 changes: 10 additions & 3 deletions linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,21 @@ def get_completed_issues(priority, label, days=30):
issues(
first: 50
after: $cursor
filter: {
filter: {
team: { name: { eq: "Apollos" } }
labels: { name: { eq: $label } }
priority: { lte: $priority }
state: { name: { in: ["Done"] } }
completedAt:{gt: $days}
project: { null: true }
completedAt: { gt: $days }
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the project filter changes the query behavior significantly. This could impact performance as it will now fetch all completed issues regardless of project status, then filter them post-query. Consider if this filtering could be done more efficiently at the GraphQL level.

Suggested change
completedAt: { gt: $days }
completedAt: { gt: $days }
project: { name: { eq: $project } }

Copilot uses AI. Check for mistakes.
}
orderBy: updatedAt
) {
nodes {
id
title
project {
name
}
description
comments {
nodes {
Expand Down Expand Up @@ -191,6 +193,11 @@ def get_completed_issues(priority, label, days=30):
if not data["issues"]["pageInfo"]["hasNextPage"]:
break
cursor = data["issues"]["pageInfo"]["endCursor"]

# Normalize project to simple name or None
for issue in issues:
proj = issue.get("project", {}).get("name") if issue.get("project") else None
issue["project"] = proj
return issues


Expand Down