feat: add DoNotReopen parameter to github-issue-create fix#52
Merged
Brend Smits (Brend-Smits) merged 3 commits intophilips-forks:mainfrom Oct 10, 2025
Merged
Conversation
Add conditional logic to prevent reopening closed issues when DoNotReopen=true. This allows educational/informational rules to skip taking action on closed issues while maintaining normal reopening behavior for critical compliance rules.
There was a problem hiding this comment.
Pull Request Overview
Adds a configurable DoNotReopen boolean option to control whether previously closed matching GitHub issues are reopened or commented on, and updates logic and tests accordingly.
- Introduces DoNotReopen config schema entry with description and default.
- Adds early-return logic in issue update flow when DoNotReopen is true.
- Extends tests to cover DoNotReopen=true and false (but misses undefined case despite describe text).
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| fixes/github-issue-create-config.json | Adds DoNotReopen schema definition and augments commentBody with description. |
| fixes/github-issue-create.js | Inserts conditional bypass logic for closed issues when DoNotReopen=true. |
| tests/fixes/github_issue_create_tests.js | Adds test cases for DoNotReopen true/false behavior. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Member
Brend Smits (Brend-Smits)
left a comment
There was a problem hiding this comment.
Nice work!
Small comment, please have a look.
Did you also test this locally?
Author
Renamed DoNotReopen to doNotReopen to match camelCase convention. Tested the changes locally by running: $ npx mocha tests/fixes/github_issue_create_tests.js
fixes
github-issue-create
in repository
with existing repolinter issues
✔ it should find them and return the issues
without matching rule identifier
✔ it should create a new Github issue
with a valid Github issue
that is closed
✔ it should reopen the issue
with a bypass label
✔ it should be able to find a bypass label
✔ it should not create a new Github issue (43ms)
without a bypass label
✔ it should not be able to find a bypass label
with unique rule identifier in body
✔ it should return the proper unique identifier of the issue
without a valid issue
without a unique rule identifier in body
No rule identifier found, was the issue modified manually?
✔ it should not return any unique identifier
without existing repolinter issues
✔ it should not return any issues and be null
✔ it should create a new Github issue
without valid top contributor
✔ it should not assign a person to the issue
when erroring
✔ it should fail gracefully and fail the fix
doNotReopen functionality
when doNotReopen is true
✔ should not reopen or comment on closed issues
when doNotReopen is false or undefined
✔ should reopen and comment on closed issues (44ms)
14 passing (321ms) |
Brend Smits (Brend-Smits)
approved these changes
Oct 10, 2025
cbbfa90
into
philips-forks:main
12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds a new configuration option to control whether closed GitHub issues should be reopened or commented on, and updates the implementation and tests to support this behavior.
Applicable to compliance issues concerning education and awareness.
The main changes are grouped below:
Configuration changes:
DoNotReopentofixes/github-issue-create-config.json, which prevents closed issues from being reopened or commented on when set totrue. This option is documented in the config file.Behavioral changes in issue handling:
fixes/github-issue-create.jsso that ifDoNotReopenistrue, the function skips reopening or commenting on closed issues and returns a specific result message. IfDoNotReopenisfalseor unset, the normal behavior applies.Test coverage improvements:
tests/fixes/github_issue_create_tests.jsto verify the newDoNotReopenfunctionality, including cases where the option istrue(no action on closed issues) andfalseor undefined (issues are reopened and commented on).