Skip to content

fix(linear-ticket): ignore post-close signal runs - #260

Open
christian-byrne wants to merge 2 commits into
mainfrom
christian-byrne/fix-linear-ticket-post-merge
Open

fix(linear-ticket): ignore post-close signal runs#260
christian-byrne wants to merge 2 commits into
mainfrom
christian-byrne/fix-linear-ticket-post-merge

Conversation

@christian-byrne

Copy link
Copy Markdown

Summary

  • treat an exact-head PR that closes before its workflow_run validator starts as a completed no-op
  • keep ambiguous or missing PR associations fail-closed
  • add a regression covering the post-merge empty-pull_requests payload

Why

A signal run can finish after its PR merges. GitHub then supplies an empty workflow_run.pull_requests list; the commit association still identifies the now-closed exact-head PR. Requiring one open PR makes the privileged validator fail after the gate has already completed.

Verification

  • python3 -m unittest discover -s scripts/linear-ticket/tests -p 'test_*.py' -v (75 tests)
  • python3 -m py_compile scripts/linear-ticket/validate.py scripts/linear-ticket/tests/test_validate.py
  • git diff --check

@christian-byrne christian-byrne self-assigned this Sep 3, 2026
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 72a2307f-8ad2-4eda-a6ac-ceaea245d7c0

📥 Commits

Reviewing files that changed from the base of the PR and between e4ef729 and 4c79d88.

📒 Files selected for processing (2)
  • scripts/linear-ticket/tests/test_validate.py
  • scripts/linear-ticket/validate.py

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

Changes

Completed pull request handling

Layer / File(s) Summary
Resolve open and completed pull requests
scripts/linear-ticket/validate.py, scripts/linear-ticket/tests/test_validate.py
_resolve_pr now collects paginated commit associations, filters candidates by repository, deduplicates candidates, and separates open, completed, other closed, and unreadable pull requests.
Skip validation for completed pull requests
scripts/linear-ticket/validate.py, scripts/linear-ticket/tests/test_validate.py
run exits successfully for one completed exact-head pull request without validating or publishing a result. Tests cover merged, stale, closed-unmerged, fetch-failure, and pagination cases.

Merge Risk: ⚪ Minimal · up to 4c79d

Validation now treats an exact-head pull request that completed before the workflow run as a successful no-op, avoiding stale result publication while retaining fail-closed behavior for ambiguous or missing associations. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch christian-byrne/fix-linear-ticket-post-merge
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch christian-byrne/fix-linear-ticket-post-merge

Comment @coderabbitai help to get the list of available commands.

@christian-byrne
christian-byrne marked this pull request as ready for review September 4, 2026 00:31
@mattmillerai mattmillerai added the cursor-review Multi-model cursor review label Sep 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 7 finding(s).

Severity Count
🟠 High 1
🟡 Medium 1
🟢 Low 4
⚪ Nit 1

Panel: 6/6 reviewers contributed findings.

Comment thread scripts/linear-ticket/validate.py Outdated
Comment thread scripts/linear-ticket/validate.py Outdated
Comment thread scripts/linear-ticket/validate.py
Comment thread scripts/linear-ticket/validate.py Outdated
Comment thread scripts/linear-ticket/validate.py
Comment thread scripts/linear-ticket/validate.py
Comment thread scripts/linear-ticket/validate.py
Addresses #260 (comment) and the associated exact-head review round.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor-review Multi-model cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants