Skip to content

Commit 43d0307

Browse files
(PTFE-248) Remove stab branch (#250)
1 parent 05c0669 commit 43d0307

File tree

8 files changed

+101
-1274
lines changed

8 files changed

+101
-1274
lines changed

bert_e/exceptions.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -290,36 +290,6 @@ def __init__(self, name):
290290
super(BranchNameInvalid, self).__init__(msg)
291291

292292

293-
class UnsupportedMultipleStabBranches(InternalException):
294-
code = 204
295-
296-
def __init__(self, branch, other_branch):
297-
msg = 'Unsupported multiple stabilization branches ' \
298-
'have been detected: %r, %r ' \
299-
% (branch, other_branch)
300-
super(UnsupportedMultipleStabBranches, self).__init__(msg)
301-
302-
303-
class DeprecatedStabilizationBranch(InternalException):
304-
code = 205
305-
306-
def __init__(self, branch, tag):
307-
msg = 'Branch %r must be deleted as %r has been created' % (
308-
branch, tag)
309-
super(DeprecatedStabilizationBranch, self).__init__(msg)
310-
311-
312-
class VersionMismatch(InternalException):
313-
code = 206
314-
315-
def __init__(self, dev_branch, stabilization_branch):
316-
msg = 'Branch %r (micro==%d) and %r do not match' % (
317-
dev_branch.name,
318-
dev_branch.micro,
319-
stabilization_branch.name)
320-
super(VersionMismatch, self).__init__(msg)
321-
322-
323293
class UnrecognizedBranchPattern(InternalException):
324294
code = 207
325295

bert_e/jobs/create_branch.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from bert_e.workflow.git_utils import clone_git_repo, push
2020
from bert_e.workflow.gitwaterflow.branches import (BranchCascade,
2121
DevelopmentBranch,
22-
StabilizationBranch,
2322
HotfixBranch,
2423
build_queue_collection,
2524
branch_factory)
@@ -57,7 +56,6 @@ def create_branch(job: CreateBranchJob):
5756
'GWF branch.' % job.settings.branch)
5857

5958
if not (isinstance(new_branch, DevelopmentBranch) or
60-
isinstance(new_branch, StabilizationBranch) or
6159
isinstance(new_branch, HotfixBranch)):
6260
raise exceptions.JobFailure('Requested new branch %r is not a GWF '
6361
'destination branch.' % new_branch)
@@ -82,17 +80,7 @@ def create_branch(job: CreateBranchJob):
8280
'branch.' % job.settings.branch_from)
8381
# ...or determine the branching point automatically
8482
else:
85-
if isinstance(new_branch, StabilizationBranch):
86-
job.settings.branch_from = DevelopmentBranch(
87-
repo,
88-
'development/%s.%s' % (new_branch.major, new_branch.minor))
89-
90-
if job.settings.branch_from not in dev_branches:
91-
raise exceptions.JobFailure('Cannot create a stabilization '
92-
'branch %r without a supporting '
93-
'development branch.' %
94-
new_branch)
95-
elif isinstance(new_branch, HotfixBranch):
83+
if isinstance(new_branch, HotfixBranch):
9684
# start from tag X.Y.Z.0
9785
job.settings.branch_from = new_branch.version + '.0'
9886
else:
@@ -110,10 +98,7 @@ def create_branch(job: CreateBranchJob):
11098
# any new conflict.
11199
#
112100
# older dev branches can be created if queues are disabled, or empty.
113-
#
114-
# there are no restrictions for stabilization branches.
115101
if (job.settings.use_queue and
116-
not isinstance(new_branch, StabilizationBranch) and
117102
not isinstance(new_branch, HotfixBranch) and
118103
new_branch < dev_branches[-1]):
119104
queue_collection = build_queue_collection(job)
@@ -140,7 +125,6 @@ def create_branch(job: CreateBranchJob):
140125
'keep pushing.')
141126

142127
if (not job.settings.use_queue or
143-
isinstance(new_branch, StabilizationBranch) or
144128
isinstance(new_branch, HotfixBranch)):
145129
raise exceptions.JobSuccess()
146130

bert_e/jobs/delete_branch.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from bert_e.lib.git import RemoveFailedException
2020
from bert_e.workflow.git_utils import clone_git_repo
2121
from bert_e.workflow.gitwaterflow.branches import (DevelopmentBranch,
22-
StabilizationBranch,
2322
HotfixBranch,
2423
build_queue_collection,
2524
QueueBranch,
@@ -61,7 +60,6 @@ def delete_branch(job: DeleteBranchJob):
6160
'GWF branch.' % job.settings.branch)
6261

6362
if not (isinstance(del_branch, DevelopmentBranch) or
64-
isinstance(del_branch, StabilizationBranch) or
6563
isinstance(del_branch, HotfixBranch)):
6664
raise exceptions.JobFailure('Requested branch %r is not a GWF '
6765
'destination branch.' % del_branch)
@@ -78,16 +76,6 @@ def delete_branch(job: DeleteBranchJob):
7876
'repository.' %
7977
(del_branch, del_branch.version))
8078

81-
# do not allow deleting a dev branch if there is a stab
82-
if not isinstance(del_branch, StabilizationBranch) and \
83-
not isinstance(del_branch, HotfixBranch):
84-
stab_prefix = 'stabilization/%s' % del_branch.version
85-
if any([b.startswith(stab_prefix) for b in repo.remote_branches]):
86-
raise exceptions.JobFailure('Cannot delete branch %r because '
87-
'there is an active stabilization '
88-
'branch in the repository.' %
89-
del_branch)
90-
9179
if job.settings.use_queue:
9280
queue_collection = build_queue_collection(job)
9381
if queue_collection.has_version_queued_prs(del_branch.version_t):

bert_e/server/api/gwf/branches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from ..base import APIEndpoint, APIForm
2525

2626

27-
BRANCH_REGEXP = r'^development/(\d+)\.(\d+)$|^stabilization/(\d+)\.(\d+)\.(\d+)$|^hotfix/(\d+)\.(\d+)\.(\d+)$' # noqa
27+
BRANCH_REGEXP = r'^development/(\d+)\.(\d+)$|^hotfix/(\d+)\.(\d+)\.(\d+)$' # noqa
2828
BRANCH_FROM_REGEXP = r'^[a-fA-F0-9]*$|^development/(\d+)\.(\d+)$'
2929

3030

0 commit comments

Comments
 (0)