Skip to content

feat: add DoNotReopen parameter to github-issue-create fix#52

Merged
Brend Smits (Brend-Smits) merged 3 commits intophilips-forks:mainfrom
ShivaSDP:feat/conditional-issue-reopening
Oct 10, 2025
Merged

feat: add DoNotReopen parameter to github-issue-create fix#52
Brend Smits (Brend-Smits) merged 3 commits intophilips-forks:mainfrom
ShivaSDP:feat/conditional-issue-reopening

Conversation

@ShivaSDP

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.

  • Educational/Informational - Provide guidance rather than enforce requirements
  • Best Practice Suggestions - Recommend improvements but not mandatory

The main changes are grouped below:

Configuration changes:

  • Added a new boolean option DoNotReopen to fixes/github-issue-create-config.json, which prevents closed issues from being reopened or commented on when set to true. This option is documented in the config file.

Behavioral changes in issue handling:

  • Updated the logic in fixes/github-issue-create.js so that if DoNotReopen is true, the function skips reopening or commenting on closed issues and returns a specific result message. If DoNotReopen is false or unset, the normal behavior applies.

Test coverage improvements:

  • Added a new test suite in tests/fixes/github_issue_create_tests.js to verify the new DoNotReopen functionality, including cases where the option is true (no action on closed issues) and false or undefined (issues are reopened and commented on).

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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Member

@Brend-Smits Brend Smits (Brend-Smits) left a comment

Choose a reason for hiding this comment

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

Nice work!
Small comment, please have a look.
Did you also test this locally?

@ShivaSDP
Copy link
Author

Nice work! Small comment, please have a look. Did you also test this locally?

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 (Brend-Smits) merged commit cbbfa90 into philips-forks:main Oct 10, 2025
12 checks passed
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

Comments