Skip to content

Commit 405295c

Browse files
committed
Merge branch 'development/3.6' of github.com:scality/bert-e into bugfix/BERTE-554/CI-status-skipped-is-ok
2 parents 41a4ef9 + d637727 commit 405295c

15 files changed

Lines changed: 40 additions & 51 deletions

File tree

.github/docker/Dockerfile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:focal
22

33
ENV HOME_BUILDBOT /var/lib/buildbot
44
ENV PYTHON_PIP_VERSION 21.0.1
@@ -18,26 +18,15 @@ RUN apt-get --assume-yes update \
1818
git \
1919
libssl-dev \
2020
openssh-client \
21-
python \
2221
python3 \
2322
python3-dev \
2423
python3-pip \
2524
python3-pkg-resources \
2625
python3-setuptools \
27-
python-dev \
28-
python-pip \
29-
python-pkg-resources \
30-
python-setuptools \
3126
sudo \
3227
tox \
3328
wget
3429

35-
RUN sudo apt-get install -y software-properties-common \
36-
&& sudo apt-get update \
37-
&& sudo add-apt-repository -y ppa:git-core/ppa \
38-
&& sudo apt-get update \
39-
&& sudo apt-get install -y git
40-
4130
COPY requirements.txt /tmp/
4231

4332
RUN pip3 install pip==$PYTHON_PIP_VERSION

bert_e/git_host/bitbucket/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""This module holds the schema declarations for the Github API's objects.
1515
16-
/!\ The schema declared in this module is not meant to be exhaustive. Only the
16+
/!\\ The schema declared in this module is not meant to be exhaustive. Only the
1717
"interesting" subsets of these objects (the attributes that are likely to be
1818
used by Bert-E) are declared.
1919

bert_e/git_host/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from bert_e.lib.lru_cache import LRUCache
2-
from collections import defaultdict
2+
from collections import defaultdict, OrderedDict
33

4-
BUILD_STATUS_CACHE = defaultdict(LRUCache) # type: Dict[str, LRUCache]
4+
BUILD_STATUS_CACHE = defaultdict(LRUCache) # type: OrderedDict[str, LRUCache]

bert_e/git_host/github/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""This module holds the schema declarations for the Github API's objects.
1515
16-
/!\ The schema declared in this module is not meant to be exhaustive. Only the
16+
/!\\ The schema declared in this module is not meant to be exhaustive. Only the
1717
"interesting" subsets of these objects (the attributes that are likely to be
1818
used by Bert-E) are declared.
1919

bert_e/git_host/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def get_tasks(self):
278278
pull_request_id=self.controlled.id)]
279279

280280
def merge(self):
281-
raise NotImplemented('Merge')
281+
raise NotImplementedError('Merge')
282282

283283
def comment_review(self):
284284
self.update_participant(changes_requested=False, approved=False,

bert_e/reactor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def handle_options(self, job, text, prefix, privileged=False,
316316
if raw.startswith(prefix):
317317
canonical_raw = raw
318318
canonical_prefix = prefix
319-
elif re.match('^/[\w=]+([\s,.\-:;|+]+/[\w=]+)*\s*$', raw):
319+
elif re.match(r'^/[\w=]+([\s,.\-:;|+]+/[\w=]+)*\s*$', raw):
320320
canonical_raw = " " + raw
321321
canonical_prefix = ""
322322
if not canonical_raw:
@@ -386,7 +386,7 @@ def handle_commands(self, job, text, prefix, privileged=False):
386386
if raw.startswith(prefix):
387387
canonical_raw = raw
388388
canonical_prefix = prefix
389-
elif re.match('^/\w', raw):
389+
elif re.match(r'^/\w', raw):
390390
canonical_raw = raw.replace("/", "/ ", 1)
391391
canonical_prefix = "/"
392392
if not canonical_raw:

bert_e/server/api/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def dispatch_request(self, *args, **kwargs):
6262
return self.view(*args, **kwargs)
6363

6464
def view(self, *args, **kwargs):
65-
raise NotImplemented() # TODO replace with abstract
65+
raise NotImplementedError() # TODO replace with abstract
6666

6767

6868
class APIEndpoint(BaseView):

bert_e/server/api/gwf/branches.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
from ..base import APIEndpoint, APIForm
2525

2626

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

3030

3131
class CreateBranchForm(FlaskForm):

bert_e/tests/test_bert_e.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def add_file_to_branch(repo, branch_name, file_name, do_push=True, folder='.'):
171171
else:
172172
repo.cmd(f'echo {branch_name} > {file_name}')
173173
repo.cmd(f'git add {folder}/{file_name}')
174-
repo.cmd(f'git commit -m "adds %s file on %s"' % (file_name, branch_name))
174+
repo.cmd('git commit -m "adds %s file on %s"' % (file_name, branch_name))
175175
if do_push:
176176
repo.cmd('git pull || exit 0')
177177
repo.cmd('git push --set-upstream origin ' + branch_name)
@@ -885,7 +885,7 @@ def handle_legacy(self, token, backtrace):
885885
bert_e_main()
886886
except exns.Queued as excp:
887887
queued_excp = excp
888-
except exns.SilentException as excp:
888+
except exns.SilentException:
889889
if backtrace:
890890
raise
891891
else:
@@ -903,7 +903,7 @@ def handle_legacy(self, token, backtrace):
903903
pr = self.robot_bb.get_pull_request(pull_request_id=token)
904904
if pr.author == self.args.robot_username:
905905
# Get main PR
906-
id = int(re.findall('\d+', pr.description)[0])
906+
id = int(re.findall(r'\d+', pr.description)[0])
907907
pr = self.robot_bb.get_pull_request(pull_request_id=id)
908908
sha1 = pr.src_commit
909909

@@ -3790,7 +3790,7 @@ def test_branch_name_escape(self):
37903790
unescaped = 'bugfix/dangerous-branch-name-${TEST}'
37913791

37923792
# Bypass git-api to create the branch (explicit escape of the bad char)
3793-
branch_name = unescaped.replace('$', '\$')
3793+
branch_name = unescaped.replace(r'$', r'\$')
37943794
cmd('git checkout development/5.1', cwd=self.gitrepo.cmd_directory)
37953795
cmd('git checkout -b %s' % branch_name, cwd=self.gitrepo.cmd_directory)
37963796

bert_e/tests/unit/test_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def test_log_filter(settings):
1818
log_filter = BertEContextFilter(settings)
1919
logger.addFilter(log_filter)
2020
logger.info('hello')
21-
assert len(logger.filters) is 1
21+
assert len(logger.filters) == 1

0 commit comments

Comments
 (0)