Skip to content

Commit

Permalink
Remove Provider Deprecations in Atlassian Jira
Browse files Browse the repository at this point in the history
  • Loading branch information
jason810496 committed Dec 5, 2024
1 parent a530ee3 commit cf1eaa8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 46 deletions.
8 changes: 8 additions & 0 deletions providers/src/airflow/providers/atlassian/jira/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
Changelog
---------

.. warning::
All deprecated classes, parameters and features have been removed from the Atlassian Jira provider package.
The following breaking changes were introduced:

* Hooks

* Removed the use of the ``verify`` extra parameters as a ``str`` from ``JiraHook``. Use ``verify`` extra parameters as a ``bool`` instead.

2.7.1
.....

Expand Down
15 changes: 1 addition & 14 deletions providers/src/airflow/providers/atlassian/jira/hooks/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

from __future__ import annotations

import warnings
from typing import Any

from atlassian import Jira

from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.exceptions import AirflowException
from airflow.hooks.base import BaseHook


Expand Down Expand Up @@ -62,18 +61,6 @@ def get_conn(self) -> Jira:
# only required attributes are taken for now,
# more can be added ex: timeout, cloud, session

# verify
if isinstance(verify, str):
warnings.warn(
"Extra parameter `verify` using str is deprecated and will be removed "
"in a future release. Please use `verify` using bool instead.",
AirflowProviderDeprecationWarning,
stacklevel=2,
)
verify = True
if extra_options["verify"].lower() == "false":
verify = False

self.client = Jira(
url=conn.host,
username=conn.login,
Expand Down
32 changes: 0 additions & 32 deletions providers/tests/atlassian/jira/hooks/test_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import pytest

from airflow.exceptions import AirflowProviderDeprecationWarning
from airflow.models import Connection
from airflow.providers.atlassian.jira.hooks.jira import JiraHook

Expand All @@ -39,7 +38,6 @@ class TestJiraHook:
@pytest.fixture(autouse=True)
def setup_test_cases(self, monkeypatch):
self.conn_id = "jira_default"
self.conn_id_with_str_verify = "jira_default_with_str"
self.host = "https://localhost/jira/"
self.port = 443
self.login = "user"
Expand All @@ -60,20 +58,6 @@ def setup_test_cases(self, monkeypatch):
)
),
)
monkeypatch.setenv(
f"AIRFLOW_CONN_{self.conn_id_with_str_verify}".upper(),
connection_as_json(
Connection(
conn_id=self.conn_id_with_str_verify,
conn_type="jira",
host="https://localhost/jira/",
port=443,
login="user",
password="password",
extra='{"verify": "False", "project": "AIRFLOW"}',
)
),
)

def test_jira_client_connection(self, mocked_jira_client):
jira_hook = JiraHook(proxies=self.proxies)
Expand All @@ -87,19 +71,3 @@ def test_jira_client_connection(self, mocked_jira_client):
)
assert isinstance(jira_hook.client, mock.Mock)
assert jira_hook.client.name == mocked_jira_client.return_value.name

def test_jira_client_connection_with_str(self, mocked_jira_client):
warning_message = "Extra parameter `verify` using str is deprecated and will be removed"

with pytest.warns(AirflowProviderDeprecationWarning, match=warning_message):
jira_hook = JiraHook(jira_conn_id=self.conn_id_with_str_verify, proxies=self.proxies)

mocked_jira_client.assert_called_once_with(
url=self.host,
username=self.login,
password=self.password,
verify_ssl=False,
proxies=self.proxies,
)
assert isinstance(jira_hook.client, mock.Mock)
assert jira_hook.client.name == mocked_jira_client.return_value.name

0 comments on commit cf1eaa8

Please sign in to comment.