Skip to content

Conversation

@Mossop
Copy link
Member

@Mossop Mossop commented Aug 16, 2022

For projects that make use of the Jira labels field JBI currently overwrites those labels everytime the synced bug changes. This allows disabling the syncing of the whiteboard fields.

@Mossop Mossop requested a review from a team as a code owner August 16, 2022 13:52
@bsieber-mozilla bsieber-mozilla added the enhancement New feature or request label Aug 16, 2022
Copy link
Contributor

@grahamalama grahamalama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments before I do a full review:

  • can we add a description to the PR?
  • In another comment above, you said:

... It has turned out though that we've decided for our project to just not store the labels at all so I could change this setting to a simple boolean to turn it off if that is preferable.

If no projects are using this setting, is it still worth merging this change? Are JBI users surprised by or not happy with the behavior as it currently is?

  • If this is something we still want to change, have we considered an approach where we merge the labels? So essentially appending the Bugzilla whiteboard tags to the Jira issue rather than overwriting them?

@Mossop Mossop changed the title Allow changing or disabling the field used to store status whiteboard labels. Fixes #201 Allow disabling syncing whiteboard fields to Jira. Fixes #201 Aug 17, 2022
@Mossop
Copy link
Member Author

Mossop commented Aug 17, 2022

A few comments before I do a full review:

* can we add a description to the PR?

Done

* In another comment above, you said:

... It has turned out though that we've decided for our project to just not store the labels at all so I could change this setting to a simple boolean to turn it off if that is preferable.

If no projects are using this setting, is it still worth merging this change? Are JBI users surprised by or not happy with the behavior as it currently is?

The previous version of the PR allowed both disabling syncing or syncing to a different field in Jira. I had thought we were going to do the latter but it turns out we just don't want the labels synced at all so we still want that functionality.

I should probably add it to the config for our project as part of this...

* If this is something we still want to change, have we considered an approach where we merge the labels? So essentially appending the Bugzilla whiteboard tags to the Jira issue rather than overwriting them?

Merging in the generic case has some challenges. You would need to retrieve the existing labels from Jira and attempt to determine which were set from Bugzilla previously. At least for private bugs the webhook request doesn't include the old value of the status whiteboard when it changes so that would involve querying the bug's history to figure that out. Then you can identify the Jira only labels and add them to the new Bug labels.

There are some ways to avoid that complexity, you could use some kind of per-project whitelist of labels to retain for instance. But either way you have a non-atomic update of the Jira fields that could still cause you to blow away fields set in between retrieving the old labels and setting the new.

Given that for our project we aren't interested in having the bug labels in Jira it seems a lot simpler to just be able to disable them.

@grahamalama grahamalama merged commit c323026 into mozilla:main Aug 19, 2022
@leplatrem leplatrem mentioned this pull request Aug 22, 2022
@Mossop Mossop deleted the label-field branch September 8, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants