Skip to content

Conversation

@bsieber-mozilla
Copy link
Contributor

@bsieber-mozilla bsieber-mozilla commented Apr 12, 2023

Resolves: #475

Updates to lookup_action logic-- instead of constructing tags from the whiteboard, then trying to see which tag exists as an action. In this commit we attempt to use the action.whiteboard_tag as the element which must exist within the bug.whiteboard element--iterating through the actions, and acting on the first action that applies to the bug. The whiteboard_tag presented in the action must be contained within the bug’s whiteboard field with a prefix of [

As is: the functionality is working with this new process for action confirmation.

  • Fix logs so that when ActionNotFound is raised and used later for processing, this makes sense in the messaging

This PR ultimately allows for [exact-match-or-partial-matchs-123]:

  • data-eng-platform and data-eng-quality would be able to coexist and map to separate processes

…e whiteboard, then trying to see which tag exists as an action. In this commit we attempt to use the action.whiteboard_tag as the element which must exist within the bug.whiteboard element--iterating through the actions, and acting on the first action that applies to the bug. The whiteboard_tag presented in the action must be contained within the bug’s whiteboard field with a prefix of [
@bsieber-mozilla bsieber-mozilla requested a review from a team as a code owner April 12, 2023 01:44
@bsieber-mozilla bsieber-mozilla marked this pull request as draft April 12, 2023 01:44
@leplatrem
Copy link
Contributor

Bryan, could you explain the reason behind this change?
It may be a good opportunity to start a docs/adrs/ folder, and add a brief one for this.

Side nitpicking: there's no issue associated to this ;)

@bsieber-mozilla
Copy link
Contributor Author

bsieber-mozilla commented Apr 13, 2023

Bryan, could you explain the reason behind this change?
It may be a good opportunity to start a docs/adrs/ folder, and add a brief one for this.

We have an action that currently is impossible to map whiteboard tags to with the current .split process that occurs on the - character (in the bug whiteboard parsing methods):

for whiteboard in self.get_whiteboard_as_list():
first_tag = whiteboard.strip().lower().split(sep="-", maxsplit=1)[0]
if first_tag:
converted_list.append(first_tag)

Currently any whiteboard tag that comes in with: [remote-settings] gets assigned the action_tag remote as the lookup key in the action dictionary.

Reversing the lookup to find the action_tag inside the whiteboard_tag without parsing the whiteboard_tag as heavily; enables this action as well as future actions to have "-"s in them.

In the later commits, I added brackets_required to the Action model; the default behavior of having the brackets required can now be disabled per action. This has been implicit and is now likely a process many users follow.

This PR now makes [this behavior] something we are not requiring, but are defaulting to at this time.

@bsieber-mozilla bsieber-mozilla marked this pull request as ready for review April 13, 2023 23:16
@bsieber-mozilla
Copy link
Contributor Author

Side nitpicking: there's no issue associated to this ;)

Ahh, upon second reading this made sense; I thought you were mentioning there's no issue with the code.. but there's no github issue associated with this change, is the conclusion I just came to... I made #475 from the DENG comment, forcing a user to adjust their whiteboard processing.

I'll add the above comment in regards to [remote-settings] to the gh issue as well

@bsieber-mozilla bsieber-mozilla added bug Something isn't working enhancement New feature or request configuration Changes to JBI action configuration labels Apr 14, 2023
@bsieber-mozilla bsieber-mozilla changed the title Reversing the lookup process Reversing the lookup process; Issue #475 Apr 14, 2023
@leplatrem leplatrem changed the title Reversing the lookup process; Issue #475 Fix #475: Reversing the lookup process May 16, 2023
@leplatrem leplatrem changed the title Fix #475: Reversing the lookup process Fix #475: Reverse lookup of actions May 16, 2023
@leplatrem leplatrem changed the title Fix #475: Reverse lookup of actions Fix #475: Fix lookup of actions when tag contains dash May 16, 2023
@leplatrem leplatrem requested a review from grahamalama May 16, 2023 15:41
@leplatrem leplatrem changed the title Fix #475: Fix lookup of actions when tag contains dash Fix #475, #382: Fix lookup of actions when tag contains dash May 16, 2023
@leplatrem leplatrem merged commit 757b806 into main May 17, 2023
@leplatrem leplatrem deleted the lookup-change branch May 17, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working configuration Changes to JBI action configuration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Currently there's a limitation in the lookup code that requires the whiteboard to adhere to a few rules:

4 participants