raid ¤
RAID is ManoMano's internal issue dispatcher.
It works with Slack and Jira to create, update and close issues.
It is currently not configurable.
admin ¤
client ¤
RaidJiraClient ¤
Bases: JiraClient
Source code in src/firefighter/jira_app/client.py
add_attachments_to_issue
staticmethod
¤
Add attachments to a Jira issue.
Parameters:
Raises:
-
JiraAttachmentError
–if there is an error while adding any attachment
Source code in src/firefighter/raid/client.py
get_jira_user_from_jira_id ¤
Look for a Jira User in DB, if not found, fetch it from Jira API.
Parameters:
-
jira_account_id
(str
) –Jira account id
Raises:
-
JiraUserNotFoundError
–User not found in Jira nor in DB
-
JiraUserDatabaseError
–Unable to create user in DB
-
ValueError
–Empty jira_account_id
Returns:
-
JiraUser
(JiraUser
) –Jira user object
Source code in src/firefighter/jira_app/client.py
get_jira_user_from_user ¤
Fetches a Jira user from the Jira API.
Parameters:
-
user
(User
) –User object
Raises:
-
JiraUserNotFoundError
–User not found in Jira
Returns:
-
JiraAPIUser
(JiraUser
) –Jira API user object
Source code in src/firefighter/jira_app/client.py
get_watchers_from_jira_ticket ¤
Fetch watchers for a specific Jira ticket from Jira API.
Parameters:
Raises:
-
ValueError
–Empty issue id
Returns:
-
list
(User
) –List of Jira users object
Source code in src/firefighter/jira_app/client.py
transition_issue_auto ¤
Attempts to close an issue by applying transitions to it.
Parameters:
-
issue_id
(str | int
) –Jira issue id
-
target_status_name
(str
) –target status name
-
workflow_name
(str
) –workflow name
Source code in src/firefighter/jira_app/client.py
forms ¤
messages ¤
models ¤
service ¤
create_issue_customer ¤
create_issue_customer(
title: str,
description: str,
reporter: str,
priority: int | None,
labels: list[str] | None,
platform: str,
business_impact: str | None,
team_to_be_routed: str | None,
area: str | None,
zendesk_ticket_id: str | None,
) -> JiraObject
Creates a Jira Incident issue of type Customer.
Parameters:
-
title
(str
) –Summary of the issue
-
description
(str
) –Description of the issue
-
reporter
(str
) –Jira account id of the reporter
-
priority
(int
) –Priority of the issue
-
labels
(list[str]
) –Labels to add to the issue
-
platform
(str
) –Platform of the issue
-
business_impact
(str
) –Business impact of the issue
-
team_to_be_routed
(str
) –Team to be routed
-
area
(str
) –Area of the issue
-
zendesk_ticket_id
(str
) –Zendesk ticket id
Source code in src/firefighter/raid/service.py
create_issue_documentation_request ¤
create_issue_documentation_request(
title: str, description: str, reporter: str, priority: int | None, labels: list[str] | None, platform: str
) -> JiraObject
Creates a Jira issue of type Documentation/Process Request.
Parameters:
-
title
(str
) –Summary of the issue
-
description
(str
) –Description of the issue
-
reporter
(str
) –Jira account id of the reporter
-
priority
(int
) –Priority of the issue
-
labels
(list[str]
) –Labels to add to the issue
-
platform
(str
) –Platform of the issue
Source code in src/firefighter/raid/service.py
create_issue_feature_request ¤
create_issue_feature_request(
title: str, description: str, reporter: str, priority: int | None, labels: list[str] | None, platform: str
) -> JiraObject
Creates a Jira issue of type Feature Request.
Parameters:
-
title
(str
) –Summary of the issue
-
description
(str
) –Description of the issue
-
reporter
(str
) –Jira account id of the reporter
-
priority
(int
) –Priority of the issue
-
labels
(list[str]
) –Labels to add to the issue
-
platform
(str
) –Platform of the issue
Source code in src/firefighter/raid/service.py
create_issue_internal ¤
create_issue_internal(
title: str,
description: str,
reporter: str,
priority: int | None,
labels: list[str] | None,
platform: str,
business_impact: str | None,
team_to_be_routed: str | None,
area: str | None,
) -> JiraObject
Creates a Jira Incident Issue of type Internal.
Parameters:
-
title
(str
) –Summary of the issue
-
description
(str
) –Description of the issue
-
reporter
(str
) –Jira account id of the reporter
-
priority
(int
) –Priority of the issue
-
labels
(list[str]
) –Labels to add to the issue
-
platform
(str
) –Platform of the issue
-
business_impact
(str
) –Business impact of the issue
-
team_to_be_routed
(str
) –Team to be routed
-
area
(str
) –Area of the issue
Source code in src/firefighter/raid/service.py
create_issue_seller ¤
create_issue_seller(
title: str,
description: str,
reporter: str,
priority: int | None,
labels: list[str] | None,
platform: str,
business_impact: str | None,
team_to_be_routed: str | None,
area: str | None,
seller_contract_id: str | None,
is_key_account: bool | None,
is_seller_in_golden_list: bool | None,
zoho_desk_ticket_id: str | None,
) -> JiraObject
Creates a Jira Incident issue of type Seller.
Parameters:
-
title
(str
) –Summary of the issue
-
description
(str
) –Description of the issue
-
reporter
(str
) –Jira account id of the reporter
-
priority
(int
) –Priority of the issue
-
labels
(list[str]
) –Labels to add to the issue
-
platform
(str
) –Platform of the issue
-
business_impact
(str
) –Business impact of the issue
-
team_to_be_routed
(str
) –Team to be routed
-
area
(str
) –Area of the issue
-
seller_contract_id
(str
) –Seller contract id
-
is_key_account
(bool
) –Is key account
-
is_seller_in_golden_list
(bool
) –Is seller in golden list
-
zoho_desk_ticket_id
(str
) –Zoho desk ticket id
Source code in src/firefighter/raid/service.py
get_current_qualifier ¤
Returns the qualifier Jira account id for today. On weekends use Qraft generic account.
Returns:
-
JiraUser
(JiraUser
) –JiraUser object
Source code in src/firefighter/raid/service.py
get_jira_user_from_user ¤
Returns the JiraUser object for a given user, if it exists in DB or can be fetched on Jira API. Returns the default JiraUser if not found.
Source code in src/firefighter/raid/service.py
tasks ¤
daily_qualifier ¤
send_daily_qualifier_message ¤
Send a message with the daily qualifier.
Ignore qualifiers that are not in the JiraUser table.
Source code in src/firefighter/raid/tasks/daily_qualifier.py
urls ¤
utils ¤
get_domain_from_email
cached
¤
Returns the domain from an email address.
Removes any subdomain(s) and the @, applies .lower().
Parameters:
-
email
(str
) –The email address to extract the domain from.
Returns:
-
str
–The domain part of the email address.
Raises:
-
ValueError
–If the email is not well-formed.
Examples:
john.doe@example.com
=>example.com
alice.bob@test.example.ORG
=>example.org
webmaster@localhost
=>localhost
Source code in src/firefighter/raid/utils.py
views ¤
CreateJiraBotView ¤
Bases: CreateModelMixin
, GenericAPIView[JiraTicket]
post ¤
Allow to create a Jira ticket through Landbot. Requires a valid Bearer token, that you can create in the back-office if you have the right permissions.
Source code in src/firefighter/raid/views/__init__.py
JiraCommentAlertView ¤
Bases: CreateAPIView[Any]
post ¤
Allow to send a message in Slack when a comment in a Jira ticket is created or modified. Requires a valid Bearer token, that you can create in the back-office if you have the right permissions.
Source code in src/firefighter/raid/views/__init__.py
JiraUpdateAlertView ¤
Bases: CreateAPIView[Any]
post ¤
Allow to send a message in Slack when some fields ("Priority", "project", "description", "status") of a Jira ticket are updated. Requires a valid Bearer token, that you can create in the back-office if you have the right permissions.