github-actions-issue-to-work-item icon indicating copy to clipboard operation
github-actions-issue-to-work-item copied to clipboard

Issues with labels

Open bakhshir opened this issue 4 years ago • 13 comments

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.

AB#5422

bakhshir avatar Jan 06 '21 12:01 bakhshir

@bakhshir how are you creating the issue. Are you creating it then adding a label? Or adding the label and then saving the Issue?

danhellem avatar Jan 11 '21 14:01 danhellem

I tried both:

  1. creating an issue without label, saving it, and after sync with the devops board, adding a label. That works without problem.

  2. 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.

bakhshir avatar Jan 11 '21 15:01 bakhshir

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.

danhellem avatar Jan 13 '21 16:01 danhellem

I've experienced the same issue.

phonomenal avatar May 20 '21 14:05 phonomenal

@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.

danhellem avatar May 20 '21 16:05 danhellem

Just want to say that we are also experiencing the same issue.

MaxKless avatar May 18 '22 09:05 MaxKless

Yep, per comments above on the cause

danhellem avatar Jun 11 '22 14:06 danhellem

I am also experiencing the same behavior - I get multiple WIs created for each label I add.

ken-mellem avatar Nov 08 '22 09:11 ken-mellem

@ken-mellem yeah please see notes above :)

danhellem avatar Nov 10 '22 17:11 danhellem

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 avatar Nov 22 '22 10:11 rokeno

@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.

danhellem avatar Nov 22 '22 18:11 danhellem

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.

rokeno avatar Nov 23 '22 06:11 rokeno

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.

AaronCrawfis avatar Jun 01 '23 18:06 AaronCrawfis