Skip to content

Filter duplicate issues from priority bug Slack post#346

Closed
redreceipt wants to merge 1 commit into
mainfrom
codex/remove-item-with-duplicate-status
Closed

Filter duplicate issues from priority bug Slack post#346
redreceipt wants to merge 1 commit into
mainfrom
codex/remove-item-with-duplicate-status

Conversation

@redreceipt
Copy link
Copy Markdown
Member

Motivation

  • Duplicate-marked Linear issues were showing up in the priority bug Slack post (e.g., in Unassigned Priority Bugs), creating noise in notifications.

Description

  • Added a helper _is_duplicate_issue(issue: dict) -> bool that treats an issue as duplicate when its Linear state name is Duplicate or when any label name equals duplicate (case-insensitive).
  • Filtered out duplicate issues early in post_priority_bugs() by applying open_priority_bugs = [bug for bug in open_priority_bugs if not _is_duplicate_issue(bug)].
  • Added a regression test test_excludes_issues_marked_duplicate in tests/test_jobs.py to ensure duplicate-marked issues are omitted while normal issues remain included.

Testing

  • Ran python -m unittest tests.test_jobs.PostPriorityBugsTest.test_excludes_issues_marked_duplicate tests.test_jobs.PostPriorityBugsTest.test_uses_linear_sla_windows_for_at_risk_and_overdue and both tests passed (OK).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f006fc9431

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread jobs.py
Comment on lines +266 to +268
state_name = ((issue.get("state") or {}).get("name") or "").strip().lower()
if state_name == "duplicate":
return True
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fetch issue state before filtering duplicate-marked bugs

_is_duplicate_issue treats state.name == "duplicate" as a filter condition, but the get_open_issues() payload used by post_priority_bugs() does not include state in its GraphQL selection (linear/issues.py only requests id/title/assignee/url/labels/SLA fields). In production this means state-marked duplicates (without a duplicate label) will still be posted to Slack because state_name is always empty, so the new duplicate filter is only partially effective.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant