-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Move new issues to triage #13528
Move new issues to triage #13528
Conversation
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.
Needs some tweaks but the overall direction is good. Once these are fixed we can merge and see if it does the job.
.github/workflows/triage.yml
Outdated
gh api graphql --raw-field query=' | ||
mutation($column: ID!, $issue: ID!) { | ||
addProjectCard(input: { | ||
projectColumnId: $column, | ||
contentId: $issue | ||
}) { clientMutationId } | ||
}' --raw-field column=$COLUMN_ID --raw-field issue=$ISSUE_ID --silent |
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.
What will happen if the issue is already on the board? Either in Triage or in another column? Will this fail or just remove it from the other column?
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.
Hum... good question. I believe that it will attempt to move it anyway. But the action is only triggered when the issue is open (and has no labels), so in theory, it can only be triggered once per issue.
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.
ok, I guess we'll see how it behaves when we merge. Some weird effects will likely be easy to notice and fix.
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.
As the job only runs when an issue is opened and has no labels, I believe we will not have such a problem. However, if we also trigger the job for reopening and remove the checking for no labels, we will have a problem when attempting to add an already existing issue in the board because of the use of the addProjectCard
method.
I tested here, and when an issue is reopened, the issue can be moved automatically to a column if that column has set the Reopened
option in the board settings. And if that is the case, and we also allow the workflow to be triggered by reopening, the action will fail.
As a reopened issue may require a new evaluation of the task, it may be good to change that command and support adding new issues to triage or move them to triage if they are reopened. This can be added as a separated PR. It will basically be the removal of the empty label requirement and the addition of a condition in the last step to decide whether add or move (using moveProjectCard
) the issue.
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.
Right, this should run also on reopening as long as the issue is still untriaged. It does happen that a someone closes something by accident and then reopens it. Having it drop from Triage in that case is undesirable. But that's something for a followup PR. We can always fix these things manually when we notice.
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.
Indeed. I will open another PR that modifies it to add another step for reopening ;)
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.
Looks good apart from some cosmetic things.
And in the end we need to merge it and see how it'll be have in practice.
Please squash the commits before merging. |
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
8658a26
to
43e8f7e
Compare
This PR adds a simple workflow to move new issues to the old project board as mentioned here: #8969 (comment)
The workflow adds any new issue not labeled yet to the Triage column. It requires repository, project and org permissions and only works for github
classic
project board. However, it is easy to adjust it to theprojectV2
api when we move to the new GH boards.It also has a
dry-run
flag, so nothing will be mutated in the boards until we turn it to false.The
COLUMN_NAME
is only for debugging and will be removed.