Skip to content

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

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

christian-byrne wants to merge 3 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 in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 5fea354a-cdbd-460d-a84c-78ed317d76fe

📥 Commits

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

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

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Walkthrough

Walkthrough

Validation now classifies pull requests associated with a commit. It exits successfully without further validation when resolution finds one unambiguous merged pull request. It fails closed for unreadable or ambiguous results.

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 paginates commit associations, filters candidates by repository, and classifies fetched pull requests as open, merged, other closed or unknown, or unreadable. Tests cover configurable pull-request data and pagination.
Skip validation for completed pull requests
scripts/linear-ticket/validate.py, scripts/linear-ticket/tests/test_validate.py
run exits successfully for one unambiguous merged pull request without validating or publishing a result. Tests cover stale signals, a newer PR head, closed-unmerged pull requests, and fetch failures.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 32a4f

No actionable merge-blocking risk is established; the change is ready for normal merge checks.

🚥 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)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

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.
# Conflicts:
#	scripts/linear-ticket/tests/test_validate.py
#	scripts/linear-ticket/validate.py
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