diff --git a/dev/archery/archery/release/core.py b/dev/archery/archery/release/core.py index d6eab45e1804c..bbaba2f648f29 100644 --- a/dev/archery/archery/release/core.py +++ b/dev/archery/archery/release/core.py @@ -25,7 +25,6 @@ from git import Repo from github import Github -from jira import JIRA from semver import VersionInfo as SemVer from ..utils.source import ArrowSources @@ -50,14 +49,6 @@ def __init__(self, released=False, release_date=None, **kwargs): def parse(cls, version, **kwargs): return cls(**SemVer.parse(version).to_dict(), **kwargs) - @classmethod - def from_jira(cls, jira_version): - return cls.parse( - jira_version.name, - released=jira_version.released, - release_date=getattr(jira_version, 'releaseDate', None) - ) - @classmethod def from_milestone(cls, milestone): return cls.parse( @@ -76,14 +67,6 @@ def __init__(self, key, type, summary, github_issue=None): self.github_issue_id = getattr(github_issue, "number", None) self._github_issue = github_issue - @classmethod - def from_jira(cls, jira_issue): - return cls( - key=jira_issue.key, - type=jira_issue.fields.issuetype.name, - summary=jira_issue.fields.summary - ) - @classmethod def from_github(cls, github_issue): return cls( @@ -117,15 +100,6 @@ def is_pr(self): return bool(self._github_issue and self._github_issue.pull_request) -class Jira(JIRA): - - def __init__(self, url='https://issues.apache.org/jira'): - super().__init__(url) - - def issue(self, key): - return Issue.from_jira(super().issue(key)) - - class IssueTracker: def __init__(self, github_token=None): @@ -401,10 +375,6 @@ def commits(self): commit_range = f"{lower}..{upper}" return list(map(Commit, self.repo.iter_commits(commit_range))) - @cached_property - def jira_instance(self): - return Jira() - @cached_property def default_branch(self): default_branch_name = os.getenv("ARCHERY_DEFAULT_BRANCH") @@ -459,20 +429,12 @@ def curate(self, minimal=False): else: outside.append( (self.issue_tracker.issue(int(c.issue_id)), c)) - elif c.project == 'ARROW': - if c.issue in release_issues: - within.append((release_issues[c.issue], c)) - else: - outside.append((self.jira_instance.issue(c.issue), c)) - elif c.project == 'PARQUET': - parquet.append((self.jira_instance.issue(c.issue), c)) else: warnings.warn( - f'Issue {c.issue} does not pertain to GH' + - ', ARROW or PARQUET') + f'Issue {c.issue} does not pertain to GH') outside.append((c.issue, c)) - # remaining jira tickets + # remaining tickets within_keys = {i.key for i, c in within} # Take into account that some issues milestoned are prs nopatch = [issue for key, issue in release_issues.items() @@ -488,12 +450,10 @@ def changelog(self): # get organized report for the release curation = self.curate() - # jira tickets having patches in the release + # issues having patches in the release issue_commit_pairs.extend(curation.within) - # parquet patches in the release - issue_commit_pairs.extend(curation.parquet) - # jira tickets without patches + # issues without patches for issue in curation.nopatch: issue_commit_pairs.append((issue, None)) @@ -576,7 +536,7 @@ def cherry_pick_commits(self, recreate_branch=True): logger.info(f"Checking out branch {self.branch}") self.repo.git.checkout(self.branch) - # cherry pick the commits based on the jira tickets + # cherry pick the commits based on the GH issue for commit in self.commits_to_pick(): logger.info(f"Cherry-picking commit {commit.hexsha}") self.repo.git.cherry_pick(commit.hexsha) diff --git a/dev/archery/archery/release/tests/test_release.py b/dev/archery/archery/release/tests/test_release.py index 22b43c7cb3bc4..fae2bdcea04a0 100644 --- a/dev/archery/archery/release/tests/test_release.py +++ b/dev/archery/archery/release/tests/test_release.py @@ -21,7 +21,6 @@ Release, MajorRelease, MinorRelease, PatchRelease, IssueTracker, Version, Issue, CommitTitle, Commit ) -from archery.testing import DotDict # subset of issues per revision @@ -141,22 +140,6 @@ def test_issue(fake_issue_tracker): assert i.project == "PARQUET" assert i.number == 1111 - fake_jira_issue = DotDict({ - 'key': 'ARROW-2222', - 'fields': { - 'issuetype': { - 'name': 'Feature' - }, - 'summary': 'Issue title' - } - }) - i = Issue.from_jira(fake_jira_issue) - assert i.key == "ARROW-2222" - assert i.type == "Feature" - assert i.summary == "Issue title" - assert i.project == "ARROW" - assert i.number == 2222 - def test_commit_title(): t = CommitTitle.parse( diff --git a/dev/archery/archery/templates/release_changelog.md.j2 b/dev/archery/archery/templates/release_changelog.md.j2 index 0eedb217a8b84..9fa9a1476af6f 100644 --- a/dev/archery/archery/templates/release_changelog.md.j2 +++ b/dev/archery/archery/templates/release_changelog.md.j2 @@ -23,11 +23,7 @@ ## {{ category }} {% for issue, commit in issue_commit_pairs -%} -{% if issue.project in ('ARROW', 'PARQUET') -%} -* [{{ issue.key }}](https://issues.apache.org/jira/browse/{{ issue.key }}) - {{ commit.title.to_string(with_issue=False) if commit else issue.summary | md }} -{% else -%} * [GH-{{ issue.key }}](https://github.com/apache/arrow/issues/{{ issue.key }}) - {{ commit.title.to_string(with_issue=False) if commit else issue.summary | md }} -{% endif -%} {% endfor %} {% endfor %} diff --git a/dev/archery/archery/testing.py b/dev/archery/archery/testing.py index 471a54d4c72cf..3b1061ac85fa4 100644 --- a/dev/archery/archery/testing.py +++ b/dev/archery/archery/testing.py @@ -21,19 +21,6 @@ import re -class DotDict(dict): - - def __getattr__(self, key): - try: - item = self[key] - except KeyError: - raise AttributeError(key) - if isinstance(item, dict): - return DotDict(item) - else: - return item - - class PartialEnv(dict): def __eq__(self, other): diff --git a/dev/archery/setup.py b/dev/archery/setup.py index f1e0df6231436..6587e61546b5a 100755 --- a/dev/archery/setup.py +++ b/dev/archery/setup.py @@ -39,9 +39,9 @@ 'lint': ['numpydoc==1.1.0', 'autopep8', 'flake8==6.1.0', 'cython-lint', 'cmake_format==0.6.13', 'sphinx-lint==0.9.1'], 'numpydoc': ['numpydoc==1.1.0'], - 'release': ['pygithub', jinja_req, 'jira', 'semver', 'gitpython'], + 'release': ['pygithub', jinja_req, 'semver', 'gitpython'], } -extras['bot'] = extras['crossbow'] + ['pygithub', 'jira'] +extras['bot'] = extras['crossbow'] + ['pygithub'] extras['all'] = list(set(functools.reduce(operator.add, extras.values()))) setup(