Skip to content

Commit 589a4f6

Browse files
authored
build: address security vulnerabilty (#181)
* Upgrade due to sec vul * Now we need to install docker-compose (before it was provided) * Disable 2 pylint warnings * Set the max line width to a 21st century number * Add wait for port * Remove the hyphen and replace it by a space * Fix the pymongo version so it does not fail * Fix the pymongo version so it does not fail * Fix the mypy version * Fix mypy (model.py) warnings * Disable E501 error
1 parent 1331fea commit 589a4f6

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

.github/workflows/checks.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,19 @@ jobs:
4545
pip install .
4646
pip install -r requirements_dev.txt
4747
- name: Deploy app
48-
run: docker-compose up -d --build
48+
run: docker compose up -d --build
4949
- name: Wait for app startup
50-
run: sleep 20
50+
run: |
51+
for i in $(seq 1 24); do
52+
sleep 5; curl localhost:8080 -so /dev/null && break;
53+
docker compose ps;
54+
echo "Retrying ($i) in 5 seconds...";
55+
done
5156
- name: Run integration tests
5257
shell: bash
5358
run: pytest tests/test_integration
5459
- name: Tear down app
55-
run: docker-compose down
60+
run: docker compose down
5661
publish:
5762
name: Build and publish app image
5863
runs-on: ubuntu-latest

pro_tes/ga4gh/tes/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TesCreateTaskResponse(CustomBaseModel):
3838

3939
class TesExecutor(CustomBaseModel):
4040
image: str = Field(
41-
default=[""],
41+
default="",
4242
description=(
4343
"Name of the container image. The string will be passed as "
4444
" the image\nargument to the containerization run command. "
@@ -626,7 +626,7 @@ class TesTask(CustomBaseModel):
626626
)
627627
resources: Optional[TesResources] = None
628628
executors: list[TesExecutor] = Field(
629-
default=[TesExecutor],
629+
default=[TesExecutor()],
630630
description=(
631631
"An array of executors to be run. Each of the executors "
632632
" will run one\nat a time sequentially. Each executor is a"

pro_tes/gunicorn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
forwarded_allow_ips = "*" # pylint: disable=invalid-name
1818

1919
# Set Gunicorn bind address
20-
bind = f"{app_config.server.host}:{app_config.server.port}"
20+
bind = f"{app_config.server.host}:{app_config.server.port}" # pylint: disable=C0103 # noqa: E501
2121

2222
# Source environment variables for Gunicorn workers
2323
raw_env = [

pro_tes/tasks/track_task_progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ignore_result=True,
2727
track_started=True,
2828
)
29-
def task__track_task_progress( # pylint: disable=too-many-arguments
29+
def task__track_task_progress( # pylint: disable=too-many-arguments,R0917
3030
self, # pylint: disable=unused-argument
3131
worker_id: str,
3232
remote_host: str,

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ celery-types>=0.20.0
22
connexion>=2.11.2,<3
33
foca>=0.12.1
44
geopy>=2.2.0
5-
gunicorn>=20.1.0,<21
5+
gunicorn>=22
66
ip2geotools>=0.1.6
77
py-tes>=0.4.2
88
pytest-ordering>=0.6
99
types-PyYAML>=6.0.12
1010
types-requests>=2.28.5
1111
types-simplejson>=3.17.7
1212
types-urllib3>=1.26.17
13+
pymongo==4.8.0

requirements_dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ mypy>=0.990
77
pylint>=2.15.5
88
pytest>=7.2.0
99
python-semantic-release>=7.32.2
10-
mypy>=1.8.0
11-
types-python-dateutil>=2.8.19.20240106
10+
mypy==1.14.1
11+
types-python-dateutil>=2.8.19.20240106

0 commit comments

Comments
 (0)