Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def update(self, document_id: str, **kwargs):
"""Replaces text in document."""
kwargs = {"{{" + k + "}}": v for k, v in kwargs.items()}
confluence_client = Confluence(
url=self.configuration.api_url,
url=str(self.configuration.api_url),
username=self.configuration.username,
password=self.configuration.password.get_secret_value(),
cloud=self.configuration.hosting_type,
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/plugins/dispatch_atlassian_confluence/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_file(
if file_type not in ["document", "folder"]:
return None
confluence_client = Confluence(
url=self.configuration.api_url,
url=str(self.configuration.api_url),
username=self.configuration.username,
password=self.configuration.password.get_secret_value(),
cloud=self.configuration.hosting_type,
Expand Down Expand Up @@ -90,7 +90,7 @@ def copy_file(self, folder_id: str, file_id: str, name: str):
# TODO : This is the function that is responsible for making the incident documents.
try:
confluence_client = Confluence(
url=self.configuration.api_url,
url=str(self.configuration.api_url),
username=self.configuration.username,
password=self.configuration.password.get_secret_value(),
cloud=self.configuration.hosting_type,
Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/plugins/dispatch_jira/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def create_dict_from_plugin_metadata(plugin_metadata: dict):
def create_client(configuration: JiraConfiguration) -> JIRA:
"""Creates a Jira client."""
return JIRA(
configuration.api_url,
str(configuration.api_url),
basic_auth=(configuration.username, configuration.password.get_secret_value()),
)

Expand Down
12 changes: 6 additions & 6 deletions src/dispatch/plugins/dispatch_pagerduty/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self):
def get(self, service_id: str) -> str:
"""Gets the current oncall person's email."""
client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
return get_oncall_email(client=client, service_id=service_id)

def page(
Expand All @@ -74,7 +74,7 @@ def page(
) -> dict:
"""Pages the oncall person."""
client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
return page_oncall(
client=client,
from_email=self.configuration.from_email,
Expand All @@ -87,7 +87,7 @@ def page(

def did_oncall_just_go_off_shift(self, schedule_id: str, hour: int) -> dict | None:
client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
return oncall_shift_check(
client=client,
schedule_id=schedule_id,
Expand All @@ -100,7 +100,7 @@ def get_schedule_id_from_service_id(self, service_id: str) -> str | None:

try:
client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
service = get_service(
client=client,
service_id=service_id,
Expand All @@ -122,7 +122,7 @@ def get_service_url(self, service_id: str) -> str | None:
return None

client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
try:
service = get_service(client, service_id)
return service.get("html_url")
Expand All @@ -135,7 +135,7 @@ def get_next_oncall(self, service_id: str) -> str | None:
schedule_id = self.get_schedule_id_from_service_id(service_id)

client = APISession(self.configuration.api_key.get_secret_value())
client.url = self.configuration.pagerduty_api_url
client.url = str(self.configuration.pagerduty_api_url)
return get_next_oncall(
client=client,
schedule_id=schedule_id,
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/plugins/dispatch_slack/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ def get(self, email: str, **kwargs):
department = profile_fields.get(self.configuration.profile_department_field_id, {}).get(
"value", "Unknown"
)
weblink = profile_fields.get(self.configuration.profile_weblink_field_id, {}).get(
"value", ""
weblink = str(
profile_fields.get(self.configuration.profile_weblink_field_id, {}).get("value", "")
)

return {
Expand Down
4 changes: 2 additions & 2 deletions src/dispatch/plugins/generic_workflow/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def get_workflow_instance(
tags: list[str],
**kwargs,
):
api_url = self.configuration.api_url
api_url = str(self.configuration.api_url)
headers = {
"Content-Type": "application/json",
"Authorization": self.configuration.auth_header.get_secret_value(),
Expand All @@ -102,7 +102,7 @@ def get_workflow_instance(
@retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=1, min=1, max=10))
def run(self, workflow_id: str, params: dict, **kwargs):
logging.info("Run on generic workflow %s, %s", params, kwargs)
api_url = self.configuration.api_url
api_url = str(self.configuration.api_url)
obj = {"workflow_id": workflow_id, "params": params}
headers = {
"Content-Type": "application/json",
Expand Down
Loading