Skip to content

Conversation

@myronchen-git
Copy link
Member

@myronchen-git myronchen-git commented Nov 27, 2025

Fixes #8139

What changes did you make?

  • Created a new GitHub Actions workflow to check closed issues without any linked PRs or appropriate excusing labels, and reopen them.
  • Created a JavaScript file to store the main code to check a closed issue. This checks if there is a "non-PR contribution" label or a label containing the word "Ignore". If there aren't any of those labels, then this checks how many linked PRs there are.
  • Created a JavaScript file to store the main code for reopening the aforementioned issue, adding a "ready for product" label to it, changing the project status to "Questions / In Review" in it, and posting a comment explaining the reason in it.

Why did you make the changes (we will use this info to test)?

  • To prevent losing track of issues that were accidentally closed.
  • The checks for the "non-PR contribution" and "Ignore" labels are required for instances where the issues are not fixed through code or for issues that should be ignored.
  • In check-issue-labels-and-linked-prs.js, a direct GitHub GraphQL request is made instead of using the utility file find-linked-issue.js, because it queries GitHub for a direct number of linked PRs while the utility file only checks an issue's description through regex. This methodology should be more reliable.
  • Reopened issues are given a "ready for product" label and have their project status changed, because those help give visibility to the team.
  • Tests for reopen-issue.js are skipped, because that file does not contain any logic, other than rethrowing Errors.

CodeQL Alerts

After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.

Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown

Screenshot 2024-10-28 154514

Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.

  • I have checked this PR for CodeQL alerts and none were found.
  • I found CodeQL alert(s), and (select one):
    • I have resolved the CodeQL alert(s) as noted
    • I believe the CodeQL alert(s) is a false positive (Merge Team will evaluate)
    • I have followed the Instructions below, but I am still stuck (Merge Team will evaluate)
Instructions for resolving CodeQL alerts

If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.

In general, CodeQL alerts should be resolved prior to PR reviews and merging

Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)

  • No visual changes to the website

@github-actions
Copy link

Want to review this pull request? Take a look at this documentation for a step by step guide!


From your project repository, check out a new branch and test the changes.

git checkout -b myronchen-git-check-closed-issue-for-linked-pr-8139 gh-pages
git pull https://github.com/myronchen-git/website.git check-closed-issue-for-linked-pr-8139

@github-actions github-actions bot added role: back end/devOps Tasks for back-end developers Complexity: Large status: Updated No blockers and update is ready for review Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly size: 5pt Can be done in 19-30 hours Lang: GHA GitHub Actions labels Nov 27, 2025
uses: actions/github-script@v8
id: reopen-issue
with:
github-token: ${{ secrets.HACKFORLA_GRAPHQL_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not 100% sure that this is the correct token to use. This workflow does need project permission though.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, you are correct- this is the token to use

Comment on lines +64 to +65
{ name: 'good first issue' },
{ name: 'size: 1pt' },
Copy link
Member Author

Choose a reason for hiding this comment

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

Testing for when issues have other labels as well.

Comment on lines +36 to +37
{ name: 'good first issue' },
{ name: 'size: 1pt' },
Copy link
Member Author

Choose a reason for hiding this comment

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

Testing for when issues have other labels as well.

// Assert
expect(result).toBe(true);
expect(github.graphql).toHaveBeenCalledWith(
expect.stringContaining('query'),
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't really care how the query is constructed, as long as it returns the number of linked PRs.

// Assert
expect(result).toBe(false);
expect(github.graphql).toHaveBeenCalledWith(
expect.stringContaining('query'),
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't really care how the query is constructed, as long as it returns the number of linked PRs.

@t-will-gillis
Copy link
Member

t-will-gillis commented Dec 1, 2025

@myronchen-git I think this was closed by mistake- the bot should have closed #8439 and didn't. Let me know if you think it is something else...

@myronchen-git
Copy link
Member Author

@myronchen-git I think this was closed by mistake- the bot should have closed #8439 and didn't. Let me know if you think it is something else...

Understood. Thanks for fixing this.

@t-will-gillis t-will-gillis self-requested a review January 6, 2026 01:16
@t-will-gillis
Copy link
Member

eta: eod January 9th

@kdaca19xx kdaca19xx requested review from kdaca19xx and removed request for kdaca19xx January 11, 2026 18:03
Copy link
Member

@t-will-gillis t-will-gillis left a comment

Choose a reason for hiding this comment

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

Hey @myronchen-git Great job on this! I tested this in my repo and the workflow appears to be working correctly. Here are some comments:

  • I noticed in my repo that the automation reopened an issue and sorted it to "Questions / In Review" like it is supposed to. However, the project board workflow then moved the issue to "New Issue Approval". There might need to be a delay added so that the project board sorts to "New Issue Approval" first, and afterwards this automation moves it to "Questions/ In Review".
  • As you mentioned, the HACKFORLA_GRAPHQL_TOKEN is the one to use
  • In the YML, please update to actions/checkout@v6.
  • For the labels in check-issue-labels-and-linked-pr.js, please import the "labelKey" for the non PR contribution label, similar to github-actions/trigger-issue/check-labels.js. The reason for this is so that Bonnie, PMs, and others can make edits to the label and not have to worry about breaking the automation.
  • For the label.includes('Ignore'), it would be good to make this case insensitive, to account for future labels such as ignore: something else.
  • This is more of an observation, but I noticed that there is a console.log() in the YML. The code works of course, and I can see the argument for logging after the return. I am thinking that for consistency we usually keep the YML for orchestration and logging in the JS. (Maybe we don't need this log, or maybe we could only have a log before return false; to indicate why the workflow won't continue?) We can talk about it of course...
  • You added in a test script- that is awesome. @ryanfkeller is working on an issue for testing front end JS (#8411) and there is an open issue to come up with testing for the GHAs (#7151). It might be too soon to add testing for this GHA, but if you have a good handle on testing a.) I would love to talk about it and b.) would you be interested in 7151?

This looks great- thank for all of your work on this!

@github-project-automation github-project-automation bot moved this from PR Needs review to PRs being reviewed in P: HfLA Website: Project Board Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly Lang: GHA GitHub Actions role: back end/devOps Tasks for back-end developers size: 5pt Can be done in 19-30 hours status: Updated No blockers and update is ready for review

Projects

Status: PRs being reviewed

Development

Successfully merging this pull request may close these issues.

Create GitHub Actions: Detect issues closed w/o PR or ignore

3 participants