From 08decdb908365450ffb08995abfeed17468195f0 Mon Sep 17 00:00:00 2001 From: Mohamed-Hacene Date: Fri, 29 Nov 2024 12:58:51 +0100 Subject: [PATCH 1/2] feat: keep order of security objectives --- backend/core/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/core/models.py b/backend/core/models.py index 474c5f4db..75000340e 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -1364,6 +1364,13 @@ def get_security_objectives(self) -> dict[str, dict[str, dict[str, int | bool]]] If the asset is a supporting asset, the security objectives are the union of the security objectives of all the primary assets it supports. If multiple ancestors share the same security objective, its value in the result is its highest value among the ancestors. """ + if self.security_objectives.get("objectives"): + self.security_objectives["objectives"] = { + key: self.security_objectives["objectives"][key] + for key in Asset.DEFAULT_SECURITY_OBJECTIVES + if key in self.security_objectives["objectives"] + } + if self.is_primary: return self.security_objectives From a65cc2ee6c9c92e34667f669fa7a4a89c34d7814 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Fri, 29 Nov 2024 21:41:51 +0100 Subject: [PATCH 2/2] Update startup-tests.yml increase timeout show warning to guide resolution --- .github/workflows/startup-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/startup-tests.yml b/.github/workflows/startup-tests.yml index ad27fc444..3fb3bb1bd 100644 --- a/.github/workflows/startup-tests.yml +++ b/.github/workflows/startup-tests.yml @@ -130,7 +130,7 @@ jobs: export $(grep -v '^#' .env | xargs) - name: Config the Docker app run: | - sleep 60 # give the migrations time to finish (included in the up on the previous step) + sleep 120 # give the migrations time to finish (included in the up on the previous step) docker compose -f docker-compose-build.yml exec backend /bin/bash -c "DJANGO_SUPERUSER_EMAIL=admin@tests.com DJANGO_SUPERUSER_PASSWORD=1234 poetry run python manage.py createsuperuser --noinput && exit 0" - name: Run tests working-directory: ${{ env.frontend-directory }} @@ -142,6 +142,7 @@ jobs: exit 0 else echo "Failure" + echo "Check if migrations are not too long" exit 1 fi @@ -258,7 +259,7 @@ jobs: export $(grep -v '^#' .env | xargs) - name: Config the Docker app run: | - sleep 60 # give the migrations time to finish (included in the up on the previous step) + sleep 120 # give the migrations time to finish (included in the up on the previous step) docker compose -f enterprise/docker-compose-build.yml exec backend /bin/bash -c "DJANGO_SUPERUSER_EMAIL=admin@tests.com DJANGO_SUPERUSER_PASSWORD=1234 poetry run python manage.py createsuperuser --noinput --settings=${{ env.enterprise-backend-settings-module }} && exit 0" - name: Run tests working-directory: ${{ env.frontend-directory }} @@ -270,5 +271,6 @@ jobs: exit 0 else echo "Failure" + echo "Check if migrations are not too long" exit 1 fi