suite-py 1.49.1__py3-none-any.whl → 1.50.0__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.
suite_py/__version__.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # -*- encoding: utf-8 -*-
2
- __version__ = "1.49.1"
2
+ __version__ = "1.50.0"
suite_py/cli.py CHANGED
@@ -233,21 +233,21 @@ def bump(obj: Context, project: Optional[str] = None, version: Optional[str] = N
233
233
  @main.command(
234
234
  "create-branch", help="Create local branch and set the YouTrack card in progress"
235
235
  )
236
- @click.option("--card", type=click.STRING, help="YouTrack card number (ex. PRIMA-123)")
237
236
  @click.option(
238
237
  "--autostash",
239
238
  is_flag=True,
240
239
  help="Stash uncommitted changes before creating the branch and reapply them afterward",
241
240
  )
242
241
  @click.option(
243
- "--parent-branch",
242
+ "--branch-name",
244
243
  type=click.STRING,
245
- help="Parent branch to create the new branch from",
244
+ help="Branch name template. Supports {card_id}, {type}, {summary} placeholders (ex. '{card_id}/{type}/{summary}')",
246
245
  )
246
+ @click.option("--card", type=click.STRING, help="YouTrack card ID (ex. PRIMA-4423)")
247
247
  @click.option(
248
- "--branch-name",
248
+ "--parent-branch",
249
249
  type=click.STRING,
250
- help="Branch name template. Supports {card_id}, {type}, {summary} placeholders (ex. '{card_id}/{type}/{summary}')",
250
+ help="Parent branch to create the new branch from",
251
251
  )
252
252
  @click.pass_obj
253
253
  @catch_exceptions
@@ -255,10 +255,10 @@ def cli_create_branch(obj, card, autostash, parent_branch, branch_name):
255
255
  from suite_py.commands.create_branch import CreateBranch
256
256
 
257
257
  obj.call(CreateBranch).run(
258
- card_id=card,
259
258
  autostash=autostash,
260
- parent_branch=parent_branch,
261
259
  branch_name=branch_name,
260
+ card_id=card,
261
+ parent_branch=parent_branch,
262
262
  )
263
263
 
264
264
 
@@ -1,7 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import re
3
3
  import sys
4
-
5
4
  import requests
6
5
 
7
6
  from suite_py.lib import logger, metrics
@@ -19,7 +18,7 @@ class CreateBranch:
19
18
  ):
20
19
  self._config = config
21
20
  self._git_handler = git_handler
22
- self._youtrack = youtrack_handler
21
+ self._youtrack_handler = youtrack_handler
23
22
 
24
23
  @metrics.command("create-branch")
25
24
  def run(
@@ -41,9 +40,9 @@ class CreateBranch:
41
40
 
42
41
  try:
43
42
  if card_id:
44
- issue = self._youtrack.get_issue(card_id)
43
+ issue = self._youtrack_handler.get_issue(card_id)
45
44
  else:
46
- issue = self._youtrack.get_issue(self._ask_card())
45
+ issue = self._youtrack_handler.get_issue(self._ask_card_id())
47
46
  except Exception:
48
47
  logger.error(
49
48
  "There was a problem retrieving the issue from YouTrack. Check that the issue number is correct"
@@ -52,11 +51,11 @@ class CreateBranch:
52
51
 
53
52
  self._checkout_branch(issue, autostash, parent_branch, branch_name)
54
53
 
55
- user = self._youtrack.get_current_user()
56
- self._youtrack.assign_to(issue["id"], user["login"])
54
+ user = self._youtrack_handler.get_current_user()
55
+ self._youtrack_handler.assign_to(issue["id"], user["login"])
57
56
 
58
57
  try:
59
- self._youtrack.update_state(
58
+ self._youtrack_handler.update_state(
60
59
  issue["id"], self._config.youtrack["picked_state"]
61
60
  )
62
61
  except requests.exceptions.HTTPError:
@@ -87,7 +86,7 @@ class CreateBranch:
87
86
  "Insert the YouTrack issue number:", self._config.user["default_slug"]
88
87
  )
89
88
 
90
- def _ask_card(self):
89
+ def _ask_card_id(self):
91
90
  suggestions = self._get_card_suggestions()
92
91
  user_choice = (
93
92
  self._select_card(suggestions)
@@ -98,8 +97,9 @@ class CreateBranch:
98
97
 
99
98
  def _get_card_suggestions(self):
100
99
  try:
101
- return self._youtrack.search_issues(
102
- self._config.user["card_suggest_query"], 5
100
+ return self._youtrack_handler.search_issues(
101
+ self._config.user["card_suggest_query"],
102
+ self._config.user["card_suggestions_limit"],
103
103
  )
104
104
  except Exception:
105
105
  logger.warning(
@@ -1,5 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  import sys
3
+ from string import Template
3
4
 
4
5
  from github import GithubException
5
6
 
@@ -77,7 +78,10 @@ class OpenPR:
77
78
 
78
79
  default_title = self._youtrack.get_issue(youtrack_id)["summary"]
79
80
  title_without_prefix = _ask_for_title(default_title)
80
- title = f"[{youtrack_id}]: {title_without_prefix}"
81
+
82
+ title = Template(self._config.user["pr_title_template"]).substitute(
83
+ card_id=youtrack_id, title=title_without_prefix
84
+ )
81
85
  else:
82
86
  logger.warning(
83
87
  f"Creating pull request on the {self._project} project for the {self._branch_name} branch NOT linked to YouTrack card"
@@ -228,7 +228,11 @@ class Release:
228
228
  def _is_success(conclusions):
229
229
  return bool(conclusions) and (
230
230
  all(c == "success" for c in conclusions)
231
- or ("success" in conclusions and not Release._any_failure(conclusions))
231
+ or (
232
+ "success" in conclusions
233
+ and not Release._any_failure(conclusions)
234
+ and "cancelled" not in conclusions
235
+ )
232
236
  )
233
237
 
234
238
  @staticmethod
suite_py/lib/config.py CHANGED
@@ -36,11 +36,13 @@ class Config:
36
36
  conf["user"].setdefault("default_slug", "PRIMA-XXX")
37
37
  default_search = f"in:{conf['user']['default_slug'].split('-')[0]} #{{To Do}}"
38
38
  conf["user"].setdefault("card_suggest_query", default_search)
39
+ conf["user"].setdefault("card_suggestions_limit", 5)
39
40
  # This is in seconds
40
41
  conf["user"].setdefault("captainhook_timeout", 30)
41
42
  conf["user"].setdefault("captainhook_url", "https://captainhook.prima.it")
42
43
  conf["user"].setdefault("use_commits_in_pr_body", False)
43
44
  conf["user"].setdefault("frequent_reviewers_max_number", 5)
45
+ conf["user"].setdefault("pr_title_template", "[$card_id]: $title")
44
46
 
45
47
  conf["youtrack"].setdefault("add_reviewers_tags", True)
46
48
  conf["youtrack"].setdefault("default_issue_type", "Task")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: suite-py
3
- Version: 1.49.1
3
+ Version: 1.50.0
4
4
  Summary:
5
5
  Author: larrywax, EugenioLaghi, michelangelomo
6
6
  Author-email: devops@prima.it
@@ -1,23 +1,23 @@
1
1
  suite_py/__init__.py,sha256=REmi3D0X2G1ZWnYpKs8Ffm3NIj-Hw6dMuvz2b9NW344,142
2
- suite_py/__version__.py,sha256=VeDjrisUW4YqNSxqHjb9wWGHToZW1js3I9jRqyYdTYI,49
3
- suite_py/cli.py,sha256=IV73nNqBwLKLAfucLxyIne_V7uBQT6OBY3Z2VryQt2M,12582
2
+ suite_py/__version__.py,sha256=38W7jlGbYwxo07w_vLhpzv02ReQdpK1kDEMKK2DCpHA,49
3
+ suite_py/cli.py,sha256=wTV-d7Yq52JjkugxVCGCHM9Qsb3vKDv3VnTIJNJ162c,12579
4
4
  suite_py/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  suite_py/commands/ask_review.py,sha256=yN__Ac-fiZBPShjRDhyCCQZGfVlQE16KozoJk4UtiNw,3788
6
6
  suite_py/commands/bump.py,sha256=oFZU1hPfD11ujFC5G7wFyQOf2alY3xp2SO1h1ldjf3s,5406
7
7
  suite_py/commands/check.py,sha256=jCX59g6DgTA55yD_75mgcqJ5zCjRwl_eIRGDeUFjUWY,3316
8
8
  suite_py/commands/common.py,sha256=aWCEvO3hqdheuMUmZcHuc9EGZPQTk7VkzkHJk283MxQ,566
9
9
  suite_py/commands/context.py,sha256=NAMZjJtTIi8xKIhdWEYNKwz0f4wUubW2eAj08gxRRbw,1267
10
- suite_py/commands/create_branch.py,sha256=eilFIsCkMjU51maeJlMMMMBpnM6rlUauXIFA-92j7no,5277
10
+ suite_py/commands/create_branch.py,sha256=HuNA5DR-9d-yupBCljxYasElwxwlP3XI_UyairnfurU,5397
11
11
  suite_py/commands/estimate_cone.py,sha256=_RekBWzPlzInlZRpSIeKUVkx-A8Phx0IEYVouTbN7z4,3411
12
12
  suite_py/commands/login.py,sha256=A59e1HsbN7Ocv2L_2H0Eb7MZK7AzLkLb72QxBthnIqU,258
13
13
  suite_py/commands/merge_pr.py,sha256=fXIE8mT9MjvvpqE-uVdXGBVFGhn0eQzcBxNr-N8SyAY,5171
14
- suite_py/commands/open_pr.py,sha256=djaF2OsYbQo0YLTEbNRTYYFzsNT0sl7VRxqtxSX1PKc,7150
14
+ suite_py/commands/open_pr.py,sha256=yys08FIHBbajmKTT6p_JWHu6Y9y2JKI43MKXQ-iIQ-A,7275
15
15
  suite_py/commands/project_lock.py,sha256=b7OkGysue_Sl13VIT7B5CTBppCvrB_Q6iC0IJRBSHp8,1909
16
- suite_py/commands/release.py,sha256=eg9RoCBj5NVfaxQW7eHF4TvPj_eherJ-ovokU7Pt4k0,14659
16
+ suite_py/commands/release.py,sha256=_pH1YxrK-8M2vi7Bed0hGn53esTHQDQYKyquPDZ8RlI,14756
17
17
  suite_py/commands/set_token.py,sha256=fehIqKjKhE-BJGFhgkPTo3Ntr0MvpgLd6EC5yjKuRs8,1508
18
18
  suite_py/commands/status.py,sha256=0JUK53_d1-U3WNS742JD2QTiGmCGZONo3jJx8WR7q70,1122
19
19
  suite_py/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- suite_py/lib/config.py,sha256=52YV0K0GK1WRbeM70IDXkpG8oZD1Zvxipn1b-XekwNA,3907
20
+ suite_py/lib/config.py,sha256=x4tJxm7IjyEkBSybD8hxYfi365qbaIFsMaoBw6yJb6I,4043
21
21
  suite_py/lib/handler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  suite_py/lib/handler/aws_handler.py,sha256=dRvRDicikfRbuFtCLPbevaX-yC-fO4LwXFdyqLPJ8OI,8815
23
23
  suite_py/lib/handler/captainhook_handler.py,sha256=R30_Vvh2ck7fM5fwbpm3UV_FtlQr2xnx6RJpkG1Gn14,2983
@@ -40,7 +40,7 @@ suite_py/lib/requests/session.py,sha256=P32H3cWnCWunu91WIj2iDM5U3HzaBglg60VN_C9J
40
40
  suite_py/lib/symbol.py,sha256=z3QYBuNIwD3qQ3zF-cLOomIr_-C3bO_u5UIDAHMiyTo,60
41
41
  suite_py/lib/tokens.py,sha256=4DbsHDFLIxs40t3mRw_ZyhmejZQ0Bht7iAL8dTCTQd4,5458
42
42
  suite_py/templates/login.html,sha256=fJLls2SB84oZTSrxTdA5q1PqfvIHcCD4fhVWfyco7Ig,861
43
- suite_py-1.49.1.dist-info/METADATA,sha256=9VplRO35M4_maBHOmHZCRRNR4Us5JQOWLidhFq9jvZY,1250
44
- suite_py-1.49.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
45
- suite_py-1.49.1.dist-info/entry_points.txt,sha256=dVKLC-9Infy-dHJT_MkK6LcDjOgBCJ8lfPkURJhBjxE,46
46
- suite_py-1.49.1.dist-info/RECORD,,
43
+ suite_py-1.50.0.dist-info/METADATA,sha256=E2McUnkrL3Q3OC1hP4rrm2h8NMBdWqPKTUuKdmFZya8,1250
44
+ suite_py-1.50.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
45
+ suite_py-1.50.0.dist-info/entry_points.txt,sha256=dVKLC-9Infy-dHJT_MkK6LcDjOgBCJ8lfPkURJhBjxE,46
46
+ suite_py-1.50.0.dist-info/RECORD,,