Skip to content

feat: add exempt-issues-with-open-linked-pr option - #1357

Open
somaz94 wants to merge 1 commit into
actions:mainfrom
somaz94:feat/exempt-issues-with-linked-pr
Open

feat: add exempt-issues-with-open-linked-pr option#1357
somaz94 wants to merge 1 commit into
actions:mainfrom
somaz94:feat/exempt-issues-with-linked-pr

Conversation

@somaz94

@somaz94 somaz94 commented Aug 4, 2026

Copy link
Copy Markdown

Description:

Adds an opt-in exempt-issues-with-open-linked-pr option. When enabled, an issue is left alone while an open pull request is linked to it in a way that will close it once merged. Work is still happening on the pull request, so the issue is not really inactive.

Three notes on the design, since this touches the operations budget:

  • It costs an operation, so it runs last. Following the note above the draft-PR check in issues-processor.ts ("this check is so far below because it cost one read operation"), the lookup only runs after every cheaper check has passed, so it is limited to issues that would otherwise be marked stale.
  • Disabled by default, so existing workflows keep the exact same operations-per-run budget. There is a test asserting the lookup is never called when the option is off.
  • Only linked pull requests count, not mentions. It uses the GraphQL closedByPullRequestsReferences(includeClosedPrs: false) field, which is the "Development" link a Closes #123 creates. The REST timeline was the other option, but its cross-referenced events also fire on a plain mention, which would exempt issues that merely got named in some pull request. GraphQL is reached through the existing getOctokit client, so there is no new dependency.

If the query fails, the error is logged and the issue is processed as usual rather than being silently exempted.

Related issue:

Related to #1333.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Validation, run locally on node 24:

  • npm run format-check, npm run lint, npm run build all pass, and dist/ rebuilds byte-identically
  • npm test goes from 29 suites / 1360 tests to 30 / 1366, no regressions
  • I checked the new tests actually fail without the feature: disabling the exemption breaks exactly the "should not stale the issue when an open pull request will close it" case, and removing the pull-request guard breaks exactly the case covering that a pull request cannot have a linked pull request

somaz94 added a commit to somaz94/somaz94 that referenced this pull request Aug 4, 2026
@somaz94
somaz94 marked this pull request as ready for review August 6, 2026 02:31
@somaz94
somaz94 requested a review from a team as a code owner August 6, 2026 02:31
@somaz94

somaz94 commented Aug 6, 2026

Copy link
Copy Markdown
Author

This is out of draft now and ready for review.

The five checks on c54266dBasic validation, Check dist/, e2e tests, Licensed, Code scanning — are all sitting at action_required, i.e. the first-run approval gate for an outside contributor, so none of them have actually executed yet. Could a maintainer kick off the run?

To save you the risk of spending that approval on a red run, I re-validated locally today. The branch is already current with main (no rebase needed), and:

  • npm test — 30/30 suites, 1366/1366 tests pass
  • npm run format-check and npm run lint — clean
  • npm run build — reproduces the committed dist/index.js byte-for-byte

Happy to rebase or adjust anything if you'd rather see the option shaped differently.

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.

2 participants