-
-
Notifications
You must be signed in to change notification settings - Fork 844
Reopen Issues Without Linked PR #8438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gh-pages
Are you sure you want to change the base?
Reopen Issues Without Linked PR #8438
Conversation
|
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. |
| uses: actions/github-script@v8 | ||
| id: reopen-issue | ||
| with: | ||
| github-token: ${{ secrets.HACKFORLA_GRAPHQL_TOKEN }} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| { name: 'good first issue' }, | ||
| { name: 'size: 1pt' }, |
There was a problem hiding this comment.
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.
| { name: 'good first issue' }, | ||
| { name: 'size: 1pt' }, |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
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.
|
@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. |
|
eta: eod January 9th |
t-will-gillis
left a comment
There was a problem hiding this 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_TOKENis 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 thenon PR contributionlabel, similar togithub-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 asignore: 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!
Fixes #8139
What changes did you make?
Why did you make the changes (we will use this info to test)?
check-issue-labels-and-linked-prs.js, a direct GitHub GraphQL request is made instead of using the utility filefind-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.reopen-issue.jsare 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
Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.
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)