Filter duplicate issues from priority bug Slack post#346
Conversation
There was a problem hiding this comment.
💡 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".
| state_name = ((issue.get("state") or {}).get("name") or "").strip().lower() | ||
| if state_name == "duplicate": | ||
| return True |
There was a problem hiding this comment.
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 👍 / 👎.
Motivation
Description
_is_duplicate_issue(issue: dict) -> boolthat treats an issue as duplicate when its Linear state name isDuplicateor when any label name equalsduplicate(case-insensitive).post_priority_bugs()by applyingopen_priority_bugs = [bug for bug in open_priority_bugs if not _is_duplicate_issue(bug)].test_excludes_issues_marked_duplicateintests/test_jobs.pyto ensure duplicate-marked issues are omitted while normal issues remain included.Testing
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_overdueand both tests passed (OK).Codex Task