Skip to content
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

Merged
merged 1 commit into from
Oct 9, 2022
Merged

Move new issues to triage #13528

merged 1 commit into from
Oct 9, 2022

Conversation

r0qs
Copy link
Member

@r0qs r0qs commented Sep 15, 2022

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 the projectV2 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.

Copy link
Member

@cameel cameel left a 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 Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
Comment on lines 46 to 52
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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

@r0qs r0qs Oct 7, 2022

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.

Copy link
Member

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.

Copy link
Member Author

@r0qs r0qs Oct 9, 2022

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 ;)

.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
@nikola-matic
Copy link
Collaborator

@r0qs can you rebase, and let's ping @cameel; if you've addressed all of the changes, we may as well merge this to test it out :)

cameel
cameel previously approved these changes Oct 6, 2022
Copy link
Member

@cameel cameel left a 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.

.github/workflows/triage.yml Show resolved Hide resolved
.github/workflows/triage.yml Show resolved Hide resolved
@cameel
Copy link
Member

cameel commented Oct 6, 2022

Please squash the commits before merging.

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
@r0qs r0qs merged commit 2ab0c05 into develop Oct 9, 2022
@r0qs r0qs deleted the gh-triage-actions branch October 9, 2022 06:17
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.

3 participants