From 6bc0882f64292e658867f1c488c2c6e3e10a329d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:58:57 +0000 Subject: [PATCH 1/3] Initial plan From 7859e8da52d44857514c64ac4daa36a6c2ee2e73 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 16:02:22 +0000 Subject: [PATCH 2/3] Fix dictionary iteration, timestamp parsing, and rename RETRY_COUNT constant Co-authored-by: redreceipt <2659478+redreceipt@users.noreply.github.com> --- jobs.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/jobs.py b/jobs.py index b303797..5aaaa31 100644 --- a/jobs.py +++ b/jobs.py @@ -35,7 +35,7 @@ load_dotenv() # Retry configuration for the with_retries decorator. -RETRY_COUNT = 3 +MAX_RETRY_COUNT = 3 RETRY_SLEEP_SECONDS = 5 @@ -95,7 +95,7 @@ def with_retries(func): """ @wraps(func) def wrapper(*args, **kwargs): - for attempt in range(RETRY_COUNT): + for attempt in range(MAX_RETRY_COUNT): try: return func(*args, **kwargs) except Exception as e: @@ -105,7 +105,7 @@ def wrapper(*args, **kwargs): type(e).__name__, exc_info=True, ) - if attempt == RETRY_COUNT - 1: + if attempt == MAX_RETRY_COUNT - 1: raise time.sleep(RETRY_SLEEP_SECONDS) @@ -129,9 +129,9 @@ def get_slack_markdown_by_linear_username(username): return "No Assignee" config = load_config() - for person in config["people"]: - if config["people"][person]["linear_username"] == username: - return f"<@{config['people'][person]['slack_id']}>" + for person in config["people"].values(): + if person.get("linear_username") == username: + return f"<@{person['slack_id']}>" return "No Assignee" @@ -454,10 +454,11 @@ def post_stale(): ] if events: created = max(ev["createdAt"] for ev in events) - if created.endswith("Z"): - created = created[:-1] - dt = datetime.fromisoformat(created) - days_waiting = (datetime.now() - dt).days + # Parse GitHub-style ISO 8601 timestamp with explicit UTC timezone + dt = datetime.strptime(created, "%Y-%m-%dT%H:%M:%SZ").replace( + tzinfo=timezone.utc + ) + days_waiting = (datetime.now(timezone.utc) - dt).days else: days_waiting = 0 pr_days.append((days_waiting, pr)) From b9fc734a88b8ae0b97f578cbe08b93c68bb3a7b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 16:03:14 +0000 Subject: [PATCH 3/3] Update docstring to reference MAX_RETRY_COUNT constant Co-authored-by: redreceipt <2659478+redreceipt@users.noreply.github.com> --- jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobs.py b/jobs.py index 5aaaa31..3292ba8 100644 --- a/jobs.py +++ b/jobs.py @@ -89,7 +89,7 @@ def format_bug_line(bug): def with_retries(func): """Decorator that retries the wrapped function. - Retries up to RETRY_COUNT times on failure. After each failure, logs the + Retries up to MAX_RETRY_COUNT times on failure. After each failure, logs the exception and waits RETRY_SLEEP_SECONDS before retrying. After the final attempt, the last exception is re-raised. """