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
4 changes: 3 additions & 1 deletion jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ def post_project_updates():
target_label = (
target_status_text
if target_status_text.endswith("overdue")
else "Today"
if days_left == 0
else _format_short_weekday(target_dt)
)
line = f"- <{url}|{name}> - {target_label} - Lead: {lead_md}"
Expand All @@ -694,7 +696,7 @@ def post_project_updates():
start_dt = parse_iso_date(project.get("startDate"))
if start_dt:
days_until_start = (start_dt - today).days
if 0 <= days_until_start <= 3:
if 1 <= days_until_start <= 3:
starting_soon.append(
{
"name": name,
Expand Down
22 changes: 22 additions & 0 deletions tests/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,14 @@ def test_groups_overdue_ending_soon_and_starting_soon_in_order(self):
"status": {"name": "Active"},
"lead": {"displayName": "Alex"},
},
# Ending today should use a relative label.
{
"name": "Ending Today",
"url": "https://linear.app/project/ending-today",
"targetDate": "2026-03-15",
"status": {"name": "Active"},
"lead": {"displayName": "Alex"},
},
# Ending soon (within 3 days)
{
"name": "Ending Tue",
Expand All @@ -739,6 +747,14 @@ def test_groups_overdue_ending_soon_and_starting_soon_in_order(self):
"status": {"name": "Active"},
"lead": {"displayName": "Alex"},
},
# Starting today should not be in starting soon.
{
"name": "Starting Today",
"url": "https://linear.app/project/starting-today",
"startDate": "2026-03-15",
"status": {"name": "Planned"},
"lead": {"displayName": "Alex"},
},
# Starting soon (within 3 days)
{
"name": "Starting Tue",
Expand Down Expand Up @@ -838,11 +854,16 @@ def test_groups_overdue_ending_soon_and_starting_soon_in_order(self):

# Correct projects present
self.assertIn("Late Alpha", message)
self.assertIn("Ending Today", message)
self.assertIn("Ending Tue", message)
self.assertIn("Ending Wed", message)
self.assertIn("Starting Tue", message)
self.assertIn("Starting Wed", message)
self.assertIn("Lead: <@U1>", message)
self.assertIn(
"- <https://linear.app/project/ending-today|Ending Today> - Today - Lead: <@U1>",
message,
)
self.assertIn(
"- <https://linear.app/project/ending-tue|Ending Tue> - Tue - Lead: <@U1>", message
)
Expand All @@ -860,6 +881,7 @@ def test_groups_overdue_ending_soon_and_starting_soon_in_order(self):

# Correct projects filtered out
self.assertNotIn("Ending Far", message)
self.assertNotIn("Starting Today", message)
self.assertNotIn("Starting Far", message)
self.assertNotIn("Canceled Start", message)
self.assertNotIn("Completed Start", message)
Expand Down
Loading