Skip to content

Commit

Permalink
Upgrade dependencies to address issues related to outdated SSL certif…
Browse files Browse the repository at this point in the history
…icates (#812)

* Use newer image

* Replace stretch with buster

* Upgrade django-gulp

* Upgrade lxml

* Upgrade psycopg2 to 2.8.4

* Upgrade flake8

* Linting fix

Co-authored-by: muratjumashev <jumasheff@gmail.com>
  • Loading branch information
progremir and jumasheff committed Oct 1, 2021
1 parent 5f3e4af commit a6f26c3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ jobs:
build:
working_directory: ~/orchestra
docker:
- image: python:3.5.6-stretch
- image: python:3.8-buster
steps:
- checkout
- run:
name: Install dependencies
command: |
echo -e "deb http://deb.debian.org/debian stretch main\ndeb http://security.debian.org stretch/updates main" > /etc/apt/sources.list
echo -e "deb http://deb.debian.org/debian buster main\ndeb http://security.debian.org buster/updates main" > /etc/apt/sources.list
curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.15.2
export PATH="$HOME/.yarn/bin:$PATH"
Expand Down
17 changes: 10 additions & 7 deletions orchestra/bots/sanitybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def _handle(project, sanity_check, handler):
handler_type = handler.get('type')
handler_message = handler.get('message')
handler_steps = handler.get('steps')
if (handler_type != 'slack_project_channel' or
not handler_message or not handler_steps):
is_invalid = (handler_type != 'slack_project_channel') or (
not handler_message or not handler_steps)
if is_invalid:
raise SanityBotError('Invalid handler: {}'.format(handler))
tasks = (
task for task in project.tasks.all()
Expand Down Expand Up @@ -44,9 +45,10 @@ def _filter_checks(project, checks, check_configurations):
check_configurations.get(check.check_slug, {})
.get('repetition_seconds'))
now = timezone.now()
if (max_created_at is None or
((seconds is not None) and
((now - max_created_at).total_seconds() > seconds))):
seconds_none_or_rep_sec_lt = (max_created_at is None) or (
(seconds is not None) and (
(now - max_created_at).total_seconds() > seconds))
if seconds_none_or_rep_sec_lt:
yield check


Expand All @@ -71,10 +73,11 @@ def _handle_sanity_checks(project, sanity_checks, check_configurations):

def create_and_handle_sanity_checks():
workflow_versions = WorkflowVersion.objects.all()
active = Q(status=Project.Status.ACTIVE)
paused = Q(status=Project.Status.PAUSED)
incomplete_projects = (Project.objects
.filter(workflow_version__in=workflow_versions)
.filter(Q(status=Project.Status.ACTIVE) |
Q(status=Project.Status.PAUSED)))
.filter(active | paused))

for project in incomplete_projects:
sanity_checks = project.workflow_version.sanity_checks
Expand Down
2 changes: 1 addition & 1 deletion orchestra/bots/staffbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# A regex for markdown links, which are of the form [link text](url).
# We capture link text and url as an text that isn't a closing ] or )
# respectively.
MARKDOWN_LINK_REGEX = re.compile('\[(?P<text>[^\]]*)\]\((?P<url>[^\)]*)\)')
MARKDOWN_LINK_REGEX = re.compile(r'\[(?P<text>[^\]]*)\]\((?P<url>[^\)]*)\)')


class StaffBot(BaseBot):
Expand Down
2 changes: 1 addition & 1 deletion orchestra/utils/common_regex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import re

image_file_regex = re.compile('([-\w\s]+\.(?:jpg|jpeg|gif|png|svg))',
image_file_regex = re.compile(r'([-\w\s]+\.(?:jpg|jpeg|gif|png|svg))',
re.IGNORECASE)
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ django-jsonview==2.0.0
requests==2.22.0
factory_boy==2.10.0
coverage==4.5.1
psycopg2==2.7.4
psycopg2==2.8.4
django-registration-redux==2.5
djrill==2.1.0
ipython==6.2.1
boto==2.49.0
moto==0.4.31
flake8==3.5.0
flake8==3.8.4
djangorestframework==3.11.0
djangorestframework-httpsignature==1.0.0
djangocms-admin-style==1.2.7
lxml==3.8.0
lxml==4.6.3
beautifulsoup4==4.6.0
pyOpenSSL==17.5.0
google-api-python-client==1.6.5
Expand All @@ -30,7 +30,7 @@ django-bitfield==2.0.1
django-phonenumber-field==4.0.0
django-nose==1.4.6
django-annoying==0.10.3
django-gulp==2.5.1
django-gulp==4.1.0
django-related-admin==1.0.1
django-ajax-selects==1.9.1
django-object-actions==3.0.1
Expand Down
2 changes: 1 addition & 1 deletion simple_workflow/v1/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

logger = logging.getLogger(__name__)

IMAGE_FILE_REGEX = re.compile('([-\w]+\.(?:jpg|jpeg|gif|png))',
IMAGE_FILE_REGEX = re.compile(r'([-\w]+\.(?:jpg|jpeg|gif|png))',
re.IGNORECASE)


Expand Down

0 comments on commit a6f26c3

Please sign in to comment.