ticket2pr 0.3.3__py2.py3-none-any.whl → 0.3.4__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
src/cli.py CHANGED
@@ -26,6 +26,7 @@ from src.console_utils import (
26
26
  print_warning,
27
27
  )
28
28
  from src.enhanced_git import EnhancedGit
29
+ from src.exceptions import GitCloneError
29
30
  from src.logging_setup import LoggerHandlerType, SetupLoggerParams, setup_logger
30
31
  from src.settings import AppSettings
31
32
 
@@ -104,7 +105,14 @@ def _setup_workspace(
104
105
  logger.info(
105
106
  "No workspace path provided, cloning repository to temp directory: %s", temp_dir
106
107
  )
107
- local_git = EnhancedGit.clone_repo(github_client.clone_url, temp_dir)
108
+ try:
109
+ logger.info("Attempting to clone via SSH: %s", github_client.ssh_url)
110
+ local_git = EnhancedGit.clone_repo(github_client.ssh_url, temp_dir)
111
+ except GitCloneError:
112
+ logger.warning(
113
+ "SSH clone failed, falling back to HTTPS: %s", github_client.clone_url
114
+ )
115
+ local_git = EnhancedGit.clone_repo(github_client.clone_url, temp_dir)
108
116
  logger.info("Repository cloned successfully")
109
117
  yield local_git, temp_dir
110
118
  else:
@@ -112,7 +120,10 @@ def _setup_workspace(
112
120
  finally:
113
121
  if temp_dir and temp_dir.exists():
114
122
  logger.info("Cleaning up temp directory: %s", temp_dir)
115
- shutil.rmtree(temp_dir)
123
+ try:
124
+ shutil.rmtree(temp_dir)
125
+ except Exception as e:
126
+ logger.warning("Failed to clean up temp directory '%s': %s", temp_dir, e)
116
127
 
117
128
 
118
129
  async def workflow_with_prints(
@@ -47,6 +47,10 @@ class GitHubClient:
47
47
  def clone_url(self) -> str:
48
48
  return self.repo.clone_url # type: ignore[no-any-return]
49
49
 
50
+ @property
51
+ def ssh_url(self) -> str:
52
+ return self.repo.ssh_url # type: ignore[no-any-return]
53
+
50
54
  def get_base_branch_ref(self, base_branch: str) -> GitRef:
51
55
  try:
52
56
  return self.repo.get_git_ref(f"heads/{base_branch}")
src/enhanced_git.py CHANGED
@@ -5,7 +5,7 @@ import git
5
5
 
6
6
  from src.exceptions import (
7
7
  GitCloneError,
8
- GitFetchCheckoutError,
8
+ GitFetchCheckoutUnknownError,
9
9
  GitPushError,
10
10
  GitWorkspacePathNotExistsError,
11
11
  LocalBranchAlreadyExistsError,
@@ -76,19 +76,15 @@ class EnhancedGit:
76
76
  LocalBranchAlreadyExistsError: If the branch already exists locally
77
77
  GitFetchCheckoutError: If a git error occurs
78
78
  """
79
- try:
80
- origin = self.repo.remotes.origin
81
- origin.fetch()
82
- except Exception as e:
83
- raise GitFetchCheckoutError from e
84
-
85
79
  if branch_name in self.repo.heads:
86
80
  raise LocalBranchAlreadyExistsError(branch_name)
87
81
 
88
82
  try:
83
+ origin = self.repo.remotes.origin
84
+ origin.fetch()
89
85
  self.repo.git.checkout(branch_name)
90
86
  except Exception as e:
91
- raise GitFetchCheckoutError from e
87
+ raise GitFetchCheckoutUnknownError(str(e)) from e
92
88
 
93
89
  def add_all_changes(self) -> None:
94
90
  """
src/exceptions.py CHANGED
@@ -15,8 +15,12 @@ class GitWorkspacePathNotExistsError(EnhancedGitError):
15
15
 
16
16
 
17
17
  class GitFetchCheckoutError(EnhancedGitError):
18
- def __init__(self) -> None:
19
- super().__init__("Failed to fetch and checkout branch")
18
+ pass
19
+
20
+
21
+ class GitFetchCheckoutUnknownError(GitFetchCheckoutError):
22
+ def __init__(self, error_msg: str) -> None:
23
+ super().__init__(f"Failed to fetch and checkout branch: {error_msg}")
20
24
 
21
25
 
22
26
  class LocalBranchAlreadyExistsError(GitFetchCheckoutError):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ticket2pr
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Automate Jira ticket to GitHub PR workflow
5
5
  Home-page: https://github.com/bengabay11/ticket2pr
6
6
  Author: Ben Gabay
@@ -1,9 +1,9 @@
1
1
  src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  src/branch_creator.py,sha256=8KqlIjP-VDnB8_qd_1NjiyimAs6yn5xJdr0o9OMtzsw,2230
3
- src/cli.py,sha256=g7DNIdEBkLsaHCzwmKpSSZGSWTuEE0cRAHq8YNqSIlk,7662
3
+ src/cli.py,sha256=4fL7R4-hbTJlN5OzdkRRk9bFDERuJUgNKQWWeBUxjzM,8215
4
4
  src/console_utils.py,sha256=TbVl_WhiGi1Kq7txk_WpCIfs7gvTJ3qPrSNVBOZ_ZiQ,6928
5
- src/enhanced_git.py,sha256=X8zCEnjzgwRjv5iumFn2h8C69PGKXCwAsSKjD8-j4Cs,5259
6
- src/exceptions.py,sha256=IsJvRAvQDj5cvVFSxzwMPgYRVXbmkFCAB3kR4aES40s,4604
5
+ src/enhanced_git.py,sha256=DONRfrYrYKXNyk1Yt9TfpvglGS3U4e1V2Q3FnvvUo38,5189
6
+ src/exceptions.py,sha256=HVtaiVoX6Hw9NOW3z9k2tfirHZTBOeQzMp52mBw2S6Y,4704
7
7
  src/logging_setup.py,sha256=k6CILizhJdh9WecRluL_lYPe005GVAXOHXt58xZsD1s,4046
8
8
  src/main.py,sha256=tsAVc2lIoiXBJqhNOV3ZOnv9qcaArLF_EJiYibPGBXg,121
9
9
  src/pr_content.py,sha256=ValoIl20sNvh4QZS4-Lm0r3SzfzMMrXyq3S7FW_cFuw,407
@@ -18,7 +18,7 @@ src/agents/pr_generator.py,sha256=keIFAQCGcM8lObpX7G1oUSjh9pV7eOkkGvpKUh7K9XE,43
18
18
  src/agents/pre_commit_fixer.py,sha256=J8aqTZ40mJffANxoBu2T0-ch6t7IHe25nmr4jsgM6F0,3513
19
19
  src/agents/ticket_solver.py,sha256=9lPbYw_cQZkCnjlFPDmSdbrDDxRPQVLgi8qt8pO9ZiU,6320
20
20
  src/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- src/clients/github_client.py,sha256=AhJBOg01XvFbOAZhU2rJZDkOwMiz-zp9MxfS8xfJH6c,4125
21
+ src/clients/github_client.py,sha256=6WwbVxLGtn97WRix7CdORiW_k7F1guJXsKmqXdReb9M,4234
22
22
  src/clients/jira_client.py,sha256=wdDRqiUSTOdBucrqIFkUkJlM7fDMk4DMfUiWCAG-c9U,2323
23
23
  src/shell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  src/shell/base.py,sha256=do3TdU7ffyTjVKRLojFjgiH3sZpptleaMUU4oSTKW5Y,906
@@ -28,9 +28,9 @@ tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
28
28
  tests/integration/test_find_first_toml.py,sha256=Wq4rDReqcWLC0CsgcDBDX62wtMljcsm8UHUDTLr4-_A,902
29
29
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  tests/unit/test_nothing.py,sha256=qRI0MSdLiBRklBNEsOAkr4jxfcrO2v2CuB2hHWePonU,103
31
- ticket2pr-0.3.3.dist-info/licenses/LICENSE,sha256=omgsokA67LJXOOKpXtf1wNH71Bfs35NWEAuLowNUMyM,1066
32
- ticket2pr-0.3.3.dist-info/METADATA,sha256=jkx5oZ9Cur8TFEfkiuLoXoIMNvH-iXvSAEMnv9y_xPo,3264
33
- ticket2pr-0.3.3.dist-info/WHEEL,sha256=Mk1ST5gDzEO5il5kYREiBnzzM469m5sI8ESPl7TRhJY,110
34
- ticket2pr-0.3.3.dist-info/entry_points.txt,sha256=DnWUjexpwtqVcRSICrpnveMIjGJA9_0K5IjZt10jVkM,47
35
- ticket2pr-0.3.3.dist-info/top_level.txt,sha256=KW3xgkz9NLMTcmmzgKvW8RFpCFkRIQ085qzq2diFf68,10
36
- ticket2pr-0.3.3.dist-info/RECORD,,
31
+ ticket2pr-0.3.4.dist-info/licenses/LICENSE,sha256=omgsokA67LJXOOKpXtf1wNH71Bfs35NWEAuLowNUMyM,1066
32
+ ticket2pr-0.3.4.dist-info/METADATA,sha256=xDthvsrpPz4U0RbM9QcwzIELfnH_O5pcV9dgybqLLIY,3264
33
+ ticket2pr-0.3.4.dist-info/WHEEL,sha256=Mk1ST5gDzEO5il5kYREiBnzzM469m5sI8ESPl7TRhJY,110
34
+ ticket2pr-0.3.4.dist-info/entry_points.txt,sha256=DnWUjexpwtqVcRSICrpnveMIjGJA9_0K5IjZt10jVkM,47
35
+ ticket2pr-0.3.4.dist-info/top_level.txt,sha256=KW3xgkz9NLMTcmmzgKvW8RFpCFkRIQ085qzq2diFf68,10
36
+ ticket2pr-0.3.4.dist-info/RECORD,,