aglinxinyuan opened a new pull request, #8678:
URL: https://github.com/apache/texera/pull/8678
### What changes were proposed in this PR?
Adds a check to `pr-assignment.yml` that flags a PR closing an issue someone
else has already claimed. It also stops the merge-time credit step from
unassigning a claimant whose own PR is still open.
```
Before: #8267 open (claimant) ── #8339 "Closes #8149" ── (silence) ── #8339
merges
── claimant unassigned from #8149, #8267 left with 0 changed files
After: #8267 open (claimant) ── #8339 "Closes #8149" ── comment on #8339
names the claimant + #8267
── #8339 merges ──
claimant stays assigned while #8267 is open
```
| Where | Change |
| --- | --- |
| New step "Flag linked issues someone else has claimed" (PR `opened` /
`edited`) | For each open same-repo issue in `closingIssuesReferences`, flags
it when **(a)** it has an assignee other than the PR opener, or **(b)** its
`closedByPullRequestsReferences` lists another `OPEN` PR by a different author.
Posts or updates one `<!-- texera:issue-claim-conflict -->` comment with an
issue / claimant / PR table, and deletes the comment once nothing matches. |
| "Credit issue assignees on PR merge" | Keeps an assignee who has their own
open PR on the issue. If that PR later closes without merging, the existing
close-without-merge step still unassigns them. |
| `.github/scripts/issue-claims.js` | The decision logic, which both steps
`require`. It is checked out from the base branch, which is safe under
`pull_request_target`. |
**(b) is needed on its own.** GitHub silently drops the opener self-assign
for an outside contributor who never commented on the issue. For example, #6674
shows no assignee but has the open PR #8603.
**It posts a comment and does not fail a check:**
| Reason | Detail |
| --- | --- |
| Both PRs match | The claimant's own PR matches the rule too: #8267 would
flag #8339 back. A failing check would also land on the person the rule
protects. |
| Some takeovers are agreed | Only a person can tell a duplicate from an
agreed takeover. One of the 2 PRs it would flag today (below), #8484, is an
agreed takeover, and a failing check would block it. |
| It would go stale | The check runs again only when this PR is opened or
edited. Closing the other PR or unassigning someone doesn't re-run it, so a
failed check would stay red until someone edits the PR. |
On its first post, the comment @-mentions the claimant, so they get a
notification. The #8149 claimant never got one. Closed issues are skipped,
because the risk is two PRs in progress at once. One known limitation: the
comment is refreshed only when this PR is edited, not when the other PR closes.
### Any related issues, documentation, discussions?
Closes #8676
Complements #8675, which adds an AGENTS.md rule to check claims before
coding. This PR catches the cases that rule misses.
### How was this PR tested?
Unit tests: 24 pass. Two of them replay the #8149 and #6674 incidents as
GraphQL fixtures.
```bash
bash .github/scripts/test_issue_claims.sh # tests 24, pass 24, fail 0
```
The `infra` job picks these up through its `test_*.sh` discovery. Mutation
check: reverting the credit fix fails the #8149 merge test, and dropping (b)
fails the #6674 test.
`pull_request_target` runs the workflow from `main`, so this PR can't run
its own steps. Instead, I ran both edited `github-script` steps, extracted from
the YAML, in a local harness. GraphQL calls went to the live API (read-only).
Every REST write was recorded, not sent.
| Scenario | Result |
| --- | --- |
| #8339 opened, fixture = #8149 as of 2026-09-02 | posts 1 comment: `#8149 ·
<claimant> (assignee) · #8267` |
| edited, with an older bot comment and a human comment quoting the marker |
updates only the bot comment |
| edited again, comment already current | no write |
| edited after `Closes #8149` is removed | deletes the bot comment; the
human comment is left alone |
| live: #8603 opened (#6674) | no conflict, no writes |
| live: #8484 edited | posts 1 comment naming the #6939 assignee |
| credit step, fixture = #8339's merge on 2026-09-25 | #8149 keeps its
claimant (`kept (own open PR)=[…]`); an assignee without a PR on #8338 is still
removed |
| credit step, live query on #8339 | query valid, no writes |
Dry run over every open PR: 218 open, 188 with closing references, **2
flagged**. Both are real claims:
| PR | Issue | Claim |
| --- | --- | --- |
| #5558 (draft) | #5422 | the issue's author assigned themselves |
| #8484 | #6939 | a `/take` that was never released; a maintainer later told
#8484's author to go ahead |
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]