github-actions-issue-to-work-item
github-actions-issue-to-work-item copied to clipboard
Issues with labels
Submitting an issue with a label, like shown in the demo, will create two items on the DevOps board, one without label and one with the label. Both will refer to the correct GitHub, but only one of them (with the label) will be synchronized by the GitHub actions.
@bakhshir how are you creating the issue. Are you creating it then adding a label? Or adding the label and then saving the Issue?
I tried both:
-
creating an issue without label, saving it, and after sync with the devops board, adding a label. That works without problem.
-
creating an issue with a label leads to the bug: two work items corresponding to the issue will appear on the devops board after synchronization (with the label and without). If i close the issue on the github side, the work item with the label will be "closed" at the devops board side, leaving the "orphaned" work item without label still among open items.
I hope my description clarifies the issue.
ok yeah that makes sense. The problem here is that when you add a label while creating an issue, the issue is not yet really created. So it is caught in an odd situation. I will see try and reproduce this to see if there is a way to ignore the label add until the issue is actually created.
I've experienced the same issue.
@James-LeHa yeah I moved to another team so I have not made these changes are priority. I will keep it open, feel free to help and contribute.
Just want to say that we are also experiencing the same issue.
Yep, per comments above on the cause
I am also experiencing the same behavior - I get multiple WIs created for each label I add.
@ken-mellem yeah please see notes above :)
When do you think you have time to work on this? I think it's the most troublesome open issue you have and the most important.
@rokeno I have some time over the holidays to work on it. Feel free to take a look and create a PR if you want to work fix it.
Unf, i don't have the skills to look at the code.... i'm DevOps and don't know jack about java :( I can work on yaml, but this is not the case.
I hit this issue as well. Was caused by the workflow being run twice (one for issue creation and one for issue update when the label was added). This leads to a race condition where two runners run in parallel with a create-if-not-exists behavior, which means if they run at the same time it can cause two issues to be created. Then from there anytime the issue is updated in the future it grabs the issue with the lowest ID number.
I fixed this by adding a concurrency
block to my workflow:
on:
issues:
types:
[opened, edited, deleted, closed, reopened, labeled, unlabeled, assigned]
concurrency:
group: issue-${{ github.event.issue.number }}
cancel-in-progress: false
...
This ensures only run runner for a given GitHub runner can run at a time. Haven't seen it get hit since we added this.