Skip to content

Commit 4884364

Browse files
author
Bryan Sieber
committed
Minor fixes based on initial testing
1 parent 289893a commit 4884364

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ dmypy.json
130130

131131
# iSort - Pre-Commit
132132
.isort.cfg
133+
134+
# Don't check in your own Env
135+
infra/config/local_dev.env

src/app/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Settings(BaseSettings):
1818

1919
# Jira
2020
jira_base_url: str = "https://mozit-test.atlassian.net/"
21-
jira_issue_url: str = f"{jira_base_url}/browse/%s"
21+
jira_issue_url: str = f"{jira_base_url}browse/%s"
2222
jira_username: str
2323
jira_password: str
2424

src/jbi/router.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def execute_action(request: BugzillaWebhookRequest, action_map, settings):
5353
"whiteboard tag not found in configured actions"
5454
)
5555

56+
jbi_logger.info("\nrequest: %s, \naction: %s", request.json(), current_action)
5657
action_module: ModuleType = importlib.import_module(current_action["action"])
5758
callable_action = action_module.init( # type: ignore
5859
**current_action["parameters"]

src/jbi/whiteboard_actions/default.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def bug_create_or_update(
8484

8585
def create_and_link_issue(self, payload):
8686
"""create jira issue and establish link between bug and issue; rollback/delete if required"""
87-
fields = {**payload.bug.map_as_jira_issue(), "key": self.jira_project_key} # type: ignore
87+
fields = {**payload.bug.map_as_jira_issue(), "project": {"key": self.jira_project_key}} # type: ignore
8888

8989
jira_response_create = self.jira_client.create_issue(fields=fields)
9090

@@ -114,11 +114,11 @@ def create_and_link_issue(self, payload):
114114
)
115115
return {"status": "duplicate", "jira_response": jira_response_delete}
116116
# else:
117-
jira_url = self.settings.jira_issue_url.format(jira_key_in_response)
117+
jira_url = self.settings.jira_issue_url % jira_key_in_response
118118
update = self.bugzilla_client.build_update(see_also_add=jira_url)
119119
bugzilla_response = self.bugzilla_client.update_bugs([bug_obj.id], update)
120120

121-
bugzilla_url = self.settings.bugzilla_bug_url.format(bug_obj.id)
121+
bugzilla_url = self.settings.bugzilla_bug_url % bug_obj.id
122122
jira_response = self.jira_client.create_or_update_issue_remote_links(
123123
issue_key=jira_key_in_response,
124124
link_url=bugzilla_url,

0 commit comments

Comments
 (0)