Skip to content

CI: Flag issue mentions that are not linked in the Development field#77396

Open
adamsilverstein wants to merge 2 commits intotrunkfrom
add-development-releationship-ci-requirement-and-automation
Open

CI: Flag issue mentions that are not linked in the Development field#77396
adamsilverstein wants to merge 2 commits intotrunkfrom
add-development-releationship-ci-requirement-and-automation

Conversation

@adamsilverstein
Copy link
Copy Markdown
Member

@adamsilverstein adamsilverstein commented Apr 15, 2026

What?

Closes #77397

Adds a new advisory CI workflow, check-linked-issues.yml, that scans every open PR's description for issue references (#1234, GH-1234, or full issue URLs) and compares them against the PR's Development relationship (GraphQL closingIssuesReferences). If any referenced issue isn't linked, the workflow posts or updates a sticky comment explaining how to link it.

Why?

Based on Amy's feedback: anything included in a release should be linked (not just mentioned) in the PR description so that it shows up in the Development section on the right sidebar of the related ticket. Today, tracking tickets like the per-release editor tasks ticket rely on release leads manually following every comment and every PR mentioned in every tracker to figure out what belongs in the release — and things still slip through. Surfacing the relationship in the sidebar lets release leads and release-note writers find every PR attached to a ticket at a glance.

The check is intentionally non-invasive:

A more aggressive variant (auto-appending a bot-managed Closes #N block to the PR body) was considered but not chosen, because closing keywords also auto-close the referenced issue on merge — which is wrong for informational references. A future iteration can layer automatic linking on top of this check if desired.

How?

  • New workflow: .github/workflows/check-linked-issues.yml.
  • Runs on pull_request_target (opened, edited, reopened, synchronize, ready_for_review) so it reacts to description edits.
  • Uses actions/github-script to:
    1. Strip HTML comments from the body (avoids matching the Closes <!-- #ISSUE-NUMBER --> placeholder in the PR template).
    2. Extract referenced numbers from bare #N, GH-N, and in-repo issue/pull URLs.
    3. Query closingIssuesReferences to determine which are already linked via the Development field.
    4. Verify each remaining number resolves to an issue (not a PR and not 404) to filter cross-repo and stale references.
    5. Post or update a single sticky comment (marked with an HTML-comment tag) listing unlinked references; delete the comment once everything is linked.
  • Uses the default GITHUB_TOKEN with scoped pull-requests: write permission. No additional secrets required.
  • Gated to WordPress/gutenberg and open PRs only.
  • The script itself is annotated with step-by-step block comments (Step 1–10) to make the flow easy to follow for future maintainers.

Testing Instructions

  1. Open or edit a test PR that mentions an issue in the body without a closing keyword (e.g. See #100).
  2. Confirm the workflow runs and posts a comment listing the unlinked issue.
  3. Update the PR body to use Closes #100 (or manually link the issue from the Development sidebar).
  4. Re-trigger the workflow (edit the body or push) and confirm the comment is removed.
  5. Verify a PR description with no issue mentions produces no comment.
  6. Verify a PR description that only mentions PR numbers (not issue numbers) produces no comment.

Follow-ups

  • If this approach works well, consider tightening to a required check (exit_type: failure) after a grace period.
  • Could be extended to enforce the relationship for PRs labeled with a release milestone only.
  • Optional: layer in automatic linking for references that clearly use closing verbs in prose (e.g. fixes issue Merge Single TinyMCE Instance #123) but aren't formatted correctly.

Add a non-invasive pull_request_target workflow that parses the PR body
for issue references (#N, GH-N, issue URLs), compares them against the
PR's closingIssuesReferences via GraphQL, and posts or updates a sticky
comment listing any referenced issues that aren't surfaced in the
Development sidebar. The comment suggests using a closing keyword or
manually linking the issue so release leads and release-note writers
can find every PR attached to a ticket. The check is advisory and does
not fail the PR.
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

Flaky tests detected in 9d4fe16.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24481862957
📝 Reported issues:

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

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Surface when PR descriptions mention issues that are not linked in the Development field

1 participant