Skip to content

fix: resolve stale linked issue warnings - #386

Open
fennoai[bot] wants to merge 2 commits into
mainfrom
fennoai/fix-pr-issue-warning-upstream
Open

fix: resolve stale linked issue warnings#386
fennoai[bot] wants to merge 2 commits into
mainfrom
fennoai/fix-pr-issue-warning-upstream

Conversation

@fennoai

@fennoai fennoai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Requested by @minorcell

Summary

  • update an existing missing-issue warning after the PR gains a closing issue reference
  • distinguish active and resolved warning markers so a later unlink can warn again
  • add regression tests for stale, duplicate, and resolved warning states

@github-actions

Copy link
Copy Markdown

⚠️ @fennoai[bot],此 PR 尚未关联 issue。请在 PR 描述中使用 Closes #123 等关闭关键字,或通过 Development 侧栏关联对应 issue。

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The active/resolved marker transition is covered for the normal body-edit path, and the focused Node test suite passes. Two lifecycle gaps remain: manual Development-sidebar links do not invoke this resolution branch, and duplicate active warnings are only partially resolved.

View job run

})

if (comments.some((comment) => comment.body?.includes(WARNING_MARKER))) {
if (result.repository.pullRequest.closingIssuesReferences.totalCount > 0) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[P1] Trigger resolution when an issue is linked from the sidebar

This branch only runs when the existing pull_request_target workflow fires, but .github/workflows/triage.yml listens to opened, edited, reopened, synchronize, and ready_for_review. Linking an issue through the Development sidebar—the workflow's warning explicitly recommends this path—does not produce one of those PR activity types, so the stale warning remains visible until some unrelated later PR event happens. Please add a trigger/path that observes manual link changes, or otherwise avoid promising automatic resolution for that supported linking method.

Comment thread .github/scripts/check-pr-issue.cjs Outdated

if (comments.some((comment) => comment.body?.includes(WARNING_MARKER))) {
if (result.repository.pullRequest.closingIssuesReferences.totalCount > 0) {
const warning = comments.find(isMissingIssueWarning)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[P2] Resolve every active duplicate warning

Using find updates only one active warning. Duplicate warnings can already exist (for example, two overlapping workflow runs can both list comments before either creates its warning), and after this run the remaining duplicate still tells users that the linked PR has no issue. A focused reproduction with two active marker comments updates comment 1 and leaves comment 2 unresolved. Filter all active warnings and update each of them, or otherwise ensure no active marker remains once the PR is linked.

@minorcell

Copy link
Copy Markdown
Member

@fennoai fix review.

@fennoai

fennoai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Review fixes published

  • Updated every active duplicate missing-issue warning when a closing issue reference is detected; already-resolved warnings remain untouched.
  • Removed the Development sidebar instruction because that link change does not trigger this workflow, and clarified that editing the PR description triggers automatic resolution.
  • Expanded regression coverage to include multiple active warnings alongside a resolved warning.
  • Verified node --test .github/scripts/*.test.cjs (11 tests passed) and git diff --check.
  • Pushed commit 3048ced to the PR branch. actionlint was unavailable locally, and no workflow file changed.

View job run

@minorcell minorcell self-assigned this Aug 18, 2026
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
windup Ignored Ignored Preview Aug 18, 2026 8:10am

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant