Skip to content

Commit d730ffe

Browse files
[jbi] comment data lost when bugzilla api call refreshes bug data. (#376)
1 parent 4b64e8a commit d730ffe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jbi/runner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from jbi.models import (
1313
ActionContext,
1414
Actions,
15+
BugzillaWebhookComment,
1516
BugzillaWebhookRequest,
1617
JiraContext,
1718
RunnerContext,
@@ -35,6 +36,7 @@ def execute_action(
3536
The value returned by the action call is returned.
3637
"""
3738
bug, event = request.bug, request.event
39+
webhook_comment: Optional[BugzillaWebhookComment] = bug.comment
3840
runner_context = RunnerContext(
3941
bug=bug,
4042
event=event,
@@ -46,7 +48,10 @@ def execute_action(
4648
extra=runner_context.dict(),
4749
)
4850
try:
49-
bug = bugzilla.get_client().get_bug(bug.id)
51+
bug = bugzilla.get_client().get_bug(
52+
bug.id
53+
) # refresh bug data; this removes webhook specific info--but avoids duplications
54+
bug.comment = webhook_comment # inject webhook data back into bug
5055
except Exception as err:
5156
logger.exception("Failed to get bug: %s", err, extra=runner_context.dict())
5257
raise IgnoreInvalidRequestError(

0 commit comments

Comments
 (0)