Skip to content

Commit b822410

Browse files
Merge branch 'dev' into perf-upgrade-notes
2 parents 0928da1 + 43fe726 commit b822410

125 files changed

Lines changed: 8342 additions & 925 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integration-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ name: Integration tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
auditlog_type:
7+
type: string
8+
default: "django-auditlog"
59

610
jobs:
711
integration_tests:
812
# run tests with docker compose
913
name: User Interface Tests
1014
runs-on: ubuntu-latest
15+
env:
16+
AUDITLOG_TYPE: ${{ inputs.auditlog_type }}
1117
strategy:
1218
matrix:
1319
test-case: [

.github/workflows/rest-framework-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ on:
66
platform:
77
type: string
88
default: "linux/amd64"
9+
auditlog_type:
10+
type: string
11+
default: "django-auditlog"
912

1013
jobs:
1114
unit_tests:
1215
name: Rest Framework Unit Tests
1316
runs-on: ${{ inputs.platform == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
17+
env:
18+
AUDITLOG_TYPE: ${{ inputs.auditlog_type }}
1419

1520
strategy:
1621
matrix:

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,26 @@ jobs:
2525
strategy:
2626
matrix:
2727
platform: ['linux/amd64', 'linux/arm64']
28+
auditlog_type: ['django-auditlog', 'django-pghistory']
2829
fail-fast: false
2930
needs: build-docker-containers
3031
uses: ./.github/workflows/rest-framework-tests.yml
3132
secrets: inherit
3233
with:
3334
platform: ${{ matrix.platform}}
35+
auditlog_type: ${{ matrix.auditlog_type }}
3436

3537
# only run integration tests for linux/amd64 (default)
3638
test-user-interface:
3739
needs: build-docker-containers
3840
uses: ./.github/workflows/integration-tests.yml
3941
secrets: inherit
42+
strategy:
43+
matrix:
44+
auditlog_type: ['django-auditlog', 'django-pghistory']
45+
fail-fast: false
46+
with:
47+
auditlog_type: ${{ matrix.auditlog_type }}
4048

4149
# only run k8s tests for linux/amd64 (default)
4250
test-k8s:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ services:
120120
source: ./docker/extra_settings
121121
target: /app/docker/extra_settings
122122
postgres:
123-
image: postgres:18.0-alpine@sha256:9636ae7feacd8d630303eede7f95cd0f472d514e7864422c6aa8ea07b2171df8
123+
image: postgres:18.0-alpine@sha256:70b32afe0c274b4d93098fd724fcdaab3aba47270a4f1e63cbf9cc69d7bf1be4
124124
environment:
125125
POSTGRES_DB: ${DD_DATABASE_NAME:-defectdojo}
126126
POSTGRES_USER: ${DD_DATABASE_USER:-defectdojo}

docker/entrypoint-initializer.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ python3 manage.py makemigrations --no-input --check --dry-run --verbosity 3 || {
110110
cat <<-EOF
111111
112112
********************************************************************************
113+
WARNING: Missing Database Migrations Detected
114+
********************************************************************************
113115
114116
You made changes to the models without creating a DB migration for them.
115117
@@ -119,15 +121,25 @@ If you're not familiar with migrations in Django, please read the
119121
great documentation thoroughly:
120122
https://docs.djangoproject.com/en/5.0/topics/migrations/
121123
124+
This is now a WARNING and the container will continue to start.
125+
However, you should create the necessary migrations as soon as possible using:
126+
docker compose exec uwsgi bash -c 'python manage.py makemigrations -v2'
127+
122128
********************************************************************************
123129
124130
EOF
125-
exit 1
131+
echo "WARNING: Continuing startup despite missing migrations..."
126132
}
127133

128134
echo "Migrating"
129135
python3 manage.py migrate
130136

137+
echo "Configuring pghistory triggers based on audit settings"
138+
cat <<EOD | python3 manage.py shell
139+
from dojo.auditlog import configure_pghistory_triggers
140+
configure_pghistory_triggers()
141+
EOD
142+
131143
echo "Admin user: ${DD_ADMIN_USER}"
132144
ADMIN_EXISTS=$(echo "SELECT * from auth_user;" | python manage.py dbshell | grep "${DD_ADMIN_USER}" || true)
133145
# Abort if the admin user already exists, instead of giving a new fake password that won't work

docs/content/en/connecting_your_tools/parsers/file/snyk_issue_api.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
title: "Snyk Issue API"
33
toc_hide: true
44
---
5-
The Snyk Issue API parser supports importing vulnerability data from the Snyk Issue API in JSON format. Currently only parsing issues of type `code` is supported. Samples of ther issue types are welcome.
5+
The Snyk Issue API parser supports importing vulnerability data from the Snyk Issue API in JSON format.
6+
7+
Currently parsing issues of type `code` (SAST) and `package_vulnerability` (SCA) are supported.
8+
9+
Samples of ther issue types are welcome.
610

711
For more information about the Snyk Issue API, refer to the [official Snyk API documentation](https://docs.snyk.io/snyk-api/reference/issues#get-orgs-org_id-issues).
812

docs/package-lock.json

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"devDependencies": {
2525
"prettier": "3.6.2",
26-
"vite": "7.1.7"
26+
"vite": "7.1.9"
2727
},
2828
"engines": {
2929
"node": "22.20.0"

dojo/admin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from auditlog.models import LogEntry
21
from django.contrib import admin
2+
from django.contrib.admin.sites import NotRegistered
33
from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin
44

55
from dojo.models import (
@@ -14,7 +14,13 @@
1414
TextQuestion,
1515
)
1616

17-
admin.site.unregister(LogEntry)
17+
# Conditionally unregister LogEntry from auditlog if it's registered
18+
try:
19+
from auditlog.models import LogEntry
20+
admin.site.unregister(LogEntry)
21+
except (ImportError, NotRegistered):
22+
# auditlog not available or LogEntry not registered
23+
pass
1824

1925
# ==============================
2026
# Defect Dojo Engaegment Surveys

dojo/api_v2/serializers.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,8 +2104,14 @@ class CommonImportScanSerializer(serializers.Serializer):
21042104
required=False,
21052105
validators=[ImporterFileExtensionValidator()],
21062106
)
2107-
product_type_name = serializers.CharField(required=False)
2108-
product_name = serializers.CharField(required=False)
2107+
product_type_name = serializers.CharField(
2108+
required=False,
2109+
help_text=_("Also referred to as 'Organization' name."),
2110+
)
2111+
product_name = serializers.CharField(
2112+
required=False,
2113+
help_text=_("Also referred to as 'Asset' name."),
2114+
)
21092115
engagement_name = serializers.CharField(required=False)
21102116
engagement_end_date = serializers.DateField(
21112117
required=False,
@@ -2160,8 +2166,14 @@ class CommonImportScanSerializer(serializers.Serializer):
21602166
# confused
21612167
test_id = serializers.IntegerField(read_only=True)
21622168
engagement_id = serializers.IntegerField(read_only=True)
2163-
product_id = serializers.IntegerField(read_only=True)
2164-
product_type_id = serializers.IntegerField(read_only=True)
2169+
product_id = serializers.IntegerField(
2170+
read_only=True,
2171+
help_text=_("Also referred to as 'Asset' ID."),
2172+
)
2173+
product_type_id = serializers.IntegerField(
2174+
read_only=True,
2175+
help_text=_("Also referred to as 'Organization' ID."),
2176+
)
21652177
statistics = ImportStatisticsSerializer(read_only=True, required=False)
21662178
pro = serializers.ListField(read_only=True, required=False)
21672179
apply_tags_to_findings = serializers.BooleanField(

0 commit comments

Comments
 (0)